From ab189ecec5def770ce5cc3f94fac44f8c1aa6868 Mon Sep 17 00:00:00 2001 From: Diegoisawesome Date: Mon, 11 Sep 2017 00:40:47 -0500 Subject: [PATCH 01/13] Begin extracting baserom calls from data2.s --- charmap.txt | 11 + data/data2.s | 2151 +++++++++++++++++-- data/data3.s | 289 ++- data/data3a.s | 8 - data/data3b.s | 3 + data/io_reg.s | 17 +- data/strings.s | 132 +- graphics/interface/blank_1x2.png | Bin 0 -> 71 bytes graphics/interface/link_test_digits.pal | 19 + graphics/interface/link_test_digits.png | Bin 0 -> 269 bytes graphics/interface/test_textbox.pal | 19 + graphics/interface/test_textbox.png | Bin 0 -> 144 bytes graphics/interface/wireless_info_screen.bin | Bin 0 -> 2048 bytes graphics/interface/wireless_info_screen.pal | 259 +++ graphics/interface/wireless_info_screen.png | Bin 0 -> 1210 bytes graphics/interface/wireless_link.bin | Bin 0 -> 2048 bytes graphics/interface/wireless_link.pal | 19 + graphics/interface/wireless_link.png | Bin 0 -> 904 bytes graphics/interface/wireless_link_icon.pal | 19 + graphics/interface/wireless_link_icon.png | Bin 0 -> 295 bytes graphics/interface/wonder_card_1.bin | Bin 0 -> 1200 bytes graphics/interface/wonder_card_1.pal | 19 + graphics/interface/wonder_card_1.png | Bin 0 -> 318 bytes graphics/interface/wonder_card_2.pal | 19 + graphics/interface/wonder_card_2.png | Bin 0 -> 311 bytes graphics/interface/wonder_card_3.pal | 19 + graphics/interface/wonder_card_3.png | Bin 0 -> 279 bytes graphics/interface/wonder_card_4.pal | 19 + graphics/interface/wonder_card_4.png | Bin 0 -> 279 bytes graphics/interface/wonder_card_5.pal | 19 + graphics/interface/wonder_card_5.png | Bin 0 -> 279 bytes graphics/interface/wonder_card_6.pal | 19 + graphics/interface/wonder_card_6.png | Bin 0 -> 279 bytes graphics/interface/wonder_card_7.pal | 19 + graphics/interface/wonder_card_7.png | Bin 0 -> 545 bytes graphics/interface/wonder_card_8.pal | 19 + graphics/interface/wonder_card_8.png | Bin 0 -> 534 bytes ld_script.txt | 1 - sym_ewram.txt | 2 +- 39 files changed, 2853 insertions(+), 248 deletions(-) delete mode 100644 data/data3a.s create mode 100644 graphics/interface/blank_1x2.png create mode 100644 graphics/interface/link_test_digits.pal create mode 100644 graphics/interface/link_test_digits.png create mode 100644 graphics/interface/test_textbox.pal create mode 100644 graphics/interface/test_textbox.png create mode 100644 graphics/interface/wireless_info_screen.bin create mode 100644 graphics/interface/wireless_info_screen.pal create mode 100644 graphics/interface/wireless_info_screen.png create mode 100644 graphics/interface/wireless_link.bin create mode 100644 graphics/interface/wireless_link.pal create mode 100644 graphics/interface/wireless_link.png create mode 100644 graphics/interface/wireless_link_icon.pal create mode 100644 graphics/interface/wireless_link_icon.png create mode 100644 graphics/interface/wonder_card_1.bin create mode 100644 graphics/interface/wonder_card_1.pal create mode 100644 graphics/interface/wonder_card_1.png create mode 100644 graphics/interface/wonder_card_2.pal create mode 100644 graphics/interface/wonder_card_2.png create mode 100644 graphics/interface/wonder_card_3.pal create mode 100644 graphics/interface/wonder_card_3.png create mode 100644 graphics/interface/wonder_card_4.pal create mode 100644 graphics/interface/wonder_card_4.png create mode 100644 graphics/interface/wonder_card_5.pal create mode 100644 graphics/interface/wonder_card_5.png create mode 100644 graphics/interface/wonder_card_6.pal create mode 100644 graphics/interface/wonder_card_6.png create mode 100644 graphics/interface/wonder_card_7.pal create mode 100644 graphics/interface/wonder_card_7.png create mode 100644 graphics/interface/wonder_card_8.pal create mode 100644 graphics/interface/wonder_card_8.png diff --git a/charmap.txt b/charmap.txt index f698701c4..5d0be5477 100644 --- a/charmap.txt +++ b/charmap.txt @@ -401,6 +401,12 @@ NAME_END = FC 00 @ special 0xF7 character SPECIAL_F7 = F7 +@ another kind of text placeholder? +SPECIAL_F700 = F7 00 +SPECIAL_F701 = F7 01 +SPECIAL_F702 = F7 02 +SPECIAL_F703 = F7 03 + @ more text functions COLOR = FC 01 @ use a color listed below right after @@ -686,6 +692,11 @@ BGM_BATTLE35 = D0 01 BGM_BATTLE38 = D1 01 BGM_BATTLE30 = D2 01 +UNK_CTRL_F800 = F8 00 +UNK_CTRL_F801 = F8 01 +UNK_CTRL_F80A = F8 0A +UNK_CTRL_F907 = F9 07 + '\l' = FA @ scroll up window text '\p' = FB @ new paragraph '\n' = FE @ new line diff --git a/data/data2.s b/data/data2.s index 7a06ad76a..5cb381bca 100644 --- a/data/data2.s +++ b/data/data2.s @@ -7,574 +7,2313 @@ .align 2 gUnknown_082EC86C:: @ 82EC86C - .incbin "baserom.gba", 0x2ec86c, 0x20 + .incbin "graphics/interface/wireless_link.gbapal" gUnknown_082EC88C:: @ 82EC88C - .incbin "baserom.gba", 0x2ec88c, 0x4a8 + .incbin "graphics/interface/wireless_link.4bpp.lz" gUnknown_082ECD34:: @ 82ECD34 - .incbin "baserom.gba", 0x2ecd34, 0x1ec + .incbin "graphics/interface/wireless_link.bin.lz" gUnknown_082ECF20:: @ 82ECF20 - .incbin "baserom.gba", 0x2ecf20, 0x20 + .incbin "graphics/interface/link_test_digits.gbapal" gUnknown_082ECF40:: @ 82ECF40 - .incbin "baserom.gba", 0x2ecf40, 0x228 + .incbin "graphics/interface/link_test_digits.4bpp" + .string "{HIGHLIGHT TRANSPARENT}{COLOR DARK_GREY}$" + + .align 2 gUnknown_082ED168:: @ 82ED168 - .incbin "baserom.gba", 0x2ed168, 0x40 + .incbin "graphics/interface/blank_1x2.4bpp" gUnknown_082ED1A8:: @ 82ED1A8 - .incbin "baserom.gba", 0x2ed1a8, 0x28 + .4byte gUnknown_020228C4 + .4byte 0x000000C8 + .4byte gUnknown_020228C4 + .4byte 0x000000C8 + .4byte gUnknown_020228C4 + .4byte 0x00000064 + .4byte gUnknown_020228C4 + .4byte 0x000000DC + .4byte gUnknown_020228C4 + .4byte 0x00000028 gUnknown_082ED1D0:: @ 82ED1D0 - .incbin "baserom.gba", 0x2ed1d0, 0x4 + .byte 0x8 + .byte 0xA + .byte 0xC + .byte 0xE gUnknown_082ED1D4:: @ 82ED1D4 - .incbin "baserom.gba", 0x2ed1d4, 0x10 + .ascii "GameFreak inc." + .align 2 gUnknown_082ED1E4:: @ 82ED1E4 - .incbin "baserom.gba", 0x2ed1e4, 0x18 + .ascii "TEST PRINT\nP0\nP1\nP2\nP3" -gUnknown_082ED1FC:: @ 82ED1FC - .incbin "baserom.gba", 0x2ed1fc, 0x8 + .align 2 +gUnknown_082ED1FC:: @ 82ED1FC BgTemplate + .4byte 0x000001F8 + .4byte 0x00001081 -gUnknown_082ED204:: @ 82ED204 - .incbin "baserom.gba", 0x2ed204, 0x20 +gUnknown_082ED204:: @ 82ED204 WindowTemplate + .byte 0x00 + .byte 0x00 + .byte 0x00 + .byte 0x1E + .byte 0x05 + .byte 0x0F + .2byte 0x0002 + + .byte 0x00 + .byte 0x00 + .byte 0x06 + .byte 0x1E + .byte 0x07 + .byte 0x0F + .2byte 0x0098 + + .byte 0x00 + .byte 0x00 + .byte 0x0D + .byte 0x1E + .byte 0x07 + .byte 0x0F + .2byte 0x016A + + .byte 0xFF + .byte 0x00 + .byte 0x00 + .byte 0x00 + .byte 0x00 + .byte 0x00 + .2byte 0x0000 gUnknown_082ED224:: @ 82ED224 - .incbin "baserom.gba", 0x2ed224, 0x14c + .byte 0x00, 0x01, 0x02, 0x00, 0xff, 0xfe, 0xff, 0x00 + +gWirelessLinkIconPalette:: @ 82ED22C + .incbin "graphics/interface/wireless_link_icon.gbapal" + +gWirelessLinkIconPic:: @ 82ED22C + .incbin "graphics/interface/wireless_link_icon.4bpp.lz" gUnknown_082ED370:: @ 82ED370 - .incbin "baserom.gba", 0x2ed370, 0x100 + .byte 0xff, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x37 + .byte 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f + .byte 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47 + .byte 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f + .byte 0x00, 0xab, 0xb5, 0xb6, 0xb1, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0xb2, 0xf1, 0x00, 0xae, 0xad, 0xba + .byte 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8 + .byte 0xa9, 0xaa, 0x00, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f + .byte 0x00, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1 + .byte 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9 + .byte 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1 + .byte 0xd2, 0xd3, 0xd4, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6 + .byte 0x00, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb + .byte 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3 + .byte 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb + .byte 0xec, 0xed, 0xee, 0x2d, 0x2f, 0x30, 0x31, 0x32 + .byte 0x33, 0x34, 0x35, 0x36, 0x50, 0x00, 0x01, 0x02 + .byte 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a + .byte 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12 + .byte 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a + .byte 0x1b, 0xad, 0xb3, 0xb4, 0x00, 0xaf, 0x7d, 0x7f + .byte 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0xa0 + .byte 0xae, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57 + .byte 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f + .byte 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67 + .byte 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f + .byte 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77 + .byte 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7e, 0xb0, 0xac + .byte 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23 + .byte 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b + .byte 0x2c, 0x2e, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c + .byte 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94 gUnknown_082ED470:: @ 82ED470 - .incbin "baserom.gba", 0x2ed470, 0x100 + .byte 0x20, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c + .byte 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94 + .byte 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c + .byte 0x9d, 0x9e, 0x9f, 0xa0, 0xe0, 0xe1, 0xe2, 0xe3 + .byte 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb + .byte 0xec, 0xed, 0xee, 0xef, 0xf0, 0x7b, 0xf1, 0x7c + .byte 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83, 0x07 + .byte 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f + .byte 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17 + .byte 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f + .byte 0x84, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7 + .byte 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf + .byte 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7 + .byte 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf + .byte 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7 + .byte 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xa6, 0xdd, 0xa7 + .byte 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xf2 + .byte 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa + .byte 0xfb, 0xfc, 0xfd, 0xfe, 0xff, 0x01, 0x02, 0x03 + .byte 0x04, 0x05, 0x06, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f + .byte 0xaf, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36 + .byte 0x37, 0x38, 0x39, 0x21, 0xdf, 0xa1, 0xb0, 0xa5 + .byte 0xde, 0x24, 0x2a, 0xa2, 0xa3, 0x22, 0x23, 0x20 + .byte 0xa4, 0x20, 0x2f, 0x41, 0x42, 0x43, 0x44, 0x45 + .byte 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d + .byte 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55 + .byte 0x56, 0x57, 0x58, 0x59, 0x5a, 0x61, 0x62, 0x63 + .byte 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b + .byte 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73 + .byte 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x20 + .byte 0x20, 0x2b, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x20 + .byte 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00 gUnknown_082ED570:: @ 82ED570 - .incbin "baserom.gba", 0x2ed570, 0x70 + .byte 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00 -gUnknown_082ED5E0:: @ 82ED5E0 - .incbin "baserom.gba", 0x2ed5e0, 0x8 +gUnknown_082ED578:: @ 82ED578 + .2byte 0x0004, 0x0005, 0x0008, 0x0005, 0x000c, 0x0005, 0x0010, 0x000a + .2byte 0x000c, 0x0005, 0x0008, 0x0005, 0xfffe, 0x0000 -gUnknown_082ED5E8:: @ 82ED5E8 - .incbin "baserom.gba", 0x2ed5e8, 0x8 +gUnknown_082ED594:: @ 82ED594 + .2byte 0x0004, 0x0005, 0x0008, 0x0005, 0x000c, 0x000a, 0x0008, 0x0005 + .2byte 0xfffe, 0x0000 -gUnknown_082ED5F0:: @ 82ED5F0 - .incbin "baserom.gba", 0x2ed5f0, 0x18 +gUnknown_082ED5A8:: @ 82ED5A8 + .2byte 0x0004, 0x0005, 0x0008, 0x0005, 0xfffe, 0x0000 + +gUnknown_082ED5B4:: @ 82ED5B4 + .2byte 0x0004, 0x000a, 0x0014, 0x000a, 0xfffe, 0x0000 + +gUnknown_082ED5C0:: @ 82ED5C0 + .2byte 0x0018, 0x000a, 0x0004, 0x000a, 0xfffe, 0x0000 + +gUnknown_082ED5CC:: @ 82ED5CC + .4byte gUnknown_082ED578 + .4byte gUnknown_082ED594 + .4byte gUnknown_082ED5A8 + .4byte gUnknown_082ED5B4 + .4byte gUnknown_082ED5C0 + +gUnknown_082ED5E0:: @ 82ED5E0 struct CompressedSpriteSheet + .4byte gWirelessLinkIconPic + .2byte 0x0380 @ uncompressed size + .2byte 0xD431 @ tag + +gUnknown_082ED5E8:: @ 82ED5E8 struct SpritePalette + .4byte gWirelessLinkIconPalette + .2byte 0xD432 @ tag + .2byte 0x0000 @ padding + +gUnknown_082ED5F0:: @ 82ED5F0 struct SpriteTemplate + .2byte 0xD431 @ tileTag + .2byte 0xD432 @ paletteTag + .4byte gUnknown_082ED570 + .4byte gUnknown_082ED5CC + .4byte NULL + .4byte gDummySpriteAffineAnimTable + .4byte SpriteCallbackDummy gUnknown_082ED608:: @ 82ED608 - .incbin "baserom.gba", 0x2ed608, 0x18 + .byte 0x04, 0x20, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00 + .byte 0x14, 0x2b, 0x02, 0x02, 0x22, 0x2b, 0x02, 0x02 + .byte 0x01, 0x00, 0x58, 0x02, 0x2c, 0x01, 0x00, 0x00 gUnknown_082ED620:: @ 82ED620 - .incbin "baserom.gba", 0x2ed620, 0x8 + .byte 0x00, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00 gUnknown_082ED628:: @ 82ED628 - .incbin "baserom.gba", 0x2ed628, 0x64 + .4byte 0x00000000, 0x00000001, 0x00000003, 0x00000007 + .4byte 0x0000000f, 0x0000001f, 0x0000003f, 0x0000007f + .4byte 0x000000ff, 0x000001ff, 0x000003ff, 0x000007ff + .4byte 0x00000fff, 0x00001fff, 0x00003fff, 0x00007fff + .4byte 0x0000ffff, 0x0001ffff, 0x0003ffff, 0x0007ffff + .4byte 0x000fffff, 0x001fffff, 0x003fffff, 0x007fffff + .4byte 0x00ffffff gUnknown_082ED68C:: @ 82ED68C - .incbin "baserom.gba", 0x2ed68c, 0x9 + .byte 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02 + .byte 0x03 gUnknown_082ED695:: @ 82ED695 - .incbin "baserom.gba", 0x2ed695, 0x10 + .byte 0x00, 0x01, 0x01, 0x02, 0x01, 0x02, 0x02, 0x03 + .byte 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x04 gUnknown_082ED6A5:: @ 82ED6A5 - .incbin "baserom.gba", 0x2ed6a5, 0x13 + .byte 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00 + .byte 0x03, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00 + .byte 0x00, 0x00, 0x00 gUnknown_082ED6B8:: @ 82ED6B8 - .incbin "baserom.gba", 0x2ed6b8, 0x28 + .4byte gUnknown_020228C4 + .4byte 0x000000c8 + .4byte gUnknown_020228C4 + .4byte 0x000000c8 + .4byte gUnknown_020228C4 + .4byte 0x00000064 + .4byte gUnknown_020228C4 + .4byte 0x000000dc + .4byte gUnknown_020228C4 + .4byte 0x00000028 gUnknown_082ED6E0:: @ 82ED6E0 - .incbin "baserom.gba", 0x2ed6e0, 0x100 + .2byte 0x0002, 0x7f7d, 0x0000, 0xffff + .ascii "RFU WAIT" + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + .ascii "RFU BOOT" + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + .ascii "RFU ERROR" + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + .ascii "RFU RESET" + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + .ascii "RFU CONFIG" + .byte 0x00, 0x00, 0x00, 0x00, 0x00 + + .ascii "RFU START" + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + .ascii "RFU SC POLL" + .byte 0x00, 0x00, 0x00, 0x00 + + .ascii "RFU SP POLL" + .byte 0x00, 0x00, 0x00, 0x00 + + .ascii "RFU START" + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + .ascii "RFU SEND ERR" + .byte 0x00, 0x00, 0x00 + + .ascii "RFU CP POLL" + .byte 0x00, 0x00, 0x00, 0x00 + + .ascii " " + .byte 0x00, 0x00 + + .ascii "RECOVER START " + .byte 0x00, 0x00 + + .ascii "DISSCONECT " + .byte 0x00, 0x00 + + .ascii "RECOVER SUUSES" + .byte 0x00, 0x00 + + .ascii "RECOVER FAILED" + .byte 0x00, 0x00 + + .align 2 gUnknown_082ED7E0:: @ 82ED7E0 - .incbin "baserom.gba", 0x2ed7e0, 0xc + .4byte sub_801084C + .4byte sub_8010AAC + .4byte sub_8010D0C gUnknown_082ED7EC:: @ 82ED7EC - .incbin "baserom.gba", 0x2ed7ec, 0x10 + .ascii "PokemonSioInfo" + .align 2 gUnknown_082ED7FC:: @ 82ED7FC - .incbin "baserom.gba", 0x2ed7fc, 0x18 + .ascii "LINK LOSS DISCONNECT!" + .align 2 gUnknown_082ED814:: @ 82ED814 - .incbin "baserom.gba", 0x2ed814, 0x18 + .ascii "LINK LOSS RECOVERY NOW" + .align 2 gUnknown_082ED82C:: @ 82ED82C - .incbin "baserom.gba", 0x2ed82c, 0x1f + .byte 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 + .byte 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 + .byte 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 + .byte 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00 gUnknown_082ED84B:: @ 82ED84B - .incbin "baserom.gba", 0x2ed84b, 0x10 + .byte 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 + .byte 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00 gUnknown_082ED85B:: @ 82ED85B - .incbin "baserom.gba", 0x2ed85b, 0xd + .byte 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 + .byte 0x00, 0x20, 0x00, 0x2a, 0x00 gUnknown_082ED868:: @ 82ED868 - .incbin "baserom.gba", 0x2ed868, 0x60 + .asciz "NOWSLOT" + + .asciz " " + + .asciz "CLOCK DRIFT" + .asciz "BUSY SEND " + + .asciz "CMD REJECT " + + .asciz "CLOCK SLAVE" + + .ascii "CHILD " + + .align 2 + .ascii "PARENT" + + .align 2 + .ascii "SEARCH" + + .align 2 +gUnknown_082ED8C4:: @ 82ED8C4 + .string "$" + + .align 2 gUnknown_082ED8C8:: @ 82ED8C8 - .incbin "baserom.gba", 0x2ed8c8, 0x4 + .string ":$" + .align 2 gUnknown_082ED8CC:: @ 82ED8CC - .incbin "baserom.gba", 0x2ed8cc, 0x4 + .string "{UNK_CTRL_F907}$" + .align 2 gUnknown_082ED8D0:: @ 82ED8D0 - .incbin "baserom.gba", 0x2ed8d0, 0x28 + .string "Please start over from the beginning.$" + .align 2 gUnknown_082ED8F8:: @ 82ED8F8 - .incbin "baserom.gba", 0x2ed8f8, 0x68 + .string "The WIRELESS COMMUNICATION\nSYSTEM search has been canceled.$" + .align 2 + .string "Awaiting communication\nfrom another player.$" + + .align 2 gUnknown_082ED960:: @ 82ED960 - .incbin "baserom.gba", 0x2ed960, 0x30 + .string "{STR_VAR_1}! Awaiting\ncommunication from another player.$" gUnknown_082ED990:: @ 82ED990 - .incbin "baserom.gba", 0x2ed990, 0x1d0 + .string "{STR_VAR_1}! Awaiting link!\nPress START when everyone’s ready.$" + + .align 2 +gUnknown_082ED9C8:: @ 82ED9C8 + .string "シングルバトルを かいさいする$" @ "shingurubatoruwo kaisaisuru" ("hold a single battle" in Japanese) + .align 2 +gUnknown_082ED9D8:: @ 82ED9D8 + .string "ダブルバトルを かいさいする$" @ "daburubatoruwo kaisaisuru" ("hold a double battle" in Japanese) + + .align 2 +gUnknown_082ED9E8:: @ 82ED9E8 + .string "マルチバトルを かいさいする$" @ "maruchibatoruwo kaisaisuru" ("hold a multi battle" in Japanese) + + .align 2 +gUnknown_082ED9F8:: @ 82ED9F8 + .string "ポケモンこうかんを かいさいする$" @ "pokemonkoukanwo kaisaisuru" ("trade Pokémon" in Japanese) + + .align 2 +gUnknown_082EDA0C:: @ 82EDA0C + .string "チャットを かいさいする$" @ "chattowo kaisaisuru" ("chat" in Japanese) + + .align 2 +gUnknown_082EDA1C:: @ 82EDA1C + .string "ふしぎなカードをくばる$" @ "fushiginakaadowokubaru" ("distribute Wonder Card" in Japanese) + + .align 2 +gUnknown_082EDA28:: @ 82EDA28 + .string "ふしぎなニュースをくばる$" @ "fushiginanyuusuwokubaru" ("distribute Mystery News" in Japanese) + + .align 2 + .string "ふしぎなできごとを かいさいする$" @ "fushiginadekigotowo kaisaisuru" ("hold a session of Mystery Event" in Japanese) + + .align 2 +gUnknown_082EDA4C:: @ 82EDA4C + .string "なわとびを かいさいする$" @ "nawatobiwo kaisaisuru" ("hold a session of Jump" in Japanese) + + .align 2 +gUnknown_082EDA5C:: @ 82EDA5C + .string "きのみマッシャーを かいさいする$" @ "kinomimassha-wo kaisaisuru" ("hold a session of Berry Masher" in Japanese) + + .align 2 +gUnknown_082EDA70:: @ 82EDA70 + .string "きのみどりを かいさいする$" @ "kinomidoriwo kaisaisuru" ("hold a session of Berry Picking" in Japanese) + + .align 2 +gUnknown_082EDA80:: @ 82EDA80 + .string "ぐるぐるこうかんを かいさいする$" @ "gurugurukoukanwo kaisaisuru" ("hold a session of Spin Trade" in Japanese) + + .align 2 +gUnknown_082EDA94:: @ 82EDA94 + .string "ぐるぐるショップを かいさいする$" @ "gurugurushoppuwo kaisaisuru" ("hold a session of Spin Shop" in Japanese) + + .align 2 + .4byte gUnknown_082ED9C8 + .4byte gUnknown_082ED9D8 + .4byte gUnknown_082ED9E8 + .4byte gUnknown_082ED9F8 + .4byte gUnknown_082EDA0C + .4byte gUnknown_082EDA1C + .4byte gUnknown_082EDA28 + .4byte gUnknown_082EDA1C + .4byte gUnknown_082EDA4C + .4byte gUnknown_082EDA5C + .4byte gUnknown_082EDA70 + .4byte gUnknown_082EDA70 + .4byte gUnknown_082EDA80 + .4byte gUnknown_082EDA94 + +gUnknown_082EDAE0:: @ 82EDAE0 + .string "1 player\nneeded.$" + +gUnknown_082EDAF1:: @ 82EDAF1 + .string "2 players\nneeded.$" + +gUnknown_082EDB03:: @ 82EDB03 + .string "3 players\nneeded.$" + +gUnknown_082EDB15:: @ 82EDB15 + .string "4 players\nneeded.$" + +gUnknown_082EDB27:: @ 82EDB27 + .string "2-PLAYER\nMODE$" + +gUnknown_082EDB35:: @ 82EDB35 + .string "3-PLAYER\nMODE$" + +gUnknown_082EDB43:: @ 82EDB43 + .string "4-PLAYER\nMODE$" + +gUnknown_082EDB51:: @ 82EDB51 + .string "5-PLAYER\nMODE$" + + .align 2 gUnknown_082EDB60:: @ 82EDB60 - .incbin "baserom.gba", 0x2edb60, 0x64 + .4byte gUnknown_082EDAE0 + .4byte gUnknown_082EDB27 + .4byte NULL + .4byte NULL + .4byte NULL + .4byte gUnknown_082EDB03 + .4byte gUnknown_082EDAF1 + .4byte gUnknown_082EDAE0 + .4byte gUnknown_082EDB43 + .4byte NULL + .4byte gUnknown_082EDAE0 + .4byte gUnknown_082EDB27 + .4byte gUnknown_082EDB35 + .4byte gUnknown_082EDB43 + .4byte gUnknown_082EDB51 + .4byte gUnknown_082EDAF1 + .4byte gUnknown_082EDAE0 + .4byte gUnknown_082EDB35 + .4byte gUnknown_082EDB43 + .4byte gUnknown_082EDB51 + .4byte gUnknown_082EDAE0 + .4byte gUnknown_082EDB27 + .4byte gUnknown_082EDB35 + .4byte gUnknown_082EDB43 + .4byte NULL + .align 2 gUnknown_082EDBC4:: @ 82EDBC4 - .incbin "baserom.gba", 0x2edbc4, 0x24 + .string "{UNK_CTRL_F801}CANCEL$" + .align 2 + .string "ため\nさんかしゃ ぼしゅうちゅう です!$" @ "tame\nsankasha boshuuchuu desu!" + + .align 2 gUnknown_082EDBE8:: @ 82EDBE8 - .incbin "baserom.gba", 0x2edbe8, 0x24 + .string "{STR_VAR_2} contacted you for\n{STR_VAR_1}. Accept?$" + .align 2 gUnknown_082EDC0C:: @ 82EDC0C - .incbin "baserom.gba", 0x2edc0c, 0x28 + .string "{STR_VAR_2} contacted you.\nWill you share {STR_VAR_1}?$" + .align 2 gUnknown_082EDC34:: @ 82EDC34 - .incbin "baserom.gba", 0x2edc34, 0x28 + .string "{STR_VAR_2} contacted you.\nAdd to the members?$" + .align 2 gUnknown_082EDC5C:: @ 82EDC5C - .incbin "baserom.gba", 0x2edc5c, 0x1c + .string "{STR_VAR_1}!\nAre these members OK?$" + .align 2 gUnknown_082EDC78:: @ 82EDC78 - .incbin "baserom.gba", 0x2edc78, 0x24 + .string "Cancel {STR_VAR_1} MODE\nwith these members?$" + .align 2 gUnknown_082EDC9C:: @ 82EDC9C - .incbin "baserom.gba", 0x2edc9c, 0xb4 + .string "An “OK” was sent\nto {STR_VAR_1}.$" + .align 2 +gUnknown_082EDCB4:: @ 82EDCB4 + .string "The other TRAINER doesn’t appear\nto be available now…\p$" + + .align 2 +gUnknown_082EDCEC:: @ 82EDCEC + .string "You can’t transmit with a TRAINER\nwho is too far away.\p$" + + .align 2 +gUnknown_082EDD24:: @ 82EDD24 + .string "The other TRAINER(S) is/are not\nready yet.\p$" + + .align 2 gUnknown_082EDD50:: @ 82EDD50 - .incbin "baserom.gba", 0x2edd50, 0x8 + .4byte gUnknown_082EDCEC + .4byte gUnknown_082EDD24 + .align 2 gUnknown_082EDD58:: @ 82EDD58 - .incbin "baserom.gba", 0x2edd58, 0x6c + .string "The {STR_VAR_1} MODE with\nthese members will be canceled.{PAUSE 60}$" + .align 2 +gUnknown_082EDD8C:: @ 82EDD8C + .string "There is a member who can no\nlonger remain available.\p$" + + .align 2 gUnknown_082EDDC4:: @ 82EDDC4 - .incbin "baserom.gba", 0x2eddc4, 0x30 + .4byte gUnknown_082EDCB4 + .4byte gUnknown_082EDD8C + .align 2 +gUnknown_082EDDCC:: @ 82EDDCC + .string "The other TRAINER appears\nunavailable…\p$" + + .align 2 gUnknown_082EDDF4:: @ 82EDDF4 - .incbin "baserom.gba", 0x2eddf4, 0x18 + .string "{STR_VAR_1} sent back an “OK”!$" + .align 2 gUnknown_082EDE0C:: @ 82EDE0C - .incbin "baserom.gba", 0x2ede0c, 0x3c + .string "{STR_VAR_1} OK’d your registration as\na member.$" + .align 2 +gUnknown_082EDE34:: @ 82EDE34 + .string "{STR_VAR_1} replied, “No…”\p$" + + .align 2 gUnknown_082EDE48:: @ 82EDE48 - .incbin "baserom.gba", 0x2ede48, 0x1c + .string "{STR_VAR_1}!\nAwaiting other members!$" + .align 2 gUnknown_082EDE64:: @ 82EDE64 - .incbin "baserom.gba", 0x2ede64, 0x38 + .string "Quit being a member?$" + .align 2 +gUnknown_082EDE7C:: @ 82EDE7C + .string "You stopped being a member.\p$" + + .align 2 gUnknown_082EDE9C:: @ 82EDE9C - .incbin "baserom.gba", 0x2ede9c, 0x28 + .4byte NULL + .4byte gUnknown_082EDD8C + .4byte gUnknown_082EDDCC + .4byte NULL + .4byte NULL + .4byte NULL + .4byte gUnknown_082EDE34 + .4byte NULL + .4byte NULL + .4byte gUnknown_082EDE7C + .align 2 gUnknown_082EDEC4:: @ 82EDEC4 - .incbin "baserom.gba", 0x2edec4, 0x40 + .string "The WIRELESS COMMUNICATION\nSYSTEM link has been established.$" + .align 2 gUnknown_082EDF04:: @ 82EDF04 - .incbin "baserom.gba", 0x2edf04, 0x3c + .string "The WIRELESS COMMUNICATION\nSYSTEM link has been dropped…$" + .align 2 gUnknown_082EDF40:: @ 82EDF40 - .incbin "baserom.gba", 0x2edf40, 0x40 + .string "The link with your friend has been\ndropped…$" + .align 2 +gUnknown_082EDF6C:: @ 82EDF6C + .string "{STR_VAR_1} replied, “No…”$" + + .align 2 gUnknown_082EDF80:: @ 82EDF80 - .incbin "baserom.gba", 0x2edf80, 0x84 + .4byte NULL + .4byte gUnknown_082EDF40 + .4byte gUnknown_082EDF40 + .4byte NULL + .4byte NULL + .4byte NULL + .4byte gUnknown_082EDF6C + .4byte NULL + .4byte NULL + .4byte NULL + .align 2 +gUnknown_082EDFA8:: @ 82EDF80 + .string "Do you want the {STR_VAR_2}\nMODE?$" + + .align 2 +gUnknown_082EDFC4:: @ 82EDFC4 + .string "Do you want the {STR_VAR_2}\nMODE?$" + + .align 2 + .4byte gUnknown_082EDFA8 + .4byte gUnknown_082EDFC4 + + .align 2 + .string "Communicating…\nPlease wait.$" + + .align 2 gUnknown_082EE004:: @ 82EE004 - .incbin "baserom.gba", 0x2ee004, 0x178 + .string "Awaiting {STR_VAR_1}’s response about\nthe trade…$" + .align 2 +gUnknown_082EE02C:: @ 82EE02C + .string "Communicating{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.\n{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.$" + + .align 2 +gUnknown_082EE098:: @ 82EE098 + .string "Communicating with {STR_VAR_1}{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.\n{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.$" + + .align 2 +gUnknown_082EE104:: @ 82EE104 + .string "Please wait a while{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.\n{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.{PAUSE 15}.$" + + .align 2 gUnknown_082EE17C:: @ 82EE17C - .incbin "baserom.gba", 0x2ee17c, 0xd0 + .4byte gUnknown_082EE02C + .4byte gUnknown_082EE098 + .4byte gUnknown_082EE104 + .align 2 +gUnknown_082EE188:: @ 82EE188 + .string "Hiya! Is there something that you\nwanted to do?$" + + .align 2 +gUnknown_082EE1B8:: @ 82EE1B8 + .string "Hello!\nWould you like to do something?$" + + .align 2 +gUnknown_082EE1E0:: @ 82EE1E0 + .string "{STR_VAR_1}: Hiya, we meet again!\nWhat are you up for this time?$" + + .align 2 +gUnknown_082EE218:: @ 82EE218 + .string "{STR_VAR_1}: Oh! {PLAYER}, hello!\nWould you like to do something?$" + + .align 2 gUnknown_082EE24C:: @ 82EE24C - .incbin "baserom.gba", 0x2ee24c, 0xd8 + .4byte gUnknown_082EE188 + .4byte gUnknown_082EE1B8 + .4byte gUnknown_082EE1E0 + .4byte gUnknown_082EE218 + .align 2 +gUnknown_082EE25C:: @ 82EE25C + .string "Want to do something?$" + + .align 2 +gUnknown_082EE274:: @ 82EE274 + .string "Would you like to do something?$" + + .align 2 +gUnknown_082EE294:: @ 82EE294 + .string "{STR_VAR_1}: What would you like to\ndo now?$" + + .align 2 + .string "{STR_VAR_1}: Want to do anything else?$" + + .align 2 + .4byte gUnknown_082EE25C + .4byte gUnknown_082EE274 + .4byte gUnknown_082EE294 + .4byte gUnknown_082EE294 + + .align 2 +gUnknown_082EE2E8:: @ 82EE2E8 + .string "Somebody has contacted you.{PAUSE 60}$" + + .align 2 +gUnknown_082EE308:: @ 82EE308 + .string "{STR_VAR_1} has contacted you.{PAUSE 60}$" + + .align 2 gUnknown_082EE324:: @ 82EE324 - .incbin "baserom.gba", 0x2ee324, 0x54 + .4byte gUnknown_082EE2E8 + .4byte gUnknown_082EE308 + .align 2 +gUnknown_082EE32C:: @ 82EE32C + .string "Awaiting a response from\nthe other TRAINER…$" + + .align 2 +gUnknown_082EE358:: @ 82EE358 + .string "Awaiting a response from\n{STR_VAR_1}…$" + + .align 2 gUnknown_082EE378:: @ 82EE378 - .incbin "baserom.gba", 0x2ee378, 0x8 + .4byte gUnknown_082EE32C + .4byte gUnknown_082EE358 + .align 2 gUnknown_082EE380:: @ 82EE380 - .incbin "baserom.gba", 0x2ee380, 0x5c + .string "The other TRAINER showed\nyou their TRAINER CARD.\pWould you like to show your\nTRAINER CARD?$" + .align 2 gUnknown_082EE3DC:: @ 82EE3DC - .incbin "baserom.gba", 0x2ee3dc, 0x54 + .string "The other TRAINER challenges you\nto battle.\pWill you accept the battle\nchallenge?$" + .align 2 gUnknown_082EE430:: @ 82EE430 - .incbin "baserom.gba", 0x2ee430, 0x4c + .string "The other TRAINER invites you\nto chat.\pWill you accept the chat\ninvitation?$" + .align 2 gUnknown_082EE47C:: @ 82EE47C - .incbin "baserom.gba", 0x2ee47c, 0x74 + .string "There is an offer to trade your\nregistered Lv. {SPECIAL_F7 0x00} {SPECIAL_F7 0x01}\pin exchange for a\nLv. {SPECIAL_F7 0x02} {SPECIAL_F7 0x03}.\pWill you accept this trade\noffer?$" + .align 2 gUnknown_082EE4F0:: @ 82EE4F0 - .incbin "baserom.gba", 0x2ee4f0, 0x54 + .string "There is an offer to trade your\nregistered EGG.\lWill you accept this trade offer?$" + .align 2 gUnknown_082EE544:: @ 82EE544 - .incbin "baserom.gba", 0x2ee544, 0x1c + .string "The chat has been dropped.\p$" + .align 2 gUnknown_082EE560:: @ 82EE560 - .incbin "baserom.gba", 0x2ee560, 0x1c + .string "You declined the offer.\p$" + .align 2 gUnknown_082EE57C:: @ 82EE57C - .incbin "baserom.gba", 0x2ee57c, 0x1c + .string "You declined the offer.\p$" + .align 2 gUnknown_082EE598:: @ 82EE598 - .incbin "baserom.gba", 0x2ee598, 0x120 + .string "The chat was ended.\p$" + .align 2 + .4byte gUnknown_082EE380 + .4byte gUnknown_082EE3DC + .4byte gUnknown_082EE430 + .4byte gUnknown_082EE47C + + .align 2 +gUnknown_082EE5C0:: @ 82EE5C0 + .string "Oh, hey! We’re in a chat right now.\nWant to join us?$" + + .align 2 +gUnknown_082EE5F8:: @ 82EE5F8 + .string "{STR_VAR_1}: Hey, {PLAYER}!\nWe’re having a chat right now.\lWant to join us?$" + + .align 2 +gUnknown_082EE638:: @ 82EE638 + .string "Oh, hi! We’re having a chat now.\nWould you like to join us?$" + + .align 2 +gUnknown_082EE674:: @ 82EE674 + .string "{STR_VAR_1}: Oh, hi, {PLAYER}!\nWe’re having a chat now.\lWould you like to join us?$" + + .align 2 gUnknown_082EE6B8:: @ 82EE6B8 - .incbin "baserom.gba", 0x2ee6b8, 0x10 + .4byte gUnknown_082EE5C0 + .4byte gUnknown_082EE638 + .4byte gUnknown_082EE5F8 + .4byte gUnknown_082EE674 + .align 2 gUnknown_082EE6C8:: @ 82EE6C8 - .incbin "baserom.gba", 0x2ee6c8, 0x164 + .string "……\nThe TRAINER appears to be busy…\p$" + .align 2 +gUnknown_082EE6EC:: @ 82EE6EC + .string "A battle, huh?\nAll right, just give me some time.$" + + .align 2 +gUnknown_082EE720:: @ 82EE720 + .string "You want to chat, huh?\nSure, just wait a little.$" + + .align 2 +gUnknown_082EE754:: @ 82EE754 + .string "Sure thing! As my “Greetings,”\nhere’s my TRAINER CARD.$" + + .align 2 +gUnknown_082EE78C:: @ 82EE78C + .string "A battle? Of course, but I need\ntime to get ready.$" + + .align 2 +gUnknown_082EE7C0:: @ 82EE7C0 + .string "Did you want to chat?\nOkay, but please wait a moment.$" + + .align 2 +gUnknown_082EE7F8:: @ 82EE7F8 + .string "As my introduction, I’ll show you\nmy TRAINER CARD.$" + + .align 2 gUnknown_082EE82C:: @ 82EE82C - .incbin "baserom.gba", 0x2ee82c, 0x158 + .4byte gUnknown_082EE6EC + .4byte gUnknown_082EE720 + .4byte NULL + .4byte gUnknown_082EE754 + .4byte gUnknown_082EE78C + .4byte gUnknown_082EE7C0 + .4byte NULL + .4byte gUnknown_082EE7F8 + .align 2 + .string "You want to chat, huh?\nSure, just wait a little.$" + + .align 2 +gUnknown_082EE880:: @ 82EE880 + .string "Thanks for waiting!\nLet’s get our battle started!{PAUSE 60}$" + + .align 2 +gUnknown_082EE8B8:: @ 82EE880 + .string "All right!\nLet’s chat!{PAUSE 60}$" + + .align 2 +gUnknown_082EE8D4:: @ 82EE8D4 + .string "Sorry I made you wait!\nLet’s get started!{PAUSE 60}$" + + .align 2 +gUnknown_082EE904:: @ 82EE904 + .string "Sorry I made you wait!\nLet’s chat.{PAUSE 60}$" + + .align 2 +gUnknown_082EE92C:: @ 82EE92C + .string "The trade will be started.{PAUSE 60}$" + + .align 2 +gUnknown_082EE94C:: @ 82EE94C + .string "The battle will be started.{PAUSE 60}$" + + .align 2 +gUnknown_082EE96C:: @ 82EE96C + .string "Entering the chat…{PAUSE 60}$" + + .align 2 gUnknown_082EE984:: @ 82EE984 - .incbin "baserom.gba", 0x2ee984, 0xe4 + .4byte gUnknown_082EE94C + .4byte gUnknown_082EE96C + .4byte gUnknown_082EE92C + .4byte gUnknown_082EE94C + .4byte gUnknown_082EE96C + .4byte gUnknown_082EE92C + .4byte gUnknown_082EE880 + .4byte gUnknown_082EE8B8 + .4byte gUnknown_082EE92C + .4byte gUnknown_082EE8D4 + .4byte gUnknown_082EE904 + .4byte gUnknown_082EE92C + .align 2 +gUnknown_082EE9B4:: @ 82EE9B4 + .string "Sorry! My POKéMON don’t seem to\nbe feeling too well right now.\lLet me battle you another time.\p$" + + .align 2 +gUnknown_082EEA14:: @ 82EEA14 + .string "I’m terribly sorry, but my POKéMON\naren’t feeling well…\pLet’s battle another time.\p$" + + .align 2 gUnknown_082EEA68:: @ 82EEA68 - .incbin "baserom.gba", 0x2eea68, 0xa0 + .4byte gUnknown_082EE9B4 + .4byte gUnknown_082EEA14 + .align 2 +gUnknown_082EEA70:: @ 82EEA70 + .string "Huh? My TRAINER CARD…\nWhere’d it go now?\lSorry! I’ll show you another time!\p$" + + .align 2 +gUnknown_082EEAC0:: @ 82EEAC0 + .string "Oh? Now where did I put my\nTRAINER CARD?…\lSorry! I’ll show you later!\p$" + + .align 2 gUnknown_082EEB08:: @ 82EEB08 - .incbin "baserom.gba", 0x2eeb08, 0x78 + .4byte gUnknown_082EEA70 + .4byte gUnknown_082EEAC0 + .align 2 +gUnknown_082EEB10:: @ 82EEB10 + .string "If you want to do something with\nme, just give me a shout!\p$" + + .align 2 +gUnknown_082EEB4C:: @ 82EEB4C + .string "If you want to do something with\nme, don’t be shy.\p$" + + .align 2 gUnknown_082EEB80:: @ 82EEB80 - .incbin "baserom.gba", 0x2eeb80, 0x8 + .4byte gUnknown_082EEB10 + .4byte gUnknown_082EEB4C + .align 2 gUnknown_082EEB88:: @ 82EEB88 - .incbin "baserom.gba", 0x2eeb88, 0x48 + .string "Whoops! Sorry, but I have to do\nsomething else.\lAnother time, okay?\p$" + .align 2 gUnknown_082EEBD0:: @ 82EEBD0 - .incbin "baserom.gba", 0x2eebd0, 0x44 + .string "If you want to battle, you need\ntwo POKéMON that are below\lLv. 30.\p$" + .align 2 gUnknown_082EEC14:: @ 82EEC14 - .incbin "baserom.gba", 0x2eec14, 0x88 + .string "For a battle, you need two\nPOKéMON that are below Lv. 30.\p$" + .align 2 +gUnknown_082EEC50:: @ 82EEC50 + .string "Oh, all right.\nCome see me anytime, okay?\p$" + + .align 2 +gUnknown_082EEC7C:: @ 82EEC7C + .string "Oh…\nPlease come by anytime.\p$" + + .align 2 gUnknown_082EEC9C:: @ 82EEC9C - .incbin "baserom.gba", 0x2eec9c, 0xa0 + .4byte gUnknown_082EEC50 + .4byte gUnknown_082EEC7C + .align 2 +gUnknown_082EECA4:: @ 82EECA4 + .string "Oh, sorry!\nI just can’t right this instant.\lLet’s chat another time.\p$" + + .align 2 +gUnknown_082EECEC:: @ 82EECEC + .string "Oh, I’m sorry.\nI have too much to do right now.\lLet’s chat some other time.\p$" + + .align 2 gUnknown_082EED3C:: @ 82EED3C - .incbin "baserom.gba", 0x2eed3c, 0x170 + .4byte gUnknown_082EECA4 + .4byte gUnknown_082EECEC + .align 2 +gUnknown_082EED44:: @ 82EED3C + .string "Whoa!\nI can tell you’re pretty tough!\p$" + + .align 2 +gUnknown_082EED6C:: @ 82EED6C + .string "You used that move?\nThat’s good strategy!\p$" + + .align 2 +gUnknown_082EED98:: @ 82EED98 + .string "Way to go!\nThat was an eye-opener!\p$" + + .align 2 +gUnknown_082EEDBC:: @ 82EEDBC + .string "Oh! How could you use that\nPOKéMON in that situation?\p$" + + .align 2 +gUnknown_082EEDF4:: @ 82EEDF4 + .string "That POKéMON…\nIt’s been raised really well!\p$" + + .align 2 +gUnknown_082EEE24:: @ 82EEE24 + .string "That’s it!\nThis is the right move now!\p$" + + .align 2 +gUnknown_082EEE4C:: @ 82EEE4C + .string "That’s awesome!\nYou can battle that way?\p$" + + .align 2 +gUnknown_082EEE78:: @ 82EEE78 + .string "You have exquisite timing for\nswitching POKéMON!\p$" + + .align 2 gUnknown_082EEEAC:: @ 82EEEAC - .incbin "baserom.gba", 0x2eeeac, 0x164 + .4byte gUnknown_082EED44 + .4byte gUnknown_082EED6C + .4byte gUnknown_082EED98 + .4byte gUnknown_082EEDBC + .4byte gUnknown_082EEDF4 + .4byte gUnknown_082EEE24 + .4byte gUnknown_082EEE4C + .4byte gUnknown_082EEE78 + .align 2 +gUnknown_082EEECC:: @ 82EEECC + .string "Oh, I see!\nThis is educational!\p$" + + .align 2 +gUnknown_082EEEF0:: @ 82EEEF0 + .string "Don’t say anything funny anymore!\nI’m sore from laughing!\p$" + + .align 2 +gUnknown_082EEF2C:: @ 82EEF2C + .string "Oh?\nSomething like that happened.\p$" + + .align 2 +gUnknown_082EEF50:: @ 82EEF50 + .string "Hmhm… What?\nSo is this what you’re saying?\p$" + + .align 2 +gUnknown_082EEF7C:: @ 82EEF7C + .string "Is that right?\nI didn’t know that.\p$" + + .align 2 +gUnknown_082EEFA0:: @ 82EEFA0 + .string "Ahaha!\nWhat is that about?\p$" + + .align 2 +gUnknown_082EEFBC:: @ 82EEFBC + .string "Yes, that’s exactly it!\nThat’s what I meant.\p$" + + .align 2 +gUnknown_082EEFEC:: @ 82EEFEC + .string "In other words…\nYes! That’s right!\p$" + + .align 2 gUnknown_082EF010:: @ 82EF010 - .incbin "baserom.gba", 0x2ef010, 0xf0 + .4byte gUnknown_082EEECC + .4byte gUnknown_082EEEF0 + .4byte gUnknown_082EEF2C + .4byte gUnknown_082EEF50 + .4byte gUnknown_082EEF7C + .4byte gUnknown_082EEFA0 + .4byte gUnknown_082EEFBC + .4byte gUnknown_082EEFEC + .align 2 +gUnknown_082EF030:: @ 82EF030 + .string "I’m just showing my TRAINER CARD\nas my way of greeting.\p$" + + .align 2 +gUnknown_082EF06C:: @ 82EF06C + .string "I hope I get to know you better!\p$" + + .align 2 +gUnknown_082EF090:: @ 82EF010 + .string "We’re showing each other our\nTRAINER CARDS to get acquainted.\p$" + + .align 2 +gUnknown_082EF0D0:: @ 82EF0D0 + .string "Glad to meet you.\nPlease don’t be a stranger!\p$" + + .align 2 gUnknown_082EF100:: @ 82EF100 - .incbin "baserom.gba", 0x2ef100, 0xcc + .4byte gUnknown_082EF030 + .4byte gUnknown_082EF06C + .4byte gUnknown_082EF090 + .4byte gUnknown_082EF0D0 + .align 2 +gUnknown_082EF110:: @ 82EF110 + .string "Yeahah!\nI really wanted this POKéMON!\p$" + + .align 2 +gUnknown_082EF138:: @ 82EF138 + .string "Finally, a trade got me that\nPOKéMON I’d wanted a long time.\p$" + + .align 2 +gUnknown_082EF178:: @ 82EF178 + .string "I’m trading POKéMON right now.\p$" + + .align 2 +gUnknown_082EF198:: @ 82EF198 + .string "I finally got that POKéMON I\nwanted in a trade!\p$" + + .align 2 gUnknown_082EF1CC:: @ 82EF1CC - .incbin "baserom.gba", 0x2ef1cc, 0x20 + .4byte gUnknown_082EF110 + .4byte gUnknown_082EF138 + .4byte NULL + .4byte NULL + .4byte gUnknown_082EF178 + .4byte gUnknown_082EF198 + .4byte NULL + .4byte NULL + .align 2 gUnknown_082EF1EC:: @ 82EF1EC - .incbin "baserom.gba", 0x2ef1ec, 0x20 + .string "{STR_VAR_1} checked the\nTRADING BOARD.\p$" + .align 2 gUnknown_082EF20C:: @ 82EF20C - .incbin "baserom.gba", 0x2ef20c, 0x8c + .string "Welcome to the TRADING BOARD.\pYou may register your POKéMON\nand offer it up for a trade.\pWould you like to register one of\nyour POKéMON?$" + .align 2 gUnknown_082EF298:: @ 82EF298 - .incbin "baserom.gba", 0x2ef298, 0x1e4 + .string "This TRADING BOARD is used for\noffering a POKéMON for a trade.\pAll you need to do is register a\nPOKéMON for a trade.\pAnother TRAINER may offer a party\nPOKéMON in return for the trade.\pWe hope you will register POKéMON\nand trade them with many, many\lother TRAINERS.\pWould you like to register one of\nyour POKéMON?$" + .align 2 + .string "We have registered your POKéMON for\ntrade on the TRADING BOARD.\pThank you for using this service!\p$" + + .align 2 + .string "Nobody has registered any POKéMON\nfor trade on the TRADING BOARD.\p\n$" + + .align 2 gUnknown_082EF47C:: @ 82EF47C - .incbin "baserom.gba", 0x2ef47c, 0x48 + .string "Please choose the type of POKéMON\nthat you would like in the trade.\n$" + .align 2 gUnknown_082EF4C4:: @ 82EF4C4 - .incbin "baserom.gba", 0x2ef4c4, 0x38 + .string "Which of your party POKéMON will\nyou offer in trade?\p$" + .align 2 gUnknown_082EF4FC:: @ 82EF4FC - .incbin "baserom.gba", 0x2ef4fc, 0x24 + .string "Registration has been canceled.\p$" + .align 2 gUnknown_082EF520:: @ 82EF520 - .incbin "baserom.gba", 0x2ef520, 0x24 + .string "Registration has been completed.\p$" + .align 2 gUnknown_082EF544:: @ 82EF544 - .incbin "baserom.gba", 0x2ef544, 0x20 + .string "The trade has been canceled.\p$" + .align 2 gUnknown_082EF564:: @ 82EF564 - .incbin "baserom.gba", 0x2ef564, 0x2c + .string "Cancel the registration of your\nLv. {STR_VAR_2} {STR_VAR_1}?$" + .align 2 gUnknown_082EF590:: @ 82EF590 - .incbin "baserom.gba", 0x2ef590, 0x28 + .string "Cancel the registration of your\nEGG?$" + .align 2 gUnknown_082EF5B8:: @ 82EF5B8 - .incbin "baserom.gba", 0x2ef5b8, 0xa4 + .string "The registration has been canceled.\p$" + .align 2 + .string "TRAINERS wishing to make a trade\nwill be listed.$" + + .align 2 + .string "Please choose the TRAINER with whom\nyou would like to trade POKéMON.$" + + .align 2 gUnknown_082EF65C:: @ 82EF65C - .incbin "baserom.gba", 0x2ef65c, 0x88 + .string "Would you like to ask {STR_VAR_1} to\nmake a trade?$" + .align 2 + .string "Awaiting a response from\nthe other TRAINER…$" + + .align 2 + .string "You have not registered a POKéMON\nfor trading.\p$" + + .align 2 gUnknown_082EF6E4:: @ 82EF6E4 - .incbin "baserom.gba", 0x2ef6e4, 0x34 + .string "You don’t have a {STR_VAR_2}-type\nPOKéMON that {STR_VAR_1} wants.\p$" + .align 2 gUnknown_082EF718:: @ 82EF718 - .incbin "baserom.gba", 0x2ef718, 0x98 + .string "You don’t have an EGG that\n{STR_VAR_1} wants.\p$" + .align 2 +gUnknown_082EF740:: @ 82EF740 + .string "{STR_VAR_1} can’t make a trade for\nyour POKéMON right now.\p$" + + .align 2 +gUnknown_082EF774:: @ 82EF774 + .string "You can’t make a trade for\n{STR_VAR_1}’s POKéMON right now.\p$" + + .align 2 + .4byte gUnknown_082EF740 + .4byte gUnknown_082EF774 + + .align 2 gUnknown_082EF7B0:: @ 82EF7B0 - .incbin "baserom.gba", 0x2ef7b0, 0x20 + .string "Your trade offer was rejected.\p$" + .align 2 gUnknown_082EF7D0:: @ 82EF7D0 - .incbin "baserom.gba", 0x2ef7d0, 0xc + .string "EGG TRADE$" + .align 2 gUnknown_082EF7DC:: @ 82EF7DC - .incbin "baserom.gba", 0x2ef7dc, 0x1c + .string "{UNK_CTRL_F80A}CHOOSE {UNK_CTRL_F800}JOIN {UNK_CTRL_F801}CANCEL$" + .align 2 gUnknown_082EF7F8:: @ 82EF7F8 - .incbin "baserom.gba", 0x2ef7f8, 0x378 + .string "Please choose a TRAINER.$" + .align 2 +gUnknown_082EF814:: @ 82EF814 + .string "Please choose a TRAINER for\na SINGLE BATTLE.$" + + .align 2 +gUnknown_082EF844:: @ 82EF844 + .string "Please choose a TRAINER for\na DOUBLE BATTLE.$" + + .align 2 +gUnknown_082EF874:: @ 82EF874 + .string "Please choose the LEADER\nfor a MULTI BATTLE.$" + + .align 2 +gUnknown_082EF8A4:: @ 82EF8A4 + .string "Please choose the TRAINER to\ntrade with.$" + + .align 2 +gUnknown_082EF8D0:: @ 82EF8D0 + .string "Please choose the TRAINER who is\nsharing WONDER CARDS.$" + + .align 2 +gUnknown_082EF908:: @ 82EF908 + .string "Please choose the TRAINER who is\nsharing WONDER NEWS.$" + + .align 2 +gUnknown_082EF940:: @ 82EF940 + .string "Jump with mini POKéMON!\nPlease choose the LEADER.$" + + .align 2 +gUnknown_082EF974:: @ 82EF974 + .string "BERRY CRUSH!\nPlease choose the LEADER.$" + + .align 2 +gUnknown_082EF99C:: @ 82EF974 + .string "DODRIO BERRY-PICKING!\nPlease choose the LEADER.$" + + .align 2 +gUnknown_082EF9CC:: @ 82EF9CC + .string "BERRY BLENDER!\nPlease choose the LEADER.$" + + .align 2 +gUnknown_082EF9F8:: @ 82EF9F8 + .string "RECORD CORNER!\nPlease choose the LEADER.$" + + .align 2 +gUnknown_082EFA24:: @ 82EFA24 + .string "COOLNESS CONTEST!\nPlease choose the LEADER.$" + + .align 2 +gUnknown_082EFA50:: @ 82EFA50 + .string "BEAUTY CONTEST!\nPlease choose the LEADER.$" + + .align 2 +gUnknown_082EFA7C:: @ 82EFA7C + .string "CUTENESS CONTEST!\nPlease choose the LEADER.$" + + .align 2 +gUnknown_082EFAA8:: @ 82EFAA8 + .string "SMARTNESS CONTEST!\nPlease choose the LEADER.$" + + .align 2 +gUnknown_082EFAD8:: @ 82EFAD8 + .string "TOUGHNESS CONTEST!\nPlease choose the LEADER.$" + + .align 2 +gUnknown_082EFB08:: @ 82EFB08 + .string "BATTLE TOWER LEVEL 50!\nPlease choose the LEADER.$" + + .align 2 +gUnknown_082EFB3C:: @ 82EFB3C + .string "BATTLE TOWER OPEN LEVEL!\nPlease choose the LEADER.$" + + .align 2 gUnknown_082EFB70:: @ 82EFB70 - .incbin "baserom.gba", 0x2efb70, 0x58 + .4byte gUnknown_082EF814 + .4byte gUnknown_082EF844 + .4byte gUnknown_082EF874 + .4byte gUnknown_082EF8A4 + .4byte gUnknown_082EF940 + .4byte gUnknown_082EF974 + .4byte gUnknown_082EF99C + .4byte gUnknown_082EF8D0 + .4byte gUnknown_082EF908 + .4byte NULL + .4byte NULL + .4byte NULL + .4byte gUnknown_082EF9F8 + .4byte gUnknown_082EF9CC + .4byte NULL + .4byte gUnknown_082EFA24 + .4byte gUnknown_082EFA50 + .4byte gUnknown_082EFA7C + .4byte gUnknown_082EFAA8 + .4byte gUnknown_082EFAD8 + .4byte gUnknown_082EFB08 + .4byte gUnknown_082EFB3C + .align 2 gUnknown_082EFBC8:: @ 82EFBC8 - .incbin "baserom.gba", 0x2efbc8, 0x74 + .string "Searching for a WIRELESS\nCOMMUNICATION SYSTEM. Wait...$" + .align 2 + .string "For a DOUBLE BATTLE, you must have\nat least two POKéMON.\p$" + + .align 2 gUnknown_082EFC3C:: @ 82EFC3C - .incbin "baserom.gba", 0x2efc3c, 0x18 + .string "Awaiting {STR_VAR_1}’s response…$" + .align 2 gUnknown_082EFC54:: @ 82EFC54 - .incbin "baserom.gba", 0x2efc54, 0x3c + .string "{STR_VAR_1} has been asked to register\nyou as a member. Please wait.$" + .align 2 gUnknown_082EFC90:: @ 82EFC90 - .incbin "baserom.gba", 0x2efc90, 0xc8 + .string "Awaiting a response from the\nWIRELESS COMMUNICATION SYSTEM.$" + .align 2 + .string "Please wait for other TRAINERS to\ngather and get ready.$" + + .align 2 +gUnknown_082EFD04:: @ 82EFD04 + .string "No CARDS appear to be shared \nright now.$" + + .align 2 +gUnknown_082EFD30:: @ 82EFD30 + .string "No NEWS appears to be shared\nright now.$" + + .align 2 gUnknown_082EFD58:: @ 82EFD58 - .incbin "baserom.gba", 0x2efd58, 0x3c + .4byte gUnknown_082EFD04 + .4byte gUnknown_082EFD30 + .align 2 +gUnknown_082EFD60:: @ 82EFD60 + .string "BATTLE$" + + .align 2 +gUnknown_082EFD68:: @ 82EFD68 + .string "CHAT$" + + .align 2 +gUnknown_082EFD70:: @ 82EFD70 + .string "GREETINGS$" + + .align 2 +gUnknown_082EFD7C:: @ 82EFD7C + .string "EXIT$" + + .align 2 +gUnknown_082EFD84:: @ 82EFD84 + .string "EXIT$" + + .align 2 +gUnknown_082EFD8C:: @ 82EFD8C + .string "INFO$" + + .align 2 gUnknown_082EFD94:: @ 82EFD94 - .incbin "baserom.gba", 0x2efd94, 0x1bc + .string "NAME{CLEAR_TO 0x3C}WANTED{CLEAR_TO 0x6E}OFFER{CLEAR_TO 0xC6}LV.$" + .align 2 +gUnknown_082EFDB0:: @ 82EFDB0 + .string "SINGLE BATTLE$" + + .align 2 +gUnknown_082EFDC0:: @ 82EFDC0 + .string "DOUBLE BATTLE$" + + .align 2 +gUnknown_082EFDD0:: @ 82EFDD0 + .string "MULTI BATTLE$" + + .align 2 +gUnknown_082EFDE0:: @ 82EFDE0 + .string "POKéMON TRADES$" + + .align 2 +gUnknown_082EFDF0:: @ 82EFDF0 + .string "CHAT$" + + .align 2 +gUnknown_082EFDF8:: @ 82EFDF8 + .string "CARDS$" + + .align 2 +gUnknown_082EFE00:: @ 82EFE00 + .string "WONDER CARDS$" + + .align 2 +gUnknown_082EFE10:: @ 82EFE10 + .string "WONDER NEWS$" + + .align 2 +gUnknown_082EFE1C:: @ 82EFE1C + .string "POKéMON JUMP$" + + .align 2 +gUnknown_082EFE2C:: @ 82EFE2C + .string "BERRY CRUSH$" + + .align 2 +gUnknown_082EFE38:: @ 82EFE38 + .string "BERRY-PICKING$" + + .align 2 +gUnknown_082EFE48:: @ 82EFE48 + .string "SEARCH$" + + .align 2 +gUnknown_082EFE50:: @ 82EFE50 + .string "BERRY BLENDER$" + + .align 2 +gUnknown_082EFE60:: @ 82EFE60 + .string "RECORD CORNER$" + + .align 2 +gUnknown_082EFE70:: @ 82EFE70 + .string "COOL CONTEST$" + + .align 2 +gUnknown_082EFE80:: @ 82EFE80 + .string "BEAUTY CONTEST$" + + .align 2 +gUnknown_082EFE90:: @ 82EFE90 + .string "CUTE CONTEST$" + + .align 2 +gUnknown_082EFEA0:: @ 82EFEA0 + .string "SMART CONTEST$" + + .align 2 +gUnknown_082EFEB0:: @ 82EFEB0 + .string "TOUGH CONTEST$" + + .align 2 +gUnknown_082EFEC0:: @ 82EFEC0 + .string "BATTLE TOWER LV. 50$" + + .align 2 +gUnknown_082EFED4:: @ 82EFED4 + .string "BATTLE TOWER OPEN LEVEL$" + + .align 2 +gUnknown_082EFEEC:: @ 82EFEEC + .string "It’s a NORMAL CARD.$" + + .align 2 +gUnknown_082EFF00:: @ 82EFF00 + .string "It’s a BRONZE CARD!$" + + .align 2 +gUnknown_082EFF14:: @ 82EFF14 + .string "It’s a COPPER CARD!$" + + .align 2 +gUnknown_082EFF28:: @ 82EFF28 + .string "It’s a SILVER CARD!$" + + .align 2 +gUnknown_082EFF3C:: @ 82EFF3C + .string "It’s a GOLD CARD!$" + + .align 2 gUnknown_082EFF50:: @ 82EFF50 - .incbin "baserom.gba", 0x2eff50, 0x14 + .4byte gUnknown_082EFEEC + .4byte gUnknown_082EFF00 + .4byte gUnknown_082EFF14 + .4byte gUnknown_082EFF28 + .4byte gUnknown_082EFF3C gUnknown_082EFF64:: @ 82EFF64 - .incbin "baserom.gba", 0x2eff64, 0x40 + .string "This is {SPECIAL_F7 0x00} {SPECIAL_F7 0x01}’s\nTRAINER CARD…\l{SPECIAL_F7 0x02}\pPOKéDEX: {SPECIAL_F7 0x03}\nTIME: {SPECIAL_F7 0x04}:{SPECIAL_F7 0x05}\p$" + .align 2 gUnknown_082EFFA4:: @ 82EFFA4 - .incbin "baserom.gba", 0x2effa4, 0x74 + .string "BATTLES: WINS: {SPECIAL_F7 0x00} LOSSES: {SPECIAL_F7 0x02}\nTRADES: {SPECIAL_F7 0x03}\p“{SPECIAL_F7 0x04} {SPECIAL_F7 0x05}\n{SPECIAL_F7 0x06} {SPECIAL_F7 0x07}”\p$" + .align 2 +gUnknown_082EFFDC:: @ 82EFFDC + .string "{SPECIAL_F7 0x01}: Glad to have met you!{PAUSE 60}$" + + .align 2 +gUnknown_082EFFFC:: @ 82EFFFC + .string "{SPECIAL_F7 0x01}: Glad to meet you!{PAUSE 60}$" + + .align 2 gUnknown_082F0018:: @ 82F0018 - .incbin "baserom.gba", 0x2f0018, 0x8 + .4byte gUnknown_082EFFDC + .4byte gUnknown_082EFFFC + .align 2 gUnknown_082F0020:: @ 82F0020 - .incbin "baserom.gba", 0x2f0020, 0x28 + .string "Finished checking {SPECIAL_F7 0x01}’s\nTRAINER CARD.{PAUSE 60}$" + .align 2 gUnknown_082F0048:: @ 82F0048 - .incbin "baserom.gba", 0x2f0048, 0x74 + .4byte gUnknown_082ED8C4 + .4byte gUnknown_082EFDB0 + .4byte gUnknown_082EFDC0 + .4byte gUnknown_082EFDD0 + .4byte gUnknown_082EFDE0 + .4byte gUnknown_082EFDF0 + .4byte gUnknown_082EFE00 + .4byte gUnknown_082EFE10 + .4byte gUnknown_082EFDF8 + .4byte gUnknown_082EFE1C + .4byte gUnknown_082EFE2C + .4byte gUnknown_082EFE38 + .4byte gUnknown_082EFE48 + .4byte gUnknown_082ED8C4 + .4byte gUnknown_082EFED4 + .4byte gUnknown_082EFE60 + .4byte gUnknown_082EFE50 + .4byte gUnknown_082ED8C4 + .4byte gUnknown_082ED8C4 + .4byte gUnknown_082ED8C4 + .4byte gUnknown_082ED8C4 + .4byte gUnknown_082EFE00 + .4byte gUnknown_082EFE10 + .4byte gUnknown_082EFE70 + .4byte gUnknown_082EFE80 + .4byte gUnknown_082EFE90 + .4byte gUnknown_082EFEA0 + .4byte gUnknown_082EFEB0 + .4byte gUnknown_082EFEC0 + .align 2 gUnknown_082F00BC:: @ 82F00BC - .incbin "baserom.gba", 0x2f00bc, 0x8 + window_template 0x00, 0x00, 0x00, 0x1E, 0x02, 0x0F, 0x0008 + .align 2 gUnknown_082F00C4:: @ 82F00C4 - .incbin "baserom.gba", 0x2f00c4, 0x58 + .byte 0x01, 0x02, 0x00, 0x00 + .byte 0x02, 0x02, 0x00, 0x00 + .byte 0x03, 0x04, 0x00, 0x00 + .byte 0x04, 0x02, 0x00, 0x00 + .byte 0x09, 0x25, 0x00, 0x00 + .byte 0x0a, 0x25, 0x00, 0x00 + .byte 0x0b, 0x35, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00 + .byte 0x0f, 0x24, 0x00, 0x00 + .byte 0x10, 0x24, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00 + .byte 0x17, 0x24, 0x00, 0x00 + .byte 0x18, 0x24, 0x00, 0x00 + .byte 0x19, 0x24, 0x00, 0x00 + .byte 0x1a, 0x24, 0x00, 0x00 + .byte 0x1b, 0x24, 0x00, 0x00 + .byte 0x1c, 0x02, 0x00, 0x00 + .byte 0x0e, 0x02, 0x00, 0x00 + .align 2 gUnknown_082F011C:: @ 82F011C - .incbin "baserom.gba", 0x2f011c, 0x8 + window_template 0x00, 0x01, 0x03, 0x0d, 0x08, 0x0f, 0x0044 + .align 2 gUnknown_082F0124:: @ 82F0124 - .incbin "baserom.gba", 0x2f0124, 0x8 + window_template 0x00, 0x01, 0x03, 0x0d, 0x0a, 0x0f, 0x0044 + .align 2 gUnknown_082F012C:: @ 82F012C - .incbin "baserom.gba", 0x2f012c, 0x30 + window_template 0x00, 0x10, 0x03, 0x07, 0x04, 0x0f, 0x00c6 -gUnknown_082F015C:: @ 82F015C - .incbin "baserom.gba", 0x2f015c, 0x18 + .align 2 +gUnknown_082F0134:: @ 82F0134 + .4byte gUnknown_082ED8C4 + .4byte 0x00000000 + .4byte gUnknown_082ED8C4 + .4byte 0x00000001 + .4byte gUnknown_082ED8C4 + .4byte 0x00000002 + .4byte gUnknown_082ED8C4 + .4byte 0x00000003 + .4byte gUnknown_082ED8C4 + .4byte 0x00000004 + .align 2 +gUnknown_082F015C:: @ 82F015C struct ListMenuTemplate + .4byte gUnknown_082F0134 + .4byte NULL + .4byte sub_8013278 + .byte 0x05, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x21, 0x31, 0x00, 0x41 + + .align 2 gUnknown_082F0174:: @ 82F0174 - .incbin "baserom.gba", 0x2f0174, 0x8 + window_template 0x00, 0x01, 0x03, 0x11, 0x0a, 0x0f, 0x0044 + .align 2 gUnknown_082F017C:: @ 82F017C - .incbin "baserom.gba", 0x2f017c, 0x88 + window_template 0x00, 0x14, 0x03, 0x07, 0x04, 0x0f, 0x00ee -gUnknown_082F0204:: @ 82F0204 - .incbin "baserom.gba", 0x2f0204, 0x18 + .align 2 +gUnknown_082F0184:: @ 82F0184 + .4byte gUnknown_082ED8C4, 0x00000000 + .4byte gUnknown_082ED8C4, 0x00000001 + .4byte gUnknown_082ED8C4, 0x00000002 + .4byte gUnknown_082ED8C4, 0x00000003 + .4byte gUnknown_082ED8C4, 0x00000004 + .4byte gUnknown_082ED8C4, 0x00000005 + .4byte gUnknown_082ED8C4, 0x00000006 + .4byte gUnknown_082ED8C4, 0x00000007 + .4byte gUnknown_082ED8C4, 0x00000008 + .4byte gUnknown_082ED8C4, 0x00000009 + .4byte gUnknown_082ED8C4, 0x0000000a + .4byte gUnknown_082ED8C4, 0x0000000b + .4byte gUnknown_082ED8C4, 0x0000000c + .4byte gUnknown_082ED8C4, 0x0000000d + .4byte gUnknown_082ED8C4, 0x0000000e + .4byte gUnknown_082ED8C4, 0x0000000f + .align 2 +gUnknown_082F0204:: @ 82F0204 struct ListMenuTemplate + .4byte gUnknown_082F0184 + .4byte sub_81AF078 + .4byte sub_8013DF4 + .byte 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x08, 0x00 + .byte 0x21, 0x31, 0x40, 0x01 + + .align 2 gUnknown_082F021C:: @ 82F021C - .incbin "baserom.gba", 0x2f021c, 0x28 + window_template 0x00, 0x14, 0x05, 0x10, 0x08, 0x0f, 0x0001 + + .align 2 +gUnknown_082F0224:: @ 82F0224 + .4byte gUnknown_082EFD70, 0x00000208 + .4byte gUnknown_082EFD60, 0x00000241 + .4byte gUnknown_082EFD68, 0x00000245 + .4byte gUnknown_082EFD7C, 0x00000040 -gUnknown_082F0244:: @ 82F0244 - .incbin "baserom.gba", 0x2f0244, 0x18 + .align 2 +gUnknown_082F0244:: @ 82F0244 struct ListMenuTemplate + .4byte gUnknown_082F0224 + .byte 0x79, 0xf0, 0x1a, 0x08 + .4byte NULL + .byte 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00 + .byte 0x21, 0x31, 0x00, 0x01 + .align 2 gUnknown_082F025C:: @ 82F025C - .incbin "baserom.gba", 0x2f025c, 0x20 + window_template 0x00, 0x12, 0x07, 0x10, 0x06, 0x0f, 0x0001 +gUnknown_082F0264:: @ 82F0264 + .4byte gUnknown_085EA333, 0x00000001 + .4byte gUnknown_082EFD8C, 0x00000002 + .4byte gUnknown_082EFD7C, 0x00000003 + + .align 2 gUnknown_082F027C:: @ 82F027C - .incbin "baserom.gba", 0x2f027c, 0x18 + .4byte gUnknown_082F0264 + .4byte sub_81AF078 + .4byte NULL + .byte 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00 + .byte 0x21, 0x31, 0x00, 0x01 + .align 2 gUnknown_082F0294:: @ 82F0294 - .incbin "baserom.gba", 0x2f0294, 0x98 + window_template 0x00, 0x14, 0x01, 0x10, 0x0c, 0x0f, 0x0001 + .align 2 +gUnknown_082F029C:: @ 82F029C + .4byte gTypeNames, 0x00000000 @ NORMAL + .4byte gTypeNames+0x46, 0x0000000a @ FIRE + .4byte gTypeNames+0x4D, 0x0000000b @ WATER + .4byte gTypeNames+0x5B, 0x0000000d @ ELECTR + .4byte gTypeNames+0x54, 0x0000000c @ GRASS + .4byte gTypeNames+0x69, 0x0000000f @ ICE + .4byte gTypeNames+0x1C, 0x00000004 @ GROUND + .4byte gTypeNames+0x23, 0x00000005 @ ROCK + .4byte gTypeNames+0x0E, 0x00000002 @ FLYING + .4byte gTypeNames+0x62, 0x0000000e @ PSYCHC + .4byte gTypeNames+0x07, 0x00000001 @ FIGHT + .4byte gTypeNames+0x15, 0x00000003 @ POISON + .4byte gTypeNames+0x2A, 0x00000006 @ BUG + .4byte gTypeNames+0x31, 0x00000007 @ GHOST + .4byte gTypeNames+0x70, 0x00000010 @ DRAGON + .4byte gTypeNames+0x38, 0x00000008 @ STEEL + .4byte gTypeNames+0x77, 0x00000011 @ DARK + .4byte gUnknown_082EFD7C, 0x00000012 @ EXIT + + .align 2 gUnknown_082F032C:: @ 82F032C - .incbin "baserom.gba", 0x2f032c, 0x18 + .4byte gUnknown_082F029C + .4byte sub_81AF078 + .4byte NULL + .byte 0x12, 0x00, 0x06, 0x00, 0x00, 0x00, 0x08, 0x00 + .byte 0x21, 0x31, 0x00, 0x01 + .align 2 gUnknown_082F0344:: @ 82F0344 - .incbin "baserom.gba", 0x2f0344, 0x8 + window_template 0x00, 0x01, 0x01, 0x1c, 0x02, 0x0d, 0x0001 + .align 2 gUnknown_082F034C:: @ 82F034C - .incbin "baserom.gba", 0x2f034c, 0x58 + window_template 0x00, 0x01, 0x05, 0x1c, 0x0c, 0x0d, 0x0039 + .align 2 +gUnknown_082F0354:: @ 82F0354 + .4byte gUnknown_082ED8C4, 0xfffffffd + .4byte gUnknown_082ED8C4, 0x00000000 + .4byte gUnknown_082ED8C4, 0x00000001 + .4byte gUnknown_082ED8C4, 0x00000002 + .4byte gUnknown_082ED8C4, 0x00000003 + .4byte gUnknown_082ED8C4, 0x00000004 + .4byte gUnknown_082ED8C4, 0x00000005 + .4byte gUnknown_082ED8C4, 0x00000006 + .4byte gUnknown_082ED8C4, 0x00000007 + .4byte gUnknown_082EFD84, 0x00000008 + + .align 2 gUnknown_082F03A4:: @ 82F03A4 - .incbin "baserom.gba", 0x2f03a4, 0xb8 + .4byte gUnknown_082F0354 + .4byte sub_81AF078 + .4byte sub_8017BE8 + .byte 0x0a, 0x00, 0x06, 0x00, 0x00, 0x00, 0x08, 0x00 + .byte 0xe1, 0xdf, 0x00, 0x01 + .align 2 + window_template 0x00, 0x01, 0x05, 0x1c, 0x0c, 0x0d, 0x0039 + + .align 2 +gUnknown_082F03C4:: @ 82F03C4 + .4byte gUnknown_082ED8C4, 0x00000000 + .4byte gUnknown_082ED8C4, 0x00000001 + .4byte gUnknown_082ED8C4, 0x00000002 + .4byte gUnknown_082ED8C4, 0x00000003 + .4byte gUnknown_082ED8C4, 0x00000004 + .4byte gUnknown_082ED8C4, 0x00000005 + .4byte gUnknown_082ED8C4, 0x00000006 + .4byte gUnknown_082ED8C4, 0x00000007 + .4byte gUnknown_082ED8C4, 0x00000008 + .4byte gUnknown_082ED8C4, 0x00000009 + .4byte gUnknown_082ED8C4, 0x0000000a + .4byte gUnknown_082ED8C4, 0x0000000b + .4byte gUnknown_082ED8C4, 0x0000000c + .4byte gUnknown_082ED8C4, 0x0000000d + .4byte gUnknown_082ED8C4, 0x0000000e + .4byte gUnknown_082ED8C4, 0x0000000f + + .align 2 + .4byte gUnknown_082F03C4 + .4byte sub_81AF078 + .4byte nullsub_14 + .byte 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00 + .byte 0x21, 0x31, 0x40, 0x01 + + .align 2 gUnknown_082F045C:: @ 82F045C - .incbin "baserom.gba", 0x2f045c, 0x7c + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .align 2 +gUnknown_082F0474:: @ 82F0474 + .byte 0x01, 0xff + + .align 2 +gUnknown_082F0478:: @ 82F0478 + .byte 0x02, 0xff + + .align 2 +gUnknown_082F047C:: @ 82F047C + .byte 0x03, 0xff + + .align 2 +gUnknown_082F0480:: @ 82F0480 + .byte 0x04, 0xff + + .align 2 +gUnknown_082F0484:: @ 82F0484 + .byte 0x09, 0xff + + .align 2 +gUnknown_082F0488:: @ 82F0488 + .byte 0x0a, 0xff + + .align 2 +gUnknown_082F048C:: @ 82F048C + .byte 0x0b, 0xff + + .align 2 +gUnknown_082F0490:: @ 82F0490 + .byte 0x15, 0xff + + .align 2 +gUnknown_082F0494:: @ 82F0494 + .byte 0x16, 0xff + + .align 2 +gUnknown_082F0498:: @ 82F0498 + .byte 0x40, 0x41, 0x44, 0x45, 0x48, 0x51, 0x52, 0x53, 0x54, 0xff + + .align 2 +gUnknown_082F04A4:: @ 82F04A4 + .byte 0x0c, 0xff + + .align 2 +gUnknown_082F04A8:: @ 82F04A8 + .byte 0x01, 0x02, 0x03, 0x04, 0x09, 0x0a, 0x0b, 0x15, 0x16, 0x0d, 0xff + + .align 2 +gUnknown_082F04B4:: @ 82F04B4 + .byte 0x0f, 0xff + + .align 2 +gUnknown_082F04B8:: @ 82F04B8 + .byte 0x10, 0xff + + .align 2 +gUnknown_082F04BC:: @ 82F04BC + .byte 0x17, 0xff + + .align 2 +gUnknown_082F04C0:: @ 82F04C0 + .byte 0x18, 0xff + + .align 2 +gUnknown_082F04C4:: @ 82F04C4 + .byte 0x19, 0xff + + .align 2 +gUnknown_082F04C8:: @ 82F04C8 + .byte 0x1a, 0xff + + .align 2 +gUnknown_082F04CC:: @ 82F04CC + .byte 0x1b, 0xff + + .align 2 +gUnknown_082F04D0:: @ 82F04D0 + .byte 0x1c, 0xff + + .align 2 +gUnknown_082F04D4:: @ 82F04D4 + .byte 0x0e, 0xff + + .align 2 gUnknown_082F04D8:: @ 82F04D8 - .incbin "baserom.gba", 0x2f04d8, 0x58 + .4byte gUnknown_082F0474 + .4byte gUnknown_082F0478 + .4byte gUnknown_082F047C + .4byte gUnknown_082F0480 + .4byte gUnknown_082F0484 + .4byte gUnknown_082F0488 + .4byte gUnknown_082F048C + .4byte gUnknown_082F0490 + .4byte gUnknown_082F0494 + .4byte gUnknown_082F0498 + .4byte gUnknown_082F04A4 + .4byte gUnknown_082F04A8 + .4byte gUnknown_082F04B4 + .4byte gUnknown_082F04B8 + .4byte NULL + .4byte gUnknown_082F04BC + .4byte gUnknown_082F04C0 + .4byte gUnknown_082F04C4 + .4byte gUnknown_082F04C8 + .4byte gUnknown_082F04CC + .4byte gUnknown_082F04D0 + .4byte gUnknown_082F04D4 + .align 2 gUnknown_082F0530:: @ 82F0530 - .incbin "baserom.gba", 0x2f0530, 0x18 + .byte 0x01, 0x02, 0x03, 0x04, 0x09, 0x0a, 0x0b, 0x15 + .byte 0x16, 0x00, 0x00, 0x00, 0x0f, 0x10, 0x00, 0x17 + .byte 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x0e, 0x00, 0x00 + .align 2 gUnknown_082F0548:: @ 82F0548 - .incbin "baserom.gba", 0x2f0548, 0x20 + .incbin "graphics/interface/test_textbox.gbapal" + .align 2 gUnknown_082F0568:: @ 82F0568 - .incbin "baserom.gba", 0x2f0568, 0x30 + .incbin "graphics/interface/test_textbox.4bpp.lz" -gUnknown_082F0598:: @ 82F0598 - .incbin "baserom.gba", 0x2f0598, 0x10 + .align 2 +gUnknown_082F0598:: @ 82F0598 struct BgTemplate + .4byte 0x000000f8 + .4byte 0x000010e1 + .4byte 0x000020d2 + .4byte 0x000030c3 + .align 2 gUnknown_082F05A8:: @ 82F05A8 - .incbin "baserom.gba", 0x2f05a8, 0x20 + window_template 0x00, 0x00, 0x00, 0x1e, 0x02, 0x0c, 0x0013 + window_template 0x00, 0x01, 0x0f, 0x1c, 0x04, 0x0c, 0x004f + window_template 0x00, 0x00, 0x0f, 0x1e, 0x05, 0x0d, 0x004f + window_template 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 + .align 2 gUnknown_082F05C8:: @ 82F05C8 - .incbin "baserom.gba", 0x2f05c8, 0x8 + window_template 0x00, 0x01, 0x0f, 0x1c, 0x04, 0x0c, 0x00e5 + .align 2 gUnknown_082F05D0:: @ 82F05D0 - .incbin "baserom.gba", 0x2f05d0, 0x8 + window_template 0x00, 0x01, 0x0f, 0x14, 0x04, 0x0c, 0x00e5 + .align 2 gUnknown_082F05D8:: @ 82F05D8 - .incbin "baserom.gba", 0x2f05d8, 0x8 + window_template 0x00, 0x01, 0x0f, 0x13, 0x04, 0x0c, 0x00e5 + .align 2 gUnknown_082F05E0:: @ 82F05E0 - .incbin "baserom.gba", 0x2f05e0, 0x8 + window_template 0x00, 0x08, 0x06, 0x0e, 0x06, 0x0c, 0x0155 + .align 2 gUnknown_082F05E8:: @ 82F05E8 - .incbin "baserom.gba", 0x2f05e8, 0x8 + window_template 0x00, 0x17, 0x0f, 0x06, 0x04, 0x0c, 0x0155 + .align 2 gUnknown_082F05F0:: @ 82F05F0 - .incbin "baserom.gba", 0x2f05f0, 0x8 + window_template 0x00, 0x16, 0x0b, 0x07, 0x08, 0x0c, 0x0155 + .align 2 gUnknown_082F05F8:: @ 82F05F8 - .incbin "baserom.gba", 0x2f05f8, 0x8 + window_template 0x00, 0x16, 0x0d, 0x07, 0x06, 0x0c, 0x0155 + .align 2 gUnknown_082F0600:: @ 82F0600 - .incbin "baserom.gba", 0x2f0600, 0x8 + window_template 0x00, 0x16, 0x0f, 0x07, 0x04, 0x0c, 0x0155 + .align 2 gUnknown_082F0608:: @ 82F0608 - .incbin "baserom.gba", 0x2f0608, 0x18 + .4byte gUnknown_085EEDEC, 0x00000000 + .4byte gUnknown_085EEDFC, 0x00000001 + .4byte gUnknown_085EEE28, 0xfffffffe + .align 2 gUnknown_082F0620:: @ 82F0620 - .incbin "baserom.gba", 0x2f0620, 0x18 + .4byte gUnknown_085EEE08, 0x00000000 + .4byte gUnknown_085EEE20, 0x00000001 + .4byte gUnknown_085E8CF7, 0xfffffffe -gUnknown_082F0638:: @ 82F0638 - .incbin "baserom.gba", 0x2f0638, 0x78 + .align 2 +gUnknown_082F0638:: @ 82F0638 struct ListMenuTemplate + .4byte NULL + .4byte sub_81AF078 + .4byte NULL + .byte 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00 + .byte 0x21, 0x31, 0x00, 0x01 -gUnknown_082F06B0:: @ 82F06B0 - .incbin "baserom.gba", 0x2f06b0, 0x18 + .align 2 +gUnknown_082F0650:: @ 82F0650 + .4byte gUnknown_085EEE30, 0x00000000 + .4byte gUnknown_085EEE38, 0x00000001 + .4byte gUnknown_085EEE40, 0x00000002 + .4byte gUnknown_085E8CF7, 0xfffffffe + .align 2 +gUnknown_082F0670:: @ 82F0670 + .4byte gUnknown_085EEE30, 0x00000000 + .4byte gUnknown_085EEE40, 0x00000002 + .4byte gUnknown_085E8CF7, 0xfffffffe + + .align 2 +gUnknown_082F0688:: @ 82F0688 + .4byte gUnknown_085EEE30, 0x00000000 + .4byte gUnknown_085EEE38, 0x00000001 + .4byte gUnknown_085E8CF7, 0xfffffffe + + .align 2 +gUnknown_082F06A0:: @ 82F06A0 + .4byte gUnknown_085EEE30, 0x00000000 + .4byte gUnknown_085E8CF7, 0xfffffffe + + .align 2 +gUnknown_082F06B0:: @ 82F06B0 struct ListMenuTemplate + .4byte gUnknown_082F0650 + .4byte sub_81AF078 + .4byte NULL + .byte 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00 + .byte 0x21, 0x31, 0x00, 0x01 + + .align 2 gUnknown_082F06C8:: @ 82F06C8 - .incbin "baserom.gba", 0x2f06c8, 0x18 + .4byte gUnknown_082F0670 + .4byte sub_81AF078 + .4byte NULL + .byte 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00 + .byte 0x21, 0x31, 0x00, 0x01 + .align 2 gUnknown_082F06E0:: @ 82F06E0 - .incbin "baserom.gba", 0x2f06e0, 0x18 + .4byte gUnknown_082F0688 + .4byte sub_81AF078 + .4byte NULL + .byte 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00 + .byte 0x21, 0x31, 0x00, 0x01 + .align 2 gUnknown_082F06F8:: @ 82F06F8 - .incbin "baserom.gba", 0x2f06f8, 0x28 + .4byte gUnknown_082F06A0 + .4byte sub_81AF078 + .4byte NULL + .byte 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00 + .byte 0x21, 0x31, 0x00, 0x01 -gUnknown_082F0720:: @ 82F0720 - .incbin "baserom.gba", 0x2f0720, 0x8 + .align 2 + .4byte gUnknown_085EEE48 + .4byte gUnknown_085EEE8C + .4byte gUnknown_085EEEB8 + .4byte gUnknown_085EEED4 -gUnknown_082F0728:: @ 82F0728 - .incbin "baserom.gba", 0x2f0728, 0x4 + .align 2 +gUnknown_082F0720:: @ 82F0720 struct TextColor + .byte 0x00, 0x01, 0x02 + + .align 2 + .byte 0x00, 0x01, 0x02 + .align 2 +gUnknown_082F0728:: @ 82F0728 struct TextColor + .byte 0x01, 0x02, 0x03 + + .align 2 gUnknown_082F072C:: @ 82F072C - .incbin "baserom.gba", 0x2f072c, 0x14 + .byte 0x21, 0x2c, 0x1f, 0x23, 0x25, 0x24, 0x41, 0x42 + .byte 0x00, 0x00, 0x22, 0x28, 0x20, 0x2f, 0x2f, 0x0e + .byte 0x14, 0x2d, 0x00, 0x00 + .align 2 gUnknown_082F0740:: @ 82F0740 - .incbin "baserom.gba", 0x2f0740, 0x20 + .2byte 0x0004, 0x0006, 0x000d, 0x0008 + .2byte 0x000a, 0x0006, 0x0001, 0x0008 + .2byte 0x000d, 0x0004, 0x0007, 0x0004 + .2byte 0x0001, 0x0004, 0x0007, 0x0008 + .align 2 gUnknown_082F0760:: @ 82F0760 - .incbin "baserom.gba", 0x2f0760, 0xa + .byte 0x00, 0x00, 0x01, 0x00, 0x00, 0xff, 0xff, 0x00 + .byte 0x00, 0x01 gUnknown_082F076A:: @ 82F076A - .incbin "baserom.gba", 0x2f076a, 0x5 + .byte 0x00, 0x02, 0x01, 0x04, 0x03 gUnknown_082F076F:: @ 82F076F - .incbin "baserom.gba", 0x2f076f, 0x5 + .byte 0x01, 0x03, 0x01, 0x04, 0x02 gUnknown_082F0774:: @ 82F0774 - .incbin "baserom.gba", 0x2f0774, 0x18 + .byte 0x09, 0x08, 0x07, 0x02, 0x06, 0x05, 0x04, 0x03 + .byte 0xbf, 0x02, 0xc0, 0x02, 0xc1, 0x02, 0xc2, 0x02 + .byte 0xc3, 0x02, 0xc4, 0x02, 0xc5, 0x02, 0xc6, 0x02 gUnknown_082F078C:: @ 82F078C - .incbin "baserom.gba", 0x2f078c, 0x2 + .byte 0x9c, 0xfe gUnknown_082F078E:: @ 82F078E - .incbin "baserom.gba", 0x2f078e, 0x2 + .byte 0x9d, 0xfe + .align 2 gUnknown_082F0790:: @ 82F0790 - .incbin "baserom.gba", 0x2f0790, 0x200 + .incbin "graphics/interface/wireless_info_screen.gbapal" + .align 2 gUnknown_082F0990:: @ 82F0990 - .incbin "baserom.gba", 0x2f0990, 0x210 + .incbin "graphics/interface/wireless_info_screen.4bpp.lz" + .align 2 gUnknown_082F0BA0:: @ 82F0BA0 - .incbin "baserom.gba", 0x2f0ba0, 0x194 + .incbin "graphics/interface/wireless_info_screen.bin.lz" + .align 2 gUnknown_082F0D34:: @ 82F0D34 - .incbin "baserom.gba", 0x2f0d34, 0x8 + .4byte 0x000001f8 + .4byte 0x00001081 + .align 2 gUnknown_082F0D3C:: @ 82F0D3C - .incbin "baserom.gba", 0x2f0d3c, 0x20 + window_template 0x00, 0x03, 0x00, 0x18, 0x03, 0x0f, 0x0001 + window_template 0x00, 0x03, 0x04, 0x15, 0x0f, 0x0f, 0x0049 + window_template 0x00, 0x18, 0x04, 0x03, 0x0f, 0x0f, 0x0184 + window_template 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 + .align 2 gUnknown_082F0D5C:: @ 82F0D5C - .incbin "baserom.gba", 0x2f0d5c, 0x14 + .4byte gUnknown_085EED41 + .4byte gUnknown_085EED5F + .4byte gUnknown_085EED6F + .4byte gUnknown_085EED80 + .4byte gUnknown_085EED9A + .align 2 gUnknown_082F0D70:: @ 82F0D70 - .incbin "baserom.gba", 0x2f0d70, 0x60 + .byte 0x01, 0x01, 0x02, 0x02, 0x01, 0x02, 0x03, 0x01 + .byte 0x04, 0x04, 0x00, 0x02, 0x06, 0x03, 0x02, 0x07 + .byte 0x03, 0x02, 0x09, 0x03, 0x00, 0x0a, 0x03, 0x00 + .byte 0x0b, 0x03, 0x00, 0x0c, 0xff, 0x00, 0x0d, 0x00 + .byte 0x00, 0x10, 0x03, 0x00, 0x0f, 0x03, 0x00, 0x40 + .byte 0x02, 0x01, 0x41, 0x02, 0x02, 0x44, 0x02, 0x02 + .byte 0x45, 0x02, 0x00, 0x48, 0x02, 0x02, 0x54, 0x02 + .byte 0x01, 0x53, 0x02, 0x02, 0x51, 0x02, 0x01, 0x52 + .byte 0x02, 0x01, 0x15, 0x03, 0x02, 0x16, 0x03, 0x02 + .byte 0x17, 0x03, 0x00, 0x18, 0x03, 0x00, 0x19, 0x03 + .byte 0x00, 0x1a, 0x03, 0x00, 0x1b, 0x03, 0x00, 0x1c + .byte 0x01, 0x02, 0x0e, 0x01, 0x02, 0x00, 0x00, 0x00 + .align 2 gUnknown_082F0DD0:: @ 82F0DD0 - .incbin "baserom.gba", 0x2f0dd0, 0x4 + .4byte 0x000001FC + .align 2 gUnknown_082F0DD4:: @ 82F0DD4 - .incbin "baserom.gba", 0x2f0dd4, 0x10 + window_template 0x00, 0x03, 0x0f, 0x18, 0x04, 0x0e, 0x0014 + window_template 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 + .align 2 gUnknown_082F0DE4:: @ 82F0DE4 - .incbin "baserom.gba", 0x2f0de4, 0x4 + .byte 0x01, 0x02, 0x03 + .align 2 gUnknown_082F0DE8:: @ 82F0DE8 - .incbin "baserom.gba", 0x2f0de8, 0x28 + .2byte 0x013a, 0x013b, 0x013c, 0x013d, 0x013e, 0x013f, 0x0140, 0x0141 + .2byte 0x0142, 0x0143, 0x0144, 0x0145, 0x0146, 0x0147, 0x0148, 0x0149 + .2byte 0x014a, 0x014b, 0x014c, 0x014d + .align 2 gUnknown_082F0E10:: @ 82F0E10 - .incbin "baserom.gba", 0x2f0e10, 0x8 + .byte 0x00, 0x02, 0x03 + .byte 0x00, 0x01, 0x02 + .align 2 gUnknown_082F0E18:: @ 82F0E18 - .incbin "baserom.gba", 0x2f0e18, 0x4 + .byte 0x07, 0x04, 0x07, 0x00 + .align 2 gUnknown_082F0E1C:: @ 82F0E1C - .incbin "baserom.gba", 0x2f0e1c, 0xee4 + window_template 0x01, 0x01, 0x01, 0x19, 0x04, 0x02, 0x029C + window_template 0x01, 0x01, 0x06, 0x1C, 0x08, 0x02, 0x01BC + window_template 0x01, 0x01, 0x0E, 0x1C, 0x05, 0x02, 0x0130 -gUnknown_082F1D00:: @ 82F1D00 - .incbin "baserom.gba", 0x2f1d00, 0x8 + .align 2 +gUnknown_082F0E34:: @ 82F0E34 + .incbin "graphics/interface/wonder_card_1.gbapal" -gUnknown_082F1D08:: @ 82F1D08 - .incbin "baserom.gba", 0x2f1d08, 0x40 + .align 2 +gUnknown_082F0E54:: @ 82F0E54 + .incbin "graphics/interface/wonder_card_2.gbapal" -gUnknown_082F1D48:: @ 82F1D48 - .incbin "baserom.gba", 0x2f1d48, 0x18 + .align 2 +gUnknown_082F0E74:: @ 82F0E74 + .incbin "graphics/interface/wonder_card_3.gbapal" + .align 2 +gUnknown_082F0E94:: @ 82F0E94 + .incbin "graphics/interface/wonder_card_4.gbapal" + + .align 2 +gUnknown_082F0EB4:: @ 82F0EB4 + .incbin "graphics/interface/wonder_card_5.gbapal" + + .align 2 +gUnknown_082F0ED4:: @ 82F0ED4 + .incbin "graphics/interface/wonder_card_6.gbapal" + + .align 2 +gUnknown_082F0EF4:: @ 82F0EF4 + .incbin "graphics/interface/wonder_card_7.gbapal" + + .align 2 +gUnknown_082F0F14:: @ 82F0F14 + .incbin "graphics/interface/wonder_card_8.gbapal" + + .align 2 +gUnknown_082F0F34:: @ 82F0F34 + .incbin "graphics/interface/wonder_card_1.4bpp.lz" + + .align 2 +gUnknown_082F1030:: @ 82F1030 + .incbin "graphics/interface/wonder_card_1.bin.lz" + + .align 2 +gUnknown_082F1124:: @ 82F1124 + .incbin "graphics/interface/wonder_card_2.4bpp.lz" + + .align 2 +gUnknown_082F1218:: @ 82F1218 + .incbin "graphics/interface/wonder_card_2.bin.lz" + + .align 2 +gUnknown_082F1300:: @ 82F1300 + .incbin "graphics/interface/wonder_card_3.4bpp.lz" + + .align 2 +gUnknown_082F13D4:: @ 82F13D4 + .incbin "graphics/interface/wonder_card_3.bin.lz" + + .align 2 +gUnknown_082F14A8:: @ 82F14A8 + .incbin "graphics/interface/wonder_card_7.4bpp.lz" + + .align 2 +gUnknown_082F16DC:: @ 82F16DC + .incbin "graphics/interface/wonder_card_7.bin.lz" + + .align 2 +gUnknown_082F1824:: @ 82F1824 + .incbin "graphics/interface/wonder_card_8.4bpp.lz" + + .align 2 +gUnknown_082F1A54:: @ 82F1A54 + .incbin "graphics/interface/wonder_card_8.bin.lz" + + .align 2 +gUnknown_082F1B9C:: @ 82F1B9C + .incbin "graphics/interface/wonder_card_shadow_1.gbapal" + + .align 2 +gUnknown_082F1BBC:: @ 82F1BBC + .incbin "graphics/interface/wonder_card_shadow_2.gbapal" + + .align 2 +gUnknown_082F1BDC:: @ 82F1BDC + .incbin "graphics/interface/wonder_card_shadow_3.gbapal" + + .align 2 +gUnknown_082F1BFC:: @ 82F1BFC + .incbin "graphics/interface/wonder_card_shadow_4.gbapal" + + .align 2 +gUnknown_082F1C1C:: @ 82F1C1C + .incbin "graphics/interface/wonder_card_shadow_5.gbapal" + + .align 2 +gUnknown_082F1C3C:: @ 82F1C3C + .incbin "graphics/interface/wonder_card_shadow_6.gbapal" + + .align 2 +gUnknown_082F1C5C:: @ 82F1C5C + .incbin "graphics/interface/wonder_card_shadow_7.gbapal" + + .align 2 +gUnknown_082F1C7C:: @ 82F1C7C + .incbin "graphics/interface/wonder_card_shadow_8.gbapal" + + .align 2 +gUnknown_082F1C9C:: @ 82F1C9C + .incbin "graphics/interface/wonder_card_shadow.4bpp.lz" + + .align 2 +gUnknown_082F1D00:: @ 82F1D00 struct CompressedSpriteSheet + .4byte gUnknown_082F1C9C + .2byte 0x0100 + .2byte 0x8000 + + .align 2 +gUnknown_082F1D08:: @ 82F1D08 struct SpritePalette + .4byte gUnknown_082F1B9C + .2byte 0x8000 + + .align 2 + .4byte gUnknown_082F1BBC + .2byte 0x8000 + + .align 2 + .4byte gUnknown_082F1BDC + .2byte 0x8000 + + .align 2 + .4byte gUnknown_082F1BFC + .2byte 0x8000 + + .align 2 + .4byte gUnknown_082F1C1C + .2byte 0x8000 + + .align 2 + .4byte gUnknown_082F1C3C + .2byte 0x8000 + + .align 2 + .4byte gUnknown_082F1C5C + .2byte 0x8000 + + .align 2 + .4byte gUnknown_082F1C7C + .2byte 0x8000 + + .align 2 +gUnknown_082F1D48:: @ 82F1D48 struct SpriteTemplate + .2byte 0x8000 + .2byte 0x8000 + .4byte gUnknown_08524934 + .4byte gDummySpriteAnimTable + .4byte NULL + .4byte gDummySpriteAffineAnimTable + .4byte SpriteCallbackDummy + + .align 2 gUnknown_082F1D60:: @ 82F1D60 - .incbin "baserom.gba", 0x2f1d60, 0x80 + .4byte 0x00000001, gUnknown_082F0F34, gUnknown_082F1030, gUnknown_082F0E34 + .4byte 0x00001001, gUnknown_082F1124, gUnknown_082F1218, gUnknown_082F0E54 + .4byte 0x00002001, gUnknown_082F1300, gUnknown_082F13D4, gUnknown_082F0E74 + .4byte 0x00003001, gUnknown_082F1300, gUnknown_082F13D4, gUnknown_082F0E94 + .4byte 0x00004001, gUnknown_082F1300, gUnknown_082F13D4, gUnknown_082F0EB4 + .4byte 0x00005001, gUnknown_082F1300, gUnknown_082F13D4, gUnknown_082F0ED4 + .4byte 0x00006001, gUnknown_082F14A8, gUnknown_082F16DC, gUnknown_082F0EF4 + .4byte 0x00007001, gUnknown_082F1824, gUnknown_082F1A54, gUnknown_082F0F14 gUnknown_082F1DE0:: @ 82F1DE0 .incbin "baserom.gba", 0x2f1de0, 0x8 diff --git a/data/data3.s b/data/data3.s index 8e223c9f6..02f76d210 100644 --- a/data/data3.s +++ b/data/data3.s @@ -1405,7 +1405,294 @@ gUnknown_0852489C:: @ 852489C .incbin "baserom.gba", 0x52489c, 0x20 sFanfares:: @ 85248BC - .incbin "baserom.gba", 0x5248bc, 0x288 + .incbin "baserom.gba", 0x5248bc, 0x48 + +gUnknown_08524904:: @ 8524904 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_0852490C:: @ 852490C + .byte 0x00, 0x00, 0x00, 0x40, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524914:: @ 8524914 + .byte 0x00, 0x00, 0x00, 0x80, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_0852491C:: @ 852491C + .byte 0x00, 0x00, 0x00, 0xc0, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524924:: @ 8524924 + .byte 0x00, 0x40, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_0852492C:: @ 852492C + .byte 0x00, 0x40, 0x00, 0x40, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524934:: @ 8524934 + .byte 0x00, 0x40, 0x00, 0x80, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_0852493C:: @ 852493C + .byte 0x00, 0x40, 0x00, 0xc0, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524944:: @ 8524944 + .byte 0x00, 0x80, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_0852494C:: @ 852494C + .byte 0x00, 0x80, 0x00, 0x40, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524954:: @ 8524954 + .byte 0x00, 0x80, 0x00, 0x80, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_0852495C:: @ 852495C + .byte 0x00, 0x80, 0x00, 0xc0, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524964:: @ 8524964 + .byte 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_0852496C:: @ 852496C + .byte 0x00, 0x01, 0x00, 0x40, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524974:: @ 8524974 + .byte 0x00, 0x01, 0x00, 0x80, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_0852497C:: @ 852497C + .byte 0x00, 0x01, 0x00, 0xc0, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524984:: @ 8524984 + .byte 0x00, 0x41, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_0852498C:: @ 852498C + .byte 0x00, 0x41, 0x00, 0x40, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524994:: @ 8524994 + .byte 0x00, 0x41, 0x00, 0x80, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_0852499C:: @ 852499C + .byte 0x00, 0x41, 0x00, 0xc0, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_085249A4:: @ 85249A4 + .byte 0x00, 0x81, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_085249AC:: @ 85249AC + .byte 0x00, 0x81, 0x00, 0x40, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_085249B4:: @ 85249B4 + .byte 0x00, 0x81, 0x00, 0x80, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_085249BC:: @ 85249BC + .byte 0x00, 0x81, 0x00, 0xc0, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_085249C4:: @ 85249C4 + .byte 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_085249CC:: @ 85249CC + .byte 0x00, 0x03, 0x00, 0x40, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_085249D4:: @ 85249D4 + .byte 0x00, 0x03, 0x00, 0x80, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_085249DC:: @ 85249DC + .byte 0x00, 0x03, 0x00, 0xc0, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_085249E4:: @ 85249E4 + .byte 0x00, 0x43, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_085249EC:: @ 85249EC + .byte 0x00, 0x43, 0x00, 0x40, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_085249F4:: @ 85249F4 + .byte 0x00, 0x43, 0x00, 0x80, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_085249FC:: @ 85249FC + .byte 0x00, 0x43, 0x00, 0xc0, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524A04:: @ 8524A04 + .byte 0x00, 0x83, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524A0C:: @ 8524A0C + .byte 0x00, 0x83, 0x00, 0x40, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524A14:: @ 8524A14 + .byte 0x00, 0x83, 0x00, 0x80, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524A1C:: @ 8524A1C + .byte 0x00, 0x83, 0x00, 0xc0, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524A24:: @ 8524A24 + .byte 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524A2C:: @ 8524A2C + .byte 0x00, 0x04, 0x00, 0x40, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524A34:: @ 8524A34 + .byte 0x00, 0x04, 0x00, 0x80, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524A3C:: @ 8524A3C + .byte 0x00, 0x04, 0x00, 0xc0, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524A44:: @ 8524A44 + .byte 0x00, 0x44, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524A4C:: @ 8524A4C + .byte 0x00, 0x44, 0x00, 0x40, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524A54:: @ 8524A54 + .byte 0x00, 0x44, 0x00, 0x80, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524A5C:: @ 8524A5C + .byte 0x00, 0x44, 0x00, 0xc0, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524A64:: @ 8524A64 + .byte 0x00, 0x84, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524A6C:: @ 8524A6C + .byte 0x00, 0x84, 0x00, 0x40, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524A74:: @ 8524A74 + .byte 0x00, 0x84, 0x00, 0x80, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524A7C:: @ 8524A7C + .byte 0x00, 0x84, 0x00, 0xc0, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524A84:: @ 8524A84 + .byte 0x00, 0x05, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524A8C:: @ 8524A8C + .byte 0x00, 0x05, 0x00, 0x40, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524A94:: @ 8524A94 + .byte 0x00, 0x05, 0x00, 0x80, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524A9C:: @ 8524A9C + .byte 0x00, 0x05, 0x00, 0xc0, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524AA4:: @ 8524AA4 + .byte 0x00, 0x45, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524AAC:: @ 8524AAC + .byte 0x00, 0x45, 0x00, 0x40, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524AB4:: @ 8524AB4 + .byte 0x00, 0x45, 0x00, 0x80, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524ABC:: @ 8524ABC + .byte 0x00, 0x45, 0x00, 0xc0, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524AC4:: @ 8524AC4 + .byte 0x00, 0x85, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524ACC:: @ 8524ACC + .byte 0x00, 0x85, 0x00, 0x40, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524AD4:: @ 8524AD4 + .byte 0x00, 0x85, 0x00, 0x80, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524ADC:: @ 8524ADC + .byte 0x00, 0x85, 0x00, 0xc0, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524AE4:: @ 8524AE4 + .byte 0x00, 0x07, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524AEC:: @ 8524AEC + .byte 0x00, 0x07, 0x00, 0x40, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524AF4:: @ 8524AF4 + .byte 0x00, 0x07, 0x00, 0x80, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524AFC:: @ 8524AFC + .byte 0x00, 0x07, 0x00, 0xc0, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524B04:: @ 8524B04 + .byte 0x00, 0x47, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524B0C:: @ 8524B0C + .byte 0x00, 0x47, 0x00, 0x40, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524B14:: @ 8524B14 + .byte 0x00, 0x47, 0x00, 0x80, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524B1C:: @ 8524B1C + .byte 0x00, 0x47, 0x00, 0xc0, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524B24:: @ 8524B24 + .byte 0x00, 0x87, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524B2C:: @ 8524B2C + .byte 0x00, 0x87, 0x00, 0x40, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524B34:: @ 8524B34 + .byte 0x00, 0x87, 0x00, 0x80, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_08524B3C:: @ 8524B3C + .byte 0x00, 0x87, 0x00, 0xc0, 0x00, 0x08, 0x00, 0x00 gUnknown_08524B44:: @ 8524B44 .incbin "baserom.gba", 0x524b44, 0x1d0 diff --git a/data/data3a.s b/data/data3a.s deleted file mode 100644 index 0b5595241..000000000 --- a/data/data3a.s +++ /dev/null @@ -1,8 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - - @ unknown unreferenced data - - .incbin "baserom.gba", 0x58d977, 0x2a1 diff --git a/data/data3b.s b/data/data3b.s index 71d189254..3faa3d290 100644 --- a/data/data3b.s +++ b/data/data3b.s @@ -5,6 +5,9 @@ .section .rodata + .align 2 + .incbin "baserom.gba", 0x58d978, 0x2a0 + .align 2 gFieldEffectObjectPalette7:: @ 858DC18 .incbin "graphics/map_objects/palettes/field_effect_object_palette_07.gbapal" diff --git a/data/io_reg.s b/data/io_reg.s index 9e3198b3b..e6315cd89 100644 --- a/data/io_reg.s +++ b/data/io_reg.s @@ -7,7 +7,22 @@ .align 2 gUnref_82EC784:: @ 82EC784 - .incbin "baserom.gba", 0x2EC784, 0x40 + .4byte 0x00000000 + .4byte 0x00000000 + .4byte 0x04000008 + .4byte 0x0400000A + .4byte 0x0400000C + .4byte 0x0400000E + .4byte 0x04000010 + .4byte 0x04000014 + .4byte 0x04000018 + .4byte 0x0400001C + .4byte 0x04000012 + .4byte 0x04000016 + .4byte 0x0400001A + .4byte 0x0400001E + .4byte 0x02000100 + .4byte 0x08000400 gUnknown_82EC7C4:: @ 82EC7C4 .2byte 0x0100 diff --git a/data/strings.s b/data/strings.s index 94cf82c59..5834ed643 100644 --- a/data/strings.s +++ b/data/strings.s @@ -1033,8 +1033,7 @@ gUnknown_085EA1CA:: @ 85EA1CA .string "{PAUSE_UNTIL_PRESS}$" gUnknown_085EA1CD:: @ 85EA1CD - -.string "{STR_VAR_1}& ぐñぐñこÂÉ+à\nだÏÛ ùªÏÁでÒÉ?$" + .string "{STR_VAR_1}を ぐるぐるこうかんに\nだして よろしいですか?$" @ "{STR_VAR_1}wo gurugurukoukanni\ndashite yoroshiidesuka?" ("do you want to put {STR_VAR_1} into the spinner?" in Japanese) gUnknown_085EA1E8:: @ 85EA1E8 .incbin "baserom.gba", 0x5ea1e8, 0x28 @@ -1042,14 +1041,27 @@ gUnknown_085EA1E8:: @ 85EA1E8 gUnknown_085EA210:: @ 85EA210 .incbin "baserom.gba", 0x5ea210, 0x24 + .align 2 gUnknown_085EA234:: @ 85EA234 + .string "An EGG can’t be traded now.$" + + .align 2 + .string "The other TRAINER’s POKéMON\ncan’t be traded now.$" + + .align 2 + .string "The other TRAINER can’t accept\nthat POKéMON now.$" + + .align 2 + .string "You can’t trade with that\nTRAINER now.$" + + .align 2 + .string "That isn’t the type of POKéMON\nthat the other TRAINER wants.$" + + .align 2 + .string "That isn’t an EGG.$" + +gUnknown_085EA333:: @ 85EA333 -.string "An EGG can’t be traded now.$" -.string "The other TRAINER’s POKéMON\ncan’t be traded now.$" -.string " The other TRAINER can’t accept\nthat POKéMON now.$" -.string " You can’t trade with that\nTRAINER now.$" -.string " That isn’t the type of POKéMON\nthat the other TRAINER wants.$" -.string " That isn’t an EGG.$" .string "REGISTER$" gUnknown_085EA33C:: @ 85EA33C @@ -3319,30 +3331,90 @@ gUnknown_085EED34:: @ 85EED34 .string "POKéDEX$" gUnknown_085EED3C:: @ 85EED3C + .string "TIME$" -.string "TIME$" -.string "Wireless Communication Status$" -.string "People trading:$" -.string "People battling:$" -.string "People in the UNION ROOM:$" -.string "People communicating:$" -.string "{SPECIAL_F7} players$" -.string "{SPECIAL_F7}À players$" -.string "{SPECIAL_F7}Á players$" -.string "{SPECIAL_F7} players$" -.string "…yセËAyセËLyセËWyセËWONDER CARDS$" -.string " WONDER NEWS$" -.string "WIRELESS COMMUNICATION$" -.string " FRIEND$" -.string " EXIT$" -.string " RECEIVE$" -.string "SEND$" -.string " TOSS$" -.string " A variety of events will be imported\nover Wireless Communication.$" -.string " Read the WONDER CARDS in your\npossession.$" -.string " Read the NEWS that arrived.$" -.string "Return to the title screen.$" +gUnknown_085EED41:: @ 85EED41 + .string "Wireless Communication Status$" +gUnknown_085EED5F:: @ 85EED5F + .string "People trading:$" + +gUnknown_085EED6F:: @ 85EED6F + .string "People battling:$" + +gUnknown_085EED80:: @ 85EED80 + .string "People in the UNION ROOM:$" + +gUnknown_085EED9A:: @ 85EED9A + .string "People communicating:$" + +gUnknown_085EEDB0:: @ 85EEDB0 + .string "{SPECIAL_F7 0} players$" + +gUnknown_085EEDBB:: @ 85EEDBB + .string "{SPECIAL_F7 1} players$" + +gUnknown_085EEDC6:: @ 85EEDC6 + .string "{SPECIAL_F7 2} players$" + +gUnknown_085EEDD1:: @ 85EEDD1 + .string "{SPECIAL_F7 3} players$" + + .align 2 + .4byte gUnknown_085EEDB0 + .4byte gUnknown_085EEDBB + .4byte gUnknown_085EEDC6 + .4byte gUnknown_085EEDD1 + + .align 2 +gUnknown_085EEDEC:: @ 85EEDEC + .string "WONDER CARDS$" + + .align 2 +gUnknown_085EEDFC:: @ 85EEDFC + .string "WONDER NEWS$" + + .align 2 +gUnknown_085EEE08:: @ 85EEE08 + .string "WIRELESS COMMUNICATION$" + + .align 2 +gUnknown_085EEE20:: @ 85EEE20 + .string "FRIEND$" + + .align 2 +gUnknown_085EEE28:: @ 85EEE28 + .string "EXIT$" + + .align 2 +gUnknown_085EEE30:: @ 85EEE30 + .string "RECEIVE$" + + .align 2 +gUnknown_085EEE38:: @ 85EEE38 + .string "SEND$" + + .align 2 +gUnknown_085EEE40:: @ 85EEE40 + .string "TOSS$" + + .align 2 +gUnknown_085EEE48:: @ 85EEE48 + .string "A variety of events will be imported\nover Wireless Communication.$" + + .align 2 +gUnknown_085EEE8C:: @ 85EEE40 + .string "Read the WONDER CARDS in your\npossession.$" + + .align 2 +gUnknown_085EEEB8:: @ 85EEEB8 + .string "Read the NEWS that arrived.$" + + .align 2 +gUnknown_085EEED4:: @ 85EEED4 + .string "Return to the title screen.$" + + .align 2 gUnknown_085EEEF0:: @ 85EEEF0 .incbin "baserom.gba", 0x5eeef0, 0x3c diff --git a/graphics/interface/blank_1x2.png b/graphics/interface/blank_1x2.png new file mode 100644 index 0000000000000000000000000000000000000000..83ba13d119bf86b61c240bc6558f55caed68ea0d GIT binary patch literal 71 zcmeAS@N?(olHy`uVBq!ia0vp^96&6<0wfqt3-&AkQhc5+jv*W~lYj8D@LW-5_;%g? U;Lr1c*Fh>gUHx3vIVCg!0P>&_^8f$< literal 0 HcmV?d00001 diff --git a/graphics/interface/link_test_digits.pal b/graphics/interface/link_test_digits.pal new file mode 100644 index 000000000..5362e8d6d --- /dev/null +++ b/graphics/interface/link_test_digits.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 255 255 diff --git a/graphics/interface/link_test_digits.png b/graphics/interface/link_test_digits.png new file mode 100644 index 0000000000000000000000000000000000000000..fe71d33877ff2910f8c7c869e607b7c2c509897e GIT binary patch literal 269 zcmeAS@N?(olHy`uVBq!ia0vp^9YD;%!VDxYsI1xvqznRlLR^6~3E=<#Cz5<$fEs3a zx;TbtOw0}J6g;57ahm0gy`1m?wrzj1*57lr<8@?=eA!VDy@YH9BTQU(D&A+A$^VDJAq&;FnN|34|~ z+mbD7j-EYw@7cZo|NjG(KtNJb5>VCAqep?33O)|S3U<9X8f%Qo1sf8_z+JQ zIf?QVC{i+@E1}kk|JQ%3f6M=W-mlsBr%Z(^HR?2IineIep-Ydx%52!OW6weDzG{w~ gggU?f58ZO*j`n5h%0I#jw=cBz!B`2)0TUf~02wJ!0{{R3 literal 0 HcmV?d00001 diff --git a/graphics/interface/wireless_info_screen.pal b/graphics/interface/wireless_info_screen.pal new file mode 100644 index 000000000..8e0bc0581 --- /dev/null +++ b/graphics/interface/wireless_info_screen.pal @@ -0,0 +1,259 @@ +JASC-PAL +0100 +256 +0 0 0 +90 90 90 +90 90 90 +90 90 90 +90 90 90 +90 90 90 +90 90 90 +90 90 90 +57 57 57 +172 123 0 +90 90 90 +57 57 57 +164 164 164 +255 180 0 +106 106 106 +74 74 74 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +90 90 90 +90 90 90 +90 90 90 +90 90 90 +90 90 90 +90 90 90 +74 246 255 +57 57 57 +172 123 0 +90 90 90 +57 57 57 +164 164 164 +255 180 0 +106 106 106 +74 74 74 +0 0 0 +90 90 90 +90 90 90 +90 90 90 +90 90 90 +90 90 90 +74 246 255 +57 213 230 +57 57 57 +172 123 0 +90 90 90 +57 57 57 +164 164 164 +255 180 0 +106 106 106 +74 74 74 +0 0 0 +90 90 90 +90 90 90 +90 90 90 +90 90 90 +74 246 255 +57 213 230 +49 180 205 +0 32 98 +172 123 0 +90 90 90 +57 57 57 +164 164 164 +255 180 0 +106 106 106 +74 74 74 +0 0 0 +90 90 90 +90 90 90 +90 90 90 +74 246 255 +57 213 230 +49 180 205 +41 148 180 +0 32 98 +172 123 0 +90 90 90 +57 57 57 +164 164 164 +255 180 0 +106 106 106 +74 74 74 +0 0 0 +90 90 90 +90 90 90 +74 246 255 +57 213 230 +49 180 205 +41 148 180 +24 123 164 +0 32 98 +172 123 0 +90 90 90 +57 57 57 +164 164 164 +255 180 0 +106 106 106 +74 74 74 +0 0 0 +90 90 90 +74 246 255 +57 213 230 +49 180 205 +41 148 180 +24 123 164 +16 90 139 +0 32 98 +172 123 0 +90 90 90 +57 57 57 +164 164 164 +255 180 0 +106 106 106 +74 74 74 +0 0 0 +74 246 255 +57 213 230 +49 180 205 +41 148 180 +24 123 164 +16 90 139 +8 57 115 +0 32 98 +172 123 0 +90 90 90 +57 57 57 +164 164 164 +255 180 0 +106 106 106 +74 74 74 +0 0 0 +57 213 230 +49 180 205 +41 148 180 +24 123 164 +16 90 139 +8 57 115 +8 57 115 +57 57 57 +172 123 0 +90 90 90 +57 57 57 +164 164 164 +255 180 0 +106 106 106 +74 74 74 +0 0 0 +49 180 205 +41 148 180 +24 123 164 +16 90 139 +8 57 115 +8 57 115 +90 90 90 +57 57 57 +172 123 0 +90 90 90 +57 57 57 +164 164 164 +255 180 0 +106 106 106 +74 74 74 +0 0 0 +41 148 180 +24 123 164 +16 90 139 +8 57 115 +8 57 115 +90 90 90 +90 90 90 +57 57 57 +172 123 0 +90 90 90 +57 57 57 +164 164 164 +255 180 0 +106 106 106 +74 74 74 +0 0 0 +24 123 164 +16 90 139 +8 57 115 +8 57 115 +90 90 90 +90 90 90 +90 90 90 +57 57 57 +172 123 0 +90 90 90 +57 57 57 +164 164 164 +255 180 0 +106 106 106 +74 74 74 +0 0 0 +16 90 139 +8 57 115 +8 57 115 +90 90 90 +90 90 90 +90 90 90 +90 90 90 +57 57 57 +172 123 0 +90 90 90 +57 57 57 +164 164 164 +255 180 0 +106 106 106 +74 74 74 +0 0 0 +8 57 115 +8 57 115 +90 90 90 +90 90 90 +90 90 90 +90 90 90 +90 90 90 +57 57 57 +172 123 0 +90 90 90 +57 57 57 +164 164 164 +255 180 0 +106 106 106 +74 74 74 +0 0 0 +90 90 90 +90 90 90 +90 90 90 +90 90 90 +90 90 90 +90 90 90 +90 90 90 +57 57 57 +172 123 0 +90 90 90 +57 57 57 +164 164 164 +255 180 0 +106 106 106 +74 74 74 diff --git a/graphics/interface/wireless_info_screen.png b/graphics/interface/wireless_info_screen.png new file mode 100644 index 0000000000000000000000000000000000000000..796b2771a36cd0771377342af4c3e0bb67b9bc32 GIT binary patch literal 1210 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0J3?w7mbKWvAFf#=Bgt!8^QP_Z`rRADxkQ9)y zWXY2MTNtvkvb?;!fa*yFn8tg3`;W(bH1#0GSDz879-`QA%UK46BwX%?n-5p4Ib{n$ z^~j1Ps+ZtbkEU24svD1bOvN0Q#dy>MLj&kRpqqit0GbR`3`BUs2U9U5T5*LBn#qvh z!ec(NGvHy1M?KulaK-rD1MwiTV*KjSR6@A8+#@hOD3pPLvDDMWF~p;D>D05nhaCi3 zm$T;0u`E2V%3831QANw4gdyC6fm_P)0z;G79Igu%qDMj==pni5ucI7hdusQ+PIlv|JS=jM zOJBTk>n+}gJAIs`9F@PBwyaik`DoM;@Q+7{W6h%ztP5V-Uvp4;E%>j0Lz_xhfT_yl zRf7AfcTQ`TpAd8U;O=7G^U5*22X*xoo=p=Mxbw~?>E7c7&YSI|#3HP_{MNgdA6Ngr zy!)y=k7>)-xCyJIz22`_$#?Cx@4qIs7pxwaT==^;*hJ5dw~2|fjk|A?&AfDuluEr( zhRf}|Wk>irG*lBE`Y*7pQ+YH^Fz}qpJNBgG9UAGG4sHro%l}Uam+)uToB7w&C_-?L zp<9XR5wqqCM?D2L?NM_Q({?mzOS$!-#Cz_ty5Q^Lt5toi&hGZvo%14#!%I3USn=(m jM4#RJ^w*rCd^=DaPK_!Z(tDnm{r-UW|`fa}% literal 0 HcmV?d00001 diff --git a/graphics/interface/wireless_link.bin b/graphics/interface/wireless_link.bin new file mode 100644 index 0000000000000000000000000000000000000000..1832ae850b41e9e196443b36e5d58c48f4f2d2e3 GIT binary patch literal 2048 zcmeIuS5p%K6vgqM5_HiZU5Y3jX`&!l0Hq@xq&IOl34H&Lph?KMVa%H^&g{KUch3Ev znR7_yUo?=BE89$}(-6{9^ZasSS={I07#=kaX*oaYM-Wd0`0{_m0N$*XW z_94c9^vP#4X3hEHtN9B2f<;S~tyr}d= literal 0 HcmV?d00001 diff --git a/graphics/interface/wireless_link.pal b/graphics/interface/wireless_link.pal new file mode 100644 index 000000000..e880353cf --- /dev/null +++ b/graphics/interface/wireless_link.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 0 0 +255 255 255 +255 90 0 +246 139 74 +255 205 164 +238 246 246 +180 222 255 +57 90 123 +115 189 255 +222 222 246 +131 246 180 +106 115 131 +189 197 213 +156 164 180 +74 74 90 +0 0 0 diff --git a/graphics/interface/wireless_link.png b/graphics/interface/wireless_link.png new file mode 100644 index 0000000000000000000000000000000000000000..3946b9b225d1f7666e8e0fd0b5d0dd51401da2aa GIT binary patch literal 904 zcmV;319$w1P)i|2bNFbG`rG-u8p`v}$vMy~Wj>q_j#(S^xk563$uk0009M zNkl|_lX0@%I={K&&ory%$nc0J;I@Wzju z&%5&d7yiP#nt||xa4_tkqElLdJs76wL*E#^E~8UmtnB+`p#b*fChK4cTQI}HL@S_5 zB>)I0Y%4eGZ4f}g4-jzm!U2R(1WZ@m<&F*LH$uMCxD9f@pLz%=?bS<74QLyF{m? zR7WcaK-I_=06}JBKLnWGVekM`0A72#RkLdr`hoy}!xi)!ui?? zuZ8ep2=l>BJe=$Cd=SRIhpVFv@Ha{*yGb>cP!f`Ax|H^jN%i8ie)+|6@zs{-d^Z)-qngJ*XM?fwF%u)Ne1<2au>EaloF)=xzkdc|4?Rk-bL1IC>ftN>u zjD6EN3+9wFQE_o`du30|;7gg3-`>qodX{M=qtP5iB{iOc^b1#P_4EY3>javWvF}dr zT(H3WhOMfe-n%Vj{+T}*cBq?(9MbUB=UzU&+RNElv8;9K^yN(wOBH4ognVaUWpn;9 zVM?8ov*NqRRXH+zW#@w&4`ytrc8ELnUhaB;0mnkM!$(;UaRAM3HDF;~$RjQuo^sS6 aoq<7~v#|8nvd#NJ{_u45b6Mw<&;$V8t#9%G literal 0 HcmV?d00001 diff --git a/graphics/interface/wonder_card_1.bin b/graphics/interface/wonder_card_1.bin new file mode 100644 index 0000000000000000000000000000000000000000..8e4a4717bb8ed62814c72f8a34c4cb84171a6e02 GIT binary patch literal 1200 zcmeIu%MyYx3`XID{7PvnirnS>-&5$Gk;bj_txu9k!NsUhiLyoRM3q~6%_LTytf{?` zM>ITWQk#Es%ZqkvE1XfK8c#6rs`u6f10Pds*c$lnJ^%6j&mBF3L9b3D6SKjj@muST Q=ALK|FZ#7zc-v^v2Th+M#Q*>R literal 0 HcmV?d00001 diff --git a/graphics/interface/wonder_card_1.pal b/graphics/interface/wonder_card_1.pal new file mode 100644 index 000000000..9c5ef9b26 --- /dev/null +++ b/graphics/interface/wonder_card_1.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +90 197 148 +213 213 213 +74 74 74 +98 106 106 +213 189 74 +238 213 82 +246 246 213 +255 255 255 +230 230 213 +238 238 213 +255 0 255 +255 0 255 +255 0 255 +255 0 255 +255 0 255 +255 0 255 diff --git a/graphics/interface/wonder_card_1.png b/graphics/interface/wonder_card_1.png new file mode 100644 index 0000000000000000000000000000000000000000..924a46dac5cbab9a5f51b90e97e15a1fd58a1ab5 GIT binary patch literal 318 zcmeAS@N?(olHy`uVBq!ia0vp^3P5bZ!VDzyEjb#px%?7E{-7@6X#xj%iCli!1iFBLS8}6 zf}VuOObWss(hbT7*!r^LtK_FFa*Y2sMZNs`GS9i(mIYmx%=Hd+3N$x`Ih44G^o7I; zv^K3`Gvw$#f1w~N{x{2}uKf?Ka+tUIFmQJ|-9M^P@|&@_j>R%{w~aej|BiqiyxJN2 z56Euj`DJmZp}hF?{GUzJp0e2lIGz)FVA(w9+JUxrtS{xAgJ#49^C`PW7jdNiSfkp! zR`OHx>7tl*;FVdQ&MBb@ E0A?JB9RL6T literal 0 HcmV?d00001 diff --git a/graphics/interface/wonder_card_2.pal b/graphics/interface/wonder_card_2.pal new file mode 100644 index 000000000..18c2be3fd --- /dev/null +++ b/graphics/interface/wonder_card_2.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +90 197 148 +82 82 106 +131 131 139 +197 189 213 +205 230 255 +115 139 197 +49 74 82 +0 0 0 +0 0 0 +222 255 246 +197 255 222 +222 238 255 +156 180 222 +156 106 115 +172 139 164 +255 255 255 diff --git a/graphics/interface/wonder_card_2.png b/graphics/interface/wonder_card_2.png new file mode 100644 index 0000000000000000000000000000000000000000..8ea8b1a4115b5c182563c64f16c4cba327b3095a GIT binary patch literal 311 zcmV-70m%M|P)!1fFZa>wl0lXVDiBw)gx4)GdIv0kj*S=~T;-fQJRxei68TwTv2Bj&2Ox zs4+|lZ$!{>p0t)5W$(Y>Tjv^sPabgwXW`CFfahk-SUwA98NRYHD20xL101 V%QkiG{SS04gQu&X%Q~loCIA(keA55` literal 0 HcmV?d00001 diff --git a/graphics/interface/wonder_card_4.pal b/graphics/interface/wonder_card_4.pal new file mode 100644 index 000000000..bfbf036a5 --- /dev/null +++ b/graphics/interface/wonder_card_4.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +90 197 148 +82 82 106 +131 131 139 +164 156 172 +197 189 213 +246 238 255 +255 0 255 +255 0 255 +255 0 255 +255 0 255 +238 255 230 +213 255 189 +189 230 156 +164 213 131 +148 197 106 +255 255 255 diff --git a/graphics/interface/wonder_card_4.png b/graphics/interface/wonder_card_4.png new file mode 100644 index 0000000000000000000000000000000000000000..7ce03b20f055a62797799221413b428a28132c33 GIT binary patch literal 279 zcmeAS@N?(olHy`uVBq!ia0vp^0ze$W!VDz&u4M%SDT4r?5Z9=qQ-XrBnwz_q%vp1E z@6~Vb{{Lq{pm+bDUH!jz@3T2et~O6On)Uzx|FE@!EkI(jV9PBK=VdJ|;{&eWpCmD~on{|5frLFyE5`OZf z;?5_YHO+55UI$EaK6x&zDqVB#=eY?VnI}KF^MA$zPM>cn(Vxv6Pv@{75}&q2Sm)oA z2O$R2(?ohW3NnrzysBsy(H%HRXPLH$&Es|UVq2=YJ)J#vtxugHKK<>|%cbvkp5R{T W*)7}Dwf8^JwG5uFelF{r5}E+%mwcB1 literal 0 HcmV?d00001 diff --git a/graphics/interface/wonder_card_5.pal b/graphics/interface/wonder_card_5.pal new file mode 100644 index 000000000..fa41ee3b0 --- /dev/null +++ b/graphics/interface/wonder_card_5.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +90 197 148 +82 82 106 +131 131 139 +164 156 172 +197 189 213 +246 238 255 +255 0 255 +255 0 255 +255 0 255 +255 0 255 +238 246 255 +205 238 246 +180 222 246 +156 197 238 +115 156 197 +255 255 255 diff --git a/graphics/interface/wonder_card_5.png b/graphics/interface/wonder_card_5.png new file mode 100644 index 0000000000000000000000000000000000000000..dcbddbcdb020d6c25a688f204f67e29c9ee9a68e GIT binary patch literal 279 zcmeAS@N?(olHy`uVBq!ia0vp^0ze$W!VDz&u4M%SDT4r?5Z9=qQ-XrBnwz_q%vp1E z@6~Vb{{Lq{pm*Q?pMCdj%e`-Nj=n3NbM*iJ|Hof`NCoO$bP0l+XkK(D;8L literal 0 HcmV?d00001 diff --git a/graphics/interface/wonder_card_6.pal b/graphics/interface/wonder_card_6.pal new file mode 100644 index 000000000..8a71f5846 --- /dev/null +++ b/graphics/interface/wonder_card_6.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +90 197 148 +82 82 106 +131 131 139 +164 156 172 +197 189 213 +246 238 255 +255 0 255 +255 0 255 +255 0 255 +255 0 255 +238 238 197 +230 230 139 +222 222 115 +213 213 90 +189 189 57 +255 255 255 diff --git a/graphics/interface/wonder_card_6.png b/graphics/interface/wonder_card_6.png new file mode 100644 index 0000000000000000000000000000000000000000..c685a629954ffdceff7e758cfd75cd5f9090e126 GIT binary patch literal 279 zcmeAS@N?(olHy`uVBq!ia0vp^0ze$W!VDz&u4M%SDT4r?5Z9=qQ-XrBnwz_q%vp1E z@6~Vb{{Lq{pm*<%K6}=E?_TlMt5JLRTK@n4f5lF#B%t0!o-U3d8WYb>Jk5K^fyYJI zs=!J?Mo{%aftSKu0bO2&T;2+`$7lOF4tAE`u<_j^e>!yQlZ?mP%{o2#($@Yn2|xK# zapx1yn&!72uLCAIpF9^%PjIjF W?3Qin+WQ~qS_V&7KbLh*2~7a|fqb|C literal 0 HcmV?d00001 diff --git a/graphics/interface/wonder_card_7.pal b/graphics/interface/wonder_card_7.pal new file mode 100644 index 000000000..01832b5e2 --- /dev/null +++ b/graphics/interface/wonder_card_7.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +189 123 148 +213 213 213 +74 74 74 +115 123 123 +164 156 90 +164 148 90 +197 197 90 +213 205 90 +222 213 90 +213 213 106 +238 246 98 +230 222 98 +213 205 98 +197 180 98 +238 230 98 +246 238 106 diff --git a/graphics/interface/wonder_card_7.png b/graphics/interface/wonder_card_7.png new file mode 100644 index 0000000000000000000000000000000000000000..f534b555eca7610b7c05b20b2034792229756b2f GIT binary patch literal 545 zcmV++0^a?JP)5bTGh>3-ql*w)oSkcV&>jr)y-nXv|{e&V)pK8rx32b00053 zNkl?#Y|xU+03jo^6ZFn6?tFQ{8-z+o0{qi} z?wt6N4`ItPC6(2mr9 zsRs$t6I14>4+PC9>y5NbfO~JZ(xLo)k=;ttO9|AqjJUs&R3kVz1^~B*R!qk2Rvn}p9%r;F#GBuv( j@RD!8;ZFEw@Lb>@ztv}Un*>d#00000NkvXXu0mjfiD~#f literal 0 HcmV?d00001 diff --git a/graphics/interface/wonder_card_8.pal b/graphics/interface/wonder_card_8.pal new file mode 100644 index 000000000..28a498b57 --- /dev/null +++ b/graphics/interface/wonder_card_8.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +189 123 148 +213 213 213 +74 74 74 +115 123 123 +156 156 156 +139 139 148 +180 180 197 +197 189 205 +205 205 222 +189 189 189 +197 230 222 +189 213 213 +180 197 197 +156 164 172 +222 222 230 +230 230 238 diff --git a/graphics/interface/wonder_card_8.png b/graphics/interface/wonder_card_8.png new file mode 100644 index 0000000000000000000000000000000000000000..90890ded9923aa929bb4d42de47da60bdf87d132 GIT binary patch literal 534 zcmV+x0_pvUP)(YQ`TA;Hdi8MuZ^LWWC14JREL>MLS62aX7vahq}IacW2)6P;=>PgH?9VGS-<{u-)U z)*+X|NS*NSTr>?S;nhHmA_hV(S-2@EwKdWJQs78i9*ltl1^QM9kIc6~574zhXo8^y z4*$aU5uy%1#<2~O8-EbuJIn>1ySK3jNnmW>3PEN_{g+z??-+g~c(InDpQ-EtBA0;HT{q92Df1Swlbt|6o{>da3VM*$RphEvS!Bk2myht8nW6Zc;>7j+#_o0!+X4~ zATIVC>2hI5Fs@b%707*qoM6N<$f>wO@2LJ#7 literal 0 HcmV?d00001 diff --git a/ld_script.txt b/ld_script.txt index 8ae46e18a..d7e038996 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -305,7 +305,6 @@ SECTIONS { src/trig.o(.rodata); data/data3.o(.rodata); src/pokemon_size_record.o(.rodata) - data/data3a.o(.rodata) data/data3b.o(.rodata); src/battle_ai.o(.rodata); data/data4.o(.rodata); diff --git a/sym_ewram.txt b/sym_ewram.txt index dda072481..eb107504f 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -37,7 +37,7 @@ gUnknown_020223C4: @ 20223C4 gUnknown_020223C8: @ 20223C8 .space 0x4FC -gUnknown_020228C4: @ 20228C4 +gUnknown_020228C4: @ 20228C4 gBlockSendBuffer .space 0x100 gUnknown_020229C4: @ 20229C4 From bc98dc128bb6db54e2642d6f31aba834aa4b97ad Mon Sep 17 00:00:00 2001 From: scnorton Date: Wed, 6 Sep 2017 09:20:49 -0400 Subject: [PATCH 02/13] Make rom.sha1 lowercase to fix erroneous comparison results on *nix --- rom.sha1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rom.sha1 b/rom.sha1 index 8dcf19572..048b0a3a5 100644 --- a/rom.sha1 +++ b/rom.sha1 @@ -1 +1 @@ -F3AE088181BF583E55DAF962A92BB46F4F1D07B7 pokeemerald.gba +f3ae088181bf583e55daf962a92bb46f4f1d07b7 pokeemerald.gba From 54e18f3f2e1e10fa703f2d1933eb6ed78c3e33cb Mon Sep 17 00:00:00 2001 From: Diegoisawesome Date: Mon, 11 Sep 2017 01:27:20 -0500 Subject: [PATCH 03/13] Add missing files for building --- graphics/interface/wonder_card_2.bin | Bin 0 -> 1200 bytes graphics/interface/wonder_card_3.bin | Bin 0 -> 1200 bytes graphics/interface/wonder_card_7.bin | Bin 0 -> 1200 bytes graphics/interface/wonder_card_8.bin | Bin 0 -> 1200 bytes graphics/interface/wonder_card_shadow.png | Bin 0 -> 167 bytes graphics/interface/wonder_card_shadow_1.pal | 19 +++++++++++++++++++ graphics/interface/wonder_card_shadow_2.pal | 19 +++++++++++++++++++ graphics/interface/wonder_card_shadow_3.pal | 19 +++++++++++++++++++ graphics/interface/wonder_card_shadow_4.pal | 19 +++++++++++++++++++ graphics/interface/wonder_card_shadow_5.pal | 19 +++++++++++++++++++ graphics/interface/wonder_card_shadow_6.pal | 19 +++++++++++++++++++ graphics/interface/wonder_card_shadow_7.pal | 19 +++++++++++++++++++ graphics/interface/wonder_card_shadow_8.pal | 19 +++++++++++++++++++ 13 files changed, 152 insertions(+) create mode 100644 graphics/interface/wonder_card_2.bin create mode 100644 graphics/interface/wonder_card_3.bin create mode 100644 graphics/interface/wonder_card_7.bin create mode 100644 graphics/interface/wonder_card_8.bin create mode 100644 graphics/interface/wonder_card_shadow.png create mode 100644 graphics/interface/wonder_card_shadow_1.pal create mode 100644 graphics/interface/wonder_card_shadow_2.pal create mode 100644 graphics/interface/wonder_card_shadow_3.pal create mode 100644 graphics/interface/wonder_card_shadow_4.pal create mode 100644 graphics/interface/wonder_card_shadow_5.pal create mode 100644 graphics/interface/wonder_card_shadow_6.pal create mode 100644 graphics/interface/wonder_card_shadow_7.pal create mode 100644 graphics/interface/wonder_card_shadow_8.pal diff --git a/graphics/interface/wonder_card_2.bin b/graphics/interface/wonder_card_2.bin new file mode 100644 index 0000000000000000000000000000000000000000..b59dbabb53cb0d03b4160f0cc500b8e6ff6e5cf2 GIT binary patch literal 1200 zcmeIv%ME}q3h#dvH}e!B=pXfB|D&T3XEViWd}uMR8~vukq}MLRx=JT r2u0g!6Gu!C%b1-q-((9Gr}Fncek}9N&MP*j9S2UQ>yz1_jZ?52?XV=% literal 0 HcmV?d00001 diff --git a/graphics/interface/wonder_card_3.bin b/graphics/interface/wonder_card_3.bin new file mode 100644 index 0000000000000000000000000000000000000000..aba2b9e924adaec8d4d304d7d784c4ae0b821b3f GIT binary patch literal 1200 zcmeIvK@NZ*3`EgEMiE5;k^5g&xPgu<6Z6(TZCZmtWN5+1B6mbssm)BtVq18ih;8MG l+FFNM>I$hZHlqQ3L@+JH?IcmaU&5c>cC literal 0 HcmV?d00001 diff --git a/graphics/interface/wonder_card_7.bin b/graphics/interface/wonder_card_7.bin new file mode 100644 index 0000000000000000000000000000000000000000..1800bff4dc9dd0984941d2882701c722db51043b GIT binary patch literal 1200 zcmd_k*%HA}5QO0$V~g0AAc%bzYZAQwgPFX+aa^jey5_2@CqtH;MpSxpiA~;INl3&dfp%kwt&(=_Ruckl*saDg O=FWqNNWRTOPJ96CA5#AS literal 0 HcmV?d00001 diff --git a/graphics/interface/wonder_card_8.bin b/graphics/interface/wonder_card_8.bin new file mode 100644 index 0000000000000000000000000000000000000000..1800bff4dc9dd0984941d2882701c722db51043b GIT binary patch literal 1200 zcmd_k*%HA}5QO0$V~g0AAc%bzYZAQwgPFX+aa^jey5_2@CqtH;MpSxpiA~;INl3&dfp%kwt&(=_Ruckl*saDg O=FWqNNWRTOPJ96CA5#AS literal 0 HcmV?d00001 diff --git a/graphics/interface/wonder_card_shadow.png b/graphics/interface/wonder_card_shadow.png new file mode 100644 index 0000000000000000000000000000000000000000..ae1c92a93bad2516e6a6f4e8808d143235c3a9e9 GIT binary patch literal 167 zcmeAS@N?(olHy`uVBq!ia0vp^3P3Et!VDx^^%AmxltF+`h-=i*DSP)WIeT`^)vJ5| zGyErr=G|hy4%BPp>Eak7F*P|sfuF;Pamr~84tA!1eG?2NG@M)#Vmbso4oGk&h&x Date: Mon, 11 Sep 2017 22:01:39 -0500 Subject: [PATCH 04/13] Dump strings.txt --- charmap.txt | 43 +- data/berry_tag_screen.s | 1 + data/data2.s | 7 +- data/strings.s | 4065 ++++++++++++++++++--------------------- 4 files changed, 1891 insertions(+), 2225 deletions(-) diff --git a/charmap.txt b/charmap.txt index 5d0be5477..d7fd15e2e 100644 --- a/charmap.txt +++ b/charmap.txt @@ -401,12 +401,6 @@ NAME_END = FC 00 @ special 0xF7 character SPECIAL_F7 = F7 -@ another kind of text placeholder? -SPECIAL_F700 = F7 00 -SPECIAL_F701 = F7 01 -SPECIAL_F702 = F7 02 -SPECIAL_F703 = F7 03 - @ more text functions COLOR = FC 01 @ use a color listed below right after @@ -437,21 +431,21 @@ RESUME_MUSIC = FC 18 @ colors TRANSPARENT = 00 -DARK_GREY = 01 -RED = 02 -GREEN = 03 -BLUE = 04 -YELLOW = 05 -CYAN = 06 -MAGENTA = 07 -LIGHT_GREY = 08 -BLACK = 09 -BLACK2 = 0A @ duplicate of black? -SILVER = 0B -WHITE = 0C -SKY_BLUE = 0D -LIGHT_BLUE = 0E -WHITE2 = 0F @ duplicate of white? +WHITE = 01 +DARK_GREY = 02 +LIGHT_GREY = 03 +RED = 04 +LIGHT_RED = 05 +GREEN = 06 +LIGHT_GREEN = 07 +BLUE = 08 +LIGHT_BLUE = 09 +BORDER_COLOR1 = 0A @ white +BORDER_COLOR2 = 0B @ white with a tinge of green +BORDER_COLOR3 = 0C @ white 2 +BORDER_COLOR4 = 0D @ aquamarine +BORDER_COLOR5 = 0E @ blue-green +BORDER_COLOR6 = 0F @ cerulean @ sound and music @@ -695,7 +689,14 @@ BGM_BATTLE30 = D2 01 UNK_CTRL_F800 = F8 00 UNK_CTRL_F801 = F8 01 UNK_CTRL_F80A = F8 0A +UNK_CTRL_F80C = F8 0C + +UNK_CTRL_F904 = F9 04 +UNK_CTRL_F905 = F9 05 UNK_CTRL_F907 = F9 07 +UNK_CTRL_F908 = F9 08 +UNK_CTRL_F9DD = F9 DD +UNK_CTRL_F9F9 = F9 F9 '\l' = FA @ scroll up window text '\p' = FB @ new paragraph diff --git a/data/berry_tag_screen.s b/data/berry_tag_screen.s index d507dfb98..89197d744 100644 --- a/data/berry_tag_screen.s +++ b/data/berry_tag_screen.s @@ -3,6 +3,7 @@ .section .rodata + .align 2 gUnknown_085EFCF0:: @ 85EFCF0 .incbin "baserom.gba", 0x5efcf0, 0x10 diff --git a/data/data2.s b/data/data2.s index 5cb381bca..45adfc678 100644 --- a/data/data2.s +++ b/data/data2.s @@ -21,7 +21,7 @@ gUnknown_082ECF20:: @ 82ECF20 gUnknown_082ECF40:: @ 82ECF40 .incbin "graphics/interface/link_test_digits.4bpp" - .string "{HIGHLIGHT TRANSPARENT}{COLOR DARK_GREY}$" + .string "{HIGHLIGHT TRANSPARENT}{COLOR WHITE}$" .align 2 gUnknown_082ED168:: @ 82ED168 @@ -40,10 +40,7 @@ gUnknown_082ED1A8:: @ 82ED1A8 .4byte 0x00000028 gUnknown_082ED1D0:: @ 82ED1D0 - .byte 0x8 - .byte 0xA - .byte 0xC - .byte 0xE + .byte 0x8, 0xA, 0xC, 0xE gUnknown_082ED1D4:: @ 82ED1D4 .ascii "GameFreak inc." diff --git a/data/strings.s b/data/strings.s index 5834ed643..2abac1437 100644 --- a/data/strings.s +++ b/data/strings.s @@ -46,1000 +46,885 @@ gExpandedPlaceholder_May:: @ 85E8260 .string "MAY$" gUnknown_085E8264:: @ 85E8264 - -.string "EGG$" + .string "EGG$" gUnknown_085E8268:: @ 85E8268 - -.string "POKéMON$" -.string "PROF. BIRCH$" + .string "POKéMON$" + .string "PROF. BIRCH$" gUnknown_085E827C:: @ 85E827C - -.string "NEW GAME$" + .string "NEW GAME$" gUnknown_085E8285:: @ 85E8285 - -.string "CONTINUE$" + .string "CONTINUE$" gUnknown_085E828E:: @ 85E828E - -.string "OPTION$" + .string "OPTION$" gUnknown_085E8295:: @ 85E8295 - -.string "MYSTERY GIFT$" + .string "MYSTERY GIFT$" gUnknown_085E82A2:: @ 85E82A2 - -.string "MYSTERY GIFT$" + .string "MYSTERY GIFT$" gUnknown_085E82AF:: @ 85E82AF - -.string "MYSTERY EVENTS$" + .string "MYSTERY EVENTS$" gUnknown_085E82BE:: @ 85E82BE - -.string "The Wireless Adapter is not\nconnected.$" + .string "The Wireless Adapter is not\nconnected.$" gUnknown_085E82E5:: @ 85E82E5 - -.string "MYSTERY GIFT can’t be used while\nthe Wireless Adapter is attached.$" + .string "MYSTERY GIFT can’t be used while\nthe Wireless Adapter is attached.$" gUnknown_085E8328:: @ 85E8328 - -.string "MYSTERY EVENTS can’t be used while\nthe Wireless Adapter is attached.$" -.string "Updating save file using external\ndata. Please wait.$" -.string "The save file has been updated.$" + .string "MYSTERY EVENTS can’t be used while\nthe Wireless Adapter is attached.$" + .string "Updating save file using external\ndata. Please wait.$" + .string "The save file has been updated.$" gUnknown_085E83C2:: @ 85E83C2 - -.string "The save file is corrupted. The\nprevious save file will be loaded.$" + .string "The save file is corrupted. The\nprevious save file will be loaded.$" gUnknown_085E8405:: @ 85E8405 - -.string "The save file has been erased\ndue to corruption or damage.$" + .string "The save file has been erased\ndue to corruption or damage.$" gUnknown_085E8440:: @ 85E8440 - -.string "1M%ブÊば+が ÎÎっÛÁまÓ+!$" + .string "1Mサブきばんが ささっていません!$" @ "1Msabukibanga sasatteimasen!" ("The 1M sub-circuit board is not installed!" in Japanese) gUnknown_085E8453:: @ 85E8453 - -.string "The internal battery has run dry.\nThe game can be played.\pHowever, clock-based events will\nno longer occur.$" -.string "PLAYER$" -.string "POKéDEX$" + .string "The internal battery has run dry.\nThe game can be played.\pHowever, clock-based events will\nno longer occur.$" + .string "PLAYER$" + .string "POKéDEX$" gUnknown_085E84CE:: @ 85E84CE - .incbin "baserom.gba", 0x5e84ce, 0x8e + .string "TIME$" + .string "BADGES$" + .string "A Button$" + .string "B Button$" + .string "R Button$" + .string "L Button$" + .string "START$" + .string "SELECT$" + .string "+ Control Pad$" + .string "L Button R Button$" + .string "CONTROLS$" + .align 2 + .string "{UNK_CTRL_F80A}PICK {UNK_CTRL_F800}OK$" + + .align 2 + .string "{UNK_CTRL_F800}NEXT$" + + .align 2 + .string "{UNK_CTRL_F800}NEXT {UNK_CTRL_F801}BACK$" + + .align 2 gUnknown_085E855C:: @ 85E855C - .incbin "baserom.gba", 0x5e855c, 0x18 + .string "{UNK_CTRL_F80A}PICK {UNK_CTRL_F800}NEXT {UNK_CTRL_F801}CANCEL$" + .align 2 gUnknown_085E8574:: @ 85E8574 - .incbin "baserom.gba", 0x5e8574, 0x14 + .string "{UNK_CTRL_F80A}PICK {UNK_CTRL_F800}{UNK_CTRL_F801}CANCEL$" + .align 2 gUnknown_085E8588:: @ 85E8588 - -.string "{248} EXIT$" -.string "BOY$" -.string "GIRL$" -.string "STU$" -.string "MILTON$" -.string "TOM$" -.string "KENNY$" -.string "REID$" -.string "JUDE$" -.string "JAXSON$" -.string "EASTON$" -.string "WALKER$" -.string "TERU$" -.string "JOHNNY$" -.string "BRETT$" -.string "SETH$" -.string "TERRY$" -.string "CASEY$" -.string "DARREN$" -.string "LANDON$" -.string "COLLIN$" -.string "STANLEY$" -.string "QUINCY$" -.string "KIMMY$" -.string "TIARA$" -.string "BELLA$" -.string "JAYLA$" -.string "ALLIE$" -.string "LIANNA$" -.string "SARA$" -.string "MONICA$" -.string "CAMILA$" -.string "AUBREE$" -.string "RUTHIE$" -.string "HAZEL$" -.string "NADINE$" -.string "TANJA$" -.string "YASMIN$" -.string "NICOLA$" -.string "LILLIE$" -.string "TERRA$" -.string "LUCY$" -.string "HALIE$" + .string "{UNK_CTRL_F800}EXIT$" + .string "BOY$" + .string "GIRL$" + .string "STU$" + .string "MILTON$" + .string "TOM$" + .string "KENNY$" + .string "REID$" + .string "JUDE$" + .string "JAXSON$" + .string "EASTON$" + .string "WALKER$" + .string "TERU$" + .string "JOHNNY$" + .string "BRETT$" + .string "SETH$" + .string "TERRY$" + .string "CASEY$" + .string "DARREN$" + .string "LANDON$" + .string "COLLIN$" + .string "STANLEY$" + .string "QUINCY$" + .string "KIMMY$" + .string "TIARA$" + .string "BELLA$" + .string "JAYLA$" + .string "ALLIE$" + .string "LIANNA$" + .string "SARA$" + .string "MONICA$" + .string "CAMILA$" + .string "AUBREE$" + .string "RUTHIE$" + .string "HAZEL$" + .string "NADINE$" + .string "TANJA$" + .string "YASMIN$" + .string "NICOLA$" + .string "LILLIE$" + .string "TERRA$" + .string "LUCY$" + .string "HALIE$" gUnknown_085E8692:: @ 85E8692 - -.string "This is what we call a “POKéMON.”{PAUSE 96}\p$" + .string "This is what we call a “POKéMON.”{PAUSE 96}\p$" gUnknown_085E86B8:: @ 85E86B8 - -.string "????? POKéMON$" + .string "????? POKéMON$" gUnknown_085E86C6:: @ 85E86C6 - -.string "{CLEAR_TO}Ï??’??”$" + .string "{CLEAR_TO 0x0C}??’??”$" gUnknown_085E86D0:: @ 85E86D0 - -.string "????.? lbs.$" -.string " POKéMON$" -.string "{CLEAR_TO}Ï ’ ”$" -.string " . lbs.$" -.string "$" + .string "????.? lbs.$" + .string " POKéMON$" + .string "{CLEAR_TO 0x0C} ’ ”$" + .string " . lbs.$" + .string "$" gUnknown_085E871B:: @ 85E871B - -.string "CRY OF$" -.string "$" + .string "CRY OF$" + .string "$" gUnknown_085E8723:: @ 85E8723 - -.string "SIZE COMPARED TO $" + .string "SIZE COMPARED TO $" gUnknown_085E8735:: @ 85E8735 - -.string "POKéDEX registration completed.$" + .string "POKéDEX registration completed.$" gUnknown_085E8755:: @ 85E8755 - -.string "HT$" + .string "HT$" gUnknown_085E8758:: @ 85E8758 - -.string "WT$" + .string "WT$" gUnknown_085E875B:: @ 85E875B - -.string "Searching…\nPlease wait.$" + .string "Searching…\nPlease wait.$" gUnknown_085E8773:: @ 85E8773 - -.string "Search completed.$" + .string "Search completed.$" gUnknown_085E8785:: @ 85E8785 - -.string "No matching POKéMON were found.$" -.string "Search for POKéMON based on\nselected parameters.$" -.string "Switch POKéDEX listings.$" -.string "Return to the POKéDEX.$" -.string "Select the POKéDEX mode.$" -.string "Select the POKéDEX listing mode.$" -.string "List by the first letter in the name.\nSpotted POKéMON only.$" -.string "List by body color.\nSpotted POKéMON only.$" -.string "List by type.\nOwned POKéMON only.$" -.string "Execute search/switch.$" -.string "HOENN DEX$" -.string "NATIONAL DEX$" -.string "NUMERICAL MODE$" -.string "A TO Z MODE$" -.string "HEAVIEST MODE$" -.string "LIGHTEST MODE$" -.string "TALLEST MODE$" -.string "SMALLEST MODE$" -.string "ABC$" -.string "DEF$" -.string "GHI$" -.string "JKL$" -.string "MNO$" -.string "PQR$" -.string "STU$" -.string "VWX$" -.string "YZ$" -.string "RED$" -.string "BLUE$" -.string "YELLOW$" -.string "GREEN$" -.string "BLACK$" -.string "BROWN$" -.string "PURPLE$" -.string "GRAY$" -.string "WHITE$" -.string "PINK$" -.string "HOENN region’s POKéDEX$" -.string "National edition POKéDEX$" -.string "POKéMON are listed according to their\nnumber.$" -.string "Spotted and owned POKéMON are listed\nalphabetically.$" -.string "Owned POKéMON are listed from the\nheaviest to the lightest.$" -.string "Owned POKéMON are listed from the\nlightest to the heaviest.$" -.string "Owned POKéMON are listed from the\ntallest to the smallest.$" -.string "Owned POKéMON are listed from the\nsmallest to the tallest.$" -.string "$" -.string "DON’T SPECIFY.$" -.string "NONE$" + .string "No matching POKéMON were found.$" + .string "Search for POKéMON based on\nselected parameters.$" + .string "Switch POKéDEX listings.$" + .string "Return to the POKéDEX.$" + .string "Select the POKéDEX mode.$" + .string "Select the POKéDEX listing mode.$" + .string "List by the first letter in the name.\nSpotted POKéMON only.$" + .string "List by body color.\nSpotted POKéMON only.$" + .string "List by type.\nOwned POKéMON only.$" + .string "Execute search/switch.$" + .string "HOENN DEX$" + .string "NATIONAL DEX$" + .string "NUMERICAL MODE$" + .string "A TO Z MODE$" + .string "HEAVIEST MODE$" + .string "LIGHTEST MODE$" + .string "TALLEST MODE$" + .string "SMALLEST MODE$" + .string "ABC$" + .string "DEF$" + .string "GHI$" + .string "JKL$" + .string "MNO$" + .string "PQR$" + .string "STU$" + .string "VWX$" + .string "YZ$" + .string "RED$" + .string "BLUE$" + .string "YELLOW$" + .string "GREEN$" + .string "BLACK$" + .string "BROWN$" + .string "PURPLE$" + .string "GRAY$" + .string "WHITE$" + .string "PINK$" + .string "HOENN region’s POKéDEX$" + .string "National edition POKéDEX$" + .string "POKéMON are listed according to their\nnumber.$" + .string "Spotted and owned POKéMON are listed\nalphabetically.$" + .string "Owned POKéMON are listed from the\nheaviest to the lightest.$" + .string "Owned POKéMON are listed from the\nlightest to the heaviest.$" + .string "Owned POKéMON are listed from the\ntallest to the smallest.$" + .string "Owned POKéMON are listed from the\nsmallest to the tallest.$" + .string "$" + .string "DON’T SPECIFY.$" + .string "NONE$" gUnknown_085E8B3A:: @ 85E8B3A - -.string "▶$" -.string " $" + .string "▶$" + .string " $" gUnknown_085E8B3E:: @ 85E8B3E - -.string "Welcome to the HALL OF FAME!$" -.string "Spotted POKéMON: {STR_VAR_1}!\nOwned POKéMON: {STR_VAR_2}!\pPROF. BIRCH’s POKéDEX rating!\pPROF. BIRCH: Let’s see…\p$" -.string "SAVING…\nDON’T TURN OFF THE POWER.$" + .string "Welcome to the HALL OF FAME!$" + .string "Spotted POKéMON: {STR_VAR_1}!\nOwned POKéMON: {STR_VAR_2}!\pPROF. BIRCH’s POKéDEX rating!\pPROF. BIRCH: Let’s see…\p$" + .string "SAVING…\nDON’T TURN OFF THE POWER.$" gUnknown_085E8BDC:: @ 85E8BDC - -.string "The HALL OF FAME data is corrupted.$" + .string "The HALL OF FAME data is corrupted.$" gUnknown_085E8C00:: @ 85E8C00 - -.string "HALL OF FAME No. {STR_VAR_1}$" + .string "HALL OF FAME No. {STR_VAR_1}$" gUnknown_085E8C14:: @ 85E8C14 - -.string "LEAGUE CHAMPION!\nCONGRATULATIONS!$" + .string "LEAGUE CHAMPION!\nCONGRATULATIONS!$" gUnknown_085E8C36:: @ 85E8C36 - -.string "No. $" + .string "No. $" gUnknown_085E8C3B:: @ 85E8C3B - -.string "Lv. $" -.string "IDNo. /$" + .string "Lv. $" + .string "IDNo. /$" gUnknown_085E8C48:: @ 85E8C48 - -.string "NAME$" + .string "NAME$" gUnknown_085E8C4D:: @ 85E8C4D - -.string "IDNo.$" + .string "IDNo.$" gUnknown_085E8C53:: @ 85E8C53 - -.string "PROF. BIRCH is in trouble!\nRelease a POKéMON and rescue him!$" + .string "PROF. BIRCH is in trouble!\nRelease a POKéMON and rescue him!$" gUnknown_085E8C90:: @ 85E8C90 - -.string "Do you choose this POKéMON?$" -.string "POKéMON$" + .string "Do you choose this POKéMON?$" + .string "POKéMON$" gUnknown_085E8CB4:: @ 85E8CB4 - -.string "FLY to where?$" -.string "USE$" -.string "TOSS$" -.string "REGISTER$" -.string "GIVE$" -.string "CHECK TAG$" + .string "FLY to where?$" + .string "USE$" + .string "TOSS$" + .string "REGISTER$" + .string "GIVE$" + .string "CHECK TAG$" gUnknown_085E8CE3:: @ 85E8CE3 - -.string "CONFIRM$" -.string "WALK$" + .string "CONFIRM$" + .string "WALK$" gUnknown_085E8CF0:: @ 85E8CF0 - -.string "CANCEL$" + .string "CANCEL$" gUnknown_085E8CF7:: @ 85E8CF7 - -.string "CANCEL$" -.string "SHOW$" + .string "CANCEL$" + .string "SHOW$" gUnknown_085E8D03:: @ 85E8D03 - -.string "$" -.string "CANCEL$" -.string "ITEM$" -.string "MAIL$" -.string "TAKE$" -.string "STORE$" -.string "CHECK$" + .string "$" + .string "CANCEL$" + .string "ITEM$" + .string "MAIL$" + .string "TAKE$" + .string "STORE$" + .string "CHECK$" gUnknown_085E8D26:: @ 85E8D26 - -.string "NONE$" -.string "DESELECT$" + .string "NONE$" + .string "DESELECT$" gUnknown_085E8D34:: @ 85E8D34 - -.string "???$" + .string "???$" gUnknown_085E8D38:: @ 85E8D38 - -.string "?????$" + .string "?????$" gUnknown_085E8D3E:: @ 85E8D3E - -.string "/$" + .string "/$" gUnknown_085E8D40:: @ 85E8D40 - -.string "-$" + .string "-$" gUnknown_085E8D42:: @ 85E8D42 - -.string "--$" + .string "--$" gUnknown_085E8D45:: @ 85E8D45 - -.string "---$" + .string "---$" gUnknown_085E8D49:: @ 85E8D49 - -.string "♂$" + .string "♂$" gUnknown_085E8D4B:: @ 85E8D4B - -.string "♀$" + .string "♀$" gUnknown_085E8D4D:: @ 85E8D4D - -.string "{LV}$" + .string "{LV}$" gUnknown_085E8D4F:: @ 85E8D4F - -.string "{249 8}{CLEAR}À$" -.string "+$" -.string "{RIGHT_ARROW}$" + .string "{UNK_CTRL_F908}{CLEAR 0x01}$" + .string "+$" + .string "{RIGHT_ARROW}$" gUnknown_085E8D59:: @ 85E8D59 - -.string "{249 7}{249 8}$" + .string "{UNK_CTRL_F907}{UNK_CTRL_F908}$" gUnknown_085E8D5E:: @ 85E8D5E - -.string " $" + .string " $" gUnknown_085E8D60:: @ 85E8D60 - -.string "▶$" + .string "▶$" gUnknown_085E8D62:: @ 85E8D62 - -.string "Go back to the\nprevious menu.$" + .string "Go back to the\nprevious menu.$" gUnknown_085E8D80:: @ 85E8D80 - -.string "What would you like to do?$" -.string "GIVE$" + .string "What would you like to do?$" + .string "GIVE$" gUnknown_085E8DA0:: @ 85E8DA0 - -.string "×{STR_VAR_1}$" -.string " BERRY$" + .string "×{STR_VAR_1}$" + .string " BERRY$" gOtherText_Coins2:: @ 85E8DAB - -.string "{STR_VAR_1} COINS$" + .string "{STR_VAR_1} COINS$" gUnknown_085E8DB4:: @ 85E8DB4 - -.string "CLOSE BAG$" + .string "CLOSE BAG$" gUnknown_085E8DBE:: @ 85E8DBE - -.string "{STR_VAR_1} is\nselected.$" + .string "{STR_VAR_1} is\nselected.$" gUnknown_085E8DCE:: @ 85E8DCE - -.string "You can’t write\nMAIL here.$" + .string "You can’t write\nMAIL here.$" gUnknown_085E8DE9:: @ 85E8DE9 - -.string "There is no\nPOKéMON.$" + .string "There is no\nPOKéMON.$" gUnknown_085E8DFE:: @ 85E8DFE - -.string "Move the\n{STR_VAR_1}\nwhere?$" + .string "Move the\n{STR_VAR_1}\nwhere?$" gUnknown_085E8E11:: @ 85E8E11 - -.string "The {STR_VAR_1} can’t be held.$" + .string "The {STR_VAR_1} can’t be held.$" gUnknown_085E8E27:: @ 85E8E27 - -.string "The {STR_VAR_1} can’t be held\nhere.$" + .string "The {STR_VAR_1} can’t be held\nhere.$" gUnknown_085E8E42:: @ 85E8E42 - -.string "Deposit how many\n{STR_VAR_1}(s)?$" + .string "Deposit how many\n{STR_VAR_1}(s)?$" gUnknown_085E8E5A:: @ 85E8E5A - -.string "Deposited {STR_VAR_2}\n{STR_VAR_1}(s).$" + .string "Deposited {STR_VAR_2}\n{STR_VAR_1}(s).$" gUnknown_085E8E6E:: @ 85E8E6E - -.string "There’s no room to\nstore items.$" + .string "There’s no room to\nstore items.$" gUnknown_085E8E8E:: @ 85E8E8E - -.string "Important items\ncan’t be stored in\nthe PC!$" + .string "Important items\ncan’t be stored in\nthe PC!$" gUnknown_085E8EB9:: @ 85E8EB9 - -.string "That’s much too\nimportant to toss\nout!$" + .string "That’s much too\nimportant to toss\nout!$" gUnknown_085E8EE0:: @ 85E8EE0 - -.string "Toss out how many\n{STR_VAR_1}(s)?$" + .string "Toss out how many\n{STR_VAR_1}(s)?$" gUnknown_085E8EF9:: @ 85E8EF9 - -.string "Threw away {STR_VAR_2}\n{STR_VAR_1}(s).$" + .string "Threw away {STR_VAR_2}\n{STR_VAR_1}(s).$" gUnknown_085E8F0E:: @ 85E8F0E - -.string "Is it okay to\nthrow away {STR_VAR_2}\n{STR_VAR_1}(s)?$" + .string "Is it okay to\nthrow away {STR_VAR_2}\n{STR_VAR_1}(s)?$" gUnknown_085E8F31:: @ 85E8F31 - -.string "DAD’s advice…\n{PLAYER}, there’s a time and place for\leverything!{PAUSE_UNTIL_PRESS}$" + .string "DAD’s advice…\n{PLAYER}, there’s a time and place for\leverything!{PAUSE_UNTIL_PRESS}$" gUnknown_085E8F6E:: @ 85E8F6E - -.string "You can’t dismount your BIKE here.{PAUSE_UNTIL_PRESS}$" + .string "You can’t dismount your BIKE here.{PAUSE_UNTIL_PRESS}$" gUnknown_085E8F93:: @ 85E8F93 - -.string "Huh?\nThe ITEMFINDER’s responding!\pThere’s an item buried around here!{PAUSE_UNTIL_PRESS}$" + .string "Huh?\nThe ITEMFINDER’s responding!\pThere’s an item buried around here!{PAUSE_UNTIL_PRESS}$" gUnknown_085E8FDB:: @ 85E8FDB - -.string "Oh!\nThe ITEMFINDER’s shaking wildly!{PAUSE_UNTIL_PRESS}$" + .string "Oh!\nThe ITEMFINDER’s shaking wildly!{PAUSE_UNTIL_PRESS}$" gUnknown_085E9002:: @ 85E9002 - -.string "… … … …Nope!\nThere’s no response.{PAUSE_UNTIL_PRESS}$" + .string "… … … …Nope!\nThere’s no response.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9026:: @ 85E9026 - -.string "Your COINS:\n{STR_VAR_1}{PAUSE_UNTIL_PRESS}$" + .string "Your COINS:\n{STR_VAR_1}{PAUSE_UNTIL_PRESS}$" gUnknown_085E9037:: @ 85E9037 - -.string "Booted up a TM.$" + .string "Booted up a TM.$" gUnknown_085E9047:: @ 85E9047 - -.string "Booted up an HM.$" + .string "Booted up an HM.$" gUnknown_085E9058:: @ 85E9058 - -.string "It contained\n{STR_VAR_1}.\pTeach {STR_VAR_1}\nto a POKéMON?$" + .string "It contained\n{STR_VAR_1}.\pTeach {STR_VAR_1}\nto a POKéMON?$" gUnknown_085E9080:: @ 85E9080 - -.string "{PLAYER} used the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}$" + .string "{PLAYER} used the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9092:: @ 85E9092 - -.string "But the effects of a REPEL\nlingered from earlier.{PAUSE_UNTIL_PRESS}$" + .string "But the effects of a REPEL\nlingered from earlier.{PAUSE_UNTIL_PRESS}$" gUnknown_085E90C6:: @ 85E90C6 - -.string "{PLAYER} used the\n{STR_VAR_2}.\pWild POKéMON will be lured.{PAUSE_UNTIL_PRESS}$" + .string "{PLAYER} used the\n{STR_VAR_2}.\pWild POKéMON will be lured.{PAUSE_UNTIL_PRESS}$" gUnknown_085E90F4:: @ 85E90F4 - -.string "{PLAYER} used the\n{STR_VAR_2}.\pWild POKéMON will be repelled.{PAUSE_UNTIL_PRESS}$" + .string "{PLAYER} used the\n{STR_VAR_2}.\pWild POKéMON will be repelled.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9125:: @ 85E9125 - -.string "The BOX is full.{PAUSE_UNTIL_PRESS}$" + .string "The BOX is full.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9138:: @ 85E9138 - .incbin "baserom.gba", 0x5e9138, 0x48 + .string "POWDER QTY: {STR_VAR_1}{PAUSE_UNTIL_PRESS}$" +gUnknown_085E9149:: @ 85E9149 + .string "the field$" + +gUnknown_085E9153:: @ 85E9153 + .string "the battle$" + +gUnknown_085E915E:: @ 85E915E + .string "the POKéMON LIST$" + +gUnknown_085E916F:: @ 85E916F + .string "the shop$" + +gUnknown_085E9178:: @ 85E9178 + .string "the PC$" + + .align 2 gUnknown_085E9180:: @ 85E9180 - .incbin "baserom.gba", 0x5e9180, 0x30 + .4byte gUnknown_085E9149 + .4byte gUnknown_085E9153 + .4byte gUnknown_085E915E + .4byte gUnknown_085E916F + .4byte gUnknown_085E9149 + .4byte gUnknown_085E9149 + .4byte gUnknown_085E9178 + .4byte gUnknown_085E9149 + .4byte gUnknown_085E9149 + .4byte gUnknown_085E9149 + .4byte gUnknown_085E9153 + .4byte gUnknown_085E9178 + .align 2 gUnknown_085E91B0:: @ 85E91B0 - .incbin "baserom.gba", 0x5e91b0, 0x10 + .4byte gUnknown_085E9149 + .4byte gUnknown_085E9153 + .4byte gUnknown_085E915E + .4byte gUnknown_085E9149 + .align 2 gUnknown_085E91C0:: @ 85E91C0 - .incbin "baserom.gba", 0x5e91c0, 0x3c + .string "Return to\n{STR_VAR_1}.$" +gUnknown_085E91CE:: @ 85E91CE + .string "ITEMS$" + +gUnknown_085E91D4:: @ 85E91D4 + .string "POKé BALLS$" + +gUnknown_085E91DF:: @ 85E91DF + .string "TMs & HMs$" + +gUnknown_085E91E9:: @ 85E91E9 + .string "BERRIES$" + +gUnknown_085E91F1:: @ 85E91F1 + .string "KEY ITEMS$" + + .align 2 gUnknown_085E91FC:: @ 85E91FC - .incbin "baserom.gba", 0x5e91fc, 0x14 + .4byte gUnknown_085E91CE + .4byte gUnknown_085E91D4 + .4byte gUnknown_085E91DF + .4byte gUnknown_085E91E9 + .4byte gUnknown_085E91F1 + .align 2 gUnknown_085E9210:: @ 85E9210 - -.string "{249 8}{STR_VAR_1}{CLEAR}Ê{STR_VAR_2}$" + .string "{UNK_CTRL_F908}{STR_VAR_1}{CLEAR 0x07}{STR_VAR_2}$" gUnknown_085E921A:: @ 85E921A - -.string "{CLEAR_TO}Ù{STR_VAR_1}{CLEAR}È{STR_VAR_2}$" + .string "{CLEAR_TO 0x11}{STR_VAR_1}{CLEAR 0x05}{STR_VAR_2}$" gUnknown_085E9225:: @ 85E9225 - -.string "SIZE /$" + .string "SIZE /$" gUnknown_085E922C:: @ 85E922C - -.string "FIRM /$" + .string "FIRM /$" gUnknown_085E9233:: @ 85E9233 - -.string "{STR_VAR_1}.{STR_VAR_2}”$" + .string "{STR_VAR_1}.{STR_VAR_2}”$" .include "data/text/berry_firmness_strings.inc" gUnknown_085E9263:: @ 85E9263 - -.string "{249 8}{STR_VAR_1} {STR_VAR_2}$" + .string "{UNK_CTRL_F908}{STR_VAR_1} {STR_VAR_2}$" gUnknown_085E926B:: @ 85E926B - -.string "BERRY TAG$" -.string "RED {POKEBLOCK}$" -.string "BLUE {POKEBLOCK}$" -.string "PINK {POKEBLOCK}$" -.string "GREEN {POKEBLOCK}$" -.string "YELLOW {POKEBLOCK}$" -.string "PURPLE {POKEBLOCK}$" -.string "INDIGO {POKEBLOCK}$" -.string "BROWN {POKEBLOCK}$" -.string "LITEBLUE {POKEBLOCK}$" -.string "OLIVE {POKEBLOCK}$" -.string "GRAY {POKEBLOCK}$" -.string "BLACK {POKEBLOCK}$" -.string "WHITE {POKEBLOCK}$" -.string "GOLD {POKEBLOCK}$" + .string "BERRY TAG$" + .string "RED {POKEBLOCK}$" + .string "BLUE {POKEBLOCK}$" + .string "PINK {POKEBLOCK}$" + .string "GREEN {POKEBLOCK}$" + .string "YELLOW {POKEBLOCK}$" + .string "PURPLE {POKEBLOCK}$" + .string "INDIGO {POKEBLOCK}$" + .string "BROWN {POKEBLOCK}$" + .string "LITEBLUE {POKEBLOCK}$" + .string "OLIVE {POKEBLOCK}$" + .string "GRAY {POKEBLOCK}$" + .string "BLACK {POKEBLOCK}$" + .string "WHITE {POKEBLOCK}$" + .string "GOLD {POKEBLOCK}$" gUnknown_085E931D:: @ 85E931D - -.string "SPICY$" + .string "SPICY$" gUnknown_085E9323:: @ 85E9323 - -.string "DRY$" + .string "DRY$" gUnknown_085E9327:: @ 85E9327 - -.string "SWEET$" + .string "SWEET$" gUnknown_085E932D:: @ 85E932D - -.string "BITTER$" + .string "BITTER$" gUnknown_085E9334:: @ 85E9334 - -.string "SOUR$" -.string "TASTY$" -.string "FEEL$" + .string "SOUR$" + .string "TASTY$" + .string "FEEL$" gUnknown_085E9344:: @ 85E9344 - -.string "Stow CASE.$" + .string "Stow CASE.$" gUnknown_085E934F:: @ 85E934F - -.string "{LV}{STR_VAR_1}$" + .string "{LV}{STR_VAR_1}$" gUnknown_085E9353:: @ 85E9353 - -.string "Throw away this\n{STR_VAR_1}?$" + .string "Throw away this\n{STR_VAR_1}?$" gUnknown_085E9367:: @ 85E9367 - -.string "The {STR_VAR_1}\nwas thrown away.$" + .string "The {STR_VAR_1}\nwas thrown away.$" gUnknown_085E937F:: @ 85E937F - -.string "{STR_VAR_1} ate the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}$" + .string "{STR_VAR_1} ate the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9390:: @ 85E9390 - -.string "{STR_VAR_1} happily ate the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}$" + .string "{STR_VAR_1} happily ate the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}$" gUnknown_085E93A9:: @ 85E93A9 - -.string "{STR_VAR_1} disdainfully ate the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}$" -.string "BUY$" -.string "SELL$" -.string "QUIT$" + .string "{STR_VAR_1} disdainfully ate the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}$" + .string "BUY$" + .string "SELL$" + .string "QUIT$" gUnknown_085E93D5:: @ 85E93D5 - -.string "IN BAG: {STR_VAR_1}$" + .string "IN BAG: {STR_VAR_1}$" gUnknown_085E93E0:: @ 85E93E0 - -.string "Quit shopping.$" + .string "Quit shopping.$" gUnknown_085E93EF:: @ 85E93EF - -.string "{STR_VAR_1}? Certainly.\nHow many would you like?$" + .string "{STR_VAR_1}? Certainly.\nHow many would you like?$" gUnknown_085E9417:: @ 85E9417 - -.string "{STR_VAR_1}? Certainly.\nHow many would you like?$" + .string "{STR_VAR_1}? Certainly.\nHow many would you like?$" gUnknown_085E943F:: @ 85E943F - -.string "{STR_VAR_1}? And you wanted {STR_VAR_2}?\nThat will be ¥{STR_VAR_3}.$" + .string "{STR_VAR_1}? And you wanted {STR_VAR_2}?\nThat will be ¥{STR_VAR_3}.$" gUnknown_085E9468:: @ 85E9468 - -.string "{STR_VAR_1}, is it?\nThat’ll be ¥{STR_VAR_2}. Do you want it?$" + .string "{STR_VAR_1}, is it?\nThat’ll be ¥{STR_VAR_2}. Do you want it?$" gUnknown_085E9493:: @ 85E9493 - -.string "You wanted {STR_VAR_1}?\nThat’ll be ¥{STR_VAR_2}. Will that be okay?$" + .string "You wanted {STR_VAR_1}?\nThat’ll be ¥{STR_VAR_2}. Will that be okay?$" gUnknown_085E94C5:: @ 85E94C5 - -.string "Here you go!\nThank you very much.$" + .string "Here you go!\nThank you very much.$" gUnknown_085E94E7:: @ 85E94E7 - -.string "Thank you!\nI’ll send it to your home PC.$" + .string "Thank you!\nI’ll send it to your home PC.$" gUnknown_085E9510:: @ 85E9510 - -.string "Thanks!\nI’ll send it to your PC at home.$" + .string "Thanks!\nI’ll send it to your PC at home.$" gUnknown_085E9539:: @ 85E9539 - -.string "You don’t have enough money.{PAUSE_UNTIL_PRESS}$" + .string "You don’t have enough money.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9558:: @ 85E9558 - -.string "You have no more room for this\nitem.{PAUSE_UNTIL_PRESS}$" + .string "You have no more room for this\nitem.{PAUSE_UNTIL_PRESS}$" gUnknown_085E957F:: @ 85E957F - -.string "The space for {STR_VAR_1} is full.{PAUSE_UNTIL_PRESS}$" + .string "The space for {STR_VAR_1} is full.{PAUSE_UNTIL_PRESS}$" gUnknown_085E959B:: @ 85E959B - -.string "Is there anything else I can help\nyou with?$" + .string "Is there anything else I can help\nyou with?$" gUnknown_085E95C7:: @ 85E95C7 - -.string "Can I help you with anything else?$" + .string "Can I help you with anything else?$" gUnknown_085E95EA:: @ 85E95EA - -.string "I’ll throw in a PREMIER BALL, too.{PAUSE_UNTIL_PRESS}$" + .string "I’ll throw in a PREMIER BALL, too.{PAUSE_UNTIL_PRESS}$" gUnknown_085E960F:: @ 85E960F - -.string "{STR_VAR_2}? Oh, no.\nI can’t buy that.{PAUSE_UNTIL_PRESS}$" + .string "{STR_VAR_2}? Oh, no.\nI can’t buy that.{PAUSE_UNTIL_PRESS}$" gUnknown_085E962F:: @ 85E962F - -.string "{STR_VAR_2}?\nHow many would you like to sell?$" + .string "{STR_VAR_2}?\nHow many would you like to sell?$" gUnknown_085E9654:: @ 85E9654 - -.string "I can pay ¥{STR_VAR_1}.\nWould that be okay?$" + .string "I can pay ¥{STR_VAR_1}.\nWould that be okay?$" gUnknown_085E9677:: @ 85E9677 - -.string "Turned over the {STR_VAR_2}\nand received ¥{STR_VAR_1}.$" + .string "Turned over the {STR_VAR_2}\nand received ¥{STR_VAR_1}.$" gUnknown_085E969C:: @ 85E969C - -.string "¥{STR_VAR_1}$" -.string "SHIFT$" -.string "SEND OUT$" -.string "SWITCH$" -.string "SUMMARY$" -.string "MOVES$" -.string "ENTER$" -.string "NO ENTRY$" -.string "TAKE$" -.string "READ$" -.string "TRADE$" + .string "¥{STR_VAR_1}$" + .string "SHIFT$" + .string "SEND OUT$" + .string "SWITCH$" + .string "SUMMARY$" + .string "MOVES$" + .string "ENTER$" + .string "NO ENTRY$" + .string "TAKE$" + .string "READ$" + .string "TRADE$" gUnknown_085E96E3:: @ 85E96E3 - -.string "HP$" + .string "HP$" gUnknown_085E96E6:: @ 85E96E6 - -.string "SP. ATK$" + .string "SP. ATK$" gUnknown_085E96EE:: @ 85E96EE - -.string "SP. DEF$" + .string "SP. DEF$" gUnknown_085E96F6:: @ 85E96F6 - -.string "It won’t have any effect.{PAUSE_UNTIL_PRESS}$" + .string "It won’t have any effect.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9712:: @ 85E9712 - -.string "This can’t be used on\nthat POKéMON.{PAUSE_UNTIL_PRESS}$" + .string "This can’t be used on\nthat POKéMON.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9738:: @ 85E9738 - -.string "{STR_VAR_1} can’t be switched\nout!{PAUSE_UNTIL_PRESS}$" + .string "{STR_VAR_1} can’t be switched\nout!{PAUSE_UNTIL_PRESS}$" gUnknown_085E9754:: @ 85E9754 - -.string "{STR_VAR_1} is already\nin battle!{PAUSE_UNTIL_PRESS}$" + .string "{STR_VAR_1} is already\nin battle!{PAUSE_UNTIL_PRESS}$" gUnknown_085E976F:: @ 85E976F - -.string "{STR_VAR_1} has already been\nselected.{PAUSE_UNTIL_PRESS}$" + .string "{STR_VAR_1} has already been\nselected.{PAUSE_UNTIL_PRESS}$" gUnknown_085E978F:: @ 85E978F - -.string "{STR_VAR_1} has no energy\nleft to battle!{PAUSE_UNTIL_PRESS}$" + .string "{STR_VAR_1} has no energy\nleft to battle!{PAUSE_UNTIL_PRESS}$" gUnknown_085E97B2:: @ 85E97B2 - -.string "You can’t switch {STR_VAR_1}’s\nPOKéMON with one of yours!{PAUSE_UNTIL_PRESS}$" + .string "You can’t switch {STR_VAR_1}’s\nPOKéMON with one of yours!{PAUSE_UNTIL_PRESS}$" gUnknown_085E97E5:: @ 85E97E5 - -.string "An EGG can’t battle!{PAUSE_UNTIL_PRESS}$" + .string "An EGG can’t battle!{PAUSE_UNTIL_PRESS}$" gUnknown_085E97FC:: @ 85E97FC - -.string "This can’t be used until a new\nBADGE is obtained.{PAUSE_UNTIL_PRESS}$" + .string "This can’t be used until a new\nBADGE is obtained.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9830:: @ 85E9830 - -.string "No more than {STR_VAR_1} POKéMON\nmay enter.{PAUSE_UNTIL_PRESS}$" + .string "No more than {STR_VAR_1} POKéMON\nmay enter.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9855:: @ 85E9855 - -.string "Send the removed MAIL to\nyour PC?$" + .string "Send the removed MAIL to\nyour PC?$" gUnknown_085E9877:: @ 85E9877 - -.string "The MAIL was sent to your PC.{PAUSE_UNTIL_PRESS}$" + .string "The MAIL was sent to your PC.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9897:: @ 85E9897 - -.string "Your PC’s MAILBOX is full.{PAUSE_UNTIL_PRESS}$" + .string "Your PC’s MAILBOX is full.{PAUSE_UNTIL_PRESS}$" gUnknown_085E98B4:: @ 85E98B4 - -.string "If the MAIL is removed, the\nmessage will be lost. Okay?$" + .string "If the MAIL is removed, the\nmessage will be lost. Okay?$" gUnknown_085E98EC:: @ 85E98EC - -.string "MAIL must be removed before\nholding an item.{PAUSE_UNTIL_PRESS}$" + .string "MAIL must be removed before\nholding an item.{PAUSE_UNTIL_PRESS}$" gUnknown_085E991B:: @ 85E991B - -.string "{STR_VAR_1} was given the\n{STR_VAR_2} to hold.{PAUSE_UNTIL_PRESS}$" + .string "{STR_VAR_1} was given the\n{STR_VAR_2} to hold.{PAUSE_UNTIL_PRESS}$" gUnknown_085E993A:: @ 85E993A - -.string "{STR_VAR_1} is already holding\none {STR_VAR_2}.\pWould you like to switch the\ntwo items?$" + .string "{STR_VAR_1} is already holding\none {STR_VAR_2}.\pWould you like to switch the\ntwo items?$" gUnknown_085E9980:: @ 85E9980 - -.string "{STR_VAR_1} isn’t holding\nanything.{PAUSE_UNTIL_PRESS}$" + .string "{STR_VAR_1} isn’t holding\nanything.{PAUSE_UNTIL_PRESS}$" gUnknown_085E999D:: @ 85E999D - -.string "Received the {STR_VAR_2}\nfrom {STR_VAR_1}.{PAUSE_UNTIL_PRESS}$" + .string "Received the {STR_VAR_2}\nfrom {STR_VAR_1}.{PAUSE_UNTIL_PRESS}$" gUnknown_085E99B8:: @ 85E99B8 - -.string "MAIL was taken from the\nPOKéMON.{PAUSE_UNTIL_PRESS}$" + .string "MAIL was taken from the\nPOKéMON.{PAUSE_UNTIL_PRESS}$" gUnknown_085E99DB:: @ 85E99DB - -.string "The {STR_VAR_2} was taken and\nreplaced with the {STR_VAR_1}.{PAUSE_UNTIL_PRESS}$" + .string "The {STR_VAR_2} was taken and\nreplaced with the {STR_VAR_1}.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9A08:: @ 85E9A08 - -.string "This POKéMON is holding an\nitem. It cannot hold MAIL.{PAUSE_UNTIL_PRESS}$" + .string "This POKéMON is holding an\nitem. It cannot hold MAIL.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9A40:: @ 85E9A40 - -.string "MAIL was transferred from\nthe MAILBOX.{PAUSE_UNTIL_PRESS}$" + .string "MAIL was transferred from\nthe MAILBOX.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9A69:: @ 85E9A69 - -.string "The BAG is full. The POKéMON’s\nitem could not be removed.{PAUSE_UNTIL_PRESS}$" + .string "The BAG is full. The POKéMON’s\nitem could not be removed.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9AA5:: @ 85E9AA5 - -.string "{STR_VAR_1} learned\n{STR_VAR_2}!$" + .string "{STR_VAR_1} learned\n{STR_VAR_2}!$" gUnknown_085E9AB4:: @ 85E9AB4 - -.string "{STR_VAR_1} and {STR_VAR_2}\nare not compatible.\p{STR_VAR_2} can’t be\nlearned.{PAUSE_UNTIL_PRESS}$" + .string "{STR_VAR_1} and {STR_VAR_2}\nare not compatible.\p{STR_VAR_2} can’t be\nlearned.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9AE9:: @ 85E9AE9 - -.string "{STR_VAR_1} wants to learn the\nmove {STR_VAR_2}.\pHowever, {STR_VAR_1} already\nknows four moves.\pShould a move be deleted and\nreplaced with {STR_VAR_2}?$" + .string "{STR_VAR_1} wants to learn the\nmove {STR_VAR_2}.\pHowever, {STR_VAR_1} already\nknows four moves.\pShould a move be deleted and\nreplaced with {STR_VAR_2}?$" gUnknown_085E9B5D:: @ 85E9B5D - -.string "Stop trying to teach\n{STR_VAR_2}?$" + .string "Stop trying to teach\n{STR_VAR_2}?$" gUnknown_085E9B76:: @ 85E9B76 - -.string "{STR_VAR_1} did not learn the\nmove {STR_VAR_2}.{PAUSE_UNTIL_PRESS}$" + .string "{STR_VAR_1} did not learn the\nmove {STR_VAR_2}.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9B96:: @ 85E9B96 - -.string "Which move should be forgotten?{PAUSE_UNTIL_PRESS}$" + .string "Which move should be forgotten?{PAUSE_UNTIL_PRESS}$" gUnknown_085E9BB8:: @ 85E9BB8 - -.string "1, {PAUSE 15}2, and{PAUSE 15}… {PAUSE 15}… {PAUSE 15}… {PAUSE 15}{PLAY_SE 0x0038}Poof!\p{STR_VAR_1} forgot how to\nuse {STR_VAR_2}.\pAnd…{PAUSE_UNTIL_PRESS}$" + .string "1, {PAUSE 15}2, and{PAUSE 15}… {PAUSE 15}… {PAUSE 15}… {PAUSE 15}{PLAY_SE 0x0038}Poof!\p{STR_VAR_1} forgot how to\nuse {STR_VAR_2}.\pAnd…{PAUSE_UNTIL_PRESS}$" gUnknown_085E9C00:: @ 85E9C00 - -.string "{STR_VAR_1} already knows\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}$" + .string "{STR_VAR_1} already knows\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9C17:: @ 85E9C17 - -.string "{STR_VAR_1}’s HP was restored\nby {STR_VAR_2} point(s).{PAUSE_UNTIL_PRESS}$" + .string "{STR_VAR_1}’s HP was restored\nby {STR_VAR_2} point(s).{PAUSE_UNTIL_PRESS}$" gUnknown_085E9C3E:: @ 85E9C3E - -.string "{STR_VAR_1} was cured of its\npoisoning.{PAUSE_UNTIL_PRESS}$" + .string "{STR_VAR_1} was cured of its\npoisoning.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9C5F:: @ 85E9C5F - -.string "{STR_VAR_1} was cured of\nparalysis.{PAUSE_UNTIL_PRESS}$" + .string "{STR_VAR_1} was cured of\nparalysis.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9C7C:: @ 85E9C7C - -.string "{STR_VAR_1} woke up.{PAUSE_UNTIL_PRESS}$" + .string "{STR_VAR_1} woke up.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9C8A:: @ 85E9C8A - -.string "{STR_VAR_1}’s burn was healed.{PAUSE_UNTIL_PRESS}$" + .string "{STR_VAR_1}’s burn was healed.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9CA2:: @ 85E9CA2 - -.string "{STR_VAR_1} was thawed out.{PAUSE_UNTIL_PRESS}$" + .string "{STR_VAR_1} was thawed out.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9CB7:: @ 85E9CB7 - -.string "PP was restored.{PAUSE_UNTIL_PRESS}$" -.string "{STR_VAR_1} regained health.{PAUSE_UNTIL_PRESS}$" + .string "PP was restored.{PAUSE_UNTIL_PRESS}$" + .string "{STR_VAR_1} regained health.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9CE0:: @ 85E9CE0 - -.string "{STR_VAR_1} became healthy.{PAUSE_UNTIL_PRESS}$" + .string "{STR_VAR_1} became healthy.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9CF5:: @ 85E9CF5 - -.string "{STR_VAR_1}’s PP increased.{PAUSE_UNTIL_PRESS}$" + .string "{STR_VAR_1}’s PP increased.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9D0A:: @ 85E9D0A - -.string "{STR_VAR_1} was elevated to\nLv. {STR_VAR_2}.$" + .string "{STR_VAR_1} was elevated to\nLv. {STR_VAR_2}.$" gUnknown_085E9D25:: @ 85E9D25 - -.string "{STR_VAR_1}’s base {STR_VAR_2}\nstat was raised.{PAUSE_UNTIL_PRESS}$" + .string "{STR_VAR_1}’s base {STR_VAR_2}\nstat was raised.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9D45:: @ 85E9D45 - -.string "{STR_VAR_1} turned friendly.\nThe base {STR_VAR_2} fell!{PAUSE_UNTIL_PRESS}$" + .string "{STR_VAR_1} turned friendly.\nThe base {STR_VAR_2} fell!{PAUSE_UNTIL_PRESS}$" gUnknown_085E9D6D:: @ 85E9D6D - -.string "{STR_VAR_1} adores you!\nThe base {STR_VAR_2} fell!{PAUSE_UNTIL_PRESS}$" + .string "{STR_VAR_1} adores you!\nThe base {STR_VAR_2} fell!{PAUSE_UNTIL_PRESS}$" gUnknown_085E9D90:: @ 85E9D90 - -.string "{STR_VAR_1} turned friendly.\nThe base {STR_VAR_2} can’t fall!{PAUSE_UNTIL_PRESS}$" + .string "{STR_VAR_1} turned friendly.\nThe base {STR_VAR_2} can’t fall!{PAUSE_UNTIL_PRESS}$" gUnknown_085E9DBE:: @ 85E9DBE - -.string "{STR_VAR_1} snapped out of its\nconfusion.{PAUSE_UNTIL_PRESS}$" + .string "{STR_VAR_1} snapped out of its\nconfusion.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9DE1:: @ 85E9DE1 - -.string "{STR_VAR_1} got over its\ninfatuation.{PAUSE_UNTIL_PRESS}$" + .string "{STR_VAR_1} got over its\ninfatuation.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9E00:: @ 85E9E00 - -.string "Throw away this\n{STR_VAR_1}?$" + .string "Throw away this\n{STR_VAR_1}?$" gUnknown_085E9E14:: @ 85E9E14 - -.string "The {STR_VAR_1}\nwas thrown away.{PAUSE_UNTIL_PRESS}$" -.string "Teach which POKéMON?$" -.string "Choose a POKéMON.$" -.string "Move to where?$" -.string "Teach which POKéMON?$" -.string "Use on which POKéMON?$" -.string "Give to which POKéMON?$" -.string "Do what with this {PKMN}?$" -.string "There’s nothing to CUT.$" -.string "You can’t SURF here.$" -.string "You’re already SURFING.$" -.string "Can’t use that here.$" -.string "Restore which move?$" -.string "Boost PP of which move?$" -.string "Do what with an item?$" -.string "No POKéMON for battle!$" -.string "Choose a POKéMON.$" -.string "Not enough HP…$" -.string "{STR_VAR_1} POKéMON are needed.$" -.string "POKéMON can’t be the same.$" -.string "No identical hold items.$" -.string "The current is much too fast!$" -.string "Do what with the MAIL?$" -.string "Choose POKéMON or CANCEL.$" -.string "Choose POKéMON and confirm.$" -.string "Let’s enjoy cycling!$" -.string "This is in use already.$" -.string "{STR_VAR_1} is already holding\none {STR_VAR_2}.$" -.string "No use.$" -.string "ABLE$" -.string "FIRST$" -.string "SECOND$" -.string "THIRD$" -.string "ABLE$" -.string "NOT ABLE$" -.string "ABLE!$" -.string "NOT ABLE!$" -.string "LEARNED$" -.string "HAVE$" -.string "DON’T HAVE$" -.string "FOURTH$" + .string "The {STR_VAR_1}\nwas thrown away.{PAUSE_UNTIL_PRESS}$" + .string "Teach which POKéMON?$" + .string "Choose a POKéMON.$" + .string "Move to where?$" + .string "Teach which POKéMON?$" + .string "Use on which POKéMON?$" + .string "Give to which POKéMON?$" + .string "Do what with this {PKMN}?$" + .string "There’s nothing to CUT.$" + .string "You can’t SURF here.$" + .string "You’re already SURFING.$" + .string "Can’t use that here.$" + .string "Restore which move?$" + .string "Boost PP of which move?$" + .string "Do what with an item?$" + .string "No POKéMON for battle!$" + .string "Choose a POKéMON.$" + .string "Not enough HP…$" + .string "{STR_VAR_1} POKéMON are needed.$" + .string "POKéMON can’t be the same.$" + .string "No identical hold items.$" + .string "The current is much too fast!$" + .string "Do what with the MAIL?$" + .string "Choose POKéMON or CANCEL.$" + .string "Choose POKéMON and confirm.$" + .string "Let’s enjoy cycling!$" + .string "This is in use already.$" + .string "{STR_VAR_1} is already holding\none {STR_VAR_2}.$" + .string "No use.$" + .string "ABLE$" + .string "FIRST$" + .string "SECOND$" + .string "THIRD$" + .string "ABLE$" + .string "NOT ABLE$" + .string "ABLE!$" + .string "NOT ABLE!$" + .string "LEARNED$" + .string "HAVE$" + .string "DON’T HAVE$" + .string "FOURTH$" gUnknown_085EA0EE:: @ 85EA0EE - -.string "That POKéMON can’t participate.{PAUSE_UNTIL_PRESS}$" + .string "That POKéMON can’t participate.{PAUSE_UNTIL_PRESS}$" gUnknown_085EA110:: @ 85EA110 - -.string "Cancel participation?$" + .string "Cancel participation?$" gUnknown_085EA126:: @ 85EA126 - -.string "Cancel the battle?$" + .string "Cancel the battle?$" gUnknown_085EA139:: @ 85EA139 - -.string "Return to the WAITING ROOM?$" + .string "Return to the WAITING ROOM?$" gUnknown_085EA155:: @ 85EA155 - -.string "Cancel the challenge?$" + .string "Cancel the challenge?$" gUnknown_085EA16B:: @ 85EA16B - -.string "Want to escape from here and return\nto {STR_VAR_1}?$" + .string "Want to escape from here and return\nto {STR_VAR_1}?$" gUnknown_085EA196:: @ 85EA196 - -.string "Want to return to the healing spot\nused last in {STR_VAR_1}?$" + .string "Want to return to the healing spot\nused last in {STR_VAR_1}?$" gUnknown_085EA1CA:: @ 85EA1CA - -.string "{PAUSE_UNTIL_PRESS}$" + .string "{PAUSE_UNTIL_PRESS}$" gUnknown_085EA1CD:: @ 85EA1CD .string "{STR_VAR_1}を ぐるぐるこうかんに\nだして よろしいですか?$" @ "{STR_VAR_1}wo gurugurukoukanni\ndashite yoroshiidesuka?" ("do you want to put {STR_VAR_1} into the spinner?" in Japanese) + .align 2 gUnknown_085EA1E8:: @ 85EA1E8 - .incbin "baserom.gba", 0x5ea1e8, 0x28 + .string "That’s your only\nPOKéMON for battle.$" + .align 2 gUnknown_085EA210:: @ 85EA210 - .incbin "baserom.gba", 0x5ea210, 0x24 + .string "That POKéMON can’t be traded\nnow.$" .align 2 gUnknown_085EA234:: @ 85EA234 @@ -1061,2274 +946,2057 @@ gUnknown_085EA234:: @ 85EA234 .string "That isn’t an EGG.$" gUnknown_085EA333:: @ 85EA333 - -.string "REGISTER$" + .string "REGISTER$" gUnknown_085EA33C:: @ 85EA33C - -.string "ATTACK$" + .string "ATTACK$" gUnknown_085EA343:: @ 85EA343 - -.string "DEFENSE$" + .string "DEFENSE$" gUnknown_085EA34B:: @ 85EA34B - -.string "SP. ATK$" + .string "SP. ATK$" gUnknown_085EA353:: @ 85EA353 - -.string "SP. DEF$" + .string "SP. DEF$" gUnknown_085EA35B:: @ 85EA35B - -.string "SPEED$" + .string "SPEED$" gUnknown_085EA361:: @ 85EA361 - -.string "HP$" -.string "$" + .string "HP$" + .string "$" gUnknown_085EA365:: @ 85EA365 - -.string "OT/$" + .string "OT/$" gUnknown_085EA369:: @ 85EA369 - -.string "RENTAL POKéMON$" + .string "RENTAL POKéMON$" gUnknown_085EA378:: @ 85EA378 - -.string "TYPE/$" + .string "TYPE/$" gUnknown_085EA37E:: @ 85EA37E - -.string "POWER$" + .string "POWER$" gUnknown_085EA384:: @ 85EA384 - -.string "ACCURACY$" + .string "ACCURACY$" gUnknown_085EA38D:: @ 85EA38D - -.string "APPEAL$" + .string "APPEAL$" gUnknown_085EA394:: @ 85EA394 - -.string "JAM$" + .string "JAM$" gUnknown_085EA398:: @ 85EA398 - -.string "STATUS$" + .string "STATUS$" gUnknown_085EA39F:: @ 85EA39F - -.string "EXP. POINTS$" + .string "EXP. POINTS$" gUnknown_085EA3AB:: @ 85EA3AB - -.string "NEXT LV.$" + .string "NEXT LV.$" gUnknown_085EA3B4:: @ 85EA3B4 - -.string "RIBBONS: {STR_VAR_1}$" + .string "RIBBONS: {STR_VAR_1}$" gUnknown_085EA3C0:: @ 85EA3C0 - -.string "$" -.string "EVENTS$" + .string "$" + .string "EVENTS$" gUnknown_085EA3C8:: @ 85EA3C8 - -.string "SWITCH$" + .string "SWITCH$" gUnknown_085EA3CF:: @ 85EA3CF - -.string "POKéMON INFO$" + .string "POKéMON INFO$" gUnknown_085EA3DC:: @ 85EA3DC - -.string "POKéMON SKILLS$" + .string "POKéMON SKILLS$" gUnknown_085EA3EB:: @ 85EA3EB - -.string "BATTLE MOVES$" + .string "BATTLE MOVES$" gUnknown_085EA3F8:: @ 85EA3F8 - -.string "C0NTEST MOVES$" + .string "C0NTEST MOVES$" gUnknown_085EA406:: @ 85EA406 - -.string "INFO$" + .string "INFO$" gUnknown_085EA40B:: @ 85EA40B - -.string "It looks like this EGG will\ntake a long time to hatch.$" + .string "It looks like this EGG will\ntake a long time to hatch.$" gUnknown_085EA442:: @ 85EA442 - -.string "What will hatch from this?\nIt will take some time.$" + .string "What will hatch from this?\nIt will take some time.$" gUnknown_085EA475:: @ 85EA475 - -.string "It moves occasionally.\nIt should hatch soon.$" + .string "It moves occasionally.\nIt should hatch soon.$" gUnknown_085EA4A2:: @ 85EA4A2 - -.string "It’s making sounds.\nIt’s about to hatch!$" + .string "It’s making sounds.\nIt’s about to hatch!$" gUnknown_085EA4CB:: @ 85EA4CB - -.string "HM moves can’t be\nforgotten now.$" + .string "HM moves can’t be\nforgotten now.$" gUnknown_085EA4EC:: @ 85EA4EC - .incbin "baserom.gba", 0x5ea4ec, 0x2a + .string "{SPECIAL_F7 0x00}{SPECIAL_F7 0x02}{SPECIAL_F7 0x01}{SPECIAL_F7 0x05} nature,\nmet at {UNK_CTRL_F905}{SPECIAL_F7 0x00}{SPECIAL_F7 0x03}{SPECIAL_F7 0x01},\n{SPECIAL_F7 0x00}{SPECIAL_F7 0x04}{SPECIAL_F7 0x01}.$" gUnknown_085EA516:: @ 85EA516 - .incbin "baserom.gba", 0x5ea516, 0x2e + .string "{SPECIAL_F7 0x00}{SPECIAL_F7 0x02}{SPECIAL_F7 0x01}{SPECIAL_F7 0x05} nature,\nhatched at {UNK_CTRL_F905}{SPECIAL_F7 0x00}{SPECIAL_F7 0x03}{SPECIAL_F7 0x01},\n{SPECIAL_F7 0x00}{SPECIAL_F7 0x04}{SPECIAL_F7 0x01}.$" gUnknown_085EA544:: @ 85EA544 - .incbin "baserom.gba", 0x5ea544, 0x26 + .string "{SPECIAL_F7 0x00}{SPECIAL_F7 0x02}{SPECIAL_F7 0x01}{SPECIAL_F7 0x05} nature,\nobtained in a trade.$" gUnknown_085EA56A:: @ 85EA56A - .incbin "baserom.gba", 0x5ea56a, 0x3e + .string "{SPECIAL_F7 0x00}{SPECIAL_F7 0x02}{SPECIAL_F7 0x01}{SPECIAL_F7 0x05} nature,\nobtained in a fateful\nencounter at {UNK_CTRL_F905}{SPECIAL_F7 0x00}{SPECIAL_F7 0x03}{SPECIAL_F7 0x01}.$" gUnknown_085EA5A8:: @ 85EA5A8 - .incbin "baserom.gba", 0x5ea5a8, 0x33 + .string "{SPECIAL_F7 0x00}{SPECIAL_F7 0x02}{SPECIAL_F7 0x01}{SPECIAL_F7 0x05} nature,\nprobably met at {UNK_CTRL_F905}{SPECIAL_F7 0x00}{SPECIAL_F7 0x03}{SPECIAL_F7 0x01},\n{SPECIAL_F7 0x00}{SPECIAL_F7 0x04}{SPECIAL_F7 0x01}.$" gUnknown_085EA5DB:: @ 85EA5DB - .incbin "baserom.gba", 0x5ea5db, 0x10 + .string "{SPECIAL_F7 0x00}{SPECIAL_F7 0x02}{SPECIAL_F7 0x01}{SPECIAL_F7 0x05} nature$" gUnknown_085EA5EB:: @ 85EA5EB - .incbin "baserom.gba", 0x5ea5eb, 0x2c + .string "{SPECIAL_F7 0x00}{SPECIAL_F7 0x02}{SPECIAL_F7 0x01}{SPECIAL_F7 0x05} nature,\nmet somewhere at {UNK_CTRL_F905}{SPECIAL_F7 0x00}{SPECIAL_F7 0x03}{SPECIAL_F7 0x01}.$" gUnknown_085EA617:: @ 85EA617 - .incbin "baserom.gba", 0x5ea617, 0x30 - -gUnknown_085EA647:: @ 85EA647 + .string "{SPECIAL_F7 0x00}{SPECIAL_F7 0x02}{SPECIAL_F7 0x01}{SPECIAL_F7 0x05} nature,\nhatched somewhere at {UNK_CTRL_F905}{SPECIAL_F7 0x00}{SPECIAL_F7 0x03}{SPECIAL_F7 0x01}.$" -.string "An odd POKéMON EGG found\nby the DAY CARE couple.$" +gUnknown_085EA647:: @ 85EA647 + .string "An odd POKéMON EGG found\nby the DAY CARE couple.$" gUnknown_085EA678:: @ 85EA678 - -.string "A peculiar POKéMON EGG\nobtained at the nice place.$" + .string "A peculiar POKéMON EGG\nobtained at the nice place.$" gUnknown_085EA6AB:: @ 85EA6AB - -.string "A peculiar POKéMON EGG\nobtained in a trade.$" + .string "A peculiar POKéMON EGG\nobtained in a trade.$" gUnknown_085EA6D7:: @ 85EA6D7 - -.string "A POKéMON EGG obtained\nat the hot springs.$" + .string "A POKéMON EGG obtained\nat the hot springs.$" gUnknown_085EA702:: @ 85EA702 - -.string "An odd POKéMON EGG\nobtained from a traveler.$" + .string "An odd POKéMON EGG\nobtained from a traveler.$" gUnknown_085EA72F:: @ 85EA72F - -.string "’s BASE$" + .string "’s BASE$" gUnknown_085EA737:: @ 85EA737 - -.string "Is it okay to delete {STR_VAR_1}\nfrom the REGISTRY?$" + .string "Is it okay to delete {STR_VAR_1}\nfrom the REGISTRY?$" gUnknown_085EA762:: @ 85EA762 - -.string "The registered data was deleted.{PAUSE_UNTIL_PRESS}$" + .string "The registered data was deleted.{PAUSE_UNTIL_PRESS}$" gUnknown_085EA785:: @ 85EA785 - -.string "There is no REGISTRY.{PAUSE_UNTIL_PRESS}$" -.string "DEL REGIST.$" -.string "{STR_VAR_3}{STR_VAR_1}/{STR_VAR_2}$" -.string "DECORATE$" -.string "PUT AWAY$" -.string "TOSS$" + .string "There is no REGISTRY.{PAUSE_UNTIL_PRESS}$" + .string "DEL REGIST.$" + .string "{STR_VAR_3}{STR_VAR_1}/{STR_VAR_2}$" + .string "DECORATE$" + .string "PUT AWAY$" + .string "TOSS$" gUnknown_085EA7C8:: @ 85EA7C8 - -.string "{COLOR 161}{SHADOW 161}$" -.string "Put out the selected decoration item.$" -.string "Store the chosen decoration in the PC.$" -.string "Throw away unwanted decorations.$" + .string "{COLOR 161}{SHADOW 161}$" + .string "Put out the selected decoration item.$" + .string "Store the chosen decoration in the PC.$" + .string "Throw away unwanted decorations.$" gUnknown_085EA83D:: @ 85EA83D - -.string "There are no decorations.{PAUSE_UNTIL_PRESS}$" -.string "DESK$" -.string "CHAIR$" -.string "PLANT$" -.string "ORNAMENT$" -.string "MAT$" -.string "POSTER$" -.string "DOLL$" -.string "CUSHION$" + .string "There are no decorations.{PAUSE_UNTIL_PRESS}$" + .string "DESK$" + .string "CHAIR$" + .string "PLANT$" + .string "ORNAMENT$" + .string "MAT$" + .string "POSTER$" + .string "DOLL$" + .string "CUSHION$" gUnknown_085EA88B:: @ 85EA88B - -.string "GOLD$" + .string "GOLD$" gUnknown_085EA890:: @ 85EA890 - -.string "SILVER$" + .string "SILVER$" gUnknown_085EA897:: @ 85EA897 - -.string "Place it here?$" + .string "Place it here?$" gUnknown_085EA8A6:: @ 85EA8A6 - -.string "It can’t be placed here.$" + .string "It can’t be placed here.$" gUnknown_085EA8BF:: @ 85EA8BF - -.string "Cancel decorating?$" + .string "Cancel decorating?$" gUnknown_085EA8D2:: @ 85EA8D2 - -.string "This is in use already.$" + .string "This is in use already.$" gUnknown_085EA8EA:: @ 85EA8EA - -.string "No more decorations can be placed.\nThe most that can be placed are {STR_VAR_1}.$" + .string "No more decorations can be placed.\nThe most that can be placed are {STR_VAR_1}.$" gUnknown_085EA931:: @ 85EA931 - -.string "No more decorations can be placed.\nThe most that can be placed are {STR_VAR_1}.$" -.string "This can’t be placed here.\nIt must be on a DESK, etc.$" + .string "No more decorations can be placed.\nThe most that can be placed are {STR_VAR_1}.$" + .string "This can’t be placed here.\nIt must be on a DESK, etc.$" gUnknown_085EA9AE:: @ 85EA9AE - -.string "This decoration can’t be placed in\nyour own room.$" + .string "This decoration can’t be placed in\nyour own room.$" gUnknown_085EA9E0:: @ 85EA9E0 - -.string "This decoration is in use.\nIt can’t be thrown away.$" + .string "This decoration is in use.\nIt can’t be thrown away.$" gUnknown_085EAA14:: @ 85EAA14 - -.string "This {STR_VAR_1} will be discarded.\nIs that okay?$" + .string "This {STR_VAR_1} will be discarded.\nIs that okay?$" gUnknown_085EAA3D:: @ 85EAA3D - -.string "The decoration item was thrown away.$" + .string "The decoration item was thrown away.$" gUnknown_085EAA62:: @ 85EAA62 - -.string "Stop putting away decorations?$" + .string "Stop putting away decorations?$" gUnknown_085EAA81:: @ 85EAA81 - -.string "There is no decoration item here.$" + .string "There is no decoration item here.$" gUnknown_085EAAA3:: @ 85EAAA3 - -.string "Return this decoration to the PC?$" + .string "Return this decoration to the PC?$" gUnknown_085EAAC5:: @ 85EAAC5 - -.string "The decoration was returned to the PC.$" + .string "The decoration was returned to the PC.$" gUnknown_085EAAEC:: @ 85EAAEC - -.string "There are no decorations in use.{PAUSE_UNTIL_PRESS}$" -.string "TRISTAN$" -.string "PHILIP$" -.string "DENNIS$" -.string "ROBERTO$" -.string "TURN OFF$" -.string "DECORATION$" -.string "ITEM STORAGE$" + .string "There are no decorations in use.{PAUSE_UNTIL_PRESS}$" + .string "TRISTAN$" + .string "PHILIP$" + .string "DENNIS$" + .string "ROBERTO$" + .string "TURN OFF$" + .string "DECORATION$" + .string "ITEM STORAGE$" gUnknown_085EAB4E:: @ 85EAB4E - -.string "MAILBOX$" -.string "DEPOSIT ITEM$" + .string "MAILBOX$" + .string "DEPOSIT ITEM$" gUnknown_085EAB63:: @ 85EAB63 - -.string "WITHDRAW ITEM$" + .string "WITHDRAW ITEM$" gUnknown_085EAB71:: @ 85EAB71 - -.string "TOSS ITEM$" -.string "Store items in the PC.$" -.string "Take out items from the PC.$" -.string "Throw away items stored in the PC.$" + .string "TOSS ITEM$" + .string "Store items in the PC.$" + .string "Take out items from the PC.$" + .string "Throw away items stored in the PC.$" gUnknown_085EABD1:: @ 85EABD1 - -.string "There are no items.{PAUSE_UNTIL_PRESS}$" + .string "There are no items.{PAUSE_UNTIL_PRESS}$" gUnknown_085EABE7:: @ 85EABE7 - -.string "There is no more\nroom in the BAG.$" + .string "There is no more\nroom in the BAG.$" gUnknown_085EAC09:: @ 85EAC09 - -.string "Withdraw how many\n{STR_VAR_1}(s)?$" + .string "Withdraw how many\n{STR_VAR_1}(s)?$" gUnknown_085EAC22:: @ 85EAC22 - -.string "Withdrew {STR_VAR_2}\n{STR_VAR_1}(s).$" -.string "READ$" -.string "MOVE TO BAG$" -.string "GIVE$" + .string "Withdrew {STR_VAR_2}\n{STR_VAR_1}(s).$" + .string "READ$" + .string "MOVE TO BAG$" + .string "GIVE$" gUnknown_085EAC4B:: @ 85EAC4B - -.string "There’s no MAIL here.{PAUSE_UNTIL_PRESS}$" + .string "There’s no MAIL here.{PAUSE_UNTIL_PRESS}$" gUnknown_085EAC63:: @ 85EAC63 - -.string "What would you like to do with\n{STR_VAR_1}’s MAIL?$" + .string "What would you like to do with\n{STR_VAR_1}’s MAIL?$" gUnknown_085EAC8D:: @ 85EAC8D - -.string "The message will be lost.\nIs that okay?$" + .string "The message will be lost.\nIs that okay?$" gUnknown_085EACB5:: @ 85EACB5 - -.string "The BAG is full.{PAUSE_UNTIL_PRESS}$" + .string "The BAG is full.{PAUSE_UNTIL_PRESS}$" gUnknown_085EACC8:: @ 85EACC8 - -.string "The MAIL was returned to the BAG\nwith its message erased.{PAUSE_UNTIL_PRESS}$" + .string "The MAIL was returned to the BAG\nwith its message erased.{PAUSE_UNTIL_PRESS}$" gUnknown_085EAD04:: @ 85EAD04 - -.string "DAD$" + .string "DAD$" gUnknown_085EAD08:: @ 85EAD08 - -.string "MOM$" + .string "MOM$" gUnknown_085EAD0C:: @ 85EAD0C - -.string "WALLACE$" + .string "WALLACE$" gUnknown_085EAD14:: @ 85EAD14 - -.string "STEVEN$" + .string "STEVEN$" gUnknown_085EAD1B:: @ 85EAD1B - -.string "BRAWLY$" + .string "BRAWLY$" gUnknown_085EAD22:: @ 85EAD22 - -.string "WINONA$" + .string "WINONA$" gUnknown_085EAD29:: @ 85EAD29 - -.string "PHOEBE$" + .string "PHOEBE$" gUnknown_085EAD30:: @ 85EAD30 - -.string "GLACIA$" -.string "PETALBURG$" -.string "SLATEPORT$" -.string "LITTLEROOT$" -.string "LILYCOVE$" -.string "DEWFORD$" -.string "ENTER$" -.string "INFO$" -.string "What’s a CONTEST?$" -.string "Types of CONTESTS$" -.string "Ranks$" -.string "Judging$" -.string "COOLNESS CONTEST$" -.string "BEAUTY CONTEST$" -.string "CUTENESS CONTEST$" -.string "SMARTNESS CONTEST$" -.string "TOUGHNESS CONTEST$" -.string "DECORATION$" -.string "PACK UP$" -.string "COUNT$" -.string "REGISTRY$" -.string "INFORMATION$" -.string "MACH$" -.string "ACRO$" -.string "PSN$" -.string "PAR$" -.string "SLP$" -.string "BRN$" -.string "FRZ$" -.string "TOXIC$" -.string "OK$" -.string "QUIT$" -.string "Saw it$" -.string "Not yet$" + .string "GLACIA$" + .string "PETALBURG$" + .string "SLATEPORT$" + .string "LITTLEROOT$" + .string "LILYCOVE$" + .string "DEWFORD$" + .string "ENTER$" + .string "INFO$" + .string "What’s a CONTEST?$" + .string "Types of CONTESTS$" + .string "Ranks$" + .string "Judging$" + .string "COOLNESS CONTEST$" + .string "BEAUTY CONTEST$" + .string "CUTENESS CONTEST$" + .string "SMARTNESS CONTEST$" + .string "TOUGHNESS CONTEST$" + .string "DECORATION$" + .string "PACK UP$" + .string "COUNT$" + .string "REGISTRY$" + .string "INFORMATION$" + .string "MACH$" + .string "ACRO$" + .string "PSN$" + .string "PAR$" + .string "SLP$" + .string "BRN$" + .string "FRZ$" + .string "TOXIC$" + .string "OK$" + .string "QUIT$" + .string "Saw it$" + .string "Not yet$" gUnknown_085EAE62:: @ 85EAE62 - -.string "YES$" + .string "YES$" gUnknown_085EAE66:: @ 85EAE66 - -.string "NO$" -.string "INFO$" -.string "SINGLE BATTLE$" -.string "DOUBLE BATTLE$" -.string "MULTI BATTLE$" -.string "MR. BRINEY$" -.string "CHALLENGE$" -.string "INFO$" + .string "NO$" + .string "INFO$" + .string "SINGLE BATTLE$" + .string "DOUBLE BATTLE$" + .string "MULTI BATTLE$" + .string "MR. BRINEY$" + .string "CHALLENGE$" + .string "INFO$" gUnknown_085EAEB1:: @ 85EAEB1 - -.string "LV. 50$" + .string "LV. 50$" gUnknown_085EAEB8:: @ 85EAEB8 - -.string "OPEN LEVEL$" -.string "FRESH WATER{CLEAR_TO}ぶ¥200$" -.string "SODA POP{CLEAR_TO}ぶ¥300$" -.string "LEMONADE{CLEAR_TO}ぶ¥350$" -.string "HOW TO RIDE$" -.string "HOW TO TURN$" -.string "SANDY SLOPES$" -.string "WHEELIES$" -.string "BUNNY-HOPS$" -.string "JUMP$" -.string "Satisfied$" -.string "Dissatisfied$" -.string "DEEPSEATOOTH$" -.string "DEEPSEASCALE$" -.string "BLUE FLUTE$" -.string "YELLOW FLUTE$" -.string "RED FLUTE$" -.string "WHITE FLUTE$" -.string "BLACK FLUTE$" -.string "GLASS CHAIR$" -.string "GLASS DESK$" -.string "TREECKO DOLL 1,000 COINS$" -.string "TORCHIC DOLL 1,000 COINS$" -.string "MUDKIP DOLL 1,000 COINS$" -.string " 50 COINS ¥1,000$" -.string "500 COINS ¥10,000$" -.string "Excellent$" -.string "Not so good$" -.string "RED SHARD$" -.string "YELLOW SHARD$" -.string "BLUE SHARD$" -.string "GREEN SHARD$" -.string "BATTLE FRONTIER$" -.string "Right$" -.string "Left$" -.string "TM32{CLEAR_TO}ぶ1,500 COINS$" -.string "TM29{CLEAR_TO}ぶ3,500 COINS$" -.string "TM35{CLEAR_TO}ぶ4,000 COINS$" -.string "TM24{CLEAR_TO}ぶ4,000 COINS$" -.string "TM13{CLEAR_TO}ぶ4,000 COINS$" + .string "OPEN LEVEL$" + .string "FRESH WATER{CLEAR_TO 0x48}¥200$" + .string "SODA POP{CLEAR_TO 0x48}¥300$" + .string "LEMONADE{CLEAR_TO 0x48}¥350$" + .string "HOW TO RIDE$" + .string "HOW TO TURN$" + .string "SANDY SLOPES$" + .string "WHEELIES$" + .string "BUNNY-HOPS$" + .string "JUMP$" + .string "Satisfied$" + .string "Dissatisfied$" + .string "DEEPSEATOOTH$" + .string "DEEPSEASCALE$" + .string "BLUE FLUTE$" + .string "YELLOW FLUTE$" + .string "RED FLUTE$" + .string "WHITE FLUTE$" + .string "BLACK FLUTE$" + .string "GLASS CHAIR$" + .string "GLASS DESK$" + .string "TREECKO DOLL 1,000 COINS$" + .string "TORCHIC DOLL 1,000 COINS$" + .string "MUDKIP DOLL 1,000 COINS$" + .string " 50 COINS ¥1,000$" + .string "500 COINS ¥10,000$" + .string "Excellent$" + .string "Not so good$" + .string "RED SHARD$" + .string "YELLOW SHARD$" + .string "BLUE SHARD$" + .string "GREEN SHARD$" + .string "BATTLE FRONTIER$" + .string "Right$" + .string "Left$" + .string "TM32{CLEAR_TO 0x48}1,500 COINS$" + .string "TM29{CLEAR_TO 0x48}3,500 COINS$" + .string "TM35{CLEAR_TO 0x48}4,000 COINS$" + .string "TM24{CLEAR_TO 0x48}4,000 COINS$" + .string "TM13{CLEAR_TO 0x48}4,000 COINS$" gUnknown_085EB0E8:: @ 85EB0E8 - -.string "COOL$" + .string "COOL$" gUnknown_085EB0ED:: @ 85EB0ED - -.string "BEAUTY$" + .string "BEAUTY$" gUnknown_085EB0F4:: @ 85EB0F4 - -.string "CUTE$" + .string "CUTE$" gUnknown_085EB0F9:: @ 85EB0F9 - -.string "SMART$" + .string "SMART$" gUnknown_085EB0FF:: @ 85EB0FF - -.string "TOUGH$" -.string "NORMAL$" -.string "SUPER$" -.string "HYPER$" -.string "MASTER$" -.string "COOL$" -.string "BEAUTY$" -.string "CUTE$" -.string "SMART$" -.string "TOUGH$" -.string "ITEMS$" -.string "KEY ITEMS$" -.string "POKé BALLS$" -.string "TMs & HMs$" -.string "BERRIES$" + .string "TOUGH$" + .string "NORMAL$" + .string "SUPER$" + .string "HYPER$" + .string "MASTER$" + .string "COOL$" + .string "BEAUTY$" + .string "CUTE$" + .string "SMART$" + .string "TOUGH$" + .string "ITEMS$" + .string "KEY ITEMS$" + .string "POKé BALLS$" + .string "TMs & HMs$" + .string "BERRIES$" gUnknown_085EB169:: @ 85EB169 - -.string "SOMEONE’S PC$" + .string "SOMEONE’S PC$" gUnknown_085EB176:: @ 85EB176 - -.string "LANETTE’S PC$" + .string "LANETTE’S PC$" gUnknown_085EB183:: @ 85EB183 - -.string "{PLAYER}’s PC$" + .string "{PLAYER}’s PC$" gUnknown_085EB18B:: @ 85EB18B - -.string "HALL OF FAME$" + .string "HALL OF FAME$" gUnknown_085EB198:: @ 85EB198 - -.string "LOG OFF$" -.string "OPPONENT$" -.string "TOURNEY TREE$" -.string "READY TO START$" -.string "NORMAL RANK$" -.string "SUPER RANK$" -.string "HYPER RANK$" -.string "MASTER RANK$" -.string "SINGLE$" -.string "DOUBLE$" -.string "MULTI$" -.string "MULTI-LINK$" -.string "BATTLE BAG$" -.string "HELD ITEM$" -.string "LINK CONTEST$" -.string "ABOUT E-MODE$" -.string "ABOUT G-MODE$" -.string "E-MODE$" -.string "G-MODE$" + .string "LOG OFF$" + .string "OPPONENT$" + .string "TOURNEY TREE$" + .string "READY TO START$" + .string "NORMAL RANK$" + .string "SUPER RANK$" + .string "HYPER RANK$" + .string "MASTER RANK$" + .string "SINGLE$" + .string "DOUBLE$" + .string "MULTI$" + .string "MULTI-LINK$" + .string "BATTLE BAG$" + .string "HELD ITEM$" + .string "LINK CONTEST$" + .string "ABOUT E-MODE$" + .string "ABOUT G-MODE$" + .string "E-MODE$" + .string "G-MODE$" gUnknown_085EB25C:: @ 85EB25C - -.string "POKéDEX$" + .string "POKéDEX$" gUnknown_085EB264:: @ 85EB264 - -.string "POKéMON$" + .string "POKéMON$" gUnknown_085EB26C:: @ 85EB26C - -.string "BAG$" + .string "BAG$" gUnknown_085EB270:: @ 85EB270 - -.string "POKéNAV$" -.string "$" + .string "POKéNAV$" + .string "$" gUnknown_085EB279:: @ 85EB279 - -.string "SAVE$" + .string "SAVE$" gUnknown_085EB27E:: @ 85EB27E - -.string "OPTION$" + .string "OPTION$" gUnknown_085EB285:: @ 85EB285 - -.string "EXIT$" -.string " 5BP$" -.string "10BP$" -.string "15BP$" -.string "RED TENT$" -.string "BLUE TENT$" -.string "SOUTHERN ISLAND$" -.string "BIRTH ISLAND$" -.string "FARAWAY ISLAND$" -.string "NAVEL ROCK$" -.string "CLAW FOSSIL$" -.string "ROOT FOSSIL$" -.string "NO$" -.string "I’ll battle now!$" -.string "I won!$" -.string "I lost!$" -.string "I won’t tell.$" -.string "NORMAL TAG MATCH$" -.string "VARIETY TAG MATCH$" -.string "UNIQUE TAG MATCH$" -.string "EXPERT TAG MATCH$" -.string "TRADE CENTER$" -.string "COLOSSEUM$" -.string "RECORD CORNER$" -.string "BERRY CRUSH$" -.string "$" -.string "POKéMON JUMP$" -.string "DODRIO BERRY-PICKING$" -.string "BECOME LEADER$" -.string "JOIN GROUP$" -.string "TWO STYLES$" -.string "LV. 50$" -.string "OPEN LEVEL$" -.string "{PKMN} TYPE & NO.$" -.string "HOLD ITEMS$" -.string "SYMBOLS$" -.string "RECORD$" -.string "BATTLE PTS$" -.string "TOWER INFO$" -.string "BATTLE {PKMN}$" -.string "BATTLE SALON$" -.string "MULTI-LINK$" -.string "BATTLE RULES$" -.string "JUDGE: MIND$" -.string "JUDGE: SKILL$" -.string "JUDGE: BODY$" -.string "MATCHUP$" -.string "TOURNEY TREE$" -.string "DOUBLE KO$" -.string "BASIC RULES$" -.string "SWAP: PARTNER$" -.string "SWAP: NUMBER$" -.string "SWAP: NOTES$" -.string "OPEN LEVEL$" -.string "BATTLE BASICS$" -.string "POKéMON NATURE$" -.string "POKéMON MOVES$" -.string "UNDERPOWERED$" -.string "WHEN IN DANGER$" -.string "PYRAMID: POKéMON$" -.string "PYRAMID: TRAINERS$" -.string "PYRAMID: MAZE$" -.string "BATTLE BAG$" -.string "POKéNAV AND BAG$" -.string "HELD ITEMS$" -.string "POKéMON ORDER$" -.string "BATTLE POKéMON$" -.string "BATTLE TRAINERS$" -.string "GO ON$" -.string "RECORD$" -.string "REST$" -.string "RETIRE$" + .string "EXIT$" + .string " 5BP$" + .string "10BP$" + .string "15BP$" + .string "RED TENT$" + .string "BLUE TENT$" + .string "SOUTHERN ISLAND$" + .string "BIRTH ISLAND$" + .string "FARAWAY ISLAND$" + .string "NAVEL ROCK$" + .string "CLAW FOSSIL$" + .string "ROOT FOSSIL$" + .string "NO$" + .string "I’ll battle now!$" + .string "I won!$" + .string "I lost!$" + .string "I won’t tell.$" + .string "NORMAL TAG MATCH$" + .string "VARIETY TAG MATCH$" + .string "UNIQUE TAG MATCH$" + .string "EXPERT TAG MATCH$" + .string "TRADE CENTER$" + .string "COLOSSEUM$" + .string "RECORD CORNER$" + .string "BERRY CRUSH$" + .string "$" + .string "POKéMON JUMP$" + .string "DODRIO BERRY-PICKING$" + .string "BECOME LEADER$" + .string "JOIN GROUP$" + .string "TWO STYLES$" + .string "LV. 50$" + .string "OPEN LEVEL$" + .string "{PKMN} TYPE & NO.$" + .string "HOLD ITEMS$" + .string "SYMBOLS$" + .string "RECORD$" + .string "BATTLE PTS$" + .string "TOWER INFO$" + .string "BATTLE {PKMN}$" + .string "BATTLE SALON$" + .string "MULTI-LINK$" + .string "BATTLE RULES$" + .string "JUDGE: MIND$" + .string "JUDGE: SKILL$" + .string "JUDGE: BODY$" + .string "MATCHUP$" + .string "TOURNEY TREE$" + .string "DOUBLE KO$" + .string "BASIC RULES$" + .string "SWAP: PARTNER$" + .string "SWAP: NUMBER$" + .string "SWAP: NOTES$" + .string "OPEN LEVEL$" + .string "BATTLE BASICS$" + .string "POKéMON NATURE$" + .string "POKéMON MOVES$" + .string "UNDERPOWERED$" + .string "WHEN IN DANGER$" + .string "PYRAMID: POKéMON$" + .string "PYRAMID: TRAINERS$" + .string "PYRAMID: MAZE$" + .string "BATTLE BAG$" + .string "POKéNAV AND BAG$" + .string "HELD ITEMS$" + .string "POKéMON ORDER$" + .string "BATTLE POKéMON$" + .string "BATTLE TRAINERS$" + .string "GO ON$" + .string "RECORD$" + .string "REST$" + .string "RETIRE$" gUnknown_085EB5CF:: @ 85EB5CF - -.string "99 times +$" + .string "99 times +$" gUnknown_085EB5DA:: @ 85EB5DA - -.string "1 minute +$" + .string "1 minute +$" gUnknown_085EB5E5:: @ 85EB5E5 - -.string " seconds$" + .string " seconds$" gUnknown_085EB5EE:: @ 85EB5EE - -.string " time(s)$" -.string ".$" + .string " time(s)$" + .string ".$" gUnknown_085EB5F9:: @ 85EB5F9 - -.string "Big guy$" + .string "Big guy$" gUnknown_085EB601:: @ 85EB601 - -.string "Big girl$" + .string "Big girl$" gUnknown_085EB60A:: @ 85EB60A - -.string "son$" + .string "son$" gUnknown_085EB60E:: @ 85EB60E - -.string "daughter$" -.string "BLUE FLUTE$" -.string "YELLOW FLUTE$" -.string "RED FLUTE$" -.string "WHITE FLUTE$" -.string "BLACK FLUTE$" -.string "PRETTY CHAIR$" -.string "PRETTY DESK$" -.string "1F$" -.string "2F$" -.string "3F$" -.string "4F$" -.string "5F$" -.string "6F$" -.string "7F$" -.string "8F$" -.string "9F$" -.string "10F$" -.string "11F$" -.string "B1F$" -.string "B2F$" -.string "B3F$" -.string "B4F$" -.string "ROOFTOP$" + .string "daughter$" + .string "BLUE FLUTE$" + .string "YELLOW FLUTE$" + .string "RED FLUTE$" + .string "WHITE FLUTE$" + .string "BLACK FLUTE$" + .string "PRETTY CHAIR$" + .string "PRETTY DESK$" + .string "1F$" + .string "2F$" + .string "3F$" + .string "4F$" + .string "5F$" + .string "6F$" + .string "7F$" + .string "8F$" + .string "9F$" + .string "10F$" + .string "11F$" + .string "B1F$" + .string "B2F$" + .string "B3F$" + .string "B4F$" + .string "ROOFTOP$" gUnknown_085EB6A5:: @ 85EB6A5 - -.string "Now on:$" + .string "Now on:$" gUnknown_085EB6AD:: @ 85EB6AD - -.string "BP$" -.string "ENERGYPOWDER{CLEAR_TO}メ{SIZE 0}50$" -.string "ENERGY ROOT{CLEAR_TO}メ{SIZE 0}80$" -.string "HEAL POWDER{CLEAR_TO}メ{SIZE 0}50$" -.string "REVIVAL HERB{CLEAR_TO}フ{SIZE 0}300$" -.string "PROTEIN{CLEAR_TO}テ{SIZE 0}1,000$" -.string "IRON{CLEAR_TO}テ{SIZE 0}1,000$" -.string "CARBOS{CLEAR_TO}テ{SIZE 0}1,000$" -.string "CALCIUM{CLEAR_TO}テ{SIZE 0}1,000$" -.string "ZINC{CLEAR_TO}テ{SIZE 0}1,000$" -.string "HP UP{CLEAR_TO}テ{SIZE 0}1,000$" -.string "PP UP{CLEAR_TO}テ{SIZE 0}3,000$" -.string "RANKING HALL$" -.string "EXCHANGE SERVICE$" -.string "LILYCOVE CITY$" -.string "SLATEPORT CITY$" -.string "CAVE OF ORIGIN$" -.string "MT. PYRE$" -.string "SKY PILLAR$" -.string "Don’t remember$" + .string "BP$" + .string "ENERGYPOWDER{CLEAR_TO 0x72}{SIZE 0}50$" + .string "ENERGY ROOT{CLEAR_TO 0x72}{SIZE 0}80$" + .string "HEAL POWDER{CLEAR_TO 0x72}{SIZE 0}50$" + .string "REVIVAL HERB{CLEAR_TO 0x6C}{SIZE 0}300$" + .string "PROTEIN{CLEAR_TO 0x63}{SIZE 0}1,000$" + .string "IRON{CLEAR_TO 0x63}{SIZE 0}1,000$" + .string "CARBOS{CLEAR_TO 0x63}{SIZE 0}1,000$" + .string "CALCIUM{CLEAR_TO 0x63}{SIZE 0}1,000$" + .string "ZINC{CLEAR_TO 0x63}{SIZE 0}1,000$" + .string "HP UP{CLEAR_TO 0x63}{SIZE 0}1,000$" + .string "PP UP{CLEAR_TO 0x63}{SIZE 0}3,000$" + .string "RANKING HALL$" + .string "EXCHANGE SERVICE$" + .string "LILYCOVE CITY$" + .string "SLATEPORT CITY$" + .string "CAVE OF ORIGIN$" + .string "MT. PYRE$" + .string "SKY PILLAR$" + .string "Don’t remember$" gUnknown_085EB7EA:: @ 85EB7EA - -.string "EXIT$" -.string "Exit from the BOX?$" -.string "What do you want to do?$" -.string "Please pick a theme.$" -.string "Pick the wallpaper.$" -.string "{SPECIAL_F7} is selected.$" -.string "Jump to which BOX?$" -.string "Deposit in which BOX?$" -.string "{SPECIAL_F7} was deposited.$" -.string "The BOX is full.$" -.string "Release this POKéMON?$" -.string "{SPECIAL_F7} was released.$" -.string "Bye-bye, {SPECIAL_F7} !$" -.string "Mark your POKéMON.$" -.string "That’s your last POKéMON!$" -.string "Your party’s full!$" -.string "You’re holding a POKéMON!$" -.string "Which one will you take?$" -.string "You can’t release an EGG.$" -.string "Continue BOX operations?$" -.string "{SPECIAL_F7} came back!$" -.string "Was it worried about you?$" -.string "… … … … !$" -.string "Please remove the MAIL.$" -.string "GIVE to a POKéMON?$" -.string "Placed item in the BAG.$" -.string "The BAG is full.$" -.string "Put this item in the BAG?$" -.string "{SPECIAL_F7} is now held.$" -.string "Changed to {SPECIAL_F7} .$" -.string "MAIL can’t be stored!$" -.string "CANCEL$" -.string "STORE$" -.string "WITHDRAW$" -.string "SHIFT$" -.string "MOVE$" -.string "PLACE$" -.string "SUMMARY$" -.string "RELEASE$" -.string "MARK$" -.string "NAME$" -.string "JUMP$" -.string "WALLPAPER$" -.string "TAKE$" -.string "GIVE$" -.string "SWITCH$" -.string "BAG$" -.string "INFO$" -.string "SCENERY 1$" -.string "SCENERY 2$" -.string "SCENERY 3$" -.string "ETCETERA$" -.string "FRIENDS$" -.string "FOREST$" -.string "CITY$" -.string "DESERT$" -.string "SAVANNA$" -.string "CRAG$" -.string "VOLCANO$" -.string "SNOW$" -.string "CAVE$" -.string "BEACH$" -.string "SEAFLOOR$" -.string "RIVER$" -.string "SKY$" -.string "POLKA-DOT$" -.string "POKéCENTER$" -.string "MACHINE$" -.string "SIMPLE$" -.string "What would you like to do?$" -.string "WITHDRAW POKéMON$" -.string "DEPOSIT POKéMON$" -.string "MOVE POKéMON$" -.string "MOVE ITEMS$" -.string "SEE YA!$" -.string "Move POKéMON stored in BOXES to\nyour party.$" -.string "Store POKéMON in your party in BOXES.$" -.string "Organize the POKéMON in BOXES and\nin your party.$" -.string "Move items held by any POKéMON\nin a BOX or your party.$" -.string "Return to the previous menu.$" + .string "EXIT$" + .string "Exit from the BOX?$" + .string "What do you want to do?$" + .string "Please pick a theme.$" + .string "Pick the wallpaper.$" + .string "{SPECIAL_F7 0x00} is selected.$" + .string "Jump to which BOX?$" + .string "Deposit in which BOX?$" + .string "{SPECIAL_F7 0x00} was deposited.$" + .string "The BOX is full.$" + .string "Release this POKéMON?$" + .string "{SPECIAL_F7 0x00} was released.$" + .string "Bye-bye, {SPECIAL_F7 0x00}!$" + .string "Mark your POKéMON.$" + .string "That’s your last POKéMON!$" + .string "Your party’s full!$" + .string "You’re holding a POKéMON!$" + .string "Which one will you take?$" + .string "You can’t release an EGG.$" + .string "Continue BOX operations?$" + .string "{SPECIAL_F7 0x00} came back!$" + .string "Was it worried about you?$" + .string "… … … … !$" + .string "Please remove the MAIL.$" + .string "GIVE to a POKéMON?$" + .string "Placed item in the BAG.$" + .string "The BAG is full.$" + .string "Put this item in the BAG?$" + .string "{SPECIAL_F7 0x00} is now held.$" + .string "Changed to {SPECIAL_F7 0x00}.$" + .string "MAIL can’t be stored!$" + .string "CANCEL$" + .string "STORE$" + .string "WITHDRAW$" + .string "SHIFT$" + .string "MOVE$" + .string "PLACE$" + .string "SUMMARY$" + .string "RELEASE$" + .string "MARK$" + .string "NAME$" + .string "JUMP$" + .string "WALLPAPER$" + .string "TAKE$" + .string "GIVE$" + .string "SWITCH$" + .string "BAG$" + .string "INFO$" + .string "SCENERY 1$" + .string "SCENERY 2$" + .string "SCENERY 3$" + .string "ETCETERA$" + .string "FRIENDS$" + .string "FOREST$" + .string "CITY$" + .string "DESERT$" + .string "SAVANNA$" + .string "CRAG$" + .string "VOLCANO$" + .string "SNOW$" + .string "CAVE$" + .string "BEACH$" + .string "SEAFLOOR$" + .string "RIVER$" + .string "SKY$" + .string "POLKA-DOT$" + .string "POKéCENTER$" + .string "MACHINE$" + .string "SIMPLE$" + .string "What would you like to do?$" + .string "WITHDRAW POKéMON$" + .string "DEPOSIT POKéMON$" + .string "MOVE POKéMON$" + .string "MOVE ITEMS$" + .string "SEE YA!$" + .string "Move POKéMON stored in BOXES to\nyour party.$" + .string "Store POKéMON in your party in BOXES.$" + .string "Organize the POKéMON in BOXES and\nin your party.$" + .string "Move items held by any POKéMON\nin a BOX or your party.$" + .string "Return to the previous menu.$" gUnknown_085EBC89:: @ 85EBC89 - -.string "There is just one POKéMON with you.$" + .string "There is just one POKéMON with you.$" gUnknown_085EBCAD:: @ 85EBCAD - -.string "Your party is full!$" + .string "Your party is full!$" gUnknown_085EBCC1:: @ 85EBCC1 - -.string "BOX$" -.string "Check the map of the HOENN region.$" -.string "Check POKéMON in detail.$" -.string "Call a registered TRAINER.$" -.string "Check obtained RIBBONS.$" -.string "Put away the POKéNAV.$" + .string "BOX$" + .string "Check the map of the HOENN region.$" + .string "Check POKéMON in detail.$" + .string "Call a registered TRAINER.$" + .string "Check obtained RIBBONS.$" + .string "Put away the POKéNAV.$" gUnknown_085EBD4A:: @ 85EBD4A - -.string "There are no RIBBON winners.$" -.string "No TRAINERS are registered.$" -.string "Check party POKéMON in detail.$" -.string "Check all POKéMON in detail.$" -.string "Return to the POKéNAV menu.$" -.string "Find cool POKéMON.$" -.string "Find beautiful POKéMON.$" -.string "Find cute POKéMON.$" -.string "Find smart POKéMON.$" -.string "Find tough POKéMON.$" -.string "Return to the CONDITION menu.$" + .string "There are no RIBBON winners.$" + .string "No TRAINERS are registered.$" + .string "Check party POKéMON in detail.$" + .string "Check all POKéMON in detail.$" + .string "Return to the POKéNAV menu.$" + .string "Find cool POKéMON.$" + .string "Find beautiful POKéMON.$" + .string "Find cute POKéMON.$" + .string "Find smart POKéMON.$" + .string "Find tough POKéMON.$" + .string "Return to the CONDITION menu.$" gUnknown_085EBE5F:: @ 85EBE5F - -.string "No. registered$" + .string "No. registered$" gUnknown_085EBE6E:: @ 85EBE6E - -.string "No. of battles$" -.string "DETAIL$" -.string "CALL$" -.string "EXIT$" -.string "Can’t call opponent here.$" -.string "STRATEGY$" -.string "TRAINER’S POKéMON$" -.string "SELF-INTRODUCTION$" -.string "{CLEAR}ィ$" -.string "{248} ZOOM {248}ÀCANCEL$" -.string "{248} FULL {248}ÀCANCEL$" -.string "{248} CONDITION {248}ÀCANCEL$" -.string "{248} MARKINGS {248}ÀCANCEL$" -.string "{248} SELECT MARK {248}ÀCANCEL$" -.string "{248} MENU {248}ÀCANCEL$" -.string "{248} OK {248}ÀCANCEL$" -.string "{248}ÀCANCEL$" -.string "{248} RIBBONS {248}ÀCANCEL$" -.string "{248} CHECK {248}ÀCANCEL$" -.string "{248}ÀCANCEL$" + .string "No. of battles$" + .string "DETAIL$" + .string "CALL$" + .string "EXIT$" + .string "Can’t call opponent here.$" + .string "STRATEGY$" + .string "TRAINER’S POKéMON$" + .string "SELF-INTRODUCTION$" + .string "{CLEAR 0x80}$" + .string "{UNK_CTRL_F800}ZOOM {UNK_CTRL_F801}CANCEL$" + .string "{UNK_CTRL_F800}FULL {UNK_CTRL_F801}CANCEL$" + .string "{UNK_CTRL_F800}CONDITION {UNK_CTRL_F801}CANCEL$" + .string "{UNK_CTRL_F800}MARKINGS {UNK_CTRL_F801}CANCEL$" + .string "{UNK_CTRL_F800}SELECT MARK {UNK_CTRL_F801}CANCEL$" + .string "{UNK_CTRL_F800}MENU {UNK_CTRL_F801}CANCEL$" + .string "{UNK_CTRL_F800}OK {UNK_CTRL_F801}CANCEL$" + .string "{UNK_CTRL_F801}CANCEL$" + .string "{UNK_CTRL_F800}RIBBONS {UNK_CTRL_F801}CANCEL$" + .string "{UNK_CTRL_F800}CHECK {UNK_CTRL_F801}CANCEL$" + .string "{UNK_CTRL_F801}CANCEL$" gUnknown_085EBF8D:: @ 85EBF8D - -.string "NATURE/$" + .string "NATURE/$" gUnknown_085EBF95:: @ 85EBF95 - -.string "That TRAINER is close by.\nTalk to the TRAINER in person!$" + .string "That TRAINER is close by.\nTalk to the TRAINER in person!$" gUnknown_085EBFCE:: @ 85EBFCE - -.string "IN PARTY$" + .string "IN PARTY$" gUnknown_085EBFD7:: @ 85EBFD7 - -.string "No. $" -.string "RIBBONS$" -.string "{SPECIAL_F7} {COLOR_HIGHLIGHT_SHADOW YELLOW DARK_GREY}É♂{COLOR_HIGHLIGHT_SHADOW RED DARK_GREY}Â/{LV}{SPECIAL_F7}À$" -.string "{SPECIAL_F7} {COLOR_HIGHLIGHT_SHADOW MAGENTA DARK_GREY}Ë♀{COLOR_HIGHLIGHT_SHADOW RED DARK_GREY}Â/{LV}{SPECIAL_F7}À$" -.string "{SPECIAL_F7} /{LV}{SPECIAL_F7}À$" + .string "No. $" + .string "RIBBONS$" + .string "{SPECIAL_F7 0x00}{COLOR_HIGHLIGHT_SHADOW LIGHT_RED WHITE GREEN}♂{COLOR_HIGHLIGHT_SHADOW DARK_GREY WHITE LIGHT_GREY}/{LV}{SPECIAL_F7 0x01}$" + .string "{SPECIAL_F7 0x00}{COLOR_HIGHLIGHT_SHADOW LIGHT_GREEN WHITE BLUE}♀{COLOR_HIGHLIGHT_SHADOW DARK_GREY WHITE LIGHT_GREY}/{LV}{SPECIAL_F7 0x01}$" + .string "{SPECIAL_F7 0x00}/{LV}{SPECIAL_F7 0x01}$" gUnknown_085EC00F:: @ 85EC00F - -.string "UNKNOWN$" -.string "CALL$" -.string "CHECK$" -.string "CANCEL$" + .string "UNKNOWN$" + .string "CALL$" + .string "CHECK$" + .string "CANCEL$" gUnknown_085EC029:: @ 85EC029 - -.string "No. {SPECIAL_F7} $" + .string "No. {SPECIAL_F7 0x00}$" gUnknown_085EC030:: @ 85EC030 - -.string "RIBBONS {SPECIAL_F7} $" -.string "{SPECIAL_F7} {COLOR_HIGHLIGHT_SHADOW YELLOW DARK_GREY}É♂{COLOR_HIGHLIGHT_SHADOW RED DARK_GREY}Â/{LV}{SPECIAL_F7}À{SPECIAL_F7}Á$" -.string "{SPECIAL_F7} {COLOR_HIGHLIGHT_SHADOW MAGENTA DARK_GREY}Ë♀{COLOR_HIGHLIGHT_SHADOW RED DARK_GREY}Â/{LV}{SPECIAL_F7}À{SPECIAL_F7}Á$" -.string "{SPECIAL_F7} /{LV}{SPECIAL_F7}À{SPECIAL_F7}Á$" -.string "Combine four words or phrases$" -.string "and make your profile.$" -.string "Combine six words or phrases$" -.string "and make a message.$" -.string "Find words that describe your$" -.string "feelings right now.$" -.string "With four phrases,$" -.string "Combine nine words or phrases$" -.string "and make a message.$" -.string "Change just one word or phrase$" -.string "and improve the BARD’s song.$" -.string "Your profile$" -.string "Your feeling at the battle’s start$" -.string "What you say if you win a battle$" -.string "What you say if you lose a battle$" -.string "The answer$" -.string "The MAIL message$" -.string "The MAIL salutation$" -.string "The new song$" -.string "Combine two words or phrases$" -.string "and make a trendy saying.$" -.string "The trendy saying$" -.string "is as shown. Okay?$" -.string "Combine two words or phrases$" -.string "to teach her a good saying.$" -.string "Find words which fit$" -.string "the TRAINER’s image.$" -.string "The image:$" -.string "Out of the listed choices,$" -.string "select the answer to the quiz!$" -.string "and create a quiz!$" -.string "Pick a word or phrase and$" -.string "set the quiz answer.$" -.string "The answer:$" -.string "The quiz:$" -.string "Apprentice’s phrase:$" + .string "RIBBONS {SPECIAL_F7 0x00}$" + .string "{SPECIAL_F7 0x00}{COLOR_HIGHLIGHT_SHADOW LIGHT_RED WHITE GREEN}♂{COLOR_HIGHLIGHT_SHADOW DARK_GREY WHITE LIGHT_GREY}/{LV}{SPECIAL_F7 0x01}{SPECIAL_F7 0x02}$" + .string "{SPECIAL_F7 0x00}{COLOR_HIGHLIGHT_SHADOW LIGHT_GREEN WHITE BLUE}♀{COLOR_HIGHLIGHT_SHADOW DARK_GREY WHITE LIGHT_GREY}/{LV}{SPECIAL_F7 0x01}{SPECIAL_F7 0x02}$" + .string "{SPECIAL_F7 0x00}/{LV}{SPECIAL_F7 0x01}{SPECIAL_F7 0x02}$" + .string "Combine four words or phrases$" + .string "and make your profile.$" + .string "Combine six words or phrases$" + .string "and make a message.$" + .string "Find words that describe your$" + .string "feelings right now.$" + .string "With four phrases,$" + .string "Combine nine words or phrases$" + .string "and make a message.$" + .string "Change just one word or phrase$" + .string "and improve the BARD’s song.$" + .string "Your profile$" + .string "Your feeling at the battle’s start$" + .string "What you say if you win a battle$" + .string "What you say if you lose a battle$" + .string "The answer$" + .string "The MAIL message$" + .string "The MAIL salutation$" + .string "The new song$" + .string "Combine two words or phrases$" + .string "and make a trendy saying.$" + .string "The trendy saying$" + .string "is as shown. Okay?$" + .string "Combine two words or phrases$" + .string "to teach her a good saying.$" + .string "Find words which fit$" + .string "the TRAINER’s image.$" + .string "The image:$" + .string "Out of the listed choices,$" + .string "select the answer to the quiz!$" + .string "and create a quiz!$" + .string "Pick a word or phrase and$" + .string "set the quiz answer.$" + .string "The answer:$" + .string "The quiz:$" + .string "Apprentice’s phrase:$" gUnknown_085EC3A6:: @ 85EC3A6 - -.string "Quit editing?$" + .string "Quit editing?$" gUnknown_085EC3B4:: @ 85EC3B4 - -.string "Stop giving the POKéMON MAIL?$" -.string "and fill out the questionnaire.$" -.string "Let’s reply to the interview!$" + .string "Stop giving the POKéMON MAIL?$" + .string "and fill out the questionnaire.$" + .string "Let’s reply to the interview!$" gUnknown_085EC410:: @ 85EC410 - -.string "All the text being edited will$" + .string "All the text being edited will$" gUnknown_085EC42F:: @ 85EC42F - -.string "be deleted. Is that okay?$" -.string "Quit editing?$" -.string "The edited text will not be saved.$" -.string "Is that okay?$" -.string "Please enter a phrase or word.$" -.string "The entire text can’t be deleted.$" + .string "be deleted. Is that okay?$" + .string "Quit editing?$" + .string "The edited text will not be saved.$" + .string "Is that okay?$" + .string "Please enter a phrase or word.$" + .string "The entire text can’t be deleted.$" gUnknown_085EC4C9:: @ 85EC4C9 - -.string "Only one phrase may be changed.$" + .string "Only one phrase may be changed.$" gUnknown_085EC4E9:: @ 85EC4E9 - -.string "The original song will be used.$" -.string "That’s trendy already!$" + .string "The original song will be used.$" + .string "That’s trendy already!$" gUnknown_085EC520:: @ 85EC520 - .incbin "baserom.gba", 0x5ec520, 0x152 + .string "Combine two words or phrases.$" + .string "Quit giving information?$" + .string "Stop giving the POKéMON MAIL?$" + .string "Create a quiz!$" + .string "Set the answer!$" + .string "Cancel the selection?$" + .string "PROFILE$" + .string "At the battle’s start:$" + .string "Upon winning a battle:$" + .string "Upon losing a battle:$" + .string "The BARD’s Song$" + .string "What’s hip and happening?$" + .string "Interview$" + .string "Good saying$" + .string "Fan’s question$" + .string "クイズの こたえは?$" @ "kuizuno kotaeha?" ("The quiz's answer is?" in Japanese) + .string "Apprentice’s phrase$" + .string "QUESTIONNAIRE$" gUnknown_085EC672:: @ 85EC672 - -.string "You cannot quit here.$" + .string "You cannot quit here.$" gUnknown_085EC688:: @ 85EC688 - -.string "This section must be completed.$" + .string "This section must be completed.$" gUnknown_085EC6A8:: @ 85EC6A8 - -.string "{SPECIAL_F7} ’s quiz$" + .string "{SPECIAL_F7 0x00}’s quiz$" gUnknown_085EC6B2:: @ 85EC6B2 - -.string "Lady$" -.string "After you have read the quiz$" -.string "question, press the A Button.$" -.string "The quiz answer is?$" + .string "Lady$" + .string "After you have read the quiz$" + .string "question, press the A Button.$" + .string "The quiz answer is?$" gUnknown_085EC706:: @ 85EC706 - -.string "Would you like to quit this quiz$" + .string "Would you like to quit this quiz$" gUnknown_085EC727:: @ 85EC727 - -.string "challenge?$" -.string "Is this quiz OK?$" + .string "challenge?$" + .string "Is this quiz OK?$" gUnknown_085EC743:: @ 85EC743 - -.string "Create a quiz!$" + .string "Create a quiz!$" gUnknown_085EC752:: @ 85EC752 - -.string "Select the answer!$" + .string "Select the answer!$" gUnknown_085EC765:: @ 85EC765 - -.string "The lyrics can’t be deleted.$" -.string "POKéMON LEAGUE$" -.string "POKéMON CENTER$" + .string "The lyrics can’t be deleted.$" + .string "POKéMON LEAGUE$" + .string "POKéMON CENTER$" gUnknown_085EC7A0:: @ 85EC7A0 - -.string " gets a {POKEBLOCK}?$" -.string "Coolness $" -.string "Beauty $" -.string "Cuteness $" -.string "Smartness $" -.string "Toughness $" + .string " gets a {POKEBLOCK}?$" + .string "Coolness $" + .string "Beauty $" + .string "Cuteness $" + .string "Smartness $" + .string "Toughness $" gUnknown_085EC7E1:: @ 85EC7E1 - -.string "was enhanced!$" + .string "was enhanced!$" gUnknown_085EC7EF:: @ 85EC7EF - -.string "Nothing changed!$" + .string "Nothing changed!$" gUnknown_085EC800:: @ 85EC800 - -.string "It won’t eat anymore…$" + .string "It won’t eat anymore…$" gUnknown_085EC816:: @ 85EC816 - -.string "Save failed. Checking the backup\nmemory… Please wait.\n{COLOR BLUE}“Time required: about 1 minute”$" + .string "Save failed. Checking the backup\nmemory… Please wait.\n{COLOR RED}“Time required: about 1 minute”$" gUnknown_085EC86F:: @ 85EC86F - -.string "The backup memory is damaged, or\nthe internal battery has run dry.\nYou can still play, but not save.$" + .string "The backup memory is damaged, or\nthe internal battery has run dry.\nYou can still play, but not save.$" gUnknown_085EC8D4:: @ 85EC8D4 - -.string "{COLOR BLUE}“Game play cannot be continued.\nReturning to the title screen…”$" + .string "{COLOR RED}“Game play cannot be continued.\nReturning to the title screen…”$" gUnknown_085EC917:: @ 85EC917 - -.string "Check completed.\nAttempting to save again.\nPlease wait.$" + .string "Check completed.\nAttempting to save again.\nPlease wait.$" gUnknown_085EC94F:: @ 85EC94F - -.string "Save completed.\n{COLOR BLUE}“Game play cannot be continued.\nReturning to the title screen.”$" + .string "Save completed.\n{COLOR RED}“Game play cannot be continued.\nReturning to the title screen.”$" gUnknown_085EC9A2:: @ 85EC9A2 - -.string "Save completed.\n{COLOR BLUE}“Please press the A Button.”$" + .string "Save completed.\n{COLOR RED}“Please press the A Button.”$" gUnknown_085EC9D2:: @ 85EC9D2 - -.string "FERRY$" + .string "FERRY$" gUnknown_085EC9D8:: @ 85EC9D8 - -.string "SECRET BASE$" + .string "SECRET BASE$" gUnknown_085EC9E4:: @ 85EC9E4 - -.string "HIDEOUT$" + .string "HIDEOUT$" gUnknown_085EC9EC:: @ 85EC9EC - -.string "Reset RTC?\nA: Confirm, B: Cancel$" + .string "Reset RTC?\nA: Confirm, B: Cancel$" gUnknown_085ECA0D:: @ 85ECA0D - -.string "Present time in game$" + .string "Present time in game$" gUnknown_085ECA22:: @ 85ECA22 - -.string "Previous time in game$" + .string "Previous time in game$" gUnknown_085ECA38:: @ 85ECA38 - -.string "Please reset the time.$" + .string "Please reset the time.$" gUnknown_085ECA4F:: @ 85ECA4F - -.string "The clock has been reset.\nData will be saved. Please wait.$" + .string "The clock has been reset.\nData will be saved. Please wait.$" gUnknown_085ECA8A:: @ 85ECA8A - -.string "Save completed.$" + .string "Save completed.$" gUnknown_085ECA9A:: @ 85ECA9A - -.string "Save failed…$" + .string "Save failed…$" gUnknown_085ECAA7:: @ 85ECAA7 - -.string "There is no save file, so the time\ncan’t be set.$" + .string "There is no save file, so the time\ncan’t be set.$" gUnknown_085ECAD8:: @ 85ECAD8 - -.string "The in-game clock adjustment system\nis now useable.$" + .string "The in-game clock adjustment system\nis now useable.$" gUnknown_085ECB0C:: @ 85ECB0C - -.string "SLOTS$" + .string "SLOTS$" gUnknown_085ECB12:: @ 85ECB12 - -.string "ROULETTE$" + .string "ROULETTE$" gUnknown_085ECB1B:: @ 85ECB1B - -.string "Good$" + .string "Good$" gUnknown_085ECB20:: @ 85ECB20 - -.string "Very good$" + .string "Very good$" gUnknown_085ECB2A:: @ 85ECB2A - -.string "Excellent$" + .string "Excellent$" gUnknown_085ECB34:: @ 85ECB34 - -.string "So-so$" + .string "So-so$" gUnknown_085ECB3A:: @ 85ECB3A - -.string "Bad$" + .string "Bad$" gUnknown_085ECB3E:: @ 85ECB3E - -.string "The worst$" + .string "The worst$" gUnknown_085ECB48:: @ 85ECB48 - -.string "spicy$" + .string "spicy$" gUnknown_085ECB4E:: @ 85ECB4E - -.string "dry$" + .string "dry$" gUnknown_085ECB52:: @ 85ECB52 - -.string "sweet$" + .string "sweet$" gUnknown_085ECB58:: @ 85ECB58 - -.string "bitter$" + .string "bitter$" gUnknown_085ECB5F:: @ 85ECB5F - -.string "sour$" + .string "sour$" gUnknown_085ECB64:: @ 85ECB64 - -.string "SINGLE$" + .string "SINGLE$" gUnknown_085ECB6B:: @ 85ECB6B - -.string "DOUBLE$" + .string "DOUBLE$" gUnknown_085ECB72:: @ 85ECB72 - -.string "jackpot$" + .string "jackpot$" gUnknown_085ECB7A:: @ 85ECB7A - -.string "first$" + .string "first$" gUnknown_085ECB80:: @ 85ECB80 - -.string "second$" + .string "second$" gUnknown_085ECB87:: @ 85ECB87 - .incbin "baserom.gba", 0x5ecb87, 0x3d6 + .string "third$" + .string "0 pts$" + .string "10 pts$" + .string "20 pts$" + .string "30 pts$" + .string "40 pts$" + .string "50 pts$" + .string "60 pts$" + .string "70 pts$" + .string "80 pts$" + .string "90 pts$" + .string "100 pts$" + .string "?$" + .string "KISS POSTER{CLEAR_TO 0x5E}16BP$" + .string "KISS CUSHION{CLEAR_TO 0x5E}32BP$" + .string "SMOOCHUM DOLL{CLEAR_TO 0x5E}32BP$" + .string "TOGEPI DOLL{CLEAR_TO 0x5E}48BP$" + .string "MEOWTH DOLL{CLEAR_TO 0x5E}48BP$" + .string "CLEFAIRY DOLL{CLEAR_TO 0x5E}48BP$" + .string "DITTO DOLL{CLEAR_TO 0x5E}48BP$" + .string "CYNDAQUIL DOLL{CLEAR_TO 0x5E}80BP$" + .string "CHIKORITA DOLL{CLEAR_TO 0x5E}80BP$" + .string "TOTODILE DOLL{CLEAR_TO 0x5E}80BP$" + .string "LAPRAS DOLL{CLEAR_TO 0x58}128BP$" + .string "SNORLAX DOLL{CLEAR_TO 0x58}128BP$" + .string "VENUSAUR DOLL{CLEAR_TO 0x58}256BP$" + .string "CHARIZARD DOLL{CLEAR_TO 0x58}256BP$" + .string "BLASTOISE DOLL{CLEAR_TO 0x58}256BP$" + .string "PROTEIN{CLEAR_TO 0x64}1BP$" + .string "CALCIUM{CLEAR_TO 0x64}1BP$" + .string "IRON{CLEAR_TO 0x64}1BP$" + .string "ZINC{CLEAR_TO 0x64}1BP$" + .string "CARBOS{CLEAR_TO 0x64}1BP$" + .string "HP UP{CLEAR_TO 0x64}1BP$" + .string "LEFTOVERS{CLEAR_TO 0x5E}48BP$" + .string "WHITE HERB{CLEAR_TO 0x5E}48BP$" + .string "QUICK CLAW{CLEAR_TO 0x5E}48BP$" + .string "MENTAL HERB{CLEAR_TO 0x5E}48BP$" + .string "BRIGHTPOWDER{CLEAR_TO 0x5E}64BP$" + .string "CHOICE BAND{CLEAR_TO 0x5E}64BP$" + .string "KING’S ROCK{CLEAR_TO 0x5E}64BP$" + .string "FOCUS BAND{CLEAR_TO 0x5E}64BP$" + .string "SCOPE LENS{CLEAR_TO 0x5E}64BP$" + .string "SOFTBOILED{CLEAR_TO 0x4E}16BP$" + .string "SEISMIC TOSS{CLEAR_TO 0x4E}24BP$" + .string "DREAM EATER{CLEAR_TO 0x4E}24BP$" + .string "MEGA PUNCH{CLEAR_TO 0x4E}24BP$" + .string "MEGA KICK{CLEAR_TO 0x4E}48BP$" + .string "BODY SLAM{CLEAR_TO 0x4E}48BP$" + .string "ROCK SLIDE{CLEAR_TO 0x4E}48BP$" + .string "COUNTER{CLEAR_TO 0x4E}48BP$" + .string "THUNDER WAVE{CLEAR_TO 0x4E}48BP$" + .string "SWORDS DANCE{CLEAR_TO 0x4E}48BP$" + .string "DEFENSE CURL{CLEAR_TO 0x4E}16BP$" + .string "SNORE{CLEAR_TO 0x4E}24BP$" + .string "MUD-SLAP{CLEAR_TO 0x4E}24BP$" + .string "SWIFT{CLEAR_TO 0x4E}24BP$" + .string "ICY WIND{CLEAR_TO 0x4E}24BP$" + .string "ENDURE{CLEAR_TO 0x4E}48BP$" + .string "PSYCH UP{CLEAR_TO 0x4E}48BP$" + .string "ICE PUNCH{CLEAR_TO 0x4E}48BP$" + .string "THUNDERPUNCH{CLEAR_TO 0x4E}48BP$" + .string "FIRE PUNCH{CLEAR_TO 0x4E}48BP$" gUnknown_085ECF5D:: @ 85ECF5D - -.string "{STR_VAR_1} fainted…\p\n$" + .string "{STR_VAR_1} fainted…\p\n$" gOtherText_Marco:: @ 85ECF6B - -.string "MARCO$" + .string "MARCO$" gUnknown_085ECF71:: @ 85ECF71 - -.string "NAME: $" + .string "NAME: $" gUnknown_085ECF78:: @ 85ECF78 - -.string "IDNo.$" + .string "IDNo.$" gUnknown_085ECF7E:: @ 85ECF7E - -.string "MONEY$" -.string "¥$" + .string "MONEY$" + .string "¥$" gUnknown_085ECF86:: @ 85ECF86 - -.string "POKéDEX$" + .string "POKéDEX$" gUnknown_085ECF8E:: @ 85ECF8E - -.string "$" + .string "$" gUnknown_085ECF8F:: @ 85ECF8F - -.string ":$" -.string " points$" + .string ":$" + .string " points$" gUnknown_085ECF99:: @ 85ECF99 - -.string "TIME$" -.string "ゲ-ムポ¡ント$" + .string "TIME$" + .string "ゲ-ムポイント$" gUnknown_085ECFA6:: @ 85ECFA6 - -.string "{STR_VAR_1}’s TRAINER CARD$" + .string "{STR_VAR_1}’s TRAINER CARD$" gUnknown_085ECFB8:: @ 85ECFB8 - -.string "HALL OF FAME DEBUT $" -.string "LINK BATTLES$" -.string "LINK CABLE BATTLES$" + .string "HALL OF FAME DEBUT $" + .string "LINK BATTLES$" + .string "LINK CABLE BATTLES$" gUnknown_085ECFED:: @ 85ECFED - -.string "W:{COLOR BLUE}{SHADOW YELLOW}{STR_VAR_1}{COLOR RED}{SHADOW GREEN} L:{COLOR BLUE}{SHADOW YELLOW}{STR_VAR_2}{COLOR RED}{SHADOW GREEN}$" + .string "W:{COLOR RED}{SHADOW LIGHT_RED}{STR_VAR_1}{COLOR DARK_GREY}{SHADOW LIGHT_GREY} L:{COLOR RED}{SHADOW LIGHT_RED}{STR_VAR_2}{COLOR DARK_GREY}{SHADOW LIGHT_GREY}$" gUnknown_085ED010:: @ 85ED010 - -.string "POKéMON TRADES$" + .string "POKéMON TRADES$" gUnknown_085ED01F:: @ 85ED01F - -.string "UNION TRADES & BATTLES$" + .string "UNION TRADES & BATTLES$" gUnknown_085ED036:: @ 85ED036 - -.string "BERRY CRUSH$" + .string "BERRY CRUSH$" gUnknown_085ED042:: @ 85ED042 - -.string "Waiting for the other TRAINER to\nfinish reading your TRAINER CARD.$" + .string "Waiting for the other TRAINER to\nfinish reading your TRAINER CARD.$" gUnknown_085ED085:: @ 85ED085 - -.string "{POKEBLOCK}S W/FRIENDS$" + .string "{POKEBLOCK}S W/FRIENDS$" gUnknown_085ED096:: @ 85ED096 - -.string "{STR_VAR_1}{COLOR RED}{SHADOW GREEN}$" + .string "{STR_VAR_1}{COLOR DARK_GREY}{SHADOW LIGHT_GREY}$" gUnknown_085ED09F:: @ 85ED09F - -.string "WON CONTESTS W/FRIENDS$" + .string "WON CONTESTS W/FRIENDS$" gUnknown_085ED0B6:: @ 85ED0B6 - -.string "BATTLE POINTS WON$" + .string "BATTLE POINTS WON$" gUnknown_085ED0C8:: @ 85ED0C8 - -.string "{STR_VAR_1}{COLOR RED}{SHADOW GREEN}BP$" + .string "{STR_VAR_1}{COLOR DARK_GREY}{SHADOW LIGHT_GREY}BP$" gUnknown_085ED0D3:: @ 85ED0D3 - -.string "BATTLE TOWER$" + .string "BATTLE TOWER$" gUnknown_085ED0E0:: @ 85ED0E0 + .string "W/{COLOR RED}{SHADOW LIGHT_RED}{STR_VAR_1}{COLOR DARK_GREY}{SHADOW LIGHT_GREY} STRAIGHT/{COLOR RED}{SHADOW LIGHT_RED}{STR_VAR_2}$" + .string "BATTLE TOWER$" + .string "BATTLE DOME$" + .string "BATTLE PALACE$" + .string "BATTLE FACTORY$" + .string "BATTLE ARENA$" + .string "BATTLE PIKE$" + .string "BATTLE PYRAMID$" -.string "W/{COLOR BLUE}{SHADOW YELLOW}{STR_VAR_1}{COLOR RED}{SHADOW GREEN} STRAIGHT/{COLOR BLUE}{SHADOW YELLOW}{STR_VAR_2}$" -.string "BATTLE TOWER$" -.string "BATTLE DOME$" -.string "BATTLE PALACE$" -.string "BATTLE FACTORY$" -.string "BATTLE ARENA$" -.string "BATTLE PIKE$" -.string "BATTLE PYRAMID$" -.string " {STR_VAR_1} SINGLE$" -.string " {STR_VAR_1} DOUBLE$" -.string " {STR_VAR_1} MULTI$" -.string " {STR_VAR_1} LINK$" -.string "{STR_VAR_1}$" + .align 2 + .string "{STR_VAR_1} SINGLE$" + .align 2 + .string "{STR_VAR_1} DOUBLE$" + .align 2 + .string "{STR_VAR_1} MULTI$" + .align 2 + .string "{STR_VAR_1} LINK$" + .string "{STR_VAR_1}$" gUnknown_085ED193:: @ 85ED193 - -.string "Give$" + .string "Give$" gUnknown_085ED198:: @ 85ED198 - -.string "No need$" + .string "No need$" gUnknown_085ED1A0:: @ 85ED1A0 - -.string "{COLOR GREEN}{SHADOW RED}$" + .string "{COLOR LIGHT_GREY}{SHADOW DARK_GREY}$" gUnknown_085ED1A7:: @ 85ED1A7 - -.string "{COLOR LIGHT_GREY}$" + .string "{COLOR BLUE}$" gUnknown_085ED1AB:: @ 85ED1AB - -.string "{HIGHLIGHT TRANSPARENT}{COLOR TRANSPARENT}$" + .string "{HIGHLIGHT TRANSPARENT}{COLOR TRANSPARENT}$" gUnknown_085ED1B2:: @ 85ED1B2 - -.string "C.$" + .string "C.$" gUnknown_085ED1B5:: @ 85ED1B5 - -.string "B.$" + .string "B.$" gUnknown_085ED1B8:: @ 85ED1B8 - -.string "Announcing the results!$" + .string "Announcing the results!$" gUnknown_085ED1D0:: @ 85ED1D0 - -.string "The preliminary results!$" + .string "The preliminary results!$" gUnknown_085ED1E9:: @ 85ED1E9 - -.string "Round 2 results!$" + .string "Round 2 results!$" gUnknown_085ED1FA:: @ 85ED1FA - -.string "{STR_VAR_1}’s {STR_VAR_2} won!$" + .string "{STR_VAR_1}’s {STR_VAR_2} won!$" gUnknown_085ED207:: @ 85ED207 - -.string "Communication standby…$" + .string "Communication standby…$" gUnknown_085ED21E:: @ 85ED21E - -.string "{COLOR RED}$" -.string "{COLOR_HIGHLIGHT_SHADOW WHITE2 DARK_GREY}Ó$" + .string "{COLOR DARK_GREY}$" + .string "{COLOR_HIGHLIGHT_SHADOW BORDER_COLOR6 WHITE BORDER_COLOR5}$" gUnknown_085ED228:: @ 85ED228 - -.string "{HIGHLIGHT RED}$" -.string " $" + .string "{HIGHLIGHT DARK_GREY}$" + .string " $" gUnknown_085ED22E:: @ 85ED22E - -.string "{COLOR SILVER}♂$" + .string "{COLOR BORDER_COLOR2}♂$" gUnknown_085ED233:: @ 85ED233 - -.string "{COLOR BLACK2}♀$" + .string "{COLOR BORDER_COLOR1}♀$" gUnknown_085ED238:: @ 85ED238 - -.string "{COLOR SILVER}$" -.string "UPPER$" -.string "lower$" -.string "OTHERS$" -.string "SYMBOLS$" -.string "REGISTER$" -.string "EXIT$" -.string "Quit chatting?$" -.string "Register text where?$" -.string "Register text here?$" -.string "Input text.$" + .string "{COLOR BORDER_COLOR2}$" + .string "UPPER$" + .string "lower$" + .string "OTHERS$" + .string "SYMBOLS$" + .string "REGISTER$" + .string "EXIT$" + .string "Quit chatting?$" + .string "Register text where?$" + .string "Register text here?$" + .string "Input text.$" gUnknown_085ED2A9:: @ 85ED2A9 - -.string "{SPECIAL_F7} joined the chat!$" + .string "{SPECIAL_F7 0x00} joined the chat!$" gUnknown_085ED2BD:: @ 85ED2BD - -.string "{SPECIAL_F7} left the chat.$" -.string "{SPECIAL_F7} ç{SPECIAL_F7}ÀéÊò:$" -.string "{SPECIAL_F7} ç{SPECIAL_F7}ÀéÊòè ÁまÓ+$" -.string "Exiting the chat…$" -.string "The LEADER, {SPECIAL_F7} , has\nleft, ending the chat.$" -.string "The registered text has been changed.\nIs it okay to save the game?$" -.string "There is already a saved file.\nIs it okay to overwrite it?$" -.string "SAVING…\nDON’T TURN OFF THE POWER.$" -.string "{SPECIAL_F7} saved the game.$" -.string "If the LEADER leaves, the chat\nwill end. Is that okay?$" + .string "{SPECIAL_F7 0x00} left the chat.$" + .string "{SPECIAL_F7 0x00}ç{SPECIAL_F7 0x01}éÊò:$" + .string "{SPECIAL_F7 0x00}ç{SPECIAL_F7 0x01}éÊòè ÁまÓ+$" + .string "Exiting the chat…$" + .string "The LEADER, {SPECIAL_F7 0x00}, has\nleft, ending the chat.$" + .string "The registered text has been changed.\nIs it okay to save the game?$" + .string "There is already a saved file.\nIs it okay to overwrite it?$" + .string "SAVING…\nDON’T TURN OFF THE POWER.$" + .string "{SPECIAL_F7 0x00} saved the game.$" + .string "If the LEADER leaves, the chat\nwill end. Is that okay?$" gUnknown_085ED40F:: @ 85ED40F - -.string "HELLO$" + .string "HELLO$" gUnknown_085ED415:: @ 85ED415 - -.string "POKéMON$" + .string "POKéMON$" gUnknown_085ED41D:: @ 85ED41D - -.string "TRADE$" + .string "TRADE$" gUnknown_085ED423:: @ 85ED423 - -.string "BATTLE$" + .string "BATTLE$" gUnknown_085ED42A:: @ 85ED42A - -.string "LET’S$" + .string "LET’S$" gUnknown_085ED430:: @ 85ED430 - -.string "OK!$" + .string "OK!$" gUnknown_085ED434:: @ 85ED434 - -.string "SORRY$" + .string "SORRY$" gUnknown_085ED43A:: @ 85ED43A - -.string "YAY{249}{249}$" + .string "YAY{UNK_CTRL_F9F9}$" gUnknown_085ED440:: @ 85ED440 - -.string "THANK YOU$" + .string "THANK YOU$" gUnknown_085ED44A:: @ 85ED44A - -.string "BYE-BYE!$" -.string "Attack the weak points!$" -.string "Ultimate STEEL POKéMON.$" -.string "I’d climb even waterfalls$" -.string "to find a rare stone!$" -.string "I’m the strongest and most$" -.string "energetic after all!$" -.string "Battle with knowledge!$" -.string "I will use various POKéMON.$" -.string "I’ll be a better POKéMON$" -.string "prof than my father is!$" -.string "I’m not so good at battles.$" -.string "I’ll use any POKéMON!$" -.string "My POKéMON and I help$" -.string "my father’s research.$" + .string "BYE-BYE!$" + .string "Attack the weak points!$" + .string "Ultimate STEEL POKéMON.$" + .string "I’d climb even waterfalls$" + .string "to find a rare stone!$" + .string "I’m the strongest and most$" + .string "energetic after all!$" + .string "Battle with knowledge!$" + .string "I will use various POKéMON.$" + .string "I’ll be a better POKéMON$" + .string "prof than my father is!$" + .string "I’m not so good at battles.$" + .string "I’ll use any POKéMON!$" + .string "My POKéMON and I help$" + .string "my father’s research.$" gUnknown_085ED5A5:: @ 85ED5A5 - -.string "{STR_VAR_1} hatched from the EGG!$" + .string "{STR_VAR_1} hatched from the EGG!$" gUnknown_085ED5BE:: @ 85ED5BE - .incbin "baserom.gba", 0x5ed5be, 0x216 + .string "Would you like to nickname the newly\nhatched {STR_VAR_1}?$" + .align 2 + .string "Are you ready to BERRY-CRUSH?\nPlease pick a BERRY for use.\p$" + + .align 2 + .string "Please wait while each member\nchooses a BERRY.$" + + .align 2 + .string "{PAUSE_MUSIC}{PLAY_BGM BGM_FANFA1}You ended up with {STR_VAR_1} units of\nsilky-smooth BERRY POWDER.{RESUME_MUSIC}\pYour total amount of BERRY POWDER\nis {STR_VAR_2}.\p$" + + .align 2 + .string "Recording your game results in the\nsave file.\lPlease wait.$" + + .align 2 + .string "Want to play BERRY CRUSH again?$" + + .align 2 + .string "You have no BERRIES.\nThe game will be canceled.$" + + .align 2 + .string "A member dropped out.\nThe game will be canceled.$" + + .align 2 + .string "Time’s up.\pGood BERRY POWDER could not be\nmade…\p$" + + .align 2 + .string "Communication standby…$" + + .align 2 gUnknown_085ED7D4:: @ 85ED7D4 + .string "1. {COLOR BLUE}{SHADOW LIGHT_BLUE}{SPECIAL_F7 0x00}$" -.string "1. {COLOR LIGHT_GREY}{SHADOW BLACK}{SPECIAL_F7} $" - + .align 2 gUnknown_085ED7E0:: @ 85ED7E0 - .incbin "baserom.gba", 0x5ed7e0, 0x28 + .string "1. {SPECIAL_F7 0x00}$" + .align 2 + .string " time(s)$" + + .align 2 + .string "{STR_VAR_1}.{STR_VAR_2}$" + + .align 2 + .string "{STR_VAR_1} BERRY$" + + .align 2 gUnknown_085ED808:: @ 85ED808 - .incbin "baserom.gba", 0x5ed808, 0x8 - + .string "Time:$" + + .align 2 gUnknown_085ED810:: @ 85ED810 + .string "Pressing Speed:$" -.string "Pressing Speed:$" - + .align 2 gUnknown_085ED820:: @ 85ED820 - .incbin "baserom.gba", 0x5ed820, 0xc + .string "Silkiness:$" + .align 2 gUnknown_085ED82C:: @ 85ED82C - .incbin "baserom.gba", 0x5ed82c, 0x4 + .string "{STR_VAR_1}$" + .align 2 gUnknown_085ED830:: @ 85ED830 - .incbin "baserom.gba", 0x5ed830, 0x8 + .string " min. $" + .align 2 gUnknown_085ED838:: @ 85ED838 - .incbin "baserom.gba", 0x5ed838, 0x8 + .string "{STR_VAR_1}.{STR_VAR_2}$" + .align 2 gUnknown_085ED840:: @ 85ED840 - .incbin "baserom.gba", 0x5ed840, 0x8 + .string " sec.$" + .align 2 gUnknown_085ED848:: @ 85ED848 - .incbin "baserom.gba", 0x5ed848, 0x8 + .string "{STR_VAR_1}.{STR_VAR_2}$" + .align 2 gUnknown_085ED850:: @ 85ED850 - -.string " Times/sec.$" + .string " Times/sec.$" gUnknown_085ED85C:: @ 85ED85C - -.string "{STR_VAR_1}%$" + .string "{STR_VAR_1}%$" gUnknown_085ED860:: @ 85ED860 - -.string "No. of Presses Rankings$" + .string "No. of Presses Rankings$" gUnknown_085ED878:: @ 85ED878 + .string "Crushing Results$" -.string "Crushing Results$" -.string " Neatness Rankings$" -.string " Cooperative Rankings$" -.string " Pressing-Power Rankings$" + .align 2 + .string "Neatness Rankings$" + + .align 2 + .string "Cooperative Rankings$" + + .align 2 + .string "Pressing-Power Rankings$" gUnknown_085ED8D0:: @ 85ED8D0 - -.string "BERRY CRUSH$" + .string "BERRY CRUSH$" gUnknown_085ED8DC:: @ 85ED8DC - -.string "Pressing-Speed Rankings$" + .string "Pressing-Speed Rankings$" gUnknown_085ED8F4:: @ 85ED8F4 - -.string "{STR_VAR_1} PLAYERS$" + .string "{STR_VAR_1} PLAYERS$" gUnknown_085ED8FF:: @ 85ED8FF - -.string "Symbols Earned$" + .string "Symbols Earned$" gUnknown_085ED90E:: @ 85ED90E - -.string "Battle Record$" + .string "Battle Record$" gUnknown_085ED91C:: @ 85ED91C - -.string "Battle Points$" -.string "CANCEL$" -.string "$" -.string "Check BATTLE FRONTIER MAP.$" -.string "Check TRAINER CARD.$" -.string "View recorded battle.$" -.string "Put away the FRONTIER PASS.$" -.string "Your current Battle Points.$" -.string "Your collected Symbols.$" -.string "Battle Tower - Ability Symbol$" -.string "Battle Dome - Tactics Symbol$" -.string "Battle Palace - Spirits Symbol$" -.string "Battle Arena - Guts Symbol$" -.string "Battle Factory - Knowledge Symbol$" -.string "Battle Pike - Luck Symbol$" -.string "Battle Pyramid - Brave Symbol$" -.string "There is no Battle Record.$" -.string "BATTLE TOWER$" -.string "BATTLE DOME$" -.string "BATTLE PALACE$" -.string "BATTLE ARENA$" -.string "BATTLE FACTORY$" -.string "BATTLE PIKE$" -.string "BATTLE PYRAMID$" -.string "KO opponents and aim for the top!\nYour ability will be tested.$" -.string "Keep winning at the tournament!\nYour tactics will be tested.$" -.string "Watch your POKéMON battle!\nYour spirit will be tested.$" -.string "Win battles with teamed-up POKéMON!\nYour guts will be tested.$" -.string "Aim for victory using rental POKéMON!\nYour knowledge will be tested.$" -.string "Select one of three paths to battle!\nYour luck will be tested.$" -.string "Aim for the top with exploration!\nYour bravery will be tested.$" + .string "Battle Points$" + .string "CANCEL$" + .string "$" + .string "Check BATTLE FRONTIER MAP.$" + .string "Check TRAINER CARD.$" + .string "View recorded battle.$" + .string "Put away the FRONTIER PASS.$" + .string "Your current Battle Points.$" + .string "Your collected Symbols.$" + .string "Battle Tower - Ability Symbol$" + .string "Battle Dome - Tactics Symbol$" + .string "Battle Palace - Spirits Symbol$" + .string "Battle Arena - Guts Symbol$" + .string "Battle Factory - Knowledge Symbol$" + .string "Battle Pike - Luck Symbol$" + .string "Battle Pyramid - Brave Symbol$" + .string "There is no Battle Record.$" + .string "BATTLE TOWER$" + .string "BATTLE DOME$" + .string "BATTLE PALACE$" + .string "BATTLE ARENA$" + .string "BATTLE FACTORY$" + .string "BATTLE PIKE$" + .string "BATTLE PYRAMID$" + .string "KO opponents and aim for the top!\nYour ability will be tested.$" + .string "Keep winning at the tournament!\nYour tactics will be tested.$" + .string "Watch your POKéMON battle!\nYour spirit will be tested.$" + .string "Win battles with teamed-up POKéMON!\nYour guts will be tested.$" + .string "Aim for victory using rental POKéMON!\nYour knowledge will be tested.$" + .string "Select one of three paths to battle!\nYour luck will be tested.$" + .string "Aim for the top with exploration!\nYour bravery will be tested.$" gUnknown_085EDCC3:: @ 85EDCC3 - -.string "PLAYER$" + .string "PLAYER$" gUnknown_085EDCCA:: @ 85EDCCA - -.string "TIME$" + .string "TIME$" gUnknown_085EDCCF:: @ 85EDCCF - -.string "POKéDEX$" + .string "POKéDEX$" gUnknown_085EDCD7:: @ 85EDCD7 - -.string "BADGES$" + .string "BADGES$" gUnknown_085EDCDE:: @ 85EDCDE - -.string "POWDER$" + .string "POWDER$" gUnknown_085EDCE5:: @ 85EDCE5 - -.string "DODRIO BERRY-PICKING RECORDS$" -.string "BERRIES picked:$" -.string "Best score:$" -.string "BERRIES picked in a row with\nfive players:$" + .string "DODRIO BERRY-PICKING RECORDS$" + .string "BERRIES picked:$" + .string "Best score:$" + .string "BERRIES picked in a row with\nfive players:$" gUnknown_085EDD49:: @ 85EDD49 - -.string "Announcing BERRY-PICKING results!$" + .string "Announcing BERRY-PICKING results!$" gUnknown_085EDD6B:: @ 85EDD6B - .incbin "baserom.gba", 0x5edd6b, 0x1b + .string "{CLEAR_TO 0x03}10P{CLEAR_TO 0x2B}30P{CLEAR_TO 0x53}50P{CLEAR_TO 0x77}{UNK_CTRL_F9DD}50P$" gUnknown_085EDD86:: @ 85EDD86 - -.string "Announcing rankings!$" + .string "Announcing rankings!$" gUnknown_085EDD9B:: @ 85EDD9B - -.string "Announcing prizes!$" -.string "1:$" -.string "2:$" -.string "3:$" -.string "4:$" -.string "5:$" + .string "Announcing prizes!$" + .string "1:$" + .string "2:$" + .string "3:$" + .string "4:$" + .string "5:$" gUnknown_085EDDBD:: @ 85EDDBD - -.string "The first-place winner gets\nthis {SPECIAL_F7} !$" + .string "The first-place winner gets\nthis {SPECIAL_F7 0x00}!$" gUnknown_085EDDE2:: @ 85EDDE2 - -.string "You can’t hold any more!$" + .string "You can’t hold any more!$" gUnknown_085EDDFB:: @ 85EDDFB - -.string "It filled its storage space.$" + .string "It filled its storage space.$" gUnknown_085EDE18:: @ 85EDE18 - -.string "Want to play again?$" + .string "Want to play again?$" gUnknown_085EDE2C:: @ 85EDE2C - -.string "Somebody dropped out.\nThe link will be canceled.$" + .string "Somebody dropped out.\nThe link will be canceled.$" gUnknown_085EDE5D:: @ 85EDE5D - -.string " points$" + .string " points$" gUnknown_085EDE65:: @ 85EDE65 - -.string "Communication standby…$" + .string "Communication standby…$" gUnknown_085EDE7C:: @ 85EDE7C - -.string " points$" + .string " points$" gUnknown_085EDE84:: @ 85EDE84 - -.string " time(s)$" + .string " time(s)$" gUnknown_085EDE8D:: @ 85EDE8D - -.string "POKéMON JUMP RECORDS$" -.string "Jumps in a row:$" -.string "Best score:$" -.string "EXCELLENTS in a row:$" + .string "POKéMON JUMP RECORDS$" + .string "Jumps in a row:$" + .string "Best score:$" + .string "EXCELLENTS in a row:$" gUnknown_085EDED3:: @ 85EDED3 - -.string "Awesome score! You’ve\nwon {SPECIAL_F7}À {SPECIAL_F7} !$" + .string "Awesome score! You’ve\nwon {SPECIAL_F7 0x01} {SPECIAL_F7 0x00}!$" gUnknown_085EDEF4:: @ 85EDEF4 - -.string "It filled its storage space.$" + .string "It filled its storage space.$" gUnknown_085EDF11:: @ 85EDF11 - -.string "You can’t hold any more!$" + .string "You can’t hold any more!$" gUnknown_085EDF2A:: @ 85EDF2A - -.string "Want to play again?$" + .string "Want to play again?$" gUnknown_085EDF3E:: @ 85EDF3E - -.string "Somebody dropped out.\nThe link will be canceled.$" + .string "Somebody dropped out.\nThe link will be canceled.$" gUnknown_085EDF6F:: @ 85EDF6F - -.string "Communication standby…$" + .string "Communication standby…$" gUnknown_085EDF86:: @ 85EDF86 - -.string "{PLAYER}’s Link Contest Results$" + .string "{PLAYER}’s Link Contest Results$" gUnknown_085EDFA0:: @ 85EDFA0 - -.string "1st$" + .string "1st$" gUnknown_085EDFA4:: @ 85EDFA4 - -.string "2nd$" + .string "2nd$" gUnknown_085EDFA8:: @ 85EDFA8 - -.string "3rd$" + .string "3rd$" gUnknown_085EDFAC:: @ 85EDFAC - -.string "4th$" + .string "4th$" gUnknown_085EDFB0:: @ 85EDFB0 - -.string "Friend$" -.string "POKeMON$" + .string "Friend$" + .string "POKeMON$" gUnknown_085EDFBF:: @ 85EDFBF - -.string "êÏぎßóúÁóç$" + .string "ふしぎなもらいもの$" @ "fushiginamoraimono" ("Mystery Gift" in Japanese) gUnknown_085EDFC9:: @ 85EDFC9 + .string "{UNK_CTRL_F800}けってい {UNK_CTRL_F801}やめる$" @ "{UNK_CTRL_F800}kettei {UNK_CTRL_F801}yameru" ("{UNK_CTRL_F800}decide {UNK_CTRL_F801}stop" in Japanese) -.string "{248} ÌっÛÁ {248}Àôòñ$" - +@ A bunch of Japanese strings here, waiting for updated datadump to dump properly gUnknown_085EDFD6:: @ 85EDFD6 - .incbin "baserom.gba", 0x5edfd6, 0x1f + .byte 0x56, 0xae, 0x95, 0xd9, 0x78, 0xae, 0x91, 0xae, 0xf9, 0x04, 0x00, 0x44, 0xfe, 0x1c, 0x0c, 0x38, 0x15, 0x23, 0x27, 0x02, 0x23, 0x19, 0x2d, 0x00, 0x26, 0x20, 0x0a, 0x20, 0x1f, 0x0d, 0xff gUnknown_085EDFF5:: @ 85EDFF5 - .incbin "baserom.gba", 0x5edff5, 0x1f + .byte 0x56, 0xae, 0x95, 0xd9, 0x78, 0xae, 0x91, 0xae, 0xf9, 0x04, 0x19, 0x00, 0x72, 0x66, 0x85, 0xae, 0x06, 0x27, 0xfe, 0xb3, 0x12, 0x03, 0x0c, 0x2e, 0xb4, 0x2d, 0x00, 0x04, 0x27, 0x47, 0xff gUnknown_085EE014:: @ 85EE014 - .incbin "baserom.gba", 0x5ee014, 0x48 + .byte 0xb3, 0x8a, 0xae, 0x71, 0x9a, 0xae, 0x52, 0x51, 0x95, 0x96, 0x7e, 0x5d, 0x14, 0x12, 0x03, 0x0c, 0x2e, 0xb4, 0xfe, 0x2d, 0x00, 0x0e, 0x2e, 0x10, 0x08, 0x00, 0x0c, 0x13, 0x08, 0x41, 0x0b, 0x02 + .byte 0xff, 0x56, 0xae, 0x95, 0xd9, 0x78, 0xae, 0x91, 0xae, 0xf9, 0x04, 0x19, 0x00, 0xb3, 0x12, 0x03, 0x0c, 0x2e, 0xb4, 0x2d, 0xfe, 0x04, 0x27, 0x2e, 0x44, 0x00, 0xbb, 0x9a, 0x60, 0x7e, 0x2d, 0x00 + .byte 0x05, 0x0c, 0x13, 0x08, 0x41, 0x0b, 0x02, 0xff gUnknown_085EE05C:: @ 85EE05C - .incbin "baserom.gba", 0x5ee05c, 0xf + .byte 0x0e, 0x12, 0x40, 0x08, 0x37, 0x00, 0x1f, 0x11, 0x37, 0x50, 0x13, 0x02, 0x1f, 0x0d, 0xff gUnknown_085EE06B:: @ 85EE06B - .incbin "baserom.gba", 0x5ee06b, 0x2c + .byte 0x56, 0xae, 0x95, 0x19, 0x00, 0x26, 0x20, 0x0a, 0x20, 0x2d, 0xfe, 0x11, 0x35, 0x03, 0x0c, 0x00, 0x0c, 0x1f, 0x0c, 0x10, 0xff, 0x56, 0xae, 0x95, 0xd9, 0x78, 0xae, 0x91, 0xae, 0xf9, 0x04, 0x14 + .byte 0xfe, 0x12, 0x03, 0x0c, 0x2e, 0x00, 0x44, 0x07, 0x1f, 0x0e, 0x2e, 0xff gUnknown_085EE097:: @ 85EE097 - .incbin "baserom.gba", 0x5ee097, 0xc + .byte 0x12, 0x03, 0x0c, 0x2e, 0x00, 0x11, 0x35, 0x03, 0x00, 0x44, 0x0d, 0xff gUnknown_085EE0A3:: @ 85EE0A3 - .incbin "baserom.gba", 0x5ee0a3, 0x1c + .byte 0x12, 0x03, 0x0c, 0x2e, 0x00, 0x54, 0x77, 0xae, 0x44, 0x0d, 0xfe, 0x0e, 0x12, 0x40, 0x08, 0x2d, 0x00, 0x10, 0x0c, 0x06, 0x22, 0x13, 0x00, 0x08, 0x41, 0x0b, 0x02, 0xff gUnknown_085EE0BF:: @ 85EE0BF - .incbin "baserom.gba", 0x5ee0bf, 0x1d + .byte 0x12, 0x03, 0x0c, 0x2e, 0x00, 0x54, 0x77, 0xae, 0x44, 0x0d, 0xfe, 0x1a, 0x3d, 0x22, 0x06, 0x27, 0x00, 0x24, 0x28, 0x15, 0x05, 0x0c, 0x13, 0x00, 0x08, 0x41, 0x0b, 0x02, 0xff gUnknown_085EE0DC:: @ 85EE0DC - .incbin "baserom.gba", 0x5ee0dc, 0x1e + .byte 0x56, 0xae, 0x95, 0xd9, 0x78, 0xae, 0x91, 0xae, 0xf9, 0x04, 0x00, 0x16, 0xfe, 0x56, 0xae, 0x95, 0x2d, 0x00, 0x26, 0x20, 0x0a, 0x1f, 0x0e, 0x13, 0x00, 0x08, 0x41, 0x0b, 0x02, 0xff gUnknown_085EE0FA:: @ 85EE0FA - .incbin "baserom.gba", 0x5ee0fa, 0xd + .byte 0x12, 0x03, 0x0c, 0x2e, 0x00, 0x0c, 0x35, 0x03, 0x28, 0x36, 0x03, 0xab, 0xff gUnknown_085EE107:: @ 85EE107 - .incbin "baserom.gba", 0x5ee107, 0x19 + .byte 0x01, 0x27, 0x10, 0x15, 0x00, 0x64, 0x7a, 0xae, 0x65, 0xae, 0x37, 0xfe, 0x6e, 0x53, 0x54, 0x7e, 0x16, 0x00, 0x24, 0x50, 0x13, 0x07, 0x10, 0xab, 0xff gUnknown_085EE120:: @ 85EE120 - .incbin "baserom.gba", 0x5ee120, 0xd + .byte 0x0c, 0x46, 0x27, 0x08, 0x00, 0x05, 0x1f, 0x11, 0x08, 0x41, 0x0b, 0x02, 0xff gUnknown_085EE12D:: @ 85EE12D - .incbin "baserom.gba", 0x5ee12d, 0x2b - -gUnknown_085EE158:: @ 85EE158 + .byte 0x06, 0x07, 0x0a, 0x20, 0x00, 0x54, 0x77, 0xae, 0x00, 0x44, 0x0d, 0xfe, 0x94, 0xae, 0x60, 0x37, 0x00, 0x1e, 0x40, 0x2e, 0x00, 0x44, 0x07, 0x1f, 0x0e, 0x2e, 0x44, 0x0c, 0x10, 0xff -.string "{PLAYER}’s Single Battle Room Results$" + .string "RED$" + .string "BLUE$" + .string "---$" + +gUnknown_085EE158:: @ 85EE158 + .string "{PLAYER}’s Single Battle Room Results$" gUnknown_085EE178:: @ 85EE178 - -.string "{PLAYER}’s Double Battle Room Results$" + .string "{PLAYER}’s Double Battle Room Results$" gUnknown_085EE198:: @ 85EE198 - -.string "{PLAYER}’s Multi Battle Room Results$" + .string "{PLAYER}’s Multi Battle Room Results$" gUnknown_085EE1B7:: @ 85EE1B7 - -.string "{PLAYER}’s Link Multi Battle Room Results$" + .string "{PLAYER}’s Link Multi Battle Room Results$" gUnknown_085EE1DB:: @ 85EE1DB - -.string "{PLAYER}’s Single Battle Tourney Results$" + .string "{PLAYER}’s Single Battle Tourney Results$" gUnknown_085EE1FE:: @ 85EE1FE - -.string "{PLAYER}’s Double Battle Tourney Results$" + .string "{PLAYER}’s Double Battle Tourney Results$" gUnknown_085EE221:: @ 85EE221 - -.string "{PLAYER}’s Single Battle Hall Results$" + .string "{PLAYER}’s Single Battle Hall Results$" gUnknown_085EE241:: @ 85EE241 - -.string "{PLAYER}’s Double Battle Hall Results$" + .string "{PLAYER}’s Double Battle Hall Results$" gUnknown_085EE261:: @ 85EE261 - -.string "{PLAYER}’s Battle Choice Results$" + .string "{PLAYER}’s Battle Choice Results$" gUnknown_085EE27C:: @ 85EE27C - -.string "{PLAYER}’s Set KO Tourney Results$" + .string "{PLAYER}’s Set KO Tourney Results$" gUnknown_085EE298:: @ 85EE298 - -.string "{PLAYER}’s Battle Swap Single Results$" + .string "{PLAYER}’s Battle Swap Single Results$" gUnknown_085EE2B8:: @ 85EE2B8 - -.string "{PLAYER}’s Battle Swap Double Results$" + .string "{PLAYER}’s Battle Swap Double Results$" gUnknown_085EE2D8:: @ 85EE2D8 - -.string "{PLAYER}’s Battle Quest Results$" + .string "{PLAYER}’s Battle Quest Results$" gUnknown_085EE2F2:: @ 85EE2F2 - -.string "LV. 50$" + .string "LV. 50$" gUnknown_085EE2F9:: @ 85EE2F9 - -.string "OPEN LV.$" + .string "OPEN LV.$" gUnknown_085EE302:: @ 85EE302 - -.string "Win streak: {STR_VAR_1}$" + .string "Win streak: {STR_VAR_1}$" gUnknown_085EE311:: @ 85EE311 - -.string "CURRENT$" + .string "CURRENT$" gUnknown_085EE319:: @ 85EE319 - -.string "RECORD$" + .string "RECORD$" gUnknown_085EE320:: @ 85EE320 - -.string "PREV.$" + .string "PREV.$" gUnknown_085EE326:: @ 85EE326 - -.string "Rental/Swap$" + .string "Rental/Swap$" gUnknown_085EE332:: @ 85EE332 - -.string "Total$" + .string "Total$" gUnknown_085EE338:: @ 85EE338 - -.string "Clear streak: {STR_VAR_1}$" + .string "Clear streak: {STR_VAR_1}$" gUnknown_085EE349:: @ 85EE349 - -.string "Championships: {STR_VAR_1}$" + .string "Championships: {STR_VAR_1}$" gUnknown_085EE35B:: @ 85EE35B - -.string "Rooms cleared: {STR_VAR_1}$" + .string "Rooms cleared: {STR_VAR_1}$" gUnknown_085EE36D:: @ 85EE36D - -.string "Times cleared:{CLEAR}È{STR_VAR_1}$" + .string "Times cleared:{CLEAR 0x05}{STR_VAR_1}$" gUnknown_085EE381:: @ 85EE381 - -.string "KOs in a row: {STR_VAR_1}$" + .string "KOs in a row: {STR_VAR_1}$" gUnknown_085EE392:: @ 85EE392 - -.string "Times: {STR_VAR_1}$" - + .string "Times: {STR_VAR_1}$" + + .align 2 gUnknown_085EE39C:: @ 85EE39C - .incbin "baserom.gba", 0x5ee39c, 0x88 + .string "Floors cleared: {STR_VAR_1}$" + .align 2 + .string "LV. 50$" + + .align 2 + .string "OPEN LEVEL$" + + .align 2 + .string "Win streak: {STR_VAR_2}$" + + .align 2 + .string "Clear streak: {STR_VAR_2}$" + + .align 2 + .string "Rooms cleared: {STR_VAR_2}$" + + .align 2 + .string "KOs in a row: {STR_VAR_2}$" + + .align 2 + .string "Floors cleared: {STR_VAR_2}$" + + .align 2 gUnknown_085EE424:: @ 85EE424 - -.string "1.$" -.string "2.$" -.string "3.$" + .string "1.$" + .string "2.$" + .string "3.$" gUnknown_085EE42D:: @ 85EE42D - -.string "SAVING…\nDON’T TURN OFF THE POWER.$" + .string "SAVING…\nDON’T TURN OFF THE POWER.$" gUnknown_085EE44F:: @ 85EE44F - -.string "BERRY BLENDER\nMAXIMUM SPEED RECORD!$" + .string "BERRY BLENDER\nMAXIMUM SPEED RECORD!$" gUnknown_085EE473:: @ 85EE473 - -.string "2 PLAYERS\n3 PLAYERS\n4 PLAYERS$" + .string "2 PLAYERS\n3 PLAYERS\n4 PLAYERS$" gUnknown_085EE491:: @ 85EE491 - -.string "YES\nNO$" + .string "YES\nNO$" gUnknown_085EE498:: @ 85EE498 - -.string "▶$" + .string "▶$" gUnknown_085EE49A:: @ 85EE49A - -.string "PEEKABOO!$" + .string "PEEKABOO!$" gUnknown_085EE4A4:: @ 85EE4A4 - -.string "Communication error…\nPlease check all connections,\nthen turn the power OFF and ON.$" + .string "Communication error…\nPlease check all connections,\nthen turn the power OFF and ON.$" gUnknown_085EE4F7:: @ 85EE4F7 - -.string "Communication error…$" + .string "Communication error…$" gUnknown_085EE50C:: @ 85EE50C - -.string "Move closer to your link partner(s).\nAvoid obstacles between partners.$" + .string "Move closer to your link partner(s).\nAvoid obstacles between partners.$" gUnknown_085EE553:: @ 85EE553 - -.string "A Button: Registration Counter$" + .string "A Button: Registration Counter$" gUnknown_085EE572:: @ 85EE572 - -.string "A Button: Title Screen$" + .string "A Button: Title Screen$" gUnknown_085EE589:: @ 85EE589 - -.string "OPTION$" -.string "TEXT SPEED$" -.string "BATTLE SCENE$" -.string "BATTLE STYLE$" -.string "SOUND$" -.string "FRAME$" -.string "CANCEL$" -.string "BUTTON MODE$" + .string "OPTION$" + .string "TEXT SPEED$" + .string "BATTLE SCENE$" + .string "BATTLE STYLE$" + .string "SOUND$" + .string "FRAME$" + .string "CANCEL$" + .string "BUTTON MODE$" gUnknown_085EE5D4:: @ 85EE5D4 - -.string "{COLOR CYAN}{SHADOW MAGENTA}SLOW$" + .string "{COLOR GREEN}{SHADOW LIGHT_GREEN}SLOW$" gUnknown_085EE5DF:: @ 85EE5DF - -.string "{COLOR CYAN}{SHADOW MAGENTA}MID$" + .string "{COLOR GREEN}{SHADOW LIGHT_GREEN}MID$" gUnknown_085EE5E9:: @ 85EE5E9 - -.string "{COLOR CYAN}{SHADOW MAGENTA}FAST$" + .string "{COLOR GREEN}{SHADOW LIGHT_GREEN}FAST$" gUnknown_085EE5F4:: @ 85EE5F4 - -.string "{COLOR CYAN}{SHADOW MAGENTA}ON$" + .string "{COLOR GREEN}{SHADOW LIGHT_GREEN}ON$" gUnknown_085EE5FD:: @ 85EE5FD - -.string "{COLOR CYAN}{SHADOW MAGENTA}OFF$" + .string "{COLOR GREEN}{SHADOW LIGHT_GREEN}OFF$" gUnknown_085EE607:: @ 85EE607 - -.string "{COLOR CYAN}{SHADOW MAGENTA}SHIFT$" + .string "{COLOR GREEN}{SHADOW LIGHT_GREEN}SHIFT$" gUnknown_085EE613:: @ 85EE613 - -.string "{COLOR CYAN}{SHADOW MAGENTA}SET$" + .string "{COLOR GREEN}{SHADOW LIGHT_GREEN}SET$" gUnknown_085EE61D:: @ 85EE61D - -.string "{COLOR CYAN}{SHADOW MAGENTA}MONO$" + .string "{COLOR GREEN}{SHADOW LIGHT_GREEN}MONO$" gUnknown_085EE628:: @ 85EE628 - -.string "{COLOR CYAN}{SHADOW MAGENTA}STEREO$" + .string "{COLOR GREEN}{SHADOW LIGHT_GREEN}STEREO$" gUnknown_085EE635:: @ 85EE635 - -.string "{COLOR CYAN}{SHADOW MAGENTA}TYPE$" + .string "{COLOR GREEN}{SHADOW LIGHT_GREEN}TYPE$" gUnknown_085EE640:: @ 85EE640 - -.string "{COLOR CYAN}{SHADOW MAGENTA}$" + .string "{COLOR GREEN}{SHADOW LIGHT_GREEN}$" gUnknown_085EE647:: @ 85EE647 - -.string "{COLOR CYAN}{SHADOW MAGENTA}NORMAL$" + .string "{COLOR GREEN}{SHADOW LIGHT_GREEN}NORMAL$" gUnknown_085EE654:: @ 85EE654 - -.string "{COLOR CYAN}{SHADOW MAGENTA}LR$" + .string "{COLOR GREEN}{SHADOW LIGHT_GREEN}LR$" gUnknown_085EE65D:: @ 85EE65D - -.string "{COLOR CYAN}{SHADOW MAGENTA}L=A$" + .string "{COLOR GREEN}{SHADOW LIGHT_GREEN}L=A$" gUnknown_085EE667:: @ 85EE667 - -.string "{STR_VAR_1}P LINK$" -.string "BRONZE$" -.string "COPPER$" -.string "SILVER$" -.string "GOLD$" + .string "{STR_VAR_1}P LINK$" + .string "BRONZE$" + .string "COPPER$" + .string "SILVER$" + .string "GOLD$" gUnknown_085EE68A:: @ 85EE68A - -.string "DAY$" + .string "DAY$" gUnknown_085EE68E:: @ 85EE68E - -.string ":$" + .string ":$" gUnknown_085EE690:: @ 85EE690 - -.string "CONFIRM$" -.string "Days$" -.string "Time:$" -.string "Game time$" -.string "RTC time$" -.string "Updated time$" -.string "POKéDEX$" -.string "POKéMON$" -.string "BAG$" -.string "POKéNAV$" -.string "{PLAYER}$" -.string "SAVE$" -.string "OPTION$" -.string "EXIT$" -.string "RETIRE$" -.string "REST$" + .string "CONFIRM$" + .string "Days$" + .string "Time:$" + .string "Game time$" + .string "RTC time$" + .string "Updated time$" + .string "POKéDEX$" + .string "POKéMON$" + .string "BAG$" + .string "POKéNAV$" + .string "{PLAYER}$" + .string "SAVE$" + .string "OPTION$" + .string "EXIT$" + .string "RETIRE$" + .string "REST$" gOtherText_SafariStock:: @ 85EE6FF - -.string "SAFARI BALLS\nStock: {STR_VAR_1}$" + .string "SAFARI BALLS\nStock: {STR_VAR_1}$" gOtherText_BattlePyramid_X:: @ 85EE716 - -.string "Battle Pyramid\n{STR_VAR_1}$" -.string "Floor 1$" -.string "Floor 2$" -.string "Floor 3$" -.string "Floor 4$" -.string "Floor 5$" -.string "Floor 6$" -.string "Floor 7$" -.string "Peak$" + .string "Battle Pyramid\n{STR_VAR_1}$" + .string "Floor 1$" + .string "Floor 2$" + .string "Floor 3$" + .string "Floor 4$" + .string "Floor 5$" + .string "Floor 6$" + .string "Floor 7$" + .string "Peak$" gUnknown_085EE765:: @ 85EE765 - -.string "Link standby…\n… … B Button: Cancel$" + .string "Link standby…\n… … B Button: Cancel$" gUnknown_085EE788:: @ 85EE788 - -.string "Press the A Button to load event.\n… … B Button: Cancel$" + .string "Press the A Button to load event.\n… … B Button: Cancel$" gUnknown_085EE7BF:: @ 85EE7BF - -.string "Loading event…$" + .string "Loading event…$" gUnknown_085EE7CE:: @ 85EE7CE - -.string "Don’t remove the Game Link cable.\nDon’t turn off the power.$" + .string "Don’t remove the Game Link cable.\nDon’t turn off the power.$" gUnknown_085EE80A:: @ 85EE80A - -.string "The event was safely loaded.$" + .string "The event was safely loaded.$" gUnknown_085EE827:: @ 85EE827 - .incbin "baserom.gba", 0x5ee827, 0x28 + .string "Loading error.\nEnding session.$" + .string "プレイヤー$" @ "pureiyaa" ("player" in Japanese) + .string "さま$" @ "sama" (a very high honorific) gUnknown_085EE84F:: @ 85EE84F - -.string "HOENN$" + .string "HOENN$" gUnknown_085EE855:: @ 85EE855 - -.string "NATIONAL$" + .string "NATIONAL$" gUnknown_085EE85E:: @ 85EE85E - .incbin "baserom.gba", 0x5ee85e, 0x93 + .string "PLAYER: {CLEAR 0x10}{COLOR RED}{SHADOW LIGHT_RED}{PLAYER}{COLOR DARK_GREY}{SHADOW LIGHT_GREY}\n\nThis document certifies\nthat you have successfully\ncompleted your\n{STR_VAR_1} POKéDEX.\n\n{CLEAR_TO 0x42}{COLOR RED}{SHADOW LIGHT_RED}GAME FREAK$" + + .string "{COLOR RED}{SHADOW LIGHT_RED}ゲ-ムフリ-ク$" @ geemufuriku ("Game Freak" in Japanese) + .string "{COLOR RED}{SHADOW LIGHT_RED}$" gUnknown_085EE8F1:: @ 85EE8F1 - -.string "HOENN$" + .string "HOENN$" gUnknown_085EE8F7:: @ 85EE8F7 - -.string "Oh! A bite!$" + .string "Oh! A bite!$" gUnknown_085EE903:: @ 85EE903 - -.string "A POKéMON’s on the hook!{PAUSE_UNTIL_PRESS}$" + .string "A POKéMON’s on the hook!{PAUSE_UNTIL_PRESS}$" gUnknown_085EE91E:: @ 85EE91E - -.string "Not even a nibble…{PAUSE_UNTIL_PRESS}$" + .string "Not even a nibble…{PAUSE_UNTIL_PRESS}$" gUnknown_085EE933:: @ 85EE933 - -.string "It got away…{PAUSE_UNTIL_PRESS}$" + .string "It got away…{PAUSE_UNTIL_PRESS}$" gUnknown_085EE942:: @ 85EE942 - -.string "{STR_VAR_2} will be\nsent to {STR_VAR_1}.$" + .string "{STR_VAR_2} will be\nsent to {STR_VAR_1}.$" gUnknown_085EE959:: @ 85EE959 - -.string "Bye-bye, {STR_VAR_2}!$" + .string "Bye-bye, {STR_VAR_2}!$" gUnknown_085EE966:: @ 85EE966 - -.string "{STR_VAR_1} sent over {STR_VAR_3}.$" + .string "{STR_VAR_1} sent over {STR_VAR_3}.$" gUnknown_085EE977:: @ 85EE977 - -.string "Take good care of {STR_VAR_3}!$" + .string "Take good care of {STR_VAR_3}!$" .include "data/text/easy_chat/easy_chat_group_names.inc" gUnknown_085EEA42:: @ 85EEA42 - -.string "???$" -.string "MAX. HP$" -.string "ATTACK$" -.string "DEFENSE$" -.string "SPEED$" -.string "SP. ATK$" -.string "SP. DEF$" + .string "???$" + .string "MAX. HP$" + .string "ATTACK$" + .string "DEFENSE$" + .string "SPEED$" + .string "SP. ATK$" + .string "SP. DEF$" gUnknown_085EEA73:: @ 85EEA73 - -.string "{249}Ç$" + .string "{UNK_CTRL_F904}$" gUnknown_085EEA76:: @ 85EEA76 - -.string "-$" + .string "-$" gUnknown_085EEA78:: @ 85EEA78 - -.string "From $" + .string "From $" gUnknown_085EEA7E:: @ 85EEA7E - -.string "Mixing records…$" + .string "Mixing records…$" gUnknown_085EEA8E:: @ 85EEA8E - -.string "Record mixing completed.\nThank you for waiting.$" -.string "YOUR NAME?$" -.string "BOX NAME?$" -.string "{STR_VAR_1}’s nickname?$" -.string "Tell him the words.$" + .string "Record mixing completed.\nThank you for waiting.$" + .string "YOUR NAME?$" + .string "BOX NAME?$" + .string "{STR_VAR_1}’s nickname?$" + .string "Tell him the words.$" gUnknown_085EEAF6:: @ 85EEAF6 - -.string "{248}ÏMOVE {248} OK {248}ÀBACK$" + .string "{UNK_CTRL_F80C}MOVE {UNK_CTRL_F800}OK {UNK_CTRL_F801}BACK$" gUnknown_085EEB0B:: @ 85EEB0B - -.string "A call can’t be made from here.$" -.string "HANDSOME$" -.string "VINNY$" -.string "MOREME$" -.string "IRONHARD$" -.string "MUSCLE$" -.string "coolness$" -.string "beauty$" -.string "cuteness$" -.string "smartness$" -.string "toughness$" + .string "A call can’t be made from here.$" + .string "HANDSOME$" + .string "VINNY$" + .string "MOREME$" + .string "IRONHARD$" + .string "MUSCLE$" + .string "coolness$" + .string "beauty$" + .string "cuteness$" + .string "smartness$" + .string "toughness$" gUnknown_085EEB7E:: @ 85EEB7E - -.string "Lady$" -.string "slippery$" -.string "roundish$" -.string "wham-ish$" -.string "shiny$" -.string "sticky$" -.string "pointy$" + .string "Lady$" + .string "slippery$" + .string "roundish$" + .string "wham-ish$" + .string "shiny$" + .string "sticky$" + .string "pointy$" gUnknown_085EEBB2:: @ 85EEBB2 - -.string "RENTAL POKéMON$" + .string "RENTAL POKéMON$" gUnknown_085EEBC1:: @ 85EEBC1 - -.string "Select the first POKéMON.$" + .string "Select the first POKéMON.$" gUnknown_085EEBDB:: @ 85EEBDB - -.string "Select the second POKéMON.$" + .string "Select the second POKéMON.$" gUnknown_085EEBF6:: @ 85EEBF6 - -.string "Select the third POKéMON.$" + .string "Select the third POKéMON.$" gUnknown_085EEC10:: @ 85EEC10 - -.string "RENT$" + .string "RENT$" gUnknown_085EEC15:: @ 85EEC15 - -.string "SUMMARY$" + .string "SUMMARY$" gUnknown_085EEC1D:: @ 85EEC1D - -.string "OTHERS$" + .string "OTHERS$" gUnknown_085EEC24:: @ 85EEC24 - -.string "DESELECT$" + .string "DESELECT$" gUnknown_085EEC2D:: @ 85EEC2D - -.string "Are these three POKéMON OK?$" + .string "Are these three POKéMON OK?$" gUnknown_085EEC49:: @ 85EEC49 - -.string "YES$" + .string "YES$" gUnknown_085EEC4D:: @ 85EEC4D - -.string "NO$" + .string "NO$" gUnknown_085EEC50:: @ 85EEC50 - -.string "Can’t select same {PKMN}.$" + .string "Can’t select same {PKMN}.$" gUnknown_085EEC66:: @ 85EEC66 - -.string "POKéMON SWAP$" + .string "POKéMON SWAP$" gUnknown_085EEC73:: @ 85EEC73 - -.string "Select POKéMON to swap.$" + .string "Select POKéMON to swap.$" gUnknown_085EEC8B:: @ 85EEC8B - -.string "Select POKéMON to accept.$" + .string "Select POKéMON to accept.$" gUnknown_085EECA5:: @ 85EECA5 - -.string "SWAP$" + .string "SWAP$" gUnknown_085EECAA:: @ 85EECAA - -.string "SUMMARY$" + .string "SUMMARY$" gUnknown_085EECB2:: @ 85EECB2 - -.string "RECHOOSE$" + .string "RECHOOSE$" gUnknown_085EECBB:: @ 85EECBB - -.string "Quit swapping?$" + .string "Quit swapping?$" gUnknown_085EECCA:: @ 85EECCA - -.string "YES$" + .string "YES$" gUnknown_085EECCE:: @ 85EECCE - -.string "NO$" + .string "NO$" gUnknown_085EECD1:: @ 85EECD1 - -.string "{PKMN} FOR SWAP$" + .string "{PKMN} FOR SWAP$" gUnknown_085EECDD:: @ 85EECDD - -.string "CANCEL$" -.string "SWAP$" -.string "ACCEPT$" + .string "CANCEL$" + .string "SWAP$" + .string "ACCEPT$" gUnknown_085EECF0:: @ 85EECF0 - -.string "Accept this POKéMON?$" -.string " $" + .string "Accept this POKéMON?$" + .string " $" gUnknown_085EED0A:: @ 85EED0A - -.string "Same {PKMN} in party already.$" + .string "Same {PKMN} in party already.$" gOtherText_DecimalPoint:: @ 85EED24 - -.string ".$" + .string ".$" gUnknown_085EED26:: @ 85EED26 - -.string "PLAYER$" + .string "PLAYER$" gUnknown_085EED2D:: @ 85EED2D - -.string "BADGES$" + .string "BADGES$" gUnknown_085EED34:: @ 85EED34 - -.string "POKéDEX$" + .string "POKéDEX$" gUnknown_085EED3C:: @ 85EED3C .string "TIME$" @@ -3416,377 +3084,376 @@ gUnknown_085EEED4:: @ 85EEED4 .align 2 gUnknown_085EEEF0:: @ 85EEEF0 - .incbin "baserom.gba", 0x5eeef0, 0x3c + .string "You don’t have a WONDER CARD,\nso a new CARD will be input.$" + .align 2 gUnknown_085EEF2C:: @ 85EEF2C - .incbin "baserom.gba", 0x5eef2c, 0x3c + .string "You don’t have any WONDER NEWS,\nso new NEWS will be input.$" + .align 2 gUnknown_085EEF68:: @ 85EEF68 - .incbin "baserom.gba", 0x5eef68, 0x2c + .string "Where should the WONDER CARD\nbe accessed?$" + .align 2 gUnknown_085EEF94:: @ 85EEF94 + .string "Where should the WONDER NEWS\nbe accessed?$" -.string "Where should the WONDER NEWS\nbe accessed?$" -.string " Communication standby…\nB Button: Cancel$" + .align 2 + .string "Communication standby…\nB Button: Cancel$" + .align 2 gUnknown_085EEFE8:: @ 85EEFE8 - .incbin "baserom.gba", 0x5eefe8, 0x10 + .string "Communicating…$" + .align 2 gUnknown_085EEFF8:: @ 85EEFF8 - .incbin "baserom.gba", 0x5eeff8, 0x1c + .string "Communication completed.$" + .align 2 gUnknown_085EF014:: @ 85EF014 - .incbin "baserom.gba", 0x5ef014, 0x18 + .string "Communication error.$" + .align 2 gUnknown_085EF02C:: @ 85EF02C - .incbin "baserom.gba", 0x5ef02c, 0x24 + .string "Communication has been canceled.$" + .align 2 gUnknown_085EF050:: @ 85EF050 - .incbin "baserom.gba", 0x5ef050, 0x34 + .string "Throw away the WONDER CARD\nand input a new CARD?$" + .align 2 gUnknown_085EF084:: @ 85EF084 - .incbin "baserom.gba", 0x5ef084, 0x44 + .string "You haven’t received the CARD’s gift\nyet. Input a new CARD anyway?$" + .align 2 gUnknown_085EF0C8:: @ 85EF0C8 - .incbin "baserom.gba", 0x5ef0c8, 0x2c + .string "A WONDER CARD has been received\nfrom {STR_VAR_1}.$" + .align 2 gUnknown_085EF0F4:: @ 85EF0F4 - .incbin "baserom.gba", 0x5ef0f4, 0x30 + .string "A WONDER NEWS item has been\nreceived from {STR_VAR_1}.$" + .align 2 gUnknown_085EF124:: @ 85EF124 - .incbin "baserom.gba", 0x5ef124, 0x28 + .string "A new WONDER CARD has been\nreceived.$" + .align 2 gUnknown_085EF14C:: @ 85EF14C - .incbin "baserom.gba", 0x5ef14c, 0x2c + .string "A new WONDER NEWS item has been\nreceived.$" + .align 2 gUnknown_085EF178:: @ 85EF178 - .incbin "baserom.gba", 0x5ef178, 0x20 + .string "A new STAMP has been received.$" + .align 2 gUnknown_085EF198:: @ 85EF198 - .incbin "baserom.gba", 0x5ef198, 0x1c + .string "A new TRAINER has arrived.$" + .align 2 gUnknown_085EF1B4:: @ 85EF1B4 - .incbin "baserom.gba", 0x5ef1b4, 0x24 + .string "You already had that\nWONDER CARD.$" + .align 2 gUnknown_085EF1D8:: @ 85EF1D8 - .incbin "baserom.gba", 0x5ef1d8, 0x28 + .string "You already had that\nWONDER NEWS item.$" + .align 2 gUnknown_085EF200:: @ 85EF200 + .string "You already had that\nSTAMP.$" -.string "You already had that\nSTAMP.$" - + .align 2 gUnknown_085EF21C:: @ 85EF21C + .string "There’s no more room for adding\nSTAMPS.$" -.string "There’s no more room for adding\nSTAMPS.$" - + .align 2 gUnknown_085EF244:: @ 85EF244 - .incbin "baserom.gba", 0x5ef244, 0x3c + .string "Your record has been uploaded via\nWIRELESS COMMUNICATION.$" + .align 2 gUnknown_085EF280:: @ 85EF280 - .incbin "baserom.gba", 0x5ef280, 0x34 + .string "You can’t accept a WONDER CARD\nfrom this TRAINER.$" + .align 2 gUnknown_085EF2B4:: @ 85EF2B4 + .string "You can’t accept WONDER NEWS\nfrom this TRAINER.$" -.string "You can’t accept WONDER NEWS\nfrom this TRAINER.$" - + .align 2 gUnknown_085EF2E4:: @ 85EF2E4 - .incbin "baserom.gba", 0x5ef2e4, 0x18 + .string "Nothing was sent over…$" + .align 2 gUnknown_085EF2FC:: @ 85EF2FC - .incbin "baserom.gba", 0x5ef2fc, 0x34 + .string "What would you like to do\nwith the WONDER CARDS?$" + .align 2 gUnknown_085EF330:: @ 85EF330 + .string "What would you like to do\nwith the WONDER NEWS?$" -.string "What would you like to do\nwith the WONDER NEWS?$" - + .align 2 gUnknown_085EF360:: @ 85EF360 - .incbin "baserom.gba", 0x5ef360, 0x1c + .string "Sending your WONDER CARD…$" + .align 2 gUnknown_085EF37C:: @ 85EF37C - .incbin "baserom.gba", 0x5ef37c, 0x20 + .string "Sending your WONDER NEWS item…$" + .align 2 gUnknown_085EF39C:: @ 85EF39C - .incbin "baserom.gba", 0x5ef39c, 0x28 + .string "Your WONDER CARD has been sent\nto {STR_VAR_1}.$" + .align 2 gUnknown_085EF3C4:: @ 85EF3C4 - .incbin "baserom.gba", 0x5ef3c4, 0x2c + .string "Your WONDER NEWS item has been\nsent to {STR_VAR_1}.$" + .align 2 gUnknown_085EF3F0:: @ 85EF3F0 - .incbin "baserom.gba", 0x5ef3f0, 0x20 + .string "A STAMP has been sent to {STR_VAR_1}.$" + .align 2 gUnknown_085EF410:: @ 85EF410 + .string "A GIFT has been sent to {STR_VAR_1}.$" -.string "A GIFT has been sent to {STR_VAR_1}.$" - + .align 2 gUnknown_085EF42C:: @ 85EF42C + .string "The other TRAINER has the same\nWONDER CARD already.$" -.string "The other TRAINER has the same\nWONDER CARD already.$" - + .align 2 gUnknown_085EF460:: @ 85EF460 + .string "The other TRAINER has the same\nWONDER NEWS already.$" -.string "The other TRAINER has the same\nWONDER NEWS already.$" - + .align 2 gUnknown_085EF494:: @ 85EF494 - .incbin "baserom.gba", 0x5ef494, 0x30 + .string "The other TRAINER has the same\nSTAMP already.$" + .align 2 gUnknown_085EF4C4:: @ 85EF4C4 - .incbin "baserom.gba", 0x5ef4c4, 0x2c + .string "The other TRAINER canceled\ncommunication.$" + .align 2 gUnknown_085EF4F0:: @ 85EF4F0 - .incbin "baserom.gba", 0x5ef4f0, 0x30 + .string "You can’t send a MYSTERY GIFT to\nthis TRAINER.$" + .align 2 gUnknown_085EF520:: @ 85EF520 - .incbin "baserom.gba", 0x5ef520, 0x3c + .string "If you throw away the CARD,\nits event won’t happen. Okay?$" + .align 2 gUnknown_085EF55C:: @ 85EF55C - .incbin "baserom.gba", 0x5ef55c, 0x28 + .string "Is it okay to discard this\nNEWS item?$" + .align 2 gUnknown_085EF584:: @ 85EF584 - .incbin "baserom.gba", 0x5ef584, 0x38 + .string "You haven’t received the\nGIFT. Is it okay to discard?$" + .align 2 gUnknown_085EF5BC:: @ 85EF5BC - .incbin "baserom.gba", 0x5ef5bc, 0x24 + .string "Data will be saved.\nPlease wait.$" + .align 2 gUnknown_085EF5E0:: @ 85EF5E0 - .incbin "baserom.gba", 0x5ef5e0, 0x2c + .string "Save completed.\nPlease press the A Button.$" + .align 2 gUnknown_085EF60C:: @ 85EF60C - .incbin "baserom.gba", 0x5ef60c, 0x24 + .string "The WONDER CARD was thrown away.$" + .align 2 gUnknown_085EF630:: @ 85EF630 - .incbin "baserom.gba", 0x5ef630, 0x24 + .string "The WONDER NEWS was thrown away.$" + .align 2 gUnknown_085EF654:: @ 85EF654 - .incbin "baserom.gba", 0x5ef654, 0x10 + .string "MYSTERY GIFT$" + .align 2 gUnknown_085EF664:: @ 85EF664 - .incbin "baserom.gba", 0x5ef664, 0x14 + .string "{UNK_CTRL_F80A}PICK {UNK_CTRL_F800}OK {UNK_CTRL_F801}EXIT$" + .align 2 gUnknown_085EF678:: @ 85EF678 - -.string "{248}こPICK {248} OK {248}ÀCANCEL$" + .string "{UNK_CTRL_F80A}PICK {UNK_CTRL_F800}OK {UNK_CTRL_F801}CANCEL$" gUnknown_085EF68D:: @ 85EF68D - -.string "{PLAYER}’s BATTLE RESULTS$" + .string "{PLAYER}’s BATTLE RESULTS$" gUnknown_085EF6A1:: @ 85EF6A1 - -.string "TOTAL RECORD W:{STR_VAR_1} L:{STR_VAR_2} D:{STR_VAR_3}$" + .string "TOTAL RECORD W:{STR_VAR_1} L:{STR_VAR_2} D:{STR_VAR_3}$" gUnknown_085EF6BD:: @ 85EF6BD - .incbin "baserom.gba", 0x5ef6bd, 0x15 + .string "{CLEAR_TO 0x53}WIN{CLEAR_TO 0x80}LOSE{CLEAR_TO 0xB0}DRAW$" gUnknown_085EF6D2:: @ 85EF6D2 - -.string "Communication standby…$" + .string "Communication standby…$" gUnknown_085EF6E9:: @ 85EF6E9 - -.string "Quit the game?$" + .string "Quit the game?$" gUnknown_085EF6F8:: @ 85EF6F8 - -.string "You’ve got 9,999 COINS.$" + .string "You’ve got 9,999 COINS.$" gUnknown_085EF710:: @ 85EF710 - -.string "You’ve run out of COINS.\nGame over!$" + .string "You’ve run out of COINS.\nGame over!$" gUnknown_085EF734:: @ 85EF734 - -.string "You don’t have three COINS.$" + .string "You don’t have three COINS.$" gUnknown_085EF750:: @ 85EF750 - -.string "REEL TIME\nHere’s your chance to take\naim and nail marks!\nReel Time continues for the\nawarded number of spins.\nIt all ends on a Big Bonus.$" -.string "The two seem to get along\nvery well.$" -.string "The two seem to get along.$" -.string "The two don’t seem to like\neach other much.$" -.string "The two prefer to play with other\nPOKéMON than each other.$" + .string "REEL TIME\nHere’s your chance to take\naim and nail marks!\nReel Time continues for the\nawarded number of spins.\nIt all ends on a Big Bonus.$" + .string "The two seem to get along\nvery well.$" + .string "The two seem to get along.$" + .string "The two don’t seem to like\neach other much.$" + .string "The two prefer to play with other\nPOKéMON than each other.$" gUnknown_085EF881:: @ 85EF881 - -.string "\n$" + .string "\n$" gUnknown_085EF883:: @ 85EF883 - -.string "EXIT$" + .string "EXIT$" gUnknown_085EF888:: @ 85EF888 - -.string "{LV}$" + .string "{LV}$" gUnknown_085EF88A:: @ 85EF88A - -.string "TIME BOARD$" + .string "TIME BOARD$" gUnknown_085EF895:: @ 85EF895 - -.string "TIME CLEARED $" + .string "TIME CLEARED $" gUnknown_085EF8A3:: @ 85EF8A3 - -.string "{STR_VAR_1} min. {STR_VAR_2}.{STR_VAR_3} sec.$" -.string "1F$" -.string "2F$" -.string "3F$" -.string "4F$" + .string "{STR_VAR_1} min. {STR_VAR_2}.{STR_VAR_3} sec.$" + .string "1F$" + .string "2F$" + .string "3F$" + .string "4F$" gUnknown_085EF8C2:: @ 85EF8C2 - -.string "Teach which move to {STR_VAR_1}?$" + .string "Teach which move to {STR_VAR_1}?$" gUnknown_085EF8DA:: @ 85EF8DA - -.string "Teach {STR_VAR_2}?$" + .string "Teach {STR_VAR_2}?$" gUnknown_085EF8E4:: @ 85EF8E4 - -.string "{STR_VAR_1} learned\n{STR_VAR_2}!$" + .string "{STR_VAR_1} learned\n{STR_VAR_2}!$" gUnknown_085EF8F3:: @ 85EF8F3 - -.string "{STR_VAR_1} is trying to learn\n{STR_VAR_2}.\pBut {STR_VAR_1} can’t learn more\nthan four moves.\pDelete an older move to make\nroom for {STR_VAR_2}?$" + .string "{STR_VAR_1} is trying to learn\n{STR_VAR_2}.\pBut {STR_VAR_1} can’t learn more\nthan four moves.\pDelete an older move to make\nroom for {STR_VAR_2}?$" gUnknown_085EF960:: @ 85EF960 - -.string "Stop trying to teach\n{STR_VAR_2}?$" + .string "Stop trying to teach\n{STR_VAR_2}?$" gUnknown_085EF979:: @ 85EF979 - -.string "{PAUSE 32}1, {PAUSE 15}2, and {PAUSE 15}… {PAUSE 15}… {PAUSE 15}… {PAUSE 15}{PLAY_SE 0x0038}Poof!\p$" + .string "{PAUSE 32}1, {PAUSE 15}2, and {PAUSE 15}… {PAUSE 15}… {PAUSE 15}… {PAUSE 15}{PLAY_SE 0x0038}Poof!\p$" gUnknown_085EF9A6:: @ 85EF9A6 - -.string "{STR_VAR_1} forgot {STR_VAR_3}.\pAnd…\p{STR_VAR_1} learned {STR_VAR_2}.$" -.string "{STR_VAR_1} did not learn the\nmove {STR_VAR_2}.$" + .string "{STR_VAR_1} forgot {STR_VAR_3}.\pAnd…\p{STR_VAR_1} learned {STR_VAR_2}.$" + .string "{STR_VAR_1} did not learn the\nmove {STR_VAR_2}.$" gUnknown_085EF9E6:: @ 85EF9E6 - -.string "Give up trying to teach a new\nmove to {STR_VAR_1}?$" + .string "Give up trying to teach a new\nmove to {STR_VAR_1}?$" gUnknown_085EFA10:: @ 85EFA10 - -.string "Which move should be\nforgotten?\p$" + .string "Which move should be\nforgotten?\p$" gUnknown_085EFA31:: @ 85EFA31 - -.string "BATTLE MOVES$" + .string "BATTLE MOVES$" gUnknown_085EFA3E:: @ 85EFA3E - -.string "CONTEST MOVES$" -.string "TYPE/$" + .string "CONTEST MOVES$" + .string "TYPE/$" gUnknown_085EFA52:: @ 85EFA52 - -.string "PP/$" + .string "PP/$" gUnknown_085EFA56:: @ 85EFA56 - -.string "POWER/$" + .string "POWER/$" gUnknown_085EFA5D:: @ 85EFA5D - -.string "ACCURACY/$" + .string "ACCURACY/$" gUnknown_085EFA67:: @ 85EFA67 - -.string "APPEAL$" + .string "APPEAL$" gUnknown_085EFA6E:: @ 85EFA6E - -.string "JAM$" -.string "KIRA$" -.string "AMY$" -.string "JOHN$" -.string "ROY$" -.string "GABBY$" -.string "ANNA$" + .string "JAM$" + .string "KIRA$" + .string "AMY$" + .string "JOHN$" + .string "ROY$" + .string "GABBY$" + .string "ANNA$" gUnknown_085EFA8F:: @ 85EFA8F - -.string "Clear all save data areas?$" + .string "Clear all save data areas?$" gUnknown_085EFAAA:: @ 85EFAAA - -.string "Clearing data…\nPlease wait.$" + .string "Clearing data…\nPlease wait.$" gUnknown_085EFAC6:: @ 85EFAC6 - -.string "Is this the correct time?$" + .string "Is this the correct time?$" gUnknown_085EFAE0:: @ 85EFAE0 - -.string "CONFIRM$" + .string "CONFIRM$" gUnknown_085EFAE8:: @ 85EFAE8 - -.string "CANCEL$" -.string "DEVON PRES$" -.string "MR. STONE$" -.string "HARD AS ROCK$" -.string "STEVEN$" -.string "RAD NEIGHBOR$" -.string "RELIABLE ONE$" -.string "CALM & KIND$" -.string "{PKMN} LOVER$" -.string "DAD$" -.string "MOM$" -.string "ELUSIVE EYES$" -.string "SCOTT$" -.string "ROCKIN’ WHIZ$" -.string "THE BIG HIT$" -.string "SWELL SHOCK$" -.string "PASSION BURN$" -.string "SKY TAMER$" -.string "MYSTIC DUO$" -.string "DANDY CHARM$" -.string "ELITE FOUR$" -.string "CHAMPION$" -.string "{PKMN} PROF.$" + .string "CANCEL$" + .string "DEVON PRES$" + .string "MR. STONE$" + .string "HARD AS ROCK$" + .string "STEVEN$" + .string "RAD NEIGHBOR$" + .string "RELIABLE ONE$" + .string "CALM & KIND$" + .string "{PKMN} LOVER$" + .string "DAD$" + .string "MOM$" + .string "ELUSIVE EYES$" + .string "SCOTT$" + .string "ROCKIN’ WHIZ$" + .string "THE BIG HIT$" + .string "SWELL SHOCK$" + .string "PASSION BURN$" + .string "SKY TAMER$" + .string "MYSTIC DUO$" + .string "DANDY CHARM$" + .string "ELITE FOUR$" + .string "CHAMPION$" + .string "{PKMN} PROF.$" gUnknown_085EFBD2:: @ 85EFBD2 - -.string "Communication standby…\nAwaiting another player to choose.$" + .string "Communication standby…\nAwaiting another player to choose.$" gUnknown_085EFC0C:: @ 85EFC0C - -.string "The battle was refused.{PAUSE 60}$" + .string "The battle was refused.{PAUSE 60}$" gUnknown_085EFC27:: @ 85EFC27 - -.string "Refused the battle.{PAUSE 60}$" -.string "NO WEATHER$" -.string "SUNNY$" -.string "SUNNY2$" -.string "RAIN$" -.string "SNOW$" -.string "LIGHTNING$" -.string "FOG$" -.string "VOLCANO ASH$" -.string "SANDSTORM$" -.string "FOG2$" -.string "SEAFLOOR$" -.string "CLOUDY$" -.string "SUNNY3$" -.string "HEAVY RAIN$" -.string "SEAFLOOR2$" -.string "DEL. ALL$" -.string "CANCEL$" -.string "OK$" -.string "QUIZ$" -.string "ANSWER$" + .string "Refused the battle.{PAUSE 60}$" + .string "NO WEATHER$" + .string "SUNNY$" + .string "SUNNY2$" + .string "RAIN$" + .string "SNOW$" + .string "LIGHTNING$" + .string "FOG$" + .string "VOLCANO ASH$" + .string "SANDSTORM$" + .string "FOG2$" + .string "SEAFLOOR$" + .string "CLOUDY$" + .string "SUNNY3$" + .string "HEAVY RAIN$" + .string "SEAFLOOR2$" + .string "DEL. ALL$" + .string "CANCEL$" + .string "OK$" + .string "QUIZ$" + .string "ANSWER$" gOtherText_PokeBalls:: @ 85EFCD4 - -.string "POKé BALLS$" + .string "POKé BALLS$" gOtherText_Berry:: @ 85EFCDF - -.string "BERRY$" + .string "BERRY$" gOtherText_Berries:: @ 85EFCE5 - .incbin "baserom.gba", 0x5efce5, 0xb + .string "BERRIES$" From 04598f07497734e76d0ebddb592d81d224a5ae6a Mon Sep 17 00:00:00 2001 From: Diegoisawesome Date: Tue, 12 Sep 2017 00:00:05 -0500 Subject: [PATCH 05/13] Rename data2 external file symbols --- asm/link.s | 40 +++--- data/data2.s | 124 +++++++++--------- data/strings.s | 7 +- ...est_textbox.pal => unk_textbox_border.pal} | 0 ...est_textbox.png => unk_textbox_border.png} | Bin ...ess_link.bin => wireless_link_display.bin} | Bin ...ess_link.pal => wireless_link_display.pal} | 0 ...ess_link.png => wireless_link_display.png} | Bin 8 files changed, 88 insertions(+), 83 deletions(-) rename graphics/interface/{test_textbox.pal => unk_textbox_border.pal} (100%) rename graphics/interface/{test_textbox.png => unk_textbox_border.png} (100%) rename graphics/interface/{wireless_link.bin => wireless_link_display.bin} (100%) rename graphics/interface/{wireless_link.pal => wireless_link_display.pal} (100%) rename graphics/interface/{wireless_link.png => wireless_link_display.png} (100%) diff --git a/asm/link.s b/asm/link.s index 1fd881b99..9e197b8d2 100644 --- a/asm/link.s +++ b/asm/link.s @@ -57,12 +57,12 @@ sub_8009414: @ 8009414 lsrs r7, r3, 24 lsls r4, 16 lsrs r4, 16 - ldr r0, =gUnknown_082ECF20 + ldr r0, =gLinkTestDigitsPal lsls r1, r5, 4 movs r2, 0x20 bl LoadPalette ldr r3, =0x040000d4 - ldr r0, =gUnknown_082ECF40 + ldr r0, =gLinkTestDigitsGfx str r0, [r3] lsls r2, r7, 14 lsls r0, r4, 5 @@ -158,13 +158,13 @@ sub_80094EC: @ 80094EC lsrs r4, 24 lsls r5, 24 lsrs r5, 24 - ldr r0, =gUnknown_082ECF20 + ldr r0, =gLinkTestDigitsPal mov r2, r8 lsls r1, r2, 4 movs r2, 0x20 bl LoadPalette ldr r2, =0x040000d4 - ldr r0, =gUnknown_082ECF40 + ldr r0, =gLinkTestDigitsGfx str r0, [r2] lsls r0, r5, 14 movs r1, 0xC0 @@ -866,7 +866,7 @@ _08009B68: stm r2!, {r3,r6,r7} ldr r1, [r1] str r1, [r2] - ldr r4, =gUnknown_082ED1D4 + ldr r4, =gASCIIGameFreakInc adds r2, r0, 0 adds r1, r4, 0 ldm r1!, {r5-r7} @@ -1025,7 +1025,7 @@ _08009C70: _08009CCA: adds r0, r2, 0 bl sub_800B524 - ldr r5, =gUnknown_082ED1D4 + ldr r5, =gASCIIGameFreakInc mov r0, r8 adds r1, r5, 0 bl strcmp @@ -2521,7 +2521,7 @@ _0800A838: task00_link_test: @ 800A850 push {r4-r6,lr} sub sp, 0x20 - ldr r1, =gUnknown_082ED1E4 + ldr r1, =gASCIITestPrint mov r0, sp bl strcpy mov r0, sp @@ -3450,26 +3450,26 @@ _0800B03C: sub_800B080: @ 800B080 push {r4,r5,lr} sub sp, 0xC - ldr r1, =gUnknown_082ED168 + ldr r1, =g2BlankTilesGfx movs r0, 0 movs r2, 0x20 movs r3, 0 bl LoadBgTiles - ldr r1, =gUnknown_082EC88C + ldr r1, =gWirelessLinkDisplayGfx movs r5, 0 str r5, [sp] movs r0, 0x1 movs r2, 0 movs r3, 0 bl copy_decompressed_tile_data_to_vram_autofree - ldr r1, =gUnknown_082ECD34 + ldr r1, =gWirelessLinkDisplayTilemap movs r0, 0x1 movs r2, 0 movs r3, 0 bl CopyToBgTilemapBuffer movs r0, 0x1 bl CopyBgTilemapBufferToVram - ldr r0, =gUnknown_082EC86C + ldr r0, =gWirelessLinkDisplayPal movs r1, 0 movs r2, 0x20 bl LoadPalette @@ -3519,7 +3519,7 @@ sub_800B080: @ 800B080 sub_800B138: @ 800B138 push {lr} sub sp, 0xC - ldr r1, =gUnknown_082ED168 + ldr r1, =g2BlankTilesGfx movs r0, 0 movs r2, 0x20 movs r3, 0 @@ -3781,7 +3781,7 @@ sub_800B348: @ 800B348 stm r2!, {r3,r4,r6} ldr r0, [r0] str r0, [r2] - ldr r3, =gUnknown_082ED1D4 + ldr r3, =gASCIIGameFreakInc adds r2, r1, 0 adds r0, r3, 0 ldm r0!, {r4-r6} @@ -3831,7 +3831,7 @@ sub_800B3A4: @ 800B3A4 str r0, [r1] adds r0, r2, 0 bl sub_800B524 - ldr r5, =gUnknown_082ED1D4 + ldr r5, =gASCIIGameFreakInc adds r0, r4, 0 adds r1, r5, 0 bl strcmp @@ -28719,7 +28719,7 @@ _08018482: b _08018610 .pool _08018574: - ldr r0, =gUnknown_082F0548 + ldr r0, =gUnkTextboxBorderPal movs r1, 0 movs r2, 0x20 bl LoadPalette @@ -31126,7 +31126,7 @@ bgid_upload_textbox_1: @ 8019938 sub sp, 0x4 lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_082F0568 + ldr r1, =gUnkTextboxBorderGfx movs r2, 0x80 lsls r2, 1 movs r3, 0 @@ -32602,14 +32602,14 @@ sub_801A43C: @ 801A43C adds r1, r0, 0 movs r0, 0 bl SetBgTilemapBuffer - ldr r1, =gUnknown_082F0990 + ldr r1, =gWirelessInfoScreenGfx movs r0, 0 str r0, [sp] movs r0, 0x1 movs r2, 0 movs r3, 0 bl copy_decompressed_tile_data_to_vram_autofree - ldr r1, =gUnknown_082F0BA0 + ldr r1, =gWirelessInfoScreenTilemap movs r0, 0x1 movs r2, 0 movs r3, 0 @@ -32653,7 +32653,7 @@ sub_801A43C: @ 801A43C movs r1, 0 movs r2, 0 bl ChangeBgY - ldr r0, =gUnknown_082F0790 + ldr r0, =gWirelessInfoScreenPal movs r1, 0 movs r2, 0x20 bl LoadPalette @@ -32738,7 +32738,7 @@ _0801A5E4: ldrsh r0, [r1, r2] adds r0, 0x2 lsls r0, 5 - ldr r1, =gUnknown_082F0790 + ldr r1, =gWirelessInfoScreenPal adds r0, r1 movs r1, 0 movs r2, 0x10 diff --git a/data/data2.s b/data/data2.s index 45adfc678..96d8c826d 100644 --- a/data/data2.s +++ b/data/data2.s @@ -6,25 +6,25 @@ .section .rodata .align 2 -gUnknown_082EC86C:: @ 82EC86C - .incbin "graphics/interface/wireless_link.gbapal" +gWirelessLinkDisplayPal:: @ 82EC86C + .incbin "graphics/interface/wireless_link_display.gbapal" -gUnknown_082EC88C:: @ 82EC88C - .incbin "graphics/interface/wireless_link.4bpp.lz" +gWirelessLinkDisplayGfx:: @ 82EC88C + .incbin "graphics/interface/wireless_link_display.4bpp.lz" -gUnknown_082ECD34:: @ 82ECD34 - .incbin "graphics/interface/wireless_link.bin.lz" +gWirelessLinkDisplayTilemap:: @ 82ECD34 + .incbin "graphics/interface/wireless_link_display.bin.lz" -gUnknown_082ECF20:: @ 82ECF20 +gLinkTestDigitsPal:: @ 82ECF20 .incbin "graphics/interface/link_test_digits.gbapal" -gUnknown_082ECF40:: @ 82ECF40 +gLinkTestDigitsGfx:: @ 82ECF40 .incbin "graphics/interface/link_test_digits.4bpp" .string "{HIGHLIGHT TRANSPARENT}{COLOR WHITE}$" .align 2 -gUnknown_082ED168:: @ 82ED168 +g2BlankTilesGfx:: @ 82ED168 .incbin "graphics/interface/blank_1x2.4bpp" gUnknown_082ED1A8:: @ 82ED1A8 @@ -42,11 +42,11 @@ gUnknown_082ED1A8:: @ 82ED1A8 gUnknown_082ED1D0:: @ 82ED1D0 .byte 0x8, 0xA, 0xC, 0xE -gUnknown_082ED1D4:: @ 82ED1D4 +gASCIIGameFreakInc:: @ 82ED1D4 .ascii "GameFreak inc." .align 2 -gUnknown_082ED1E4:: @ 82ED1E4 +gASCIITestPrint:: @ 82ED1E4 .ascii "TEST PRINT\nP0\nP1\nP2\nP3" .align 2 @@ -1882,12 +1882,12 @@ gUnknown_082F0530:: @ 82F0530 .byte 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x0e, 0x00, 0x00 .align 2 -gUnknown_082F0548:: @ 82F0548 - .incbin "graphics/interface/test_textbox.gbapal" +gUnkTextboxBorderPal:: @ 82F0548 + .incbin "graphics/interface/unk_textbox_border.gbapal" .align 2 -gUnknown_082F0568:: @ 82F0568 - .incbin "graphics/interface/test_textbox.4bpp.lz" +gUnkTextboxBorderGfx:: @ 82F0568 + .incbin "graphics/interface/unk_textbox_border.4bpp.lz" .align 2 gUnknown_082F0598:: @ 82F0598 struct BgTemplate @@ -2064,15 +2064,15 @@ gUnknown_082F078E:: @ 82F078E .byte 0x9d, 0xfe .align 2 -gUnknown_082F0790:: @ 82F0790 +gWirelessInfoScreenPal:: @ 82F0790 .incbin "graphics/interface/wireless_info_screen.gbapal" .align 2 -gUnknown_082F0990:: @ 82F0990 +gWirelessInfoScreenGfx:: @ 82F0990 .incbin "graphics/interface/wireless_info_screen.4bpp.lz" .align 2 -gUnknown_082F0BA0:: @ 82F0BA0 +gWirelessInfoScreenTilemap:: @ 82F0BA0 .incbin "graphics/interface/wireless_info_screen.bin.lz" .align 2 @@ -2145,150 +2145,150 @@ gUnknown_082F0E1C:: @ 82F0E1C window_template 0x01, 0x01, 0x0E, 0x1C, 0x05, 0x02, 0x0130 .align 2 -gUnknown_082F0E34:: @ 82F0E34 +gWonderCardBgPal1:: @ 82F0E34 .incbin "graphics/interface/wonder_card_1.gbapal" .align 2 -gUnknown_082F0E54:: @ 82F0E54 +gWonderCardBgPal2:: @ 82F0E54 .incbin "graphics/interface/wonder_card_2.gbapal" .align 2 -gUnknown_082F0E74:: @ 82F0E74 +gWonderCardBgPal3:: @ 82F0E74 .incbin "graphics/interface/wonder_card_3.gbapal" .align 2 -gUnknown_082F0E94:: @ 82F0E94 +gWonderCardBgPal4:: @ 82F0E94 .incbin "graphics/interface/wonder_card_4.gbapal" .align 2 -gUnknown_082F0EB4:: @ 82F0EB4 +gWonderCardBgPal5:: @ 82F0EB4 .incbin "graphics/interface/wonder_card_5.gbapal" .align 2 -gUnknown_082F0ED4:: @ 82F0ED4 +gWonderCardBgPal6:: @ 82F0ED4 .incbin "graphics/interface/wonder_card_6.gbapal" .align 2 -gUnknown_082F0EF4:: @ 82F0EF4 +gWonderCardBgPal7:: @ 82F0EF4 .incbin "graphics/interface/wonder_card_7.gbapal" .align 2 -gUnknown_082F0F14:: @ 82F0F14 +gWonderCardBgPal8:: @ 82F0F14 .incbin "graphics/interface/wonder_card_8.gbapal" .align 2 -gUnknown_082F0F34:: @ 82F0F34 +gWonderCardBgGfx1:: @ 82F0F34 .incbin "graphics/interface/wonder_card_1.4bpp.lz" .align 2 -gUnknown_082F1030:: @ 82F1030 +gWonderCardBgTilemap1:: @ 82F1030 .incbin "graphics/interface/wonder_card_1.bin.lz" .align 2 -gUnknown_082F1124:: @ 82F1124 +gWonderCardBgGfx2:: @ 82F1124 .incbin "graphics/interface/wonder_card_2.4bpp.lz" .align 2 -gUnknown_082F1218:: @ 82F1218 +gWonderCardBgTilemap2:: @ 82F1218 .incbin "graphics/interface/wonder_card_2.bin.lz" .align 2 -gUnknown_082F1300:: @ 82F1300 +gWonderCardBgGfx3:: @ 82F1300 .incbin "graphics/interface/wonder_card_3.4bpp.lz" .align 2 -gUnknown_082F13D4:: @ 82F13D4 +gWonderCardBgTilemap3:: @ 82F13D4 .incbin "graphics/interface/wonder_card_3.bin.lz" .align 2 -gUnknown_082F14A8:: @ 82F14A8 +gWonderCardBgGfx7:: @ 82F14A8 .incbin "graphics/interface/wonder_card_7.4bpp.lz" .align 2 -gUnknown_082F16DC:: @ 82F16DC +gWonderCardBgTilemap7:: @ 82F16DC .incbin "graphics/interface/wonder_card_7.bin.lz" .align 2 -gUnknown_082F1824:: @ 82F1824 +gWonderCardBgGfx8:: @ 82F1824 .incbin "graphics/interface/wonder_card_8.4bpp.lz" .align 2 -gUnknown_082F1A54:: @ 82F1A54 +gWonderCardBgTilemap8:: @ 82F1A54 .incbin "graphics/interface/wonder_card_8.bin.lz" .align 2 -gUnknown_082F1B9C:: @ 82F1B9C +gWonderCardShadowPal1:: @ 82F1B9C .incbin "graphics/interface/wonder_card_shadow_1.gbapal" .align 2 -gUnknown_082F1BBC:: @ 82F1BBC +gWonderCardShadowPal2:: @ 82F1BBC .incbin "graphics/interface/wonder_card_shadow_2.gbapal" .align 2 -gUnknown_082F1BDC:: @ 82F1BDC +gWonderCardShadowPal3:: @ 82F1BDC .incbin "graphics/interface/wonder_card_shadow_3.gbapal" .align 2 -gUnknown_082F1BFC:: @ 82F1BFC +gWonderCardShadowPal4:: @ 82F1BFC .incbin "graphics/interface/wonder_card_shadow_4.gbapal" .align 2 -gUnknown_082F1C1C:: @ 82F1C1C +gWonderCardShadowPal5:: @ 82F1C1C .incbin "graphics/interface/wonder_card_shadow_5.gbapal" .align 2 -gUnknown_082F1C3C:: @ 82F1C3C +gWonderCardShadowPal6:: @ 82F1C3C .incbin "graphics/interface/wonder_card_shadow_6.gbapal" .align 2 -gUnknown_082F1C5C:: @ 82F1C5C +gWonderCardShadowPal7:: @ 82F1C5C .incbin "graphics/interface/wonder_card_shadow_7.gbapal" .align 2 -gUnknown_082F1C7C:: @ 82F1C7C +gWonderCardShadowPal8:: @ 82F1C7C .incbin "graphics/interface/wonder_card_shadow_8.gbapal" .align 2 -gUnknown_082F1C9C:: @ 82F1C9C +gWonderCardShadowGfx:: @ 82F1C9C .incbin "graphics/interface/wonder_card_shadow.4bpp.lz" .align 2 gUnknown_082F1D00:: @ 82F1D00 struct CompressedSpriteSheet - .4byte gUnknown_082F1C9C + .4byte gWonderCardShadowGfx .2byte 0x0100 .2byte 0x8000 .align 2 gUnknown_082F1D08:: @ 82F1D08 struct SpritePalette - .4byte gUnknown_082F1B9C + .4byte gWonderCardShadowPal1 .2byte 0x8000 .align 2 - .4byte gUnknown_082F1BBC + .4byte gWonderCardShadowPal2 .2byte 0x8000 .align 2 - .4byte gUnknown_082F1BDC + .4byte gWonderCardShadowPal3 .2byte 0x8000 .align 2 - .4byte gUnknown_082F1BFC + .4byte gWonderCardShadowPal4 .2byte 0x8000 .align 2 - .4byte gUnknown_082F1C1C + .4byte gWonderCardShadowPal5 .2byte 0x8000 .align 2 - .4byte gUnknown_082F1C3C + .4byte gWonderCardShadowPal6 .2byte 0x8000 .align 2 - .4byte gUnknown_082F1C5C + .4byte gWonderCardShadowPal7 .2byte 0x8000 .align 2 - .4byte gUnknown_082F1C7C + .4byte gWonderCardShadowPal8 .2byte 0x8000 .align 2 @@ -2303,14 +2303,14 @@ gUnknown_082F1D48:: @ 82F1D48 struct SpriteTemplate .align 2 gUnknown_082F1D60:: @ 82F1D60 - .4byte 0x00000001, gUnknown_082F0F34, gUnknown_082F1030, gUnknown_082F0E34 - .4byte 0x00001001, gUnknown_082F1124, gUnknown_082F1218, gUnknown_082F0E54 - .4byte 0x00002001, gUnknown_082F1300, gUnknown_082F13D4, gUnknown_082F0E74 - .4byte 0x00003001, gUnknown_082F1300, gUnknown_082F13D4, gUnknown_082F0E94 - .4byte 0x00004001, gUnknown_082F1300, gUnknown_082F13D4, gUnknown_082F0EB4 - .4byte 0x00005001, gUnknown_082F1300, gUnknown_082F13D4, gUnknown_082F0ED4 - .4byte 0x00006001, gUnknown_082F14A8, gUnknown_082F16DC, gUnknown_082F0EF4 - .4byte 0x00007001, gUnknown_082F1824, gUnknown_082F1A54, gUnknown_082F0F14 + .4byte 0x00000001, gWonderCardBgGfx1, gWonderCardBgTilemap1, gWonderCardBgPal1 + .4byte 0x00001001, gWonderCardBgGfx2, gWonderCardBgTilemap2, gWonderCardBgPal2 + .4byte 0x00002001, gWonderCardBgGfx3, gWonderCardBgTilemap3, gWonderCardBgPal3 + .4byte 0x00003001, gWonderCardBgGfx3, gWonderCardBgTilemap3, gWonderCardBgPal4 + .4byte 0x00004001, gWonderCardBgGfx3, gWonderCardBgTilemap3, gWonderCardBgPal5 + .4byte 0x00005001, gWonderCardBgGfx3, gWonderCardBgTilemap3, gWonderCardBgPal6 + .4byte 0x00006001, gWonderCardBgGfx7, gWonderCardBgTilemap7, gWonderCardBgPal7 + .4byte 0x00007001, gWonderCardBgGfx8, gWonderCardBgTilemap8, gWonderCardBgPal8 gUnknown_082F1DE0:: @ 82F1DE0 .incbin "baserom.gba", 0x2f1de0, 0x8 diff --git a/data/strings.s b/data/strings.s index 2abac1437..755cc45bc 100644 --- a/data/strings.s +++ b/data/strings.s @@ -2053,7 +2053,7 @@ gUnknown_085ECF8F:: @ 85ECF8F gUnknown_085ECF99:: @ 85ECF99 .string "TIME$" - .string "ゲ-ムポイント$" + .string "ゲ-ムポイント$" @ "geemupointo" ("game point" in Japanese) gUnknown_085ECFA6:: @ 85ECFA6 .string "{STR_VAR_1}’s TRAINER CARD$" @@ -2108,12 +2108,17 @@ gUnknown_085ED0E0:: @ 85ED0E0 .align 2 .string "{STR_VAR_1} SINGLE$" + .align 2 .string "{STR_VAR_1} DOUBLE$" + .align 2 .string "{STR_VAR_1} MULTI$" + .align 2 .string "{STR_VAR_1} LINK$" + + .align 2 .string "{STR_VAR_1}$" gUnknown_085ED193:: @ 85ED193 diff --git a/graphics/interface/test_textbox.pal b/graphics/interface/unk_textbox_border.pal similarity index 100% rename from graphics/interface/test_textbox.pal rename to graphics/interface/unk_textbox_border.pal diff --git a/graphics/interface/test_textbox.png b/graphics/interface/unk_textbox_border.png similarity index 100% rename from graphics/interface/test_textbox.png rename to graphics/interface/unk_textbox_border.png diff --git a/graphics/interface/wireless_link.bin b/graphics/interface/wireless_link_display.bin similarity index 100% rename from graphics/interface/wireless_link.bin rename to graphics/interface/wireless_link_display.bin diff --git a/graphics/interface/wireless_link.pal b/graphics/interface/wireless_link_display.pal similarity index 100% rename from graphics/interface/wireless_link.pal rename to graphics/interface/wireless_link_display.pal diff --git a/graphics/interface/wireless_link.png b/graphics/interface/wireless_link_display.png similarity index 100% rename from graphics/interface/wireless_link.png rename to graphics/interface/wireless_link_display.png From a9f09ca05120fca58b99839066301724c40cbd8b Mon Sep 17 00:00:00 2001 From: Diegoisawesome Date: Tue, 12 Sep 2017 01:23:34 -0500 Subject: [PATCH 06/13] Begin renaming string.s unknowns --- asm/battle_setup.s | 2 +- asm/berry_blender.s | 4 +- asm/berry_tag_screen.s | 4 +- asm/contest.s | 8 +- asm/contest_link_80F57C4.s | 2 +- asm/contest_painting.s | 2 +- asm/decoration.s | 6 +- asm/hall_of_fame.s | 26 ++-- asm/item_use.s | 36 +++--- asm/link.s | 24 ++-- asm/main_menu.s | 44 +++---- asm/mystery_event_script.s | 4 +- asm/naming_screen.s | 4 +- asm/player_pc.s | 28 ++-- asm/pokedex.s | 24 ++-- asm/pokemon_2.s | 2 +- asm/region_map.s | 2 +- asm/rom6.s | 2 +- asm/rom_8072304.s | 2 +- asm/rom_80C6FA0.s | 2 +- asm/rom_815A0D4.s | 2 +- asm/rom_818E9AC.s | 72 +++++------ asm/rom_81BE66C.s | 74 +++++------ asm/secret_base.s | 2 +- asm/shop.s | 6 +- asm/starter_choose.s | 4 +- asm/trader.s | 4 +- data/data2.s | 238 +++++++++++++++++----------------- data/data_emerald2.s | 2 - data/strings.s | 254 ++++++++++++++++++------------------- src/coins.c | 4 +- 31 files changed, 444 insertions(+), 446 deletions(-) diff --git a/asm/battle_setup.s b/asm/battle_setup.s index 43f30e0ec..4604e22b8 100644 --- a/asm/battle_setup.s +++ b/asm/battle_setup.s @@ -2590,7 +2590,7 @@ ReturnEmptyStringIfNull: @ 80B1C6C push {lr} cmp r0, 0 bne _080B1C74 - ldr r0, =gUnknown_085E8D03 + ldr r0, =gText_EmptyString2 _080B1C74: pop {r1} bx r1 diff --git a/asm/berry_blender.s b/asm/berry_blender.s index cc859f052..0929da338 100644 --- a/asm/berry_blender.s +++ b/asm/berry_blender.s @@ -7333,7 +7333,7 @@ _08083564: bl StringAppend ldr r0, [r7] adds r0, 0x9F - ldr r1, =gUnknown_085E8D5E + ldr r1, =gText_Space bl StringAppend ldr r0, [r7] adds r0, 0x9F @@ -8165,7 +8165,7 @@ _08083C84: bl StringAppend ldr r0, [r7] adds r0, 0x9F - ldr r1, =gUnknown_085E8D5E + ldr r1, =gText_Space bl StringAppend ldr r0, [r7] adds r0, 0x9F diff --git a/asm/berry_tag_screen.s b/asm/berry_tag_screen.s index 4d5022189..04d04bb31 100644 --- a/asm/berry_tag_screen.s +++ b/asm/berry_tag_screen.s @@ -666,7 +666,7 @@ _081781C8: b _08178242 .pool _08178230: - ldr r2, =gUnknown_085E8D34 + ldr r2, =gText_ThreeMarks str r7, [sp] str r0, [sp, 0x4] str r0, [sp, 0x8] @@ -724,7 +724,7 @@ itemid_copy_name: @ 8178250 b _081782C2 .pool _081782B0: - ldr r2, =gUnknown_085E8D34 + ldr r2, =gText_ThreeMarks str r5, [sp] str r0, [sp, 0x4] str r0, [sp, 0x8] diff --git a/asm/contest.s b/asm/contest.s index e0ea14adb..bc062dd94 100644 --- a/asm/contest.s +++ b/asm/contest.s @@ -6447,7 +6447,7 @@ sub_80DAF1C: @ 80DAF1C adds r5, r0, 0 lsls r4, 24 lsrs r4, 24 - ldr r1, =gUnknown_085E8D3E + ldr r1, =gText_Slash add r0, sp, 0x4 bl StringCopy lsls r1, r5, 6 @@ -7100,7 +7100,7 @@ _080DB472: ldr r1, [r0] movs r0, 0xA bl sub_80DEB70 - ldr r1, =gUnknown_085E8D3E + ldr r1, =gText_Slash movs r0, 0x9 bl sub_80DEB70 add sp, 0x10 @@ -10296,7 +10296,7 @@ _080DCD92: lsls r0, 16 lsrs r4, r0, 16 adds r0, r2, 0 - ldr r1, =gUnknown_085E8D40 + ldr r1, =gText_OneDash bl StringCopy adds r2, r0, 0 _080DCDBC: @@ -10339,7 +10339,7 @@ _080DCDEA: lsls r0, 16 lsrs r4, r0, 16 adds r0, r2, 0 - ldr r1, =gUnknown_085E8D40 + ldr r1, =gText_OneDash bl StringCopy adds r2, r0, 0 _080DCE14: diff --git a/asm/contest_link_80F57C4.s b/asm/contest_link_80F57C4.s index 39a8f5209..730be91ad 100644 --- a/asm/contest_link_80F57C4.s +++ b/asm/contest_link_80F57C4.s @@ -296,7 +296,7 @@ _080F5A96: adds r1, r4, 0 movs r2, 0 bl sub_80F7ED0 - ldr r1, =gUnknown_085E8D3E + ldr r1, =gText_Slash adds r0, r6, 0 bl StringCopy adds r1, r7, 0 diff --git a/asm/contest_painting.s b/asm/contest_painting.s index d8dec9f2a..e3ecfd619 100644 --- a/asm/contest_painting.s +++ b/asm/contest_painting.s @@ -383,7 +383,7 @@ sub_813010C: @ 813010C adds r0, r4, 0 adds r1, r5, 0 bl sub_818E868 - ldr r1, =gUnknown_085E8D5E + ldr r1, =gText_Space adds r0, r4, 0 bl StringAppend ldr r1, =gUnknown_085B07D4 diff --git a/asm/decoration.s b/asm/decoration.s index 53eca818a..c51a40896 100644 --- a/asm/decoration.s +++ b/asm/decoration.s @@ -653,7 +653,7 @@ _08126F0C: adds r1, r0 movs r2, 0x1E ldrsh r0, [r1, r2] - ldr r2, =gUnknown_085E8CF0 + ldr r2, =gText_Cancel cmp r0, 0x2 bne _08126F2C ldr r2, =gUnknown_085EB7EA @@ -1216,7 +1216,7 @@ _081273D6: adds r4, r3 ldr r0, [r5] adds r0, r4 - ldr r1, =gUnknown_085E8CF0 + ldr r1, =gText_Cancel bl StringCopy ldr r0, [r5] lsls r2, r6, 3 @@ -1610,7 +1610,7 @@ sub_8127744: @ 8127744 ldrb r0, [r0] cmp r4, r0 bcc _08127770 - ldr r2, =gUnknown_085E8D62 + ldr r2, =gText_GoBackPrevMenu b _08127782 .pool _08127770: diff --git a/asm/hall_of_fame.s b/asm/hall_of_fame.s index 4dbea35d5..d787a1ad8 100644 --- a/asm/hall_of_fame.s +++ b/asm/hall_of_fame.s @@ -1235,7 +1235,7 @@ _08173FD0: movs r0, 0 movs r1, 0 bl sub_81973C4 - ldr r2, =gUnknown_085E8C14 + ldr r2, =gText_LeagueChamp str r5, [sp] movs r0, 0x2 str r0, [sp, 0x4] @@ -1858,14 +1858,14 @@ _0817454E: movs r3, 0x3 bl ConvertIntToDecimalStringN ldr r5, =gStringVar4 - ldr r1, =gUnknown_085E8C00 + ldr r1, =gText_HOFNumber adds r0, r5, 0 bl StringExpandPlaceholders movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0 bgt _081745C0 - ldr r1, =gUnknown_085E8574 + ldr r1, =gText_PickCancel movs r0, 0x1 str r0, [sp] adds r0, r5, 0 @@ -1875,7 +1875,7 @@ _0817454E: b _081745D0 .pool _081745C0: - ldr r1, =gUnknown_085E855C + ldr r1, =gText_PickNextCancel movs r0, 0x1 str r0, [sp] adds r0, r5, 0 @@ -2321,14 +2321,14 @@ sub_81749A0: @ 81749A0 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - ldr r0, =gUnknown_085E8588 + ldr r0, =gText_UnkCtrlF800Exit movs r1, 0x8 movs r2, 0x1 bl sub_8198180 movs r0, 0 movs r1, 0 bl sub_81973C4 - ldr r2, =gUnknown_085E8BDC + ldr r2, =gText_HOFCorrupted movs r0, 0 str r0, [sp] movs r0, 0x2 @@ -2391,7 +2391,7 @@ sub_8174A38: @ 8174A38 bl FillWindowPixelBuffer movs r0, 0 bl PutWindowTilemap - ldr r4, =gUnknown_085E8B3E + ldr r4, =gText_WelcomeToHOF movs r0, 0x1 adds r1, r4, 0 movs r2, 0xD0 @@ -2434,7 +2434,7 @@ sub_8174A88: @ 8174A88 lsls r0, 1 cmp r1, r0 beq _08174B30 - ldr r1, =gUnknown_085E8C36 + ldr r1, =gText_Number add r0, sp, 0xC bl StringCopy adds r6, r0, 0 @@ -2604,7 +2604,7 @@ _08174C0A: movs r2, 0x80 movs r3, 0x1 bl box_print - ldr r1, =gUnknown_085E8C3B + ldr r1, =gText_Level add r0, sp, 0xC bl StringCopy adds r6, r0, 0 @@ -2622,7 +2622,7 @@ _08174C0A: movs r2, 0x24 movs r3, 0x11 bl box_print - ldr r1, =gUnknown_085E8C4D + ldr r1, =gText_IDNumber add r0, sp, 0xC bl StringCopy adds r6, r0, 0 @@ -2675,7 +2675,7 @@ sub_8174C98: @ 8174C98 negs r1, r1 mov r9, r1 str r1, [sp, 0x4] - ldr r0, =gUnknown_085E8C48 + ldr r0, =gText_Name str r0, [sp, 0x8] movs r0, 0x1 movs r1, 0x1 @@ -2711,7 +2711,7 @@ sub_8174C98: @ 8174C98 str r0, [sp] movs r7, 0 str r7, [sp, 0x4] - ldr r0, =gUnknown_085E8C4D + ldr r0, =gText_IDNumber str r0, [sp, 0x8] movs r0, 0x1 movs r1, 0x1 @@ -2787,7 +2787,7 @@ sub_8174C98: @ 8174C98 str r0, [sp] mov r1, r9 str r1, [sp, 0x4] - ldr r0, =gUnknown_085E84CE + ldr r0, =gText_MainMenuTime str r0, [sp, 0x8] movs r0, 0x1 movs r1, 0x1 diff --git a/asm/item_use.s b/asm/item_use.s index 3f97bb2d1..ca84557d5 100644 --- a/asm/item_use.s +++ b/asm/item_use.s @@ -157,7 +157,7 @@ DisplayCannotUseItemMessage: @ 80FD164 b _080FD1BE .pool _080FD1A0: - ldr r1, =gUnknown_085E8F31 + ldr r1, =gText_DadsAdvice ldr r2, =sub_81C6714 adds r0, r5, 0 bl DisplayItemMessageInBattlePyramid @@ -183,7 +183,7 @@ DisplayDadsAdviceCannotUseItemMessage: @ 80FD1C8 lsrs r0, 24 lsls r1, 24 lsrs r1, 24 - ldr r2, =gUnknown_085E8F31 + ldr r2, =gText_DadsAdvice bl DisplayCannotUseItemMessage pop {r0} bx r0 @@ -198,7 +198,7 @@ DisplayCannotDismountBikeMessage: @ 80FD1E0 lsrs r0, 24 lsls r1, 24 lsrs r1, 24 - ldr r2, =gUnknown_085E8F6E + ldr r2, =gText_CantDismountBike bl DisplayCannotUseItemMessage pop {r0} bx r0 @@ -571,7 +571,7 @@ ItemUseOnFieldCB_Itemfinder: @ 80FD4B8 b _080FD4F6 .pool _080FD4EC: - ldr r1, =gUnknown_085E9002 + ldr r1, =gText_ItemFinderNothing ldr r2, =sub_80FD5CC adds r0, r4, 0 bl DisplayItemMessageOnField @@ -1363,7 +1363,7 @@ sub_80FDA94: @ 80FDA94 lsrs r0, 24 cmp r0, 0x1 bne _080FDACA - ldr r1, =gUnknown_085E8F93 + ldr r1, =gText_ItemFinderNearby ldr r2, =sub_80FD5CC adds r0, r4, 0 bl DisplayItemMessageOnField @@ -1427,7 +1427,7 @@ _080FDB1C: asrs r0, 16 cmp r0, 0x4 bne _080FDB50 - ldr r1, =gUnknown_085E8FDB + ldr r1, =gText_ItemFinderOnTop ldr r2, =sub_80FD5CC adds r0, r5, 0 bl DisplayItemMessageOnField @@ -1542,7 +1542,7 @@ ItemUseOutOfBattle_CoinCase: @ 80FDC34 movs r3, 0x4 bl ConvertIntToDecimalStringN ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9026 + ldr r1, =gText_CoinCase adds r0, r4, 0 bl StringExpandPlaceholders ldr r1, =gTasks @@ -1586,7 +1586,7 @@ ItemUseOutOfBattle_PowderJar: @ 80FDCA4 movs r3, 0x5 bl ConvertIntToDecimalStringN ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9138 + ldr r1, =gText_PowderQty adds r0, r4, 0 bl StringExpandPlaceholders ldr r1, =gTasks @@ -1892,7 +1892,7 @@ ItemUseOutOfBattle_TMHM: @ 80FDF48 lsls r0, 1 cmp r1, r0 bls _080FDF74 - ldr r2, =gUnknown_085E9047 + ldr r2, =gText_BootedUpHM ldr r3, =sub_80FDF90 adds r0, r4, 0 movs r1, 0x1 @@ -1900,7 +1900,7 @@ ItemUseOutOfBattle_TMHM: @ 80FDF48 b _080FDF80 .pool _080FDF74: - ldr r2, =gUnknown_085E9037 + ldr r2, =gText_BootedUpTM ldr r3, =sub_80FDF90 adds r0, r4, 0 movs r1, 0x1 @@ -1957,7 +1957,7 @@ task08_0809AD8C: @ 80FDFBC adds r0, r4, 0 bl StringCopy ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9058 + ldr r1, =gText_TMHMContainedVar1 adds r0, r4, 0 bl StringExpandPlaceholders ldr r3, =sub_80FE024 @@ -2010,7 +2010,7 @@ sub_80FE058: @ 80FE058 ldr r1, =gStringVar2 bl CopyItemName ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9080 + ldr r1, =gText_PlayerUsedVar2 bl StringExpandPlaceholders bl InBattlePyramid lsls r0, 24 @@ -2062,7 +2062,7 @@ _080FE0EC: lsls r0, 24 cmp r0, 0 bne _080FE10C - ldr r2, =gUnknown_085E9092 + ldr r2, =gText_RepelEffectsLingered ldr r3, =bag_menu_inits_lists_menu adds r0, r4, 0 movs r1, 0x1 @@ -2070,7 +2070,7 @@ _080FE0EC: b _080FE116 .pool _080FE10C: - ldr r1, =gUnknown_085E9092 + ldr r1, =gText_RepelEffectsLingered ldr r2, =sub_81C6714 adds r0, r5, 0 bl DisplayItemMessageInBattlePyramid @@ -2217,7 +2217,7 @@ ItemUseOutOfBattle_BlackWhiteFlute: @ 80FE234 ldr r0, =0x000008ae bl FlagReset ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E90C6 + ldr r1, =gText_UsedVar2WildLured bl StringExpandPlaceholders b _080FE28C .pool @@ -2227,7 +2227,7 @@ _080FE278: ldr r0, =0x000008ad bl FlagReset ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E90F4 + ldr r1, =gText_UsedVar2WildRepelled bl StringExpandPlaceholders _080FE28C: ldr r1, =gTasks @@ -2382,7 +2382,7 @@ _080FE3D0: lsls r0, 24 cmp r0, 0 bne _080FE3F0 - ldr r2, =gUnknown_085E9125 + ldr r2, =gText_BoxFull ldr r3, =bag_menu_inits_lists_menu adds r0, r4, 0 movs r1, 0x1 @@ -2390,7 +2390,7 @@ _080FE3D0: b _080FE3FA .pool _080FE3F0: - ldr r1, =gUnknown_085E9125 + ldr r1, =gText_BoxFull ldr r2, =sub_81C6714 adds r0, r5, 0 bl DisplayItemMessageInBattlePyramid diff --git a/asm/link.s b/asm/link.s index 9e197b8d2..a84191883 100644 --- a/asm/link.s +++ b/asm/link.s @@ -17895,7 +17895,7 @@ sub_80125BC: @ 80125BC movs r1, 0x1 movs r3, 0 bl sub_80173E0 - ldr r1, =gUnknown_082ED8CC + ldr r1, =gText_UnkCtrlCodeF907 add r0, sp, 0x8 bl StringCopy adds r5, r0, 0 @@ -17973,7 +17973,7 @@ _08012648: .4byte _080126B8 _080126B8: ldr r0, =gStringVar4 - ldr r1, =gUnknown_082ED960 + ldr r1, =gText_AwaitingCommunication bl StringExpandPlaceholders _080126C0: pop {r0} @@ -18294,13 +18294,13 @@ _080129C8: cmp r0, 0 beq _08012A18 ldr r0, =gStringVar4 - ldr r1, =gUnknown_082ED990 + ldr r1, =gText_AwaitingLink bl StringExpandPlaceholders b _08012A34 .pool _08012A18: ldr r0, =gStringVar4 - ldr r1, =gUnknown_082ED960 + ldr r1, =gText_AwaitingCommunication bl StringExpandPlaceholders b _08012A34 .pool @@ -22289,7 +22289,7 @@ _08014E16: _08014E4E: adds r0, r5, 0 adds r0, 0xD - ldr r1, =gUnknown_082ED8D0 + ldr r1, =gText_PleaseStartOver bl mevent_0814257C cmp r0, 0 beq _08014EF2 @@ -22719,7 +22719,7 @@ _0801523A: .pool _08015260: bl sub_800E084 - ldr r0, =gUnknown_082ED8D0 + ldr r0, =gText_PleaseStartOver bl sub_8018884 _0801526A: adds r0, r6, 0 @@ -23078,7 +23078,7 @@ _0801559A: _080155A8: adds r0, r5, 0 adds r0, 0x9 - ldr r1, =gUnknown_082ED8F8 + ldr r1, =gText_WirelessSearchCanceled b _080155C2 .pool _080155B4: @@ -27066,7 +27066,7 @@ sub_80177B8: @ 80177B8 movs r2, 0x2 movs r3, 0x2 bl ConvertIntToDecimalStringN - ldr r1, =gUnknown_082ED8C8 + ldr r1, =gText_Colon adds r0, r5, 0 bl StringAppend str r7, [sp] @@ -27111,7 +27111,7 @@ sub_80177B8: @ 80177B8 movs r2, 0x2 movs r3, 0x5 bl ConvertIntToDecimalStringN - ldr r1, =gUnknown_082ED8CC + ldr r1, =gText_UnkCtrlCodeF907 adds r0, r5, 0 bl StringCopy adds r0, r5, 0 @@ -27186,7 +27186,7 @@ sub_80178A0: @ 80178A0 movs r2, 0x2 movs r3, 0x5 bl ConvertIntToDecimalStringN - ldr r1, =gUnknown_082ED8CC + ldr r1, =gText_UnkCtrlCodeF907 adds r0, r4, 0 bl StringCopy adds r0, r4, 0 @@ -63848,7 +63848,7 @@ _0802A0CC: ldr r0, [r7] add r0, r10 ldrb r0, [r0] - ldr r2, =gUnknown_085E8D60 + ldr r2, =gText_SelectorArrow2 str r6, [sp] mov r3, r9 str r3, [sp, 0x4] @@ -63940,7 +63940,7 @@ _0802A1DC: ldr r0, [r7] add r0, r8 ldrb r0, [r0] - ldr r2, =gUnknown_085E8D60 + ldr r2, =gText_SelectorArrow2 subs r1, r5, 0x1 lsls r1, 4 adds r1, 0x1 diff --git a/asm/main_menu.s b/asm/main_menu.s index 0fa716115..d7c482ac5 100644 --- a/asm/main_menu.s +++ b/asm/main_menu.s @@ -312,7 +312,7 @@ _0802F982: b _0802F9FC .pool _0802F990: - ldr r0, =gUnknown_085E8405 + ldr r0, =gText_SaveFileErased bl CreateMainMenuErrorWindow strh r5, [r4] mov r0, r8 @@ -321,7 +321,7 @@ _0802F990: b _0802F9FA .pool _0802F9A4: - ldr r0, =gUnknown_085E83C2 + ldr r0, =gText_SaveFileCorrupted bl CreateMainMenuErrorWindow mov r0, r8 subs r0, 0x8 @@ -350,7 +350,7 @@ _0802F9D0: b _0802F9FC .pool _0802F9EC: - ldr r0, =gUnknown_085E8440 + ldr r0, =gJPText_No1MSubCircuit bl CreateMainMenuErrorWindow mov r0, r8 subs r0, 0x8 @@ -495,7 +495,7 @@ Task_MainMenuCheckBattery: @ 802FAB0 b _0802FB3C .pool _0802FB28: - ldr r0, =gUnknown_085E8453 + ldr r0, =gText_BatteryRunDry bl CreateMainMenuErrorWindow ldr r1, =gTasks lsls r0, r5, 2 @@ -679,7 +679,7 @@ _0802FCBC: movs r4, 0x1 negs r4, r4 str r4, [sp, 0x4] - ldr r0, =gUnknown_085E827C + ldr r0, =gText_MainMenuNewGame str r0, [sp, 0x8] movs r0, 0 movs r1, 0x1 @@ -688,7 +688,7 @@ _0802FCBC: bl box_print str r5, [sp] str r4, [sp, 0x4] - ldr r0, =gUnknown_085E828E + ldr r0, =gText_MainMenuOption str r0, [sp, 0x8] movs r0, 0x1 movs r1, 0x1 @@ -728,7 +728,7 @@ _0802FD44: movs r4, 0x1 negs r4, r4 str r4, [sp, 0x4] - ldr r0, =gUnknown_085E8285 + ldr r0, =gText_MainMenuContinue str r0, [sp, 0x8] movs r0, 0x2 movs r1, 0x1 @@ -737,7 +737,7 @@ _0802FD44: bl box_print str r5, [sp] str r4, [sp, 0x4] - ldr r0, =gUnknown_085E827C + ldr r0, =gText_MainMenuNewGame str r0, [sp, 0x8] movs r0, 0x3 movs r1, 0x1 @@ -746,7 +746,7 @@ _0802FD44: bl box_print str r5, [sp] str r4, [sp, 0x4] - ldr r0, =gUnknown_085E828E + ldr r0, =gText_MainMenuOption str r0, [sp, 0x8] movs r0, 0x4 movs r1, 0x1 @@ -799,7 +799,7 @@ _0802FE00: movs r4, 0x1 negs r4, r4 str r4, [sp, 0x4] - ldr r0, =gUnknown_085E8285 + ldr r0, =gText_MainMenuContinue str r0, [sp, 0x8] movs r0, 0x2 movs r1, 0x1 @@ -808,7 +808,7 @@ _0802FE00: bl box_print str r5, [sp] str r4, [sp, 0x4] - ldr r0, =gUnknown_085E827C + ldr r0, =gText_MainMenuNewGame str r0, [sp, 0x8] movs r0, 0x3 movs r1, 0x1 @@ -817,7 +817,7 @@ _0802FE00: bl box_print str r5, [sp] str r4, [sp, 0x4] - ldr r0, =gUnknown_085E8295 + ldr r0, =gText_MainMenuMysteryGift str r0, [sp, 0x8] movs r0, 0x4 movs r1, 0x1 @@ -826,7 +826,7 @@ _0802FE00: bl box_print str r5, [sp] str r4, [sp, 0x4] - ldr r0, =gUnknown_085E828E + ldr r0, =gText_MainMenuOption str r0, [sp, 0x8] movs r0, 0x5 movs r1, 0x1 @@ -895,7 +895,7 @@ _0802FEFC: movs r4, 0x1 negs r4, r4 str r4, [sp, 0x4] - ldr r0, =gUnknown_085E8285 + ldr r0, =gText_MainMenuContinue str r0, [sp, 0x8] movs r0, 0x2 movs r1, 0x1 @@ -904,7 +904,7 @@ _0802FEFC: bl box_print str r5, [sp] str r4, [sp, 0x4] - ldr r0, =gUnknown_085E827C + ldr r0, =gText_MainMenuNewGame str r0, [sp, 0x8] movs r0, 0x3 movs r1, 0x1 @@ -913,7 +913,7 @@ _0802FEFC: bl box_print str r5, [sp] str r4, [sp, 0x4] - ldr r0, =gUnknown_085E82A2 + ldr r0, =gText_MainMenuMysteryGift2 str r0, [sp, 0x8] movs r0, 0x4 movs r1, 0x1 @@ -922,7 +922,7 @@ _0802FEFC: bl box_print str r5, [sp] str r4, [sp, 0x4] - ldr r0, =gUnknown_085E82AF + ldr r0, =gText_MainMenuMysteryEvents str r0, [sp, 0x8] movs r0, 0x5 movs r1, 0x1 @@ -931,7 +931,7 @@ _0802FEFC: bl box_print str r5, [sp] str r4, [sp, 0x4] - ldr r0, =gUnknown_085E828E + ldr r0, =gText_MainMenuOption str r0, [sp, 0x8] movs r0, 0x6 movs r1, 0x1 @@ -1671,17 +1671,17 @@ _080305FC: beq _0803061C b _08030622 _08030602: - ldr r0, =gUnknown_085E82BE + ldr r0, =gText_WirelessNotConnected bl CreateMainMenuErrorWindow b _08030622 .pool _08030610: - ldr r0, =gUnknown_085E82E5 + ldr r0, =gText_MysteryGiftCantUse bl CreateMainMenuErrorWindow b _08030622 .pool _0803061C: - ldr r0, =gUnknown_085E8328 + ldr r0, =gText_MysteryEventsCantUse bl CreateMainMenuErrorWindow _08030622: ldr r0, =gTasks @@ -2123,7 +2123,7 @@ task_new_game_prof_birch_speech_4: @ 80309CC ldr r1, =task_new_game_prof_birch_speech_5 str r1, [r0] ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E8692 + ldr r1, =gText_ThisIsAPokemon bl StringExpandPlaceholders ldr r1, =sub_80323A0 movs r0, 0x1 diff --git a/asm/mystery_event_script.s b/asm/mystery_event_script.s index af9b0a745..3c6466d08 100644 --- a/asm/mystery_event_script.s +++ b/asm/mystery_event_script.s @@ -669,14 +669,14 @@ sub_8153CC8: @ 8153CC8 cmp r4, r0 bne _08153D18 ldr r0, =gStringVar1 - ldr r1, =gUnknown_085E8264 + ldr r1, =gText_Egg movs r2, 0xB bl StringCopyN b _08153D22 .pool _08153D18: ldr r0, =gStringVar1 - ldr r1, =gUnknown_085E8268 + ldr r1, =gText_Pokemon movs r2, 0xB bl StringCopyN _08153D22: diff --git a/asm/naming_screen.s b/asm/naming_screen.s index d67f1425d..2d79e464a 100644 --- a/asm/naming_screen.s +++ b/asm/naming_screen.s @@ -3387,7 +3387,7 @@ sub_80E49BC: @ 80E49BC push {r4,r5,lr} sub sp, 0x10 movs r4, 0 - ldr r1, =gUnknown_085E8D49 + ldr r1, =gText_MaleSymbol add r0, sp, 0xC bl StringCopy ldr r5, =gUnknown_02039F94 @@ -3399,7 +3399,7 @@ sub_80E49BC: @ 80E49BC beq _080E4A0C cmp r0, 0xFE bne _080E49E6 - ldr r1, =gUnknown_085E8D4B + ldr r1, =gText_FemaleSymbol add r0, sp, 0xC bl StringCopy movs r4, 0x1 diff --git a/asm/player_pc.s b/asm/player_pc.s index 1f5e0c332..2780d4fc5 100644 --- a/asm/player_pc.s +++ b/asm/player_pc.s @@ -69,7 +69,7 @@ sub_816AE58: @ 816AE58 bl CreateTask lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_085E8D80 + ldr r1, =gText_WhatWouldYouLike ldr r2, =sub_816AED8 bl DisplayItemMessageOnField pop {r0} @@ -91,7 +91,7 @@ sub_816AE98: @ 816AE98 bl CreateTask lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_085E8D80 + ldr r1, =gText_WhatWouldYouLike ldr r2, =sub_816AED8 bl DisplayItemMessageOnField pop {r0} @@ -266,7 +266,7 @@ sub_816B060: @ 816B060 push {lr} lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_085E8D80 + ldr r1, =gText_WhatWouldYouLike ldr r2, =sub_816AED8 bl DisplayItemMessageOnField pop {r0} @@ -1601,7 +1601,7 @@ sub_816BBB8: @ 816BBB8 push {lr} lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_085E8DE9 + ldr r1, =gText_NoPokemon ldr r2, =sub_816BBD4 bl DisplayItemMessageOnField pop {r0} @@ -1808,7 +1808,7 @@ _0816BD58: adds r4, r3 ldr r0, [r5] adds r0, r4 - ldr r1, =gUnknown_085E8CF7 + ldr r1, =gText_Cancel2 bl StringCopy ldr r0, [r5] lsls r2, r6, 3 @@ -1950,7 +1950,7 @@ _0816BE8E: movs r3, 0x3 bl ConvertIntToDecimalStringN ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E8DA0 + ldr r1, =gText_xVar1 adds r0, r4, 0 bl StringExpandPlaceholders movs r0, 0x7 @@ -2144,7 +2144,7 @@ _0816C030: lsls r0, r2, 24 asrs r0, 24 str r0, [sp, 0xC] - ldr r0, =gUnknown_085E8D60 + ldr r0, =gText_SelectorArrow2 str r0, [sp, 0x10] adds r0, r5, 0 movs r1, 0x1 @@ -2379,7 +2379,7 @@ _0816C248: .4byte _0816C274 .4byte _0816C26C _0816C26C: - ldr r0, =gUnknown_085E8D62 + ldr r0, =gText_GoBackPrevMenu b _0816C2BA .pool _0816C274: @@ -2391,11 +2391,11 @@ _0816C27C: b _0816C2BA .pool _0816C284: - ldr r0, =gUnknown_085E8EE0 + ldr r0, =gText_TossHowManyVar1s b _0816C2BA .pool _0816C28C: - ldr r0, =gUnknown_085E8EF9 + ldr r0, =gText_ThrewAwayVar2Var1s b _0816C2BA .pool _0816C294: @@ -2403,15 +2403,15 @@ _0816C294: b _0816C2BA .pool _0816C29C: - ldr r0, =gUnknown_085E8EB9 + ldr r0, =gText_TooImportantToToss b _0816C2BA .pool _0816C2A4: - ldr r0, =gUnknown_085E8F0E + ldr r0, =gText_ConfirmTossItems b _0816C2BA .pool _0816C2AC: - ldr r0, =gUnknown_085E8DFE + ldr r0, =gText_MoveVar1Where b _0816C2BA .pool _0816C2B4: @@ -2892,7 +2892,7 @@ sub_816C6BC: @ 816C6BC ldr r0, =gStringVar1 bl ConvertIntToDecimalStringN ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E8DA0 + ldr r1, =gText_xVar1 adds r0, r4, 0 bl StringExpandPlaceholders movs r0, 0x1 diff --git a/asm/pokedex.s b/asm/pokedex.s index c24701b76..0eba63518 100644 --- a/asm/pokedex.s +++ b/asm/pokedex.s @@ -7310,7 +7310,7 @@ _080BF38C: b _080BF582 .pool _080BF3A0: - ldr r0, =gUnknown_085E871B + ldr r0, =gText_CryOf movs r1, 0x52 movs r2, 0x21 bl sub_80BE8DC @@ -7893,7 +7893,7 @@ _080BF910: b _080BFB4E .pool _080BF93C: - ldr r1, =gUnknown_085E8723 + ldr r1, =gText_SizeComparedTo add r0, sp, 0x4 bl StringCopy ldr r0, =gSaveBlock2Ptr @@ -8891,7 +8891,7 @@ sub_80C020C: @ 80C020C adds r7, r2, 0 cmp r3, 0 beq _080C0234 - ldr r4, =gUnknown_085E8735 + ldr r4, =gText_PokedexRegistration movs r0, 0x1 adds r1, r4, 0 movs r2, 0xF0 @@ -8916,7 +8916,7 @@ _080C024C: adds r5, r6, 0 lsls r4, r6, 16 _080C0250: - ldr r1, =gUnknown_085E8D4F + ldr r1, =gText_UnkCtrlF908Clear01 mov r0, sp bl StringCopy adds r1, r5, 0 @@ -8955,16 +8955,16 @@ _080C028E: b _080C02AE .pool _080C02AC: - ldr r0, =gUnknown_085E86B8 + ldr r0, =gText_5MarksPokemon _080C02AE: movs r1, 0x64 movs r2, 0x29 bl sub_80BE8DC - ldr r0, =gUnknown_085E8755 + ldr r0, =gText_HTHeight movs r1, 0x60 movs r2, 0x39 bl sub_80BE8DC - ldr r0, =gUnknown_085E8758 + ldr r0, =gText_WTWeight movs r1, 0x60 movs r2, 0x49 bl sub_80BE8DC @@ -8984,11 +8984,11 @@ _080C02AE: b _080C0310 .pool _080C02FC: - ldr r0, =gUnknown_085E86C6 + ldr r0, =gText_UnkHeight movs r1, 0x81 movs r2, 0x39 bl sub_80BE8DC - ldr r0, =gUnknown_085E86D0 + ldr r0, =gText_UnkWeight movs r1, 0x81 movs r2, 0x49 bl sub_80BE8DC @@ -11626,7 +11626,7 @@ _080C17E8: b _080C1994 .pool _080C183C: - ldr r0, =gUnknown_085E875B + ldr r0, =gText_SearchingPleaseWait bl sub_80C2618 ldr r0, =sub_80C19A4 str r0, [r6] @@ -11880,7 +11880,7 @@ sub_80C1A4C: @ 80C1A4C beq _080C1A84 movs r0, 0x1F bl PlaySE - ldr r0, =gUnknown_085E8773 + ldr r0, =gText_SearchCompleted bl sub_80C2618 b _080C1A90 .pool @@ -13334,7 +13334,7 @@ sub_80C2638: @ 80C2638 sub_80C2650: @ 80C2650 push {lr} adds r2, r0, 0 - ldr r0, =gUnknown_085E8B3A + ldr r0, =gText_SelectorArrow lsls r2, 4 adds r2, 0x9 movs r1, 0x90 diff --git a/asm/pokemon_2.s b/asm/pokemon_2.s index 7b587ad5c..02531d81e 100644 --- a/asm/pokemon_2.s +++ b/asm/pokemon_2.s @@ -1338,7 +1338,7 @@ _0806A89C: ands r0, r1 cmp r0, 0 beq _0806A8BC - ldr r1, =gUnknown_085E8264 + ldr r1, =gText_Egg adds r0, r6, 0 bl StringCopy adds r0, r6, 0 diff --git a/asm/region_map.s b/asm/region_map.s index a6112ab61..1b1dfb4bd 100644 --- a/asm/region_map.s +++ b/asm/region_map.s @@ -3452,7 +3452,7 @@ _0812480C: movs r0, 0x2 movs r1, 0 bl FillWindowPixelBuffer - ldr r2, =gUnknown_085E8CB4 + ldr r2, =gText_FlyToWhere movs r0, 0x1 str r0, [sp] movs r0, 0 diff --git a/asm/rom6.s b/asm/rom6.s index 5f604448d..2cf9a4ade 100644 --- a/asm/rom6.s +++ b/asm/rom6.s @@ -10753,7 +10753,7 @@ _0813AE1E: ldrh r0, [r6, 0x22] lsls r0, 24 lsrs r0, 24 - ldr r2, =gUnknown_085E8B3A + ldr r2, =gText_SelectorArrow mov r3, r9 ldrh r1, [r3] lsls r1, 28 diff --git a/asm/rom_8072304.s b/asm/rom_8072304.s index 87c9f2567..a43e8afd6 100644 --- a/asm/rom_8072304.s +++ b/asm/rom_8072304.s @@ -1533,7 +1533,7 @@ _08072F52: mov r3, r8 cmp r3, 0 bne _08072F82 - ldr r1, =gUnknown_085E8D3E + ldr r1, =gText_Slash bl StringCopy _08072F82: ldr r0, =gUnknown_020244D4 diff --git a/asm/rom_80C6FA0.s b/asm/rom_80C6FA0.s index c58388b92..ede71066b 100644 --- a/asm/rom_80C6FA0.s +++ b/asm/rom_80C6FA0.s @@ -14847,7 +14847,7 @@ _080CEE94: _080CEEC0: ldr r2, =0x00000cf9 adds r0, r1, r2 - ldr r1, =gUnknown_085E8264 + ldr r1, =gText_Egg movs r2, 0 movs r3, 0x8 bl StringCopyPadded diff --git a/asm/rom_815A0D4.s b/asm/rom_815A0D4.s index e6441f17b..44c77bca6 100644 --- a/asm/rom_815A0D4.s +++ b/asm/rom_815A0D4.s @@ -13903,7 +13903,7 @@ _081612F6: adds r1, r2, 0 adds r1, 0x48 adds r1, r0 - ldr r0, =gUnknown_085E8CF0 + ldr r0, =gText_Cancel str r0, [r1] ldrb r0, [r3] lsls r0, 3 diff --git a/asm/rom_818E9AC.s b/asm/rom_818E9AC.s index 89694f630..137f852b9 100644 --- a/asm/rom_818E9AC.s +++ b/asm/rom_818E9AC.s @@ -54438,7 +54438,7 @@ _081AAF0C: b _081AB012 .pool _081AAF1C: - ldr r1, =gUnknown_085E91FC + ldr r1, =gPocketNames ldr r4, =gUnknown_0203CE58 ldrb r0, [r4, 0x5] lsls r0, 2 @@ -54848,7 +54848,7 @@ _081AB2B6: lsls r4, 3 ldr r0, [r5] adds r0, r4 - ldr r1, =gUnknown_085E8DB4 + ldr r1, =gText_CloseBag bl StringCopy ldr r0, =gUnknown_0203CE74 ldr r0, [r0] @@ -55185,7 +55185,7 @@ _081AB5BE: movs r3, 0x3 bl ConvertIntToDecimalStringN ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E8DA0 + ldr r1, =gText_xVar1 adds r0, r4, 0 bl StringExpandPlaceholders movs r0, 0x7 @@ -55218,7 +55218,7 @@ _081AB610: movs r3, 0x2 bl ConvertIntToDecimalStringN ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E8DA0 + ldr r1, =gText_xVar1 adds r0, r4, 0 bl StringExpandPlaceholders movs r0, 0x7 @@ -55306,7 +55306,7 @@ _081AB6E0: ldr r1, [r1] bl StringCopy ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E91C0 + ldr r1, =gText_ReturnToVar1 adds r0, r4, 0 bl StringExpandPlaceholders _081AB6FC: @@ -55380,7 +55380,7 @@ bag_menu_print_cursor: @ 81AB75C bl FillWindowPixelRect b _081AB7AE _081AB798: - ldr r2, =gUnknown_085E8D60 + ldr r2, =gText_SelectorArrow2 str r5, [sp] movs r0, 0 str r0, [sp, 0x4] @@ -55980,7 +55980,7 @@ _081ABC6C: movs r2, 0x2 bl ConvertIntToDecimalStringN ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E8DA0 + ldr r1, =gText_xVar1 adds r0, r4, 0 bl StringExpandPlaceholders movs r0, 0x1 @@ -56023,7 +56023,7 @@ _081ABCD4: movs r2, 0x2 bl ConvertIntToDecimalStringN ldr r6, =gStringVar4 - ldr r1, =gUnknown_085E8DA0 + ldr r1, =gText_xVar1 adds r0, r6, 0 bl StringExpandPlaceholders lsls r4, 24 @@ -56424,7 +56424,7 @@ _081AC026: adds r5, r0, 0 cmp r1, 0x1 bne _081AC07C - ldr r2, =gUnknown_085E91FC + ldr r2, =gPocketNames ldrb r0, [r4, 0x5] lsls r0, 2 adds r0, r2 @@ -56440,7 +56440,7 @@ _081AC026: b _081AC09A .pool _081AC07C: - ldr r2, =gUnknown_085E91FC + ldr r2, =gPocketNames add r0, sp, 0x8 ldrb r0, [r0] lsls r0, 2 @@ -56775,7 +56775,7 @@ bag_menu_swap_items: @ 81AC2E8 bl CopyItemName ldr r0, =gStringVar4 mov r8, r0 - ldr r1, =gUnknown_085E8DFE + ldr r1, =gText_MoveVar1Where bl StringExpandPlaceholders movs r0, 0x1 movs r1, 0 @@ -57490,7 +57490,7 @@ _081ACA50: ldr r1, =gStringVar1 bl CopyItemName ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E8DBE + ldr r1, =gText_Var1IsSelected adds r0, r4, 0 bl StringExpandPlaceholders movs r0, 0x1 @@ -58061,7 +58061,7 @@ _081ACF24: ldr r1, =gStringVar1 bl CopyItemName ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E8EE0 + ldr r1, =gText_TossHowManyVar1s adds r0, r4, 0 bl StringExpandPlaceholders movs r0, 0x1 @@ -58117,7 +58117,7 @@ BagMenuConfirmToss: @ 81ACF88 movs r3, 0x3 bl ConvertIntToDecimalStringN ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E8F0E + ldr r1, =gText_ConfirmTossItems adds r0, r4, 0 bl StringExpandPlaceholders movs r0, 0x1 @@ -58254,7 +58254,7 @@ BagMenuActuallyToss: @ 81AD0CC movs r3, 0x3 bl ConvertIntToDecimalStringN ldr r6, =gStringVar4 - ldr r1, =gUnknown_085E8EF9 + ldr r1, =gText_ThrewAwayVar2Var1s adds r0, r6, 0 bl StringExpandPlaceholders movs r0, 0x1 @@ -58419,7 +58419,7 @@ ItemMenu_Give: @ 81AD278 lsls r0, 24 cmp r0, 0 bne _081AD2AC - ldr r2, =gUnknown_085E8DCE + ldr r2, =gText_CantWriteMail ldr r3, =sub_81AD350 adds r0, r4, 0 movs r1, 0x1 @@ -58462,7 +58462,7 @@ bag_menu_print_there_is_no_pokemon: @ 81AD2F0 push {lr} lsls r0, 24 lsrs r0, 24 - ldr r2, =gUnknown_085E8DE9 + ldr r2, =gText_NoPokemon ldr r3, =sub_81AD350 movs r1, 0x1 bl DisplayItemMessage @@ -58482,7 +58482,7 @@ bag_menu_print_cant_be_held_msg: @ 81AD30C ldr r1, =gStringVar1 bl CopyItemName ldr r5, =gStringVar4 - ldr r1, =gUnknown_085E8E11 + ldr r1, =gText_Var1CantBeHeld adds r0, r5, 0 bl StringExpandPlaceholders ldr r3, =sub_81AD350 @@ -58608,7 +58608,7 @@ item_menu_type_2: @ 81AD41C lsls r0, 24 cmp r0, 0 bne _081AD44C - ldr r2, =gUnknown_085E8DCE + ldr r2, =gText_CantWriteMail ldr r3, =sub_81AD350 adds r0, r5, 0 movs r1, 0x1 @@ -58625,7 +58625,7 @@ _081AD44C: ldr r1, =gStringVar1 bl CopyItemName ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E8E27 + ldr r1, =gText_Var1CantBeHeldHere adds r0, r4, 0 bl StringExpandPlaceholders ldr r3, =sub_81AD350 @@ -58670,7 +58670,7 @@ item_menu_type_b: @ 81AD4B4 lsrs r0, 24 cmp r0, 0x1 bne _081AD4E4 - ldr r2, =gUnknown_085E8DCE + ldr r2, =gText_CantWriteMail ldr r3, =sub_81AD350 adds r0, r4, 0 movs r1, 0x1 @@ -59247,7 +59247,7 @@ _081ADA18: ldr r1, =gStringVar1 bl CopyItemName ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E8E42 + ldr r1, =gText_DepositHowManyVar1 adds r0, r4, 0 bl StringExpandPlaceholders movs r0, 0x1 @@ -59374,7 +59374,7 @@ sub_81ADB14: @ 81ADB14 lsrs r5, r0, 24 cmp r5, 0 beq _081ADB6C - ldr r2, =gUnknown_085E8E8E + ldr r2, =gText_CantStoreImportantItems movs r0, 0x1 str r0, [sp] movs r0, 0 @@ -59405,7 +59405,7 @@ _081ADB6C: movs r3, 0x3 bl ConvertIntToDecimalStringN ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E8E5A + ldr r1, =gText_DepositedVar2Var1s adds r0, r4, 0 bl StringExpandPlaceholders str r6, [sp] @@ -59425,7 +59425,7 @@ _081ADB6C: b _081ADBF2 .pool _081ADBD4: - ldr r2, =gUnknown_085E8E6E + ldr r2, =gText_NoRoomForItems movs r0, 0x1 str r0, [sp] str r5, [sp, 0x4] @@ -60320,7 +60320,7 @@ _081AE31A: movs r0, 0x4 str r0, [sp, 0x10] movs r1, 0x1 - ldr r2, =gUnknown_085E8D45 + ldr r2, =gText_ThreeDashes movs r3, 0x7 bl bag_menu_print adds r0, r4, 0x1 @@ -60354,7 +60354,7 @@ _081AE354: ldrb r0, [r5, 0x1] cmp r0, 0x1 bhi _081AE38C - ldr r2, =gUnknown_085E8D45 + ldr r2, =gText_ThreeDashes b _081AE39C .pool _081AE38C: @@ -60387,7 +60387,7 @@ _081AE39C: adds r6, r1, 0 cmp r0, 0 bne _081AE3D8 - ldr r2, =gUnknown_085E8D45 + ldr r2, =gText_ThreeDashes b _081AE3E8 .pool _081AE3D8: @@ -61406,7 +61406,7 @@ _081AEB66: beq _081AEBCC b _081AEC0C _081AEB70: - ldr r1, =gUnknown_085E8D60 + ldr r1, =gText_SelectorArrow2 adds r0, r6, 0 mov r2, r8 adds r3, r7, 0 @@ -68511,7 +68511,7 @@ _081B243E: adds r0, r4, 0 movs r1, 0 bl FillWindowPixelBuffer - ldr r5, =gUnknown_085E8CE3 + ldr r5, =gText_Confirm movs r0, 0 adds r1, r5, 0 movs r2, 0x30 @@ -68559,7 +68559,7 @@ _081B24C0: ands r0, r1 cmp r0, 0xA beq _081B2514 - ldr r4, =gUnknown_085E8CF0 + ldr r4, =gText_Cancel movs r0, 0 adds r1, r4, 0 movs r2, 0x30 @@ -68582,7 +68582,7 @@ _081B24C0: b _081B2540 .pool _081B2514: - ldr r4, =gUnknown_085E8CF7 + ldr r4, =gText_Cancel2 movs r0, 0 adds r1, r4, 0 movs r2, 0x30 @@ -69314,7 +69314,7 @@ sub_81B2B40: @ 81B2B40 movs r3, 0x3 bl ConvertIntToDecimalStringN ldr r4, =gStringVar1 - ldr r1, =gUnknown_085E8D4D + ldr r1, =gText_LevelSymbol adds r0, r4, 0 bl StringCopy adds r0, r4, 0 @@ -69442,7 +69442,7 @@ _081B2C48: movs r2, 0x2 bl LoadPalette ldrb r0, [r7, 0x8] - ldr r1, =gUnknown_085E8D49 + ldr r1, =gText_MaleSymbol ldr r3, [r7] adds r3, 0xC movs r2, 0x2 @@ -69465,7 +69465,7 @@ _081B2C88: movs r2, 0x2 bl LoadPalette ldrb r0, [r7, 0x8] - ldr r1, =gUnknown_085E8D4B + ldr r1, =gText_FemaleSymbol ldr r3, [r7] adds r3, 0xC movs r2, 0x2 @@ -69630,7 +69630,7 @@ sub_81B2DDC: @ 81B2DDC movs r3, 0x3 bl ConvertIntToDecimalStringN ldr r4, =gStringVar1 - ldr r1, =gUnknown_085E8D3E + ldr r1, =gText_Slash adds r0, r4, 0 bl StringCopy adds r0, r4, 0 diff --git a/asm/rom_81BE66C.s b/asm/rom_81BE66C.s index d7a5aac86..ffaf35d7d 100644 --- a/asm/rom_81BE66C.s +++ b/asm/rom_81BE66C.s @@ -7339,7 +7339,7 @@ sub_81C2628: @ 81C2628 cmp r5, r0 beq _081C26CE ldr r6, =gStringVar1 - ldr r1, =gUnknown_085E8D4F + ldr r1, =gText_UnkCtrlF908Clear01 adds r0, r6, 0 bl StringCopy ldr r4, =gStringVar2 @@ -7401,7 +7401,7 @@ _081C26E8: bl sub_81C228C _081C26EE: ldr r4, =gStringVar1 - ldr r1, =gUnknown_085E8D4D + ldr r1, =gText_LevelSymbol adds r0, r4, 0 bl StringCopy ldr r5, =gStringVar2 @@ -7517,7 +7517,7 @@ sub_81C27DC: @ 81C27DC beq _081C2818 b _081C282C _081C27FE: - ldr r1, =gUnknown_085E8D49 + ldr r1, =gText_MaleSymbol str r0, [sp] movs r0, 0x3 str r0, [sp, 0x4] @@ -7528,7 +7528,7 @@ _081C27FE: b _081C282C .pool _081C2818: - ldr r1, =gUnknown_085E8D4B + ldr r1, =gText_FemaleSymbol movs r0, 0 str r0, [sp] movs r0, 0x4 @@ -7606,7 +7606,7 @@ sub_81C286C: @ 81C286C movs r2, 0x2 movs r3, 0x1 bl sub_81C25A4 - ldr r7, =gUnknown_085E8CF7 + ldr r7, =gText_Cancel2 movs r0, 0x1 adds r1, r7, 0 movs r2, 0x3E @@ -8354,7 +8354,7 @@ sub_81C2F5C: @ 81C2F5C cmp r0, 0x1 beq _081C2FC0 ldr r5, =gStringVar1 - ldr r1, =gUnknown_085E8D59 + ldr r1, =gText_UnkCtrlF907F908 adds r0, r5, 0 bl StringCopy ldr r1, =gUnknown_0203CF1C @@ -8829,7 +8829,7 @@ sub_81C335C: @ 81C335C movs r2, 0 movs r3, 0x1 bl sub_81C25A4 - ldr r1, =gUnknown_085E8D38 + ldr r1, =gText_FiveMarks lsls r5, 24 lsrs r5, 24 mov r0, r9 @@ -8854,10 +8854,10 @@ sub_81C33CC: @ 81C33CC push {r4,r5,lr} sub sp, 0x8 ldr r5, =gStringVar1 - ldr r1, =gUnknown_085E8D59 + ldr r1, =gText_UnkCtrlF907F908 adds r0, r5, 0 bl StringCopy - ldr r1, =gUnknown_085E8D38 + ldr r1, =gText_FiveMarks adds r0, r5, 0 bl StringAppend movs r0, 0x1 @@ -9126,7 +9126,7 @@ _081C3628: ldrh r0, [r1] cmp r0, 0 bne _081C3644 - ldr r5, =gUnknown_085E8D26 + ldr r5, =gText_None b _081C3650 .pool _081C3644: @@ -9174,7 +9174,7 @@ sub_81C3690: @ 81C3690 ldrb r0, [r1] cmp r0, 0 bne _081C36B0 - ldr r5, =gUnknown_085E8D26 + ldr r5, =gText_None b _081C36C8 .pool _081C36B0: @@ -9747,7 +9747,7 @@ sub_81C3B08: @ 81C3B08 b _081C3C26 .pool _081C3C00: - ldr r1, =gUnknown_085E8D40 + ldr r1, =gText_OneDash lsls r4, r7, 4 adds r3, r4, 0x1 lsls r3, 24 @@ -9758,7 +9758,7 @@ _081C3C00: mov r0, r8 movs r2, 0 bl sub_81C25A4 - ldr r7, =gUnknown_085E8D42 + ldr r7, =gText_TwoDashes movs r5, 0xC movs r0, 0x1 adds r1, r7, 0 @@ -9815,7 +9815,7 @@ sub_81C3C5C: @ 81C3C5C adds r6, r1, 0 cmp r0, 0x1 bhi _081C3C9C - ldr r1, =gUnknown_085E8D45 + ldr r1, =gText_ThreeDashes b _081C3CAC .pool _081C3C9C: @@ -9841,7 +9841,7 @@ _081C3CAC: ldrb r0, [r1, 0x3] cmp r0, 0 bne _081C3CDC - ldr r1, =gUnknown_085E8D45 + ldr r1, =gText_ThreeDashes b _081C3CEC .pool _081C3CDC: @@ -10143,7 +10143,7 @@ sub_81C3F44: @ 81C3F44 ldrh r2, [r0] cmp r2, 0 bne _081C3F9C - ldr r1, =gUnknown_085E8CF0 + ldr r1, =gText_Cancel str r2, [sp] movs r0, 0x1 str r0, [sp, 0x4] @@ -12533,7 +12533,7 @@ _081C5382: adds r4, r1 ldr r0, [r5] adds r0, r4 - ldr r1, =gUnknown_085E8DB4 + ldr r1, =gText_CloseBag bl StringCopy ldr r1, [r5] lsls r2, r6, 3 @@ -12739,7 +12739,7 @@ _081C5560: movs r3, 0x2 bl ConvertIntToDecimalStringN ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E8DA0 + ldr r1, =gText_xVar1 adds r0, r4, 0 bl StringExpandPlaceholders movs r0, 0x7 @@ -12806,7 +12806,7 @@ _081C561C: ldr r1, [r1] bl StringCopy ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E91C0 + ldr r1, =gText_ReturnToVar1 adds r0, r4, 0 bl StringExpandPlaceholders _081C5638: @@ -13393,7 +13393,7 @@ sub_81C5AB8: @ 81C5AB8 bl FillWindowPixelRect b _081C5B08 _081C5AF4: - ldr r1, =gUnknown_085E8D60 + ldr r1, =gText_SelectorArrow2 movs r0, 0 str r0, [sp] str r0, [sp, 0x4] @@ -13716,7 +13716,7 @@ _081C5DDA: ldr r1, =gStringVar1 bl CopyItemName ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E8DBE + ldr r1, =gText_Var1IsSelected adds r0, r4, 0 bl StringExpandPlaceholders movs r0, 0x1 @@ -14203,7 +14203,7 @@ sub_81C61E0: @ 81C61E0 bne _081C6228 _081C620C: bl sub_81C61A8 - ldr r1, =gUnknown_085E8F31 + ldr r1, =gText_DadsAdvice ldr r2, =sub_81C6714 adds r0, r5, 0 bl DisplayItemMessageInBattlePyramid @@ -14309,7 +14309,7 @@ _081C62F4: ldr r1, =gStringVar1 bl CopyItemName ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E8EE0 + ldr r1, =gText_TossHowManyVar1s adds r0, r4, 0 bl StringExpandPlaceholders movs r0, 0x1 @@ -14362,7 +14362,7 @@ sub_81C6350: @ 81C6350 movs r3, 0x2 bl ConvertIntToDecimalStringN ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E8F0E + ldr r1, =gText_ConfirmTossItems adds r0, r4, 0 bl StringExpandPlaceholders movs r0, 0x1 @@ -14423,7 +14423,7 @@ sub_81C6404: @ 81C6404 movs r3, 0x2 bl ConvertIntToDecimalStringN ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E8DA0 + ldr r1, =gText_xVar1 adds r0, r4, 0 bl StringExpandPlaceholders movs r0, 0x3 @@ -14463,7 +14463,7 @@ sub_81C645C: @ 81C645C movs r3, 0x2 bl ConvertIntToDecimalStringN ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E8DA0 + ldr r1, =gText_xVar1 adds r0, r4, 0 bl StringExpandPlaceholders movs r0, 0x1 @@ -14577,7 +14577,7 @@ sub_81C654C: @ 81C654C movs r3, 0x2 bl ConvertIntToDecimalStringN ldr r6, =gStringVar4 - ldr r1, =gUnknown_085E8EF9 + ldr r1, =gText_ThrewAwayVar2Var1s adds r0, r6, 0 bl StringExpandPlaceholders movs r0, 0x1 @@ -14667,7 +14667,7 @@ sub_81C6648: @ 81C6648 lsrs r0, 24 cmp r0, 0x1 bne _081C667C - ldr r1, =gUnknown_085E8DCE + ldr r1, =gText_CantWriteMail ldr r2, =sub_81C66EC adds r0, r4, 0 bl DisplayItemMessageInBattlePyramid @@ -14707,7 +14707,7 @@ sub_81C66AC: @ 81C66AC ldr r1, =gStringVar1 bl CopyItemName ldr r5, =gStringVar4 - ldr r1, =gUnknown_085E8E11 + ldr r1, =gText_Var1CantBeHeld adds r0, r5, 0 bl StringExpandPlaceholders ldr r2, =sub_81C66EC @@ -14780,7 +14780,7 @@ sub_81C674C: @ 81C674C lsls r0, 24 cmp r0, 0 bne _081C677C - ldr r1, =gUnknown_085E8DCE + ldr r1, =gText_CantWriteMail ldr r2, =sub_81C66EC adds r0, r4, 0 bl DisplayItemMessageInBattlePyramid @@ -14879,7 +14879,7 @@ sub_81C67CC: @ 81C67CC ldr r1, =gStringVar1 bl CopyItemName ldr r6, =gStringVar4 - ldr r1, =gUnknown_085E8DFE + ldr r1, =gText_MoveVar1Where adds r0, r6, 0 bl StringExpandPlaceholders movs r0, 0x1 @@ -28902,7 +28902,7 @@ sub_81CD624: @ 81CD624 bl sub_81D2C68 cmp r0, 0 beq _081CD690 - ldr r1, =gUnknown_085E8264 + ldr r1, =gText_Egg adds r0, r5, 0 movs r2, 0 movs r3, 0xC @@ -37978,7 +37978,7 @@ sub_81D1DC0: @ 81D1DC0 adds r5, r0, 0 movs r3, 0 ldr r7, =gUnknown_0203CF4C - ldr r0, =gUnknown_085E8CF7 + ldr r0, =gText_Cancel2 mov r12, r0 ldr r4, =gUnknown_03006310 ldr r1, =gUnknown_0203CF48 @@ -39591,7 +39591,7 @@ _081D29C4: ldrb r0, [r6, 0x1] cmp r0, 0x1 bhi _081D2A3C - ldr r5, =gUnknown_085E8D45 + ldr r5, =gText_ThreeDashes b _081D2A4A .pool _081D2A3C: @@ -39615,7 +39615,7 @@ _081D2A4A: ldrb r0, [r6, 0x3] cmp r0, 0 bne _081D2A70 - ldr r5, =gUnknown_085E8D45 + ldr r5, =gText_ThreeDashes b _081D2A7E .pool _081D2A70: @@ -39944,7 +39944,7 @@ sub_81D2CD0: @ 81D2CD0 bl sub_81D2C68 cmp r0, 0 beq _081D2D20 - ldr r1, =gUnknown_085E8264 + ldr r1, =gText_Egg adds r0, r5, 0 movs r2, 0 movs r3, 0xC @@ -56467,7 +56467,7 @@ sub_81DB468: @ 81DB468 movs r1, 0 strb r1, [r0] adds r0, 0x1 - ldr r1, =gUnknown_085E8268 + ldr r1, =gText_Pokemon bl StringCopy pop {r0} bx r0 diff --git a/asm/secret_base.s b/asm/secret_base.s index 8c105ced6..fc5b89a32 100644 --- a/asm/secret_base.s +++ b/asm/secret_base.s @@ -2268,7 +2268,7 @@ _080E9D7C: ldr r1, [r4] lsls r3, r6, 3 adds r2, r1, r3 - ldr r0, =gUnknown_085E8CF0 + ldr r0, =gText_Cancel str r0, [r2] adds r1, 0x4 adds r1, r3 diff --git a/asm/shop.s b/asm/shop.s index a7ec60c54..8a9d54a9c 100644 --- a/asm/shop.s +++ b/asm/shop.s @@ -589,7 +589,7 @@ _080DFF78: lsls r5, r6, 4 ldr r0, [r4] adds r0, r5 - ldr r1, =gUnknown_085E8CF7 + ldr r1, =gText_Cancel2 bl StringCopy ldr r2, =gUnknown_02039F74 ldr r0, [r2] @@ -927,7 +927,7 @@ BuyMenuPrintCursor: @ 80E0250 adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 - ldr r1, =gUnknown_085E8D60 + ldr r1, =gText_SelectorArrow2 movs r0, 0 str r0, [sp] str r4, [sp, 0x4] @@ -2642,7 +2642,7 @@ BuyMenuPrintItemQuantityAndPrice: @ 80E10EC movs r3, 0x2 bl ConvertIntToDecimalStringN ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E8DA0 + ldr r1, =gText_xVar1 adds r0, r4, 0 bl StringExpandPlaceholders movs r0, 0 diff --git a/asm/starter_choose.s b/asm/starter_choose.s index 0f8f5d464..7e998c45f 100644 --- a/asm/starter_choose.s +++ b/asm/starter_choose.s @@ -328,7 +328,7 @@ sub_81341FC: @ 81341FC movs r1, 0 movs r3, 0xD bl SetWindowBorderStyle - ldr r2, =gUnknown_085E8C53 + ldr r2, =gText_BirchInTrouble movs r0, 0x1 str r0, [sp] movs r0, 0 @@ -507,7 +507,7 @@ sub_8134390: @ 8134390 movs r0, 0 movs r1, 0x11 bl FillWindowPixelBuffer - ldr r2, =gUnknown_085E8C90 + ldr r2, =gText_ConfirmStarterChoice movs r0, 0x1 str r0, [sp] movs r0, 0 diff --git a/asm/trader.s b/asm/trader.s index b5d8d47bc..592291d88 100644 --- a/asm/trader.s +++ b/asm/trader.s @@ -92,7 +92,7 @@ sub_8133A78: @ 8133A78 movs r2, 0 bl GetStringWidth adds r6, r0, 0 - ldr r1, =gUnknown_085E8D38 + ldr r1, =gText_FiveMarks movs r0, 0x1 movs r2, 0 bl GetStringWidth @@ -163,7 +163,7 @@ _08133B3C: movs r1, 0 str r1, [sp, 0x8] movs r1, 0x1 - ldr r2, =gUnknown_085E8D38 + ldr r2, =gText_FiveMarks movs r3, 0x8 bl PrintTextOnWindow b _08133B94 diff --git a/data/data2.s b/data/data2.s index 96d8c826d..cd8c43f65 100644 --- a/data/data2.s +++ b/data/data2.s @@ -357,152 +357,152 @@ gUnknown_082ED868:: @ 82ED868 .ascii "SEARCH" .align 2 -gUnknown_082ED8C4:: @ 82ED8C4 +gText_EmptyString:: @ 82ED8C4 .string "$" .align 2 -gUnknown_082ED8C8:: @ 82ED8C8 +gText_Colon:: @ 82ED8C8 .string ":$" .align 2 -gUnknown_082ED8CC:: @ 82ED8CC +gText_UnkCtrlCodeF907:: @ 82ED8CC .string "{UNK_CTRL_F907}$" .align 2 -gUnknown_082ED8D0:: @ 82ED8D0 +gText_PleaseStartOver:: @ 82ED8D0 .string "Please start over from the beginning.$" .align 2 -gUnknown_082ED8F8:: @ 82ED8F8 +gText_WirelessSearchCanceled:: @ 82ED8F8 .string "The WIRELESS COMMUNICATION\nSYSTEM search has been canceled.$" .align 2 .string "Awaiting communication\nfrom another player.$" .align 2 -gUnknown_082ED960:: @ 82ED960 +gText_AwaitingCommunication:: @ 82ED960 .string "{STR_VAR_1}! Awaiting\ncommunication from another player.$" -gUnknown_082ED990:: @ 82ED990 +gText_AwaitingLink:: @ 82ED990 .string "{STR_VAR_1}! Awaiting link!\nPress START when everyone’s ready.$" .align 2 -gUnknown_082ED9C8:: @ 82ED9C8 +gJPText_SingleBattle:: @ 82ED9C8 .string "シングルバトルを かいさいする$" @ "shingurubatoruwo kaisaisuru" ("hold a single battle" in Japanese) .align 2 -gUnknown_082ED9D8:: @ 82ED9D8 +gJPText_DoubleBattle:: @ 82ED9D8 .string "ダブルバトルを かいさいする$" @ "daburubatoruwo kaisaisuru" ("hold a double battle" in Japanese) .align 2 -gUnknown_082ED9E8:: @ 82ED9E8 +gJPText_MultiBattle:: @ 82ED9E8 .string "マルチバトルを かいさいする$" @ "maruchibatoruwo kaisaisuru" ("hold a multi battle" in Japanese) .align 2 -gUnknown_082ED9F8:: @ 82ED9F8 +gJPText_TradePokemon:: @ 82ED9F8 .string "ポケモンこうかんを かいさいする$" @ "pokemonkoukanwo kaisaisuru" ("trade Pokémon" in Japanese) .align 2 -gUnknown_082EDA0C:: @ 82EDA0C +gJPText_Chat:: @ 82EDA0C .string "チャットを かいさいする$" @ "chattowo kaisaisuru" ("chat" in Japanese) .align 2 -gUnknown_082EDA1C:: @ 82EDA1C +gJPText_DistWonderCard:: @ 82EDA1C .string "ふしぎなカードをくばる$" @ "fushiginakaadowokubaru" ("distribute Wonder Card" in Japanese) .align 2 -gUnknown_082EDA28:: @ 82EDA28 - .string "ふしぎなニュースをくばる$" @ "fushiginanyuusuwokubaru" ("distribute Mystery News" in Japanese) +gJPText_DistWonderNews:: @ 82EDA28 + .string "ふしぎなニュースをくばる$" @ "fushiginanyuusuwokubaru" ("distribute Wonder News" in Japanese) .align 2 .string "ふしぎなできごとを かいさいする$" @ "fushiginadekigotowo kaisaisuru" ("hold a session of Mystery Event" in Japanese) .align 2 -gUnknown_082EDA4C:: @ 82EDA4C +gJPText_HoldPokemonJump:: @ 82EDA4C .string "なわとびを かいさいする$" @ "nawatobiwo kaisaisuru" ("hold a session of Jump" in Japanese) .align 2 -gUnknown_082EDA5C:: @ 82EDA5C +gJPText_HoldBerryCrush:: @ 82EDA5C .string "きのみマッシャーを かいさいする$" @ "kinomimassha-wo kaisaisuru" ("hold a session of Berry Masher" in Japanese) .align 2 -gUnknown_082EDA70:: @ 82EDA70 +gJPText_HoldBerryPicking:: @ 82EDA70 .string "きのみどりを かいさいする$" @ "kinomidoriwo kaisaisuru" ("hold a session of Berry Picking" in Japanese) .align 2 -gUnknown_082EDA80:: @ 82EDA80 +gJPText_HoldSpinTrade:: @ 82EDA80 .string "ぐるぐるこうかんを かいさいする$" @ "gurugurukoukanwo kaisaisuru" ("hold a session of Spin Trade" in Japanese) .align 2 -gUnknown_082EDA94:: @ 82EDA94 +gJPText_HoldSpinShop:: @ 82EDA94 .string "ぐるぐるショップを かいさいする$" @ "gurugurushoppuwo kaisaisuru" ("hold a session of Spin Shop" in Japanese) .align 2 - .4byte gUnknown_082ED9C8 - .4byte gUnknown_082ED9D8 - .4byte gUnknown_082ED9E8 - .4byte gUnknown_082ED9F8 - .4byte gUnknown_082EDA0C - .4byte gUnknown_082EDA1C - .4byte gUnknown_082EDA28 - .4byte gUnknown_082EDA1C - .4byte gUnknown_082EDA4C - .4byte gUnknown_082EDA5C - .4byte gUnknown_082EDA70 - .4byte gUnknown_082EDA70 - .4byte gUnknown_082EDA80 - .4byte gUnknown_082EDA94 + .4byte gJPText_SingleBattle + .4byte gJPText_DoubleBattle + .4byte gJPText_MultiBattle + .4byte gJPText_TradePokemon + .4byte gJPText_Chat + .4byte gJPText_DistWonderCard + .4byte gJPText_DistWonderNews + .4byte gJPText_DistWonderCard + .4byte gJPText_HoldPokemonJump + .4byte gJPText_HoldBerryCrush + .4byte gJPText_HoldBerryPicking + .4byte gJPText_HoldBerryPicking + .4byte gJPText_HoldSpinTrade + .4byte gJPText_HoldSpinShop -gUnknown_082EDAE0:: @ 82EDAE0 +gText_1PlayerNeeded:: @ 82EDAE0 .string "1 player\nneeded.$" -gUnknown_082EDAF1:: @ 82EDAF1 +gText_2PlayersNeeded:: @ 82EDAF1 .string "2 players\nneeded.$" -gUnknown_082EDB03:: @ 82EDB03 +gText_3PlayersNeeded:: @ 82EDB03 .string "3 players\nneeded.$" -gUnknown_082EDB15:: @ 82EDB15 +gText_4PlayersNeeded:: @ 82EDB15 .string "4 players\nneeded.$" -gUnknown_082EDB27:: @ 82EDB27 +gText_2PlayerMode:: @ 82EDB27 .string "2-PLAYER\nMODE$" -gUnknown_082EDB35:: @ 82EDB35 +gText_3PlayerMode:: @ 82EDB35 .string "3-PLAYER\nMODE$" -gUnknown_082EDB43:: @ 82EDB43 +gText_4PlayerMode:: @ 82EDB43 .string "4-PLAYER\nMODE$" -gUnknown_082EDB51:: @ 82EDB51 +gText_5PlayerMode:: @ 82EDB51 .string "5-PLAYER\nMODE$" .align 2 gUnknown_082EDB60:: @ 82EDB60 - .4byte gUnknown_082EDAE0 - .4byte gUnknown_082EDB27 + .4byte gText_1PlayerNeeded + .4byte gText_2PlayerMode .4byte NULL .4byte NULL .4byte NULL - .4byte gUnknown_082EDB03 - .4byte gUnknown_082EDAF1 - .4byte gUnknown_082EDAE0 - .4byte gUnknown_082EDB43 + .4byte gText_3PlayersNeeded + .4byte gText_2PlayersNeeded + .4byte gText_1PlayerNeeded + .4byte gText_4PlayerMode .4byte NULL - .4byte gUnknown_082EDAE0 - .4byte gUnknown_082EDB27 - .4byte gUnknown_082EDB35 - .4byte gUnknown_082EDB43 - .4byte gUnknown_082EDB51 - .4byte gUnknown_082EDAF1 - .4byte gUnknown_082EDAE0 - .4byte gUnknown_082EDB35 - .4byte gUnknown_082EDB43 - .4byte gUnknown_082EDB51 - .4byte gUnknown_082EDAE0 - .4byte gUnknown_082EDB27 - .4byte gUnknown_082EDB35 - .4byte gUnknown_082EDB43 + .4byte gText_1PlayerNeeded + .4byte gText_2PlayerMode + .4byte gText_3PlayerMode + .4byte gText_4PlayerMode + .4byte gText_5PlayerMode + .4byte gText_2PlayersNeeded + .4byte gText_1PlayerNeeded + .4byte gText_3PlayerMode + .4byte gText_4PlayerMode + .4byte gText_5PlayerMode + .4byte gText_1PlayerNeeded + .4byte gText_2PlayerMode + .4byte gText_3PlayerMode + .4byte gText_4PlayerMode .4byte NULL .align 2 @@ -1506,7 +1506,7 @@ gUnknown_082F0020:: @ 82F0020 .align 2 gUnknown_082F0048:: @ 82F0048 - .4byte gUnknown_082ED8C4 + .4byte gText_EmptyString .4byte gUnknown_082EFDB0 .4byte gUnknown_082EFDC0 .4byte gUnknown_082EFDD0 @@ -1519,14 +1519,14 @@ gUnknown_082F0048:: @ 82F0048 .4byte gUnknown_082EFE2C .4byte gUnknown_082EFE38 .4byte gUnknown_082EFE48 - .4byte gUnknown_082ED8C4 + .4byte gText_EmptyString .4byte gUnknown_082EFED4 .4byte gUnknown_082EFE60 .4byte gUnknown_082EFE50 - .4byte gUnknown_082ED8C4 - .4byte gUnknown_082ED8C4 - .4byte gUnknown_082ED8C4 - .4byte gUnknown_082ED8C4 + .4byte gText_EmptyString + .4byte gText_EmptyString + .4byte gText_EmptyString + .4byte gText_EmptyString .4byte gUnknown_082EFE00 .4byte gUnknown_082EFE10 .4byte gUnknown_082EFE70 @@ -1579,15 +1579,15 @@ gUnknown_082F012C:: @ 82F012C .align 2 gUnknown_082F0134:: @ 82F0134 - .4byte gUnknown_082ED8C4 + .4byte gText_EmptyString .4byte 0x00000000 - .4byte gUnknown_082ED8C4 + .4byte gText_EmptyString .4byte 0x00000001 - .4byte gUnknown_082ED8C4 + .4byte gText_EmptyString .4byte 0x00000002 - .4byte gUnknown_082ED8C4 + .4byte gText_EmptyString .4byte 0x00000003 - .4byte gUnknown_082ED8C4 + .4byte gText_EmptyString .4byte 0x00000004 .align 2 @@ -1608,22 +1608,22 @@ gUnknown_082F017C:: @ 82F017C .align 2 gUnknown_082F0184:: @ 82F0184 - .4byte gUnknown_082ED8C4, 0x00000000 - .4byte gUnknown_082ED8C4, 0x00000001 - .4byte gUnknown_082ED8C4, 0x00000002 - .4byte gUnknown_082ED8C4, 0x00000003 - .4byte gUnknown_082ED8C4, 0x00000004 - .4byte gUnknown_082ED8C4, 0x00000005 - .4byte gUnknown_082ED8C4, 0x00000006 - .4byte gUnknown_082ED8C4, 0x00000007 - .4byte gUnknown_082ED8C4, 0x00000008 - .4byte gUnknown_082ED8C4, 0x00000009 - .4byte gUnknown_082ED8C4, 0x0000000a - .4byte gUnknown_082ED8C4, 0x0000000b - .4byte gUnknown_082ED8C4, 0x0000000c - .4byte gUnknown_082ED8C4, 0x0000000d - .4byte gUnknown_082ED8C4, 0x0000000e - .4byte gUnknown_082ED8C4, 0x0000000f + .4byte gText_EmptyString, 0x00000000 + .4byte gText_EmptyString, 0x00000001 + .4byte gText_EmptyString, 0x00000002 + .4byte gText_EmptyString, 0x00000003 + .4byte gText_EmptyString, 0x00000004 + .4byte gText_EmptyString, 0x00000005 + .4byte gText_EmptyString, 0x00000006 + .4byte gText_EmptyString, 0x00000007 + .4byte gText_EmptyString, 0x00000008 + .4byte gText_EmptyString, 0x00000009 + .4byte gText_EmptyString, 0x0000000a + .4byte gText_EmptyString, 0x0000000b + .4byte gText_EmptyString, 0x0000000c + .4byte gText_EmptyString, 0x0000000d + .4byte gText_EmptyString, 0x0000000e + .4byte gText_EmptyString, 0x0000000f .align 2 gUnknown_082F0204:: @ 82F0204 struct ListMenuTemplate @@ -1712,15 +1712,15 @@ gUnknown_082F034C:: @ 82F034C .align 2 gUnknown_082F0354:: @ 82F0354 - .4byte gUnknown_082ED8C4, 0xfffffffd - .4byte gUnknown_082ED8C4, 0x00000000 - .4byte gUnknown_082ED8C4, 0x00000001 - .4byte gUnknown_082ED8C4, 0x00000002 - .4byte gUnknown_082ED8C4, 0x00000003 - .4byte gUnknown_082ED8C4, 0x00000004 - .4byte gUnknown_082ED8C4, 0x00000005 - .4byte gUnknown_082ED8C4, 0x00000006 - .4byte gUnknown_082ED8C4, 0x00000007 + .4byte gText_EmptyString, 0xfffffffd + .4byte gText_EmptyString, 0x00000000 + .4byte gText_EmptyString, 0x00000001 + .4byte gText_EmptyString, 0x00000002 + .4byte gText_EmptyString, 0x00000003 + .4byte gText_EmptyString, 0x00000004 + .4byte gText_EmptyString, 0x00000005 + .4byte gText_EmptyString, 0x00000006 + .4byte gText_EmptyString, 0x00000007 .4byte gUnknown_082EFD84, 0x00000008 .align 2 @@ -1736,22 +1736,22 @@ gUnknown_082F03A4:: @ 82F03A4 .align 2 gUnknown_082F03C4:: @ 82F03C4 - .4byte gUnknown_082ED8C4, 0x00000000 - .4byte gUnknown_082ED8C4, 0x00000001 - .4byte gUnknown_082ED8C4, 0x00000002 - .4byte gUnknown_082ED8C4, 0x00000003 - .4byte gUnknown_082ED8C4, 0x00000004 - .4byte gUnknown_082ED8C4, 0x00000005 - .4byte gUnknown_082ED8C4, 0x00000006 - .4byte gUnknown_082ED8C4, 0x00000007 - .4byte gUnknown_082ED8C4, 0x00000008 - .4byte gUnknown_082ED8C4, 0x00000009 - .4byte gUnknown_082ED8C4, 0x0000000a - .4byte gUnknown_082ED8C4, 0x0000000b - .4byte gUnknown_082ED8C4, 0x0000000c - .4byte gUnknown_082ED8C4, 0x0000000d - .4byte gUnknown_082ED8C4, 0x0000000e - .4byte gUnknown_082ED8C4, 0x0000000f + .4byte gText_EmptyString, 0x00000000 + .4byte gText_EmptyString, 0x00000001 + .4byte gText_EmptyString, 0x00000002 + .4byte gText_EmptyString, 0x00000003 + .4byte gText_EmptyString, 0x00000004 + .4byte gText_EmptyString, 0x00000005 + .4byte gText_EmptyString, 0x00000006 + .4byte gText_EmptyString, 0x00000007 + .4byte gText_EmptyString, 0x00000008 + .4byte gText_EmptyString, 0x00000009 + .4byte gText_EmptyString, 0x0000000a + .4byte gText_EmptyString, 0x0000000b + .4byte gText_EmptyString, 0x0000000c + .4byte gText_EmptyString, 0x0000000d + .4byte gText_EmptyString, 0x0000000e + .4byte gText_EmptyString, 0x0000000f .align 2 .4byte gUnknown_082F03C4 @@ -1945,7 +1945,7 @@ gUnknown_082F0608:: @ 82F0608 gUnknown_082F0620:: @ 82F0620 .4byte gUnknown_085EEE08, 0x00000000 .4byte gUnknown_085EEE20, 0x00000001 - .4byte gUnknown_085E8CF7, 0xfffffffe + .4byte gText_Cancel2, 0xfffffffe .align 2 gUnknown_082F0638:: @ 82F0638 struct ListMenuTemplate @@ -1960,24 +1960,24 @@ gUnknown_082F0650:: @ 82F0650 .4byte gUnknown_085EEE30, 0x00000000 .4byte gUnknown_085EEE38, 0x00000001 .4byte gUnknown_085EEE40, 0x00000002 - .4byte gUnknown_085E8CF7, 0xfffffffe + .4byte gText_Cancel2, 0xfffffffe .align 2 gUnknown_082F0670:: @ 82F0670 .4byte gUnknown_085EEE30, 0x00000000 .4byte gUnknown_085EEE40, 0x00000002 - .4byte gUnknown_085E8CF7, 0xfffffffe + .4byte gText_Cancel2, 0xfffffffe .align 2 gUnknown_082F0688:: @ 82F0688 .4byte gUnknown_085EEE30, 0x00000000 .4byte gUnknown_085EEE38, 0x00000001 - .4byte gUnknown_085E8CF7, 0xfffffffe + .4byte gText_Cancel2, 0xfffffffe .align 2 gUnknown_082F06A0:: @ 82F06A0 .4byte gUnknown_085EEE30, 0x00000000 - .4byte gUnknown_085E8CF7, 0xfffffffe + .4byte gText_Cancel2, 0xfffffffe .align 2 gUnknown_082F06B0:: @ 82F06B0 struct ListMenuTemplate diff --git a/data/data_emerald2.s b/data/data_emerald2.s index a20731acb..a6ae64e25 100644 --- a/data/data_emerald2.s +++ b/data/data_emerald2.s @@ -933,5 +933,3 @@ gUnknown_0862B7E8:: @ 862B7E8 gUnknown_0862B7FC:: @ 862B7FC .incbin "baserom.gba", 0x62b7fc, 0x2e8 - - \ No newline at end of file diff --git a/data/strings.s b/data/strings.s index 755cc45bc..790252952 100644 --- a/data/strings.s +++ b/data/strings.s @@ -45,57 +45,57 @@ gExpandedPlaceholder_Brendan:: @ 85E8258 gExpandedPlaceholder_May:: @ 85E8260 .string "MAY$" -gUnknown_085E8264:: @ 85E8264 +gText_Egg:: @ 85E8264 .string "EGG$" -gUnknown_085E8268:: @ 85E8268 +gText_Pokemon:: @ 85E8268 .string "POKéMON$" .string "PROF. BIRCH$" -gUnknown_085E827C:: @ 85E827C +gText_MainMenuNewGame:: @ 85E827C .string "NEW GAME$" -gUnknown_085E8285:: @ 85E8285 +gText_MainMenuContinue:: @ 85E8285 .string "CONTINUE$" -gUnknown_085E828E:: @ 85E828E +gText_MainMenuOption:: @ 85E828E .string "OPTION$" -gUnknown_085E8295:: @ 85E8295 +gText_MainMenuMysteryGift:: @ 85E8295 .string "MYSTERY GIFT$" -gUnknown_085E82A2:: @ 85E82A2 +gText_MainMenuMysteryGift2:: @ 85E82A2 .string "MYSTERY GIFT$" -gUnknown_085E82AF:: @ 85E82AF +gText_MainMenuMysteryEvents:: @ 85E82AF .string "MYSTERY EVENTS$" -gUnknown_085E82BE:: @ 85E82BE +gText_WirelessNotConnected:: @ 85E82BE .string "The Wireless Adapter is not\nconnected.$" -gUnknown_085E82E5:: @ 85E82E5 +gText_MysteryGiftCantUse:: @ 85E82E5 .string "MYSTERY GIFT can’t be used while\nthe Wireless Adapter is attached.$" -gUnknown_085E8328:: @ 85E8328 +gText_MysteryEventsCantUse:: @ 85E8328 .string "MYSTERY EVENTS can’t be used while\nthe Wireless Adapter is attached.$" .string "Updating save file using external\ndata. Please wait.$" .string "The save file has been updated.$" -gUnknown_085E83C2:: @ 85E83C2 +gText_SaveFileCorrupted:: @ 85E83C2 .string "The save file is corrupted. The\nprevious save file will be loaded.$" -gUnknown_085E8405:: @ 85E8405 +gText_SaveFileErased:: @ 85E8405 .string "The save file has been erased\ndue to corruption or damage.$" -gUnknown_085E8440:: @ 85E8440 +gJPText_No1MSubCircuit:: @ 85E8440 .string "1Mサブきばんが ささっていません!$" @ "1Msabukibanga sasatteimasen!" ("The 1M sub-circuit board is not installed!" in Japanese) -gUnknown_085E8453:: @ 85E8453 +gText_BatteryRunDry:: @ 85E8453 .string "The internal battery has run dry.\nThe game can be played.\pHowever, clock-based events will\nno longer occur.$" .string "PLAYER$" .string "POKéDEX$" -gUnknown_085E84CE:: @ 85E84CE +gText_MainMenuTime:: @ 85E84CE .string "TIME$" .string "BADGES$" .string "A Button$" @@ -118,15 +118,15 @@ gUnknown_085E84CE:: @ 85E84CE .string "{UNK_CTRL_F800}NEXT {UNK_CTRL_F801}BACK$" .align 2 -gUnknown_085E855C:: @ 85E855C +gText_PickNextCancel:: @ 85E855C .string "{UNK_CTRL_F80A}PICK {UNK_CTRL_F800}NEXT {UNK_CTRL_F801}CANCEL$" .align 2 -gUnknown_085E8574:: @ 85E8574 +gText_PickCancel:: @ 85E8574 .string "{UNK_CTRL_F80A}PICK {UNK_CTRL_F800}{UNK_CTRL_F801}CANCEL$" .align 2 -gUnknown_085E8588:: @ 85E8588 +gText_UnkCtrlF800Exit:: @ 85E8588 .string "{UNK_CTRL_F800}EXIT$" .string "BOY$" .string "GIRL$" @@ -171,42 +171,42 @@ gUnknown_085E8588:: @ 85E8588 .string "LUCY$" .string "HALIE$" -gUnknown_085E8692:: @ 85E8692 +gText_ThisIsAPokemon:: @ 85E8692 .string "This is what we call a “POKéMON.”{PAUSE 96}\p$" -gUnknown_085E86B8:: @ 85E86B8 +gText_5MarksPokemon:: @ 85E86B8 .string "????? POKéMON$" -gUnknown_085E86C6:: @ 85E86C6 +gText_UnkHeight:: @ 85E86C6 .string "{CLEAR_TO 0x0C}??’??”$" -gUnknown_085E86D0:: @ 85E86D0 +gText_UnkWeight:: @ 85E86D0 .string "????.? lbs.$" .string " POKéMON$" .string "{CLEAR_TO 0x0C} ’ ”$" .string " . lbs.$" .string "$" -gUnknown_085E871B:: @ 85E871B +gText_CryOf:: @ 85E871B .string "CRY OF$" .string "$" -gUnknown_085E8723:: @ 85E8723 +gText_SizeComparedTo:: @ 85E8723 .string "SIZE COMPARED TO $" -gUnknown_085E8735:: @ 85E8735 +gText_PokedexRegistration:: @ 85E8735 .string "POKéDEX registration completed.$" -gUnknown_085E8755:: @ 85E8755 +gText_HTHeight:: @ 85E8755 .string "HT$" -gUnknown_085E8758:: @ 85E8758 +gText_WTWeight:: @ 85E8758 .string "WT$" -gUnknown_085E875B:: @ 85E875B +gText_SearchingPleaseWait:: @ 85E875B .string "Searching…\nPlease wait.$" -gUnknown_085E8773:: @ 85E8773 +gText_SearchCompleted:: @ 85E8773 .string "Search completed.$" gUnknown_085E8785:: @ 85E8785 @@ -259,45 +259,45 @@ gUnknown_085E8785:: @ 85E8785 .string "DON’T SPECIFY.$" .string "NONE$" -gUnknown_085E8B3A:: @ 85E8B3A +gText_SelectorArrow:: @ 85E8B3A .string "▶$" .string " $" -gUnknown_085E8B3E:: @ 85E8B3E +gText_WelcomeToHOF:: @ 85E8B3E .string "Welcome to the HALL OF FAME!$" .string "Spotted POKéMON: {STR_VAR_1}!\nOwned POKéMON: {STR_VAR_2}!\pPROF. BIRCH’s POKéDEX rating!\pPROF. BIRCH: Let’s see…\p$" .string "SAVING…\nDON’T TURN OFF THE POWER.$" -gUnknown_085E8BDC:: @ 85E8BDC +gText_HOFCorrupted:: @ 85E8BDC .string "The HALL OF FAME data is corrupted.$" -gUnknown_085E8C00:: @ 85E8C00 +gText_HOFNumber:: @ 85E8C00 .string "HALL OF FAME No. {STR_VAR_1}$" -gUnknown_085E8C14:: @ 85E8C14 +gText_LeagueChamp:: @ 85E8C14 .string "LEAGUE CHAMPION!\nCONGRATULATIONS!$" -gUnknown_085E8C36:: @ 85E8C36 +gText_Number:: @ 85E8C36 .string "No. $" -gUnknown_085E8C3B:: @ 85E8C3B +gText_Level:: @ 85E8C3B .string "Lv. $" .string "IDNo. /$" -gUnknown_085E8C48:: @ 85E8C48 +gText_Name:: @ 85E8C48 .string "NAME$" -gUnknown_085E8C4D:: @ 85E8C4D +gText_IDNumber:: @ 85E8C4D .string "IDNo.$" -gUnknown_085E8C53:: @ 85E8C53 +gText_BirchInTrouble:: @ 85E8C53 .string "PROF. BIRCH is in trouble!\nRelease a POKéMON and rescue him!$" -gUnknown_085E8C90:: @ 85E8C90 +gText_ConfirmStarterChoice:: @ 85E8C90 .string "Do you choose this POKéMON?$" .string "POKéMON$" -gUnknown_085E8CB4:: @ 85E8CB4 +gText_FlyToWhere:: @ 85E8CB4 .string "FLY to where?$" .string "USE$" .string "TOSS$" @@ -305,18 +305,18 @@ gUnknown_085E8CB4:: @ 85E8CB4 .string "GIVE$" .string "CHECK TAG$" -gUnknown_085E8CE3:: @ 85E8CE3 +gText_Confirm:: @ 85E8CE3 .string "CONFIRM$" .string "WALK$" -gUnknown_085E8CF0:: @ 85E8CF0 +gText_Cancel:: @ 85E8CF0 .string "CANCEL$" -gUnknown_085E8CF7:: @ 85E8CF7 +gText_Cancel2:: @ 85E8CF7 .string "CANCEL$" .string "SHOW$" -gUnknown_085E8D03:: @ 85E8D03 +gText_EmptyString2:: @ 85E8D03 .string "$" .string "CANCEL$" .string "ITEM$" @@ -325,218 +325,218 @@ gUnknown_085E8D03:: @ 85E8D03 .string "STORE$" .string "CHECK$" -gUnknown_085E8D26:: @ 85E8D26 +gText_None:: @ 85E8D26 .string "NONE$" .string "DESELECT$" -gUnknown_085E8D34:: @ 85E8D34 +gText_ThreeMarks:: @ 85E8D34 .string "???$" -gUnknown_085E8D38:: @ 85E8D38 +gText_FiveMarks:: @ 85E8D38 .string "?????$" -gUnknown_085E8D3E:: @ 85E8D3E +gText_Slash:: @ 85E8D3E .string "/$" -gUnknown_085E8D40:: @ 85E8D40 +gText_OneDash:: @ 85E8D40 .string "-$" -gUnknown_085E8D42:: @ 85E8D42 +gText_TwoDashes:: @ 85E8D42 .string "--$" -gUnknown_085E8D45:: @ 85E8D45 +gText_ThreeDashes:: @ 85E8D45 .string "---$" -gUnknown_085E8D49:: @ 85E8D49 +gText_MaleSymbol:: @ 85E8D49 .string "♂$" -gUnknown_085E8D4B:: @ 85E8D4B +gText_FemaleSymbol:: @ 85E8D4B .string "♀$" -gUnknown_085E8D4D:: @ 85E8D4D +gText_LevelSymbol:: @ 85E8D4D .string "{LV}$" -gUnknown_085E8D4F:: @ 85E8D4F +gText_UnkCtrlF908Clear01:: @ 85E8D4F .string "{UNK_CTRL_F908}{CLEAR 0x01}$" .string "+$" .string "{RIGHT_ARROW}$" -gUnknown_085E8D59:: @ 85E8D59 +gText_UnkCtrlF907F908:: @ 85E8D59 .string "{UNK_CTRL_F907}{UNK_CTRL_F908}$" -gUnknown_085E8D5E:: @ 85E8D5E +gText_Space:: @ 85E8D5E .string " $" -gUnknown_085E8D60:: @ 85E8D60 +gText_SelectorArrow2:: @ 85E8D60 .string "▶$" -gUnknown_085E8D62:: @ 85E8D62 +gText_GoBackPrevMenu:: @ 85E8D62 .string "Go back to the\nprevious menu.$" -gUnknown_085E8D80:: @ 85E8D80 +gText_WhatWouldYouLike:: @ 85E8D80 .string "What would you like to do?$" .string "GIVE$" -gUnknown_085E8DA0:: @ 85E8DA0 +gText_xVar1:: @ 85E8DA0 .string "×{STR_VAR_1}$" .string " BERRY$" -gOtherText_Coins2:: @ 85E8DAB +gText_Coins:: @ 85E8DAB .string "{STR_VAR_1} COINS$" -gUnknown_085E8DB4:: @ 85E8DB4 +gText_CloseBag:: @ 85E8DB4 .string "CLOSE BAG$" -gUnknown_085E8DBE:: @ 85E8DBE +gText_Var1IsSelected:: @ 85E8DBE .string "{STR_VAR_1} is\nselected.$" -gUnknown_085E8DCE:: @ 85E8DCE +gText_CantWriteMail:: @ 85E8DCE .string "You can’t write\nMAIL here.$" -gUnknown_085E8DE9:: @ 85E8DE9 +gText_NoPokemon:: @ 85E8DE9 .string "There is no\nPOKéMON.$" -gUnknown_085E8DFE:: @ 85E8DFE +gText_MoveVar1Where:: @ 85E8DFE .string "Move the\n{STR_VAR_1}\nwhere?$" -gUnknown_085E8E11:: @ 85E8E11 +gText_Var1CantBeHeld:: @ 85E8E11 .string "The {STR_VAR_1} can’t be held.$" -gUnknown_085E8E27:: @ 85E8E27 +gText_Var1CantBeHeldHere:: @ 85E8E27 .string "The {STR_VAR_1} can’t be held\nhere.$" -gUnknown_085E8E42:: @ 85E8E42 +gText_DepositHowManyVar1:: @ 85E8E42 .string "Deposit how many\n{STR_VAR_1}(s)?$" -gUnknown_085E8E5A:: @ 85E8E5A +gText_DepositedVar2Var1s:: @ 85E8E5A .string "Deposited {STR_VAR_2}\n{STR_VAR_1}(s).$" -gUnknown_085E8E6E:: @ 85E8E6E +gText_NoRoomForItems:: @ 85E8E6E .string "There’s no room to\nstore items.$" -gUnknown_085E8E8E:: @ 85E8E8E +gText_CantStoreImportantItems:: @ 85E8E8E .string "Important items\ncan’t be stored in\nthe PC!$" -gUnknown_085E8EB9:: @ 85E8EB9 +gText_TooImportantToToss:: @ 85E8EB9 .string "That’s much too\nimportant to toss\nout!$" -gUnknown_085E8EE0:: @ 85E8EE0 +gText_TossHowManyVar1s:: @ 85E8EE0 .string "Toss out how many\n{STR_VAR_1}(s)?$" -gUnknown_085E8EF9:: @ 85E8EF9 +gText_ThrewAwayVar2Var1s:: @ 85E8EF9 .string "Threw away {STR_VAR_2}\n{STR_VAR_1}(s).$" -gUnknown_085E8F0E:: @ 85E8F0E +gText_ConfirmTossItems:: @ 85E8F0E .string "Is it okay to\nthrow away {STR_VAR_2}\n{STR_VAR_1}(s)?$" -gUnknown_085E8F31:: @ 85E8F31 +gText_DadsAdvice:: @ 85E8F31 .string "DAD’s advice…\n{PLAYER}, there’s a time and place for\leverything!{PAUSE_UNTIL_PRESS}$" -gUnknown_085E8F6E:: @ 85E8F6E +gText_CantDismountBike:: @ 85E8F6E .string "You can’t dismount your BIKE here.{PAUSE_UNTIL_PRESS}$" -gUnknown_085E8F93:: @ 85E8F93 +gText_ItemFinderNearby:: @ 85E8F93 .string "Huh?\nThe ITEMFINDER’s responding!\pThere’s an item buried around here!{PAUSE_UNTIL_PRESS}$" -gUnknown_085E8FDB:: @ 85E8FDB +gText_ItemFinderOnTop:: @ 85E8FDB .string "Oh!\nThe ITEMFINDER’s shaking wildly!{PAUSE_UNTIL_PRESS}$" -gUnknown_085E9002:: @ 85E9002 +gText_ItemFinderNothing:: @ 85E9002 .string "… … … …Nope!\nThere’s no response.{PAUSE_UNTIL_PRESS}$" -gUnknown_085E9026:: @ 85E9026 +gText_CoinCase:: @ 85E9026 .string "Your COINS:\n{STR_VAR_1}{PAUSE_UNTIL_PRESS}$" -gUnknown_085E9037:: @ 85E9037 +gText_BootedUpTM:: @ 85E9037 .string "Booted up a TM.$" -gUnknown_085E9047:: @ 85E9047 +gText_BootedUpHM:: @ 85E9047 .string "Booted up an HM.$" -gUnknown_085E9058:: @ 85E9058 +gText_TMHMContainedVar1:: @ 85E9058 .string "It contained\n{STR_VAR_1}.\pTeach {STR_VAR_1}\nto a POKéMON?$" -gUnknown_085E9080:: @ 85E9080 +gText_PlayerUsedVar2:: @ 85E9080 .string "{PLAYER} used the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}$" -gUnknown_085E9092:: @ 85E9092 +gText_RepelEffectsLingered:: @ 85E9092 .string "But the effects of a REPEL\nlingered from earlier.{PAUSE_UNTIL_PRESS}$" -gUnknown_085E90C6:: @ 85E90C6 +gText_UsedVar2WildLured:: @ 85E90C6 .string "{PLAYER} used the\n{STR_VAR_2}.\pWild POKéMON will be lured.{PAUSE_UNTIL_PRESS}$" -gUnknown_085E90F4:: @ 85E90F4 +gText_UsedVar2WildRepelled:: @ 85E90F4 .string "{PLAYER} used the\n{STR_VAR_2}.\pWild POKéMON will be repelled.{PAUSE_UNTIL_PRESS}$" -gUnknown_085E9125:: @ 85E9125 +gText_BoxFull:: @ 85E9125 .string "The BOX is full.{PAUSE_UNTIL_PRESS}$" -gUnknown_085E9138:: @ 85E9138 +gText_PowderQty:: @ 85E9138 .string "POWDER QTY: {STR_VAR_1}{PAUSE_UNTIL_PRESS}$" -gUnknown_085E9149:: @ 85E9149 +gText_TheField:: @ 85E9149 .string "the field$" -gUnknown_085E9153:: @ 85E9153 +gText_TheBattle:: @ 85E9153 .string "the battle$" -gUnknown_085E915E:: @ 85E915E +gText_ThePokemonList:: @ 85E915E .string "the POKéMON LIST$" -gUnknown_085E916F:: @ 85E916F +gText_TheShop:: @ 85E916F .string "the shop$" -gUnknown_085E9178:: @ 85E9178 +gText_ThePC:: @ 85E9178 .string "the PC$" .align 2 gUnknown_085E9180:: @ 85E9180 - .4byte gUnknown_085E9149 - .4byte gUnknown_085E9153 - .4byte gUnknown_085E915E - .4byte gUnknown_085E916F - .4byte gUnknown_085E9149 - .4byte gUnknown_085E9149 - .4byte gUnknown_085E9178 - .4byte gUnknown_085E9149 - .4byte gUnknown_085E9149 - .4byte gUnknown_085E9149 - .4byte gUnknown_085E9153 - .4byte gUnknown_085E9178 + .4byte gText_TheField + .4byte gText_TheBattle + .4byte gText_ThePokemonList + .4byte gText_TheShop + .4byte gText_TheField + .4byte gText_TheField + .4byte gText_ThePC + .4byte gText_TheField + .4byte gText_TheField + .4byte gText_TheField + .4byte gText_TheBattle + .4byte gText_ThePC .align 2 gUnknown_085E91B0:: @ 85E91B0 - .4byte gUnknown_085E9149 - .4byte gUnknown_085E9153 - .4byte gUnknown_085E915E - .4byte gUnknown_085E9149 + .4byte gText_TheField + .4byte gText_TheBattle + .4byte gText_ThePokemonList + .4byte gText_TheField .align 2 -gUnknown_085E91C0:: @ 85E91C0 +gText_ReturnToVar1:: @ 85E91C0 .string "Return to\n{STR_VAR_1}.$" -gUnknown_085E91CE:: @ 85E91CE +gText_ItemsPocket:: @ 85E91CE .string "ITEMS$" -gUnknown_085E91D4:: @ 85E91D4 +gText_PokeBallsPocket:: @ 85E91D4 .string "POKé BALLS$" -gUnknown_085E91DF:: @ 85E91DF +gText_TMHMPocket:: @ 85E91DF .string "TMs & HMs$" -gUnknown_085E91E9:: @ 85E91E9 +gText_BerriesPocket:: @ 85E91E9 .string "BERRIES$" -gUnknown_085E91F1:: @ 85E91F1 +gText_KeyItemsPocket:: @ 85E91F1 .string "KEY ITEMS$" .align 2 -gUnknown_085E91FC:: @ 85E91FC - .4byte gUnknown_085E91CE - .4byte gUnknown_085E91D4 - .4byte gUnknown_085E91DF - .4byte gUnknown_085E91E9 - .4byte gUnknown_085E91F1 +gPocketNames:: @ 85E91FC + .4byte gText_ItemsPocket + .4byte gText_PokeBallsPocket + .4byte gText_TMHMPocket + .4byte gText_BerriesPocket + .4byte gText_KeyItemsPocket .align 2 gUnknown_085E9210:: @ 85E9210 diff --git a/src/coins.c b/src/coins.c index f43b5b336..84a79f5f2 100644 --- a/src/coins.c +++ b/src/coins.c @@ -14,14 +14,14 @@ extern void SetWindowTemplateFields(struct WindowTemplate* template, u8 priority extern void SetWindowBorderStyle(u8 windowId, bool8 copyToVram, s16 tileStart, s8 palette); extern void sub_819746C(u8 windowId, bool8 copyToVram); -extern const u8 gOtherText_Coins2[]; +extern const u8 gText_Coins[]; void PrintCoinsString(u32 coinAmount) { u32 xAlign; ConvertIntToDecimalStringN(gStringVar1, coinAmount, STR_CONV_MODE_RIGHT_ALIGN, 4); - StringExpandPlaceholders(gStringVar4, gOtherText_Coins2); + StringExpandPlaceholders(gStringVar4, gText_Coins); xAlign = GetStringRightAlignXOffset(1, gStringVar4, 0x40); PrintTextOnWindow(sCoinsWindowId, 1, gStringVar4, xAlign, 1, 0, NULL); From 3e1c6024a7a43192eb4a766fb0ee4e107c3e949d Mon Sep 17 00:00:00 2001 From: Diegoisawesome Date: Wed, 13 Sep 2017 01:10:12 -0500 Subject: [PATCH 07/13] Continue extracting from data2.s --- asm/link.s | 4 +- charmap.txt | 1 + data/data2.s | 704 +++++++++++++++++- data/data_emerald2.s | 112 ++- data/fonts.s | 8 + data/graphics.s | 6 +- data/strings.s | 47 +- graphics/interface/unk_change_case.png | Bin 0 -> 247 bytes graphics/interface/unk_cursor.png | Bin 0 -> 307 bytes .../interface/unk_cursor_arrow.4bpp.lz.bak | Bin 0 -> 44 bytes graphics/interface/unk_cursor_arrow.png | Bin 0 -> 157 bytes graphics/interface/unk_dash.png | Bin 0 -> 146 bytes graphics/interface/unk_palette1.pal | 19 + graphics/interface/unk_palette2.pal | 19 + graphics/interface/unk_palette3.pal | 19 + graphics/interface/unk_rbutton.png | Bin 0 -> 188 bytes graphics/interface/wonder_news_1.4bpp.bak | Bin 0 -> 348 bytes graphics/interface/wonder_news_1.pal | 19 + graphics/interface/wonder_news_1.png | Bin 0 -> 225 bytes graphics/interface/wonder_news_2.bin | Bin 0 -> 1440 bytes graphics/interface/wonder_news_2.png | Bin 0 -> 160 bytes graphics/interface/wonder_news_3.bin | Bin 0 -> 1440 bytes graphics/interface/wonder_news_3.png | Bin 0 -> 204 bytes graphics/interface/wonder_news_7.bin | Bin 0 -> 1440 bytes graphics/interface/wonder_news_7.pal | 19 + graphics/interface/wonder_news_7.png | Bin 0 -> 223 bytes graphics/interface/wonder_news_8.bin | Bin 0 -> 1440 bytes graphics/interface/wonder_news_8.pal | 19 + graphics/interface/wonder_news_8.png | Bin 0 -> 223 bytes 29 files changed, 950 insertions(+), 46 deletions(-) create mode 100644 graphics/interface/unk_change_case.png create mode 100644 graphics/interface/unk_cursor.png create mode 100644 graphics/interface/unk_cursor_arrow.4bpp.lz.bak create mode 100644 graphics/interface/unk_cursor_arrow.png create mode 100644 graphics/interface/unk_dash.png create mode 100644 graphics/interface/unk_palette1.pal create mode 100644 graphics/interface/unk_palette2.pal create mode 100644 graphics/interface/unk_palette3.pal create mode 100644 graphics/interface/unk_rbutton.png create mode 100644 graphics/interface/wonder_news_1.4bpp.bak create mode 100644 graphics/interface/wonder_news_1.pal create mode 100644 graphics/interface/wonder_news_1.png create mode 100644 graphics/interface/wonder_news_2.bin create mode 100644 graphics/interface/wonder_news_2.png create mode 100644 graphics/interface/wonder_news_3.bin create mode 100644 graphics/interface/wonder_news_3.png create mode 100644 graphics/interface/wonder_news_7.bin create mode 100644 graphics/interface/wonder_news_7.pal create mode 100644 graphics/interface/wonder_news_7.png create mode 100644 graphics/interface/wonder_news_8.bin create mode 100644 graphics/interface/wonder_news_8.pal create mode 100644 graphics/interface/wonder_news_8.png diff --git a/asm/link.s b/asm/link.s index a84191883..c9fd1ff96 100644 --- a/asm/link.s +++ b/asm/link.s @@ -44323,7 +44323,7 @@ _080202AC: movs r1, 0x1 negs r1, r1 str r1, [sp, 0x4] - ldr r0, =gUnknown_082F2DC4 + ldr r0, =gText_Ellipsis str r0, [sp, 0x8] movs r0, 0x2 movs r1, 0 @@ -45129,7 +45129,7 @@ sub_80209AC: @ 80209AC push {r4,lr} adds r4, r0, 0 lsls r4, 2 - ldr r0, =gUnknown_082F2DF2 + ldr r0, =gUnknown_082F2DF0+2 adds r4, r0 movs r0, 0 bl IndexOfSpritePaletteTag diff --git a/charmap.txt b/charmap.txt index d7fd15e2e..4f2f10e0b 100644 --- a/charmap.txt +++ b/charmap.txt @@ -691,6 +691,7 @@ UNK_CTRL_F801 = F8 01 UNK_CTRL_F80A = F8 0A UNK_CTRL_F80C = F8 0C +UNK_CTRL_F9 = F9 UNK_CTRL_F904 = F9 04 UNK_CTRL_F905 = F9 05 UNK_CTRL_F907 = F9 07 diff --git a/data/data2.s b/data/data2.s index cd8c43f65..a3fcbd536 100644 --- a/data/data2.s +++ b/data/data2.s @@ -2313,110 +2313,734 @@ gUnknown_082F1D60:: @ 82F1D60 .4byte 0x00007001, gWonderCardBgGfx8, gWonderCardBgTilemap8, gWonderCardBgPal8 gUnknown_082F1DE0:: @ 82F1DE0 - .incbin "baserom.gba", 0x2f1de0, 0x8 + .byte 0x00, 0x02, 0x03, 0x00, 0x01, 0x02, 0x00, 0x00 gUnknown_082F1DE8:: @ 82F1DE8 - .incbin "baserom.gba", 0x2f1de8, 0x10 + window_template 0x00, 0x01, 0x00, 0x1C, 0x03, 0x02, 0x02AC + window_template 0x02, 0x01, 0x03, 0x1C, 0x14, 0x02, 0x007C gUnknown_082F1DF8:: @ 82F1DF8 - .incbin "baserom.gba", 0x2f1df8, 0x6d0 + .4byte 0x0318e802, 0x000098e8, 0x10000002, 0x00001000 + .align 2 +gWonderNewsPal1:: @ 82F1E08 + .incbin "graphics/interface/wonder_news_1.gbapal" + + .align 2 +gWonderNewsPal7:: @ 82F1E28 + .incbin "graphics/interface/wonder_news_7.gbapal" + + .align 2 +gWonderNewsPal8:: @ 82F1E48 + .incbin "graphics/interface/wonder_news_8.gbapal" + + .align 2 +gWonderNewsGfx1:: @ 82F1E68 + .incbin "graphics/interface/wonder_news_1.4bpp.lz" + + .align 2 +gWonderNewsTilemap1:: @ 82F1EE8 + .incbin "graphics/interface/wonder_news_1.bin.lz" + + .align 2 +gWonderNewsGfx2:: @ 82F1FC4 + .incbin "graphics/interface/wonder_news_2.4bpp.lz" + + .align 2 +gWonderNewsTilemap2:: @ 82F1FF4 + .incbin "graphics/interface/wonder_news_2.bin.lz" + + .align 2 +gWonderNewsGfx3:: @ 82F20B4 + .incbin "graphics/interface/wonder_news_3.4bpp.lz" + + .align 2 +gWonderNewsTilemap3:: @ 82F2124 + .incbin "graphics/interface/wonder_news_3.bin.lz" + + .align 2 +gWonderNewsGfx7:: @ 82F21F0 + .incbin "graphics/interface/wonder_news_7.4bpp.lz" + + .align 2 +gWonderNewsTilemap7:: @ 82F2280 + .incbin "graphics/interface/wonder_news_7.bin.lz" + + .align 2 +gWonderNewsGfx8:: @ 82F235C + .incbin "graphics/interface/wonder_news_8.4bpp.lz" + + .align 2 +gWonderNewsTilemap8:: @ 82F23EC + .incbin "graphics/interface/wonder_news_8.bin.lz" + + .align 2 gUnknown_082F24C8:: @ 82F24C8 - .incbin "baserom.gba", 0x2f24c8, 0x80 + .4byte 0x00000001, gWonderNewsGfx1, gWonderNewsTilemap1, gWonderNewsPal1 + .4byte 0x00000001, gWonderNewsGfx2, gWonderNewsTilemap2, gWonderCardBgPal2 + .4byte 0x00000001, gWonderNewsGfx3, gWonderNewsTilemap3, gWonderCardBgPal3 + .4byte 0x00000001, gWonderNewsGfx3, gWonderNewsTilemap3, gWonderCardBgPal4 + .4byte 0x00000001, gWonderNewsGfx3, gWonderNewsTilemap3, gWonderCardBgPal5 + .4byte 0x00000001, gWonderNewsGfx3, gWonderNewsTilemap3, gWonderCardBgPal6 + .4byte 0x00000001, gWonderNewsGfx7, gWonderNewsTilemap7, gWonderNewsPal7 + .4byte 0x00000001, gWonderNewsGfx8, gWonderNewsTilemap8, gWonderNewsPal8 + .align 2 gUnknown_082F2548:: @ 82F2548 - .incbin "baserom.gba", 0x2f2548, 0x14 + .4byte sub_801D1AC + .4byte sub_801D1B4 + .4byte sub_801D1B8 + .4byte sub_801D1D4 + .4byte sub_801D1F0 + .align 2 gUnknown_082F255C:: @ 82F255C - .incbin "baserom.gba", 0x2f255c, 0x3c + .4byte sub_801D5D0 + .4byte sub_801D5F8 + .4byte sub_801D5FC + .4byte sub_801D61C + .4byte sub_801D63C + .4byte sub_801D810 + .4byte sub_801D828 + .4byte sub_801D860 + .align 2 +gText_CanceledReadingCard:: @ 82F257C + .string "Canceled reading\nthe Card.$" + + .align 2 gUnknown_082F2598:: @ 82F2598 - .incbin "baserom.gba", 0x2f2598, 0x3f4 + .byte 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00 + .byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .align 2 +gUnknown_082F25A8:: @ 82F25A8 + .byte 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00 + .byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + .align 2 +gUnknown_082F25C8:: @ 82F25C8 + .byte 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00 + + .align 2 +gUnknown_082F25D8:: @ 82F25D8 + .byte 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00 + + .align 2 +gUnknown_082F25E8:: @ 82F25E8 + .byte 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + .align 2 +gUnknown_082F25F8:: @ 82F25F8 + .byte 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00 + .byte 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x02, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00 + .byte 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00 + + .align 2 +gUnknown_082F2628:: @ 82F2628 + .byte 0x02, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00 + .byte 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00 + .byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + .align 2 +gUnknown_082F2650:: @ 82F2650 + .byte 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00 + + .align 2 +gUnknown_082F2660:: @ 82F2660 + .byte 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00 + + .align 2 +gUnknown_082F2670:: @ 82F2670 + .byte 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00 + .byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + .align 2 +gUnknown_082F2698:: @ 82F2698 + .byte 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x01, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00 + + .align 2 +gUnknown_082F26A8:: @ 82F26A8 + .byte 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00 + + .align 2 +gUnknown_082F26B8:: @ 82F26B8 + .byte 0x02, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00 + .byte 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x01, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00 + .byte 0x02, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00 + .byte 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00 + + .align 2 +gUnknown_082F26F8:: @ 82F26F8 + .byte 0x12, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00 + + .4byte gUnknown_082F25C8 + .byte 0x01, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x02, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x12, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00 + + .4byte gUnknown_082F25D8 + .byte 0x01, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x02, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x12, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00 + + .4byte gUnknown_082F2698 + .byte 0x01, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x02, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + .align 2 +gUnknown_082F2788:: @ 82F2788 + .byte 0x12, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00 + + .4byte gUnknown_082F26B8 + .byte 0x01, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x14, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00 + + .4byte gText_CanceledReadingCard + .byte 0x01, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x02, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + .align 2 +gUnknown_082F27D0:: @ 82F27D0 + .byte 0x12, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00 + + .4byte gUnknown_082F2650 + .byte 0x01, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x02, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + .align 2 +gUnknown_082F2800:: @ 82F2800 + .byte 0x12, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00 + + .4byte gUnknown_082F2628 + .byte 0x01, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x02, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 + + .4byte gUnknown_082F27D0 + .byte 0x12, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00 + + .4byte gUnknown_082F2660 + .byte 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00 + .byte 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00 + + .align 2 +gUnknown_082F2884:: @ 82F2884 + .byte 0x12, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00 + + .4byte gUnknown_082F25F8 + .byte 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00 + .byte 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00 + + .align 2 +gUnknown_082F28E4:: @ 82F28E4 + .byte 0x12, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00 + + .4byte gUnknown_082F2670 + .byte 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00 + .byte 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00 + + .4byte gUnknown_082F2884 + .byte 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + .4byte gUnknown_082F2788 + + .align 2 +gUnknown_082F292C:: @ 82F292C + .byte 0x12, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00 + + .4byte gUnknown_082F26A8 + .byte 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00 + .byte 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00 + .byte 0x10, 0x00, 0x00, 0x00 + + .4byte gUnknown_082F25E8 + .byte 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00 + .byte 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00 + + .align 2 gUnknown_082F298C:: @ 82F298C - .incbin "baserom.gba", 0x2f298c, 0x60 + .byte 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00 + .byte 0x20, 0x00, 0x00, 0x00 + .4byte gUnknown_082F25A8 + .byte 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00 + .byte 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + .4byte gUnknown_082F26F8 + .byte 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + .4byte gUnknown_082F2800 + + .align 2 gUnknown_082F29EC:: @ 82F29EC - .incbin "baserom.gba", 0x2f29ec, 0x90 + .byte 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x12, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00 + .4byte gUnknown_082F25A8 + .byte 0x01, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x02, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00 + + .4byte gUnknown_082F26F8 + .byte 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00 + .byte 0x02, 0x00, 0x00, 0x00 + + .4byte gUnknown_082F28E4 + .byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + .4byte gUnknown_082F2884 + .byte 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + .4byte gUnknown_082F292C + + .align 2 gUnknown_082F2A7C:: @ 82F2A7C - .incbin "baserom.gba", 0x2f2a7c, 0x28 + .4byte sub_801DFAC + .4byte sub_801E030 + .4byte sub_801E120 + .4byte sub_801E240 + .4byte sub_801E764 + .4byte sub_801E838 + .4byte sub_801E460 + .4byte sub_801E5C4 + .4byte sub_801E668 + .4byte sub_801E978 + .align 2 gUnknown_082F2AA4:: @ 82F2AA4 - .incbin "baserom.gba", 0x2f2aa4, 0x4 + .byte 0x09, 0x09, 0x09, 0x09 + .align 2 gUnknown_082F2AA8:: @ 82F2AA8 - .incbin "baserom.gba", 0x2f2aa8, 0x100 + .byte 0x00, 0x16, 0x17, 0x68, 0x19, 0x1a, 0x1b, 0x1c + .byte 0x1d, 0x1e, 0x00, 0x20, 0x21, 0x22, 0x23, 0x24 + .byte 0x25, 0x26, 0x27, 0x28, 0x29, 0x15, 0x01, 0x02 + .byte 0x00, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x00 + .byte 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12 + .byte 0x13, 0x14, 0x2a, 0x2b, 0x2c, 0x2d, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x35, 0x36, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x53, 0x54, 0x55, 0x56, 0x00 + .byte 0x00, 0x00, 0x6f, 0x5b, 0x5c, 0x5d, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x84, 0x85, 0x86, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7 + .byte 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf + .byte 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7 + .byte 0xb8, 0xb9, 0xba, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9 + .byte 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1 + .byte 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9 + .byte 0xea, 0xeb, 0xec, 0xed, 0xee, 0xbb, 0xbc, 0xbd + .byte 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5 + .byte 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd + .byte 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xef + .byte 0xf0, 0xf4, 0xf5, 0xf6, 0xf1, 0xf2, 0xf3, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .align 2 gUnknown_082F2BA8:: @ 82F2BA8 - .incbin "baserom.gba", 0x2f2ba8, 0x78 + .4byte gUnknown_0862B9F9 + .4byte gUnknown_0862B9FF + .4byte gUnknown_0862BA05 + .4byte gUnknown_0862BA0B + .4byte gUnknown_0862BA11 + .4byte gUnknown_0862BA17 + .4byte gUnknown_0862BA1D + .4byte gUnknown_0862BA23 + .4byte gUnknown_0862BA29 + .4byte gUnknown_0862BA2F + .4byte gUnknown_0862BA35 + .4byte gUnknown_0862BA3B + .4byte gUnknown_0862BA41 + .4byte gUnknown_0862BA47 + .4byte gUnknown_0862BA4D + .4byte gUnknown_0862BA53 + .4byte gUnknown_0862BA59 + .4byte gUnknown_0862BA5F + .4byte gUnknown_0862BA65 + .4byte gUnknown_0862BA6B + .4byte gUnknown_0862BA79 + .4byte gUnknown_0862BA84 + .4byte gUnknown_0862BA8F + .4byte gUnknown_0862BA9A + .4byte gUnknown_0862BAA3 + .4byte gUnknown_0862BAAE + .4byte gUnknown_0862BAB9 + .4byte gUnknown_0862BAC4 + .4byte gUnknown_0862BACF + .4byte gUnknown_0862BADA + .align 2 gUnknown_082F2C20:: @ 82F2C20 - .incbin "baserom.gba", 0x2f2c20, 0x20 + .incbin "graphics/interface/unk_palette1.gbapal" + .align 2 gUnknown_082F2C40:: @ 82F2C40 - .incbin "baserom.gba", 0x2f2c40, 0x20 + .incbin "graphics/interface/unk_palette2.gbapal" -gUnknown_082F2C60:: @ 82F2C60 - .incbin "baserom.gba", 0x2f2c60, 0x10 + .align 2 +gUnknown_082F2C60:: @ 82F2C60 struct BgTemplate + .4byte 0x00000070, 0x000011fd, 0x0000217a, 0x000070f7 + .align 2 gUnknown_082F2C70:: @ 82F2C70 - .incbin "baserom.gba", 0x2f2c70, 0x28 + window_template 0x03, 0x08, 0x01, 0x15, 0x13, 0x0f, 0x0001 + window_template 0x01, 0x09, 0x12, 0x0f, 0x02, 0x0c, 0x007a + window_template 0x01, 0x00, 0x02, 0x06, 0x0f, 0x07, 0x0020 + window_template 0x00, 0x01, 0x02, 0x07, 0x09, 0x0e, 0x0013 + window_template 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 + .align 2 gUnknown_082F2C98:: @ 82F2C98 - .incbin "baserom.gba", 0x2f2c98, 0xa8 + .4byte 0x00000000, sub_801F658 + .4byte 0x00000003, sub_801F6F8 + .4byte 0x00000004, sub_801F730 + .4byte 0x00000005, sub_801F768 + .4byte 0x00000001, sub_801F7D4 + .4byte 0x00000006, sub_801F7E0 + .4byte 0x00000007, sub_801F82C + .4byte 0x00000008, sub_801F870 + .4byte 0x00000009, sub_801F8DC + .4byte 0x0000000a, sub_801F984 + .4byte 0x0000000b, sub_801FA2C + .4byte 0x0000000c, sub_801FA68 + .4byte 0x00000002, sub_801FB44 + .4byte 0x0000000d, sub_801FB70 + .4byte 0x00000012, sub_801FBB4 + .4byte 0x00000013, sub_801FBF8 + .4byte 0x0000000e, sub_801FC4C + .4byte 0x0000000f, sub_801FC9C + .4byte 0x00000010, sub_801FCEC + .4byte 0x00000011, sub_801FD30 + .4byte 0x00000014, sub_801FD88 + .align 2 gUnknown_082F2D40:: @ 82F2D40 - .incbin "baserom.gba", 0x2f2d40, 0x84 + .4byte gUnknown_085ED265 + .byte 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 -gUnknown_082F2DC4:: @ 82F2DC4 - .incbin "baserom.gba", 0x2f2dc4, 0x4 + .4byte gUnknown_085ED274 + .byte 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 + .4byte gUnknown_085ED289 + .byte 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 + + .4byte gUnknown_085ED29D + .byte 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 + + .4byte gUnknown_085ED2E8 + .byte 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 + + .4byte gUnknown_085ED2FA + .byte 0x02, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00 + + .4byte gUnknown_085ED325 + .byte 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00 + + .4byte gUnknown_085ED368 + .byte 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00 + + .4byte gUnknown_085ED3A3 + .byte 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00 + + .4byte gUnknown_085ED3C5 + .byte 0x02, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00 + + .4byte gUnknown_085ED3D8 + .byte 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00 + + .align 2 +gText_Ellipsis:: @ 82F2DC4 + .string "…$" + + .align 2 gUnknown_082F2DC8:: @ 82F2DC8 - .incbin "baserom.gba", 0x2f2dc8, 0x2a + .4byte gUnknown_085ED23C, 0x00000000 + .4byte gUnknown_085ED242, 0x00000000 + .4byte gUnknown_085ED24F, 0x00000000 + .4byte gUnknown_085ED257, 0x00000000 + .4byte gUnknown_085ED260, 0x00000000 -gUnknown_082F2DF2:: @ 82F2DF2 - .incbin "baserom.gba", 0x2f2df2, 0x342 + .align 2 +gUnknown_082F2DF0:: @ 82F2DF0 + .incbin "graphics/interface/unk_palette3.gbapal" + .align 2 +gUnknown_082F2E10:: @ 82F2E10 + .incbin "graphics/interface/unk_cursor.4bpp.lz" + + .align 2 +gUnknown_082F3094:: @ 82F3094 + .incbin "graphics/interface/unk_dash.4bpp.lz" + + .align 2 +gUnknown_082F30B4:: @ 82F30B4 + .incbin "graphics/interface/unk_cursor_arrow.4bpp.lz" + + .align 2 +gUnknown_082F30E0:: @ 82F30E0 + .incbin "graphics/interface/unk_rbutton.4bpp.lz" + + .align 2 gUnknown_082F3134:: @ 82F3134 - .incbin "baserom.gba", 0x2f3134, 0x28 + .4byte gUnknown_082F2E10 + .2byte 0x1000, 0x0000 -gUnknown_082F315C:: @ 82F315C - .incbin "baserom.gba", 0x2f315c, 0x40 + .4byte gUnknown_082F30B4 + .2byte 0x0040, 0x0001 + .4byte gUnknown_082F3094 + .2byte 0x0040, 0x0002 + + .4byte gUnknown_082F30E0 + .2byte 0x0080, 0x0003 + + .4byte gUnknown_08DD4CF8 + .2byte 0x0400, 0x0004 + + .align 2 +gUnknown_082F315C:: @ 82F315C struct SpritePalette + .4byte gUnknown_082F2DF0 + .2byte 0x0000 + + .align 2 +gUnknown_082F3164:: @ 82F3164 + .2byte 0x4000, 0xc000, 0x0400, 0x0000 + + .align 2 +gUnknown_082F316C:: @ 82F316C + .2byte 0x0000, 0x001e, 0xffff, 0x0000 + + .align 2 +gUnknown_082F3174:: @ 82F3174 + .2byte 0x0020, 0x001e, 0xffff, 0x0000 + + .align 2 +gUnknown_082F317C:: @ 82F317C + .2byte 0x0040, 0x001e, 0xffff, 0x0000 + + .align 2 +gUnknown_082F3184:: @ 82F3184 + .2byte 0x0060, 0x001e, 0xffff, 0x0000 + +gUnknown_082F318C:: @ 82F318C + .4byte gUnknown_082F316C + .4byte gUnknown_082F3174 + .4byte gUnknown_082F317C + .4byte gUnknown_082F3184 + + .align 2 gUnknown_082F319C:: @ 82F319C - .incbin "baserom.gba", 0x2f319c, 0x20 + .2byte 0x0000 @ tileTag + .2byte 0x0000 @ paletteTag + .4byte gUnknown_082F3164 + .4byte gUnknown_082F318C + .4byte NULL + .4byte gDummySpriteAffineAnimTable + .4byte SpriteCallbackDummy + .align 2 +gUnknown_082F31B4:: @ 82F31B4 + .byte 0x00, 0x80, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00 + + .align 2 gUnknown_082F31BC:: @ 82F31BC - .incbin "baserom.gba", 0x2f31bc, 0x18 + .2byte 0x0002 @ tileTag + .2byte 0x0000 @ paletteTag + .4byte gUnknown_082F31B4 + .4byte gDummySpriteAnimTable + .4byte NULL + .4byte gDummySpriteAffineAnimTable + .4byte sub_8020ABC + .align 2 gUnknown_082F31D4:: @ 82F31D4 - .incbin "baserom.gba", 0x2f31d4, 0x58 + .2byte 0x0001 @ tileTag + .2byte 0x0000 @ paletteTag + .4byte gUnknown_082F31B4 + .4byte gDummySpriteAnimTable + .4byte NULL + .4byte gDummySpriteAffineAnimTable + .4byte sub_8020AF4 + .align 2 +gUnknown_082F31EC:: @ 82F31EC + .byte 0x00, 0x00, 0x00, 0x40, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_082F31F4:: @ 82F31F4 + .byte 0x00, 0x40, 0x00, 0x80, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_082F31FC:: @ 82F31FC + .2byte 0x0000, 0x0002, 0xffff, 0x0000 + + .align 2 +gUnknown_082F3204:: @ 82F3204 + .2byte 0x0008, 0x0002, 0xffff, 0x0000 + + .align 2 +gUnknown_082F320C:: @ 82F320C + .2byte 0x0010, 0x0002, 0xffff, 0x0000 + + .align 2 +gUnknown_082F3214:: @ 82F3214 + .2byte 0x0018, 0x0002, 0xffff, 0x0000 + + .align 2 +gUnknown_082F321C:: @ 82F321C + .4byte gUnknown_082F31FC + .4byte gUnknown_082F3204 + .4byte gUnknown_082F320C + .4byte gUnknown_082F3214 + + .align 2 gUnknown_082F322C:: @ 82F322C - .incbin "baserom.gba", 0x2f322c, 0x18 + .2byte 0x0003 @ tileTag + .2byte 0x0000 @ paletteTag + .4byte gUnknown_082F31EC + .4byte gDummySpriteAnimTable + .4byte 0x00000000 + .4byte gDummySpriteAffineAnimTable + .4byte SpriteCallbackDummy + .align 2 gUnknown_082F3244:: @ 82F3244 - .incbin "baserom.gba", 0x2f3244, 0x18 + .2byte 0x0004 @ tileTag + .2byte 0x0000 @ paletteTag + .4byte gUnknown_082F31F4 + .4byte gUnknown_082F321C + .4byte 0x00000000 + .4byte gDummySpriteAffineAnimTable + .4byte SpriteCallbackDummy + .align 2 gUnknown_082F325C:: @ 82F325C - .incbin "baserom.gba", 0x2f325c, 0x8 + .byte 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 + .align 2 gUnknown_082F3264:: @ 82F3264 - .incbin "baserom.gba", 0x2f3264, 0x8 + .byte 0x00, 0x01, 0x02, 0x03, 0x05, 0x00, 0x00, 0x00 + .align 2 gUnknown_082F326C:: @ 82F326C - .incbin "baserom.gba", 0x2f326c, 0x24 + .byte 0x04, 0x01, 0x00, 0xff, 0x00, 0x00, 0x00, 0x04 + .byte 0x02, 0x00, 0xff, 0x00, 0x00, 0x00, 0x04, 0x02 + .byte 0x00, 0xfe, 0x00, 0x00, 0x00, 0x06, 0x03, 0x01 + .byte 0xff, 0xfd, 0xff, 0x00, 0x06, 0x04, 0x01, 0xfe + .byte 0xfc, 0xfe, 0x00, 0x00 + .align 2 gUnknown_082F3290:: @ 82F3290 - .incbin "baserom.gba", 0x2f3290, 0x14 + .byte 0x03, 0x02, 0x01, 0x00, 0x03, 0x03, 0x01, 0x00 + .byte 0x03, 0x03, 0x02, 0x00, 0x03, 0x04, 0x02, 0x00 + .byte 0x03, 0x05, 0x03, 0x00 + .align 2 gUnknown_082F32A4:: @ 82F32A4 - .incbin "baserom.gba", 0x2f32a4, 0x24 + .4byte gUnknown_085ED5F0 + .4byte gUnknown_085ED62C + .4byte gUnknown_085ED65C + .4byte gUnknown_085ED6C8 + .4byte gUnknown_085ED704 + .4byte gUnknown_085ED724 + .4byte gUnknown_085ED754 + .4byte gUnknown_085ED788 + .4byte gUnknown_085ED7BC -gUnknown_082F32C8:: @ 82F32C8 - .incbin "baserom.gba", 0x2f32c8, 0x4 + .align 2 +gUnknown_082F32C8:: @ 82F32C8 struct BgTemplate + .4byte 0x000000F8 + .align 2 gUnknown_082F32CC:: @ 82F32CC .incbin "baserom.gba", 0x2f32cc, 0xc diff --git a/data/data_emerald2.s b/data/data_emerald2.s index a6ae64e25..7efcbbecf 100644 --- a/data/data_emerald2.s +++ b/data/data_emerald2.s @@ -932,4 +932,114 @@ gUnknown_0862B7E8:: @ 862B7E8 .incbin "baserom.gba", 0x62b7e8, 0x14 gUnknown_0862B7FC:: @ 862B7FC - .incbin "baserom.gba", 0x62b7fc, 0x2e8 + .incbin "baserom.gba", 0x62b7fc, 0x14 + + .align 2 + .string "{CLEAR 11}A{CLEAR 6}B{CLEAR 6}C{CLEAR 26}D{CLEAR 6}E{CLEAR 6}F{CLEAR 26}others$" + .string "{CLEAR 11}G{CLEAR 6}H{CLEAR 6}I{CLEAR 26}J{CLEAR 6}K{CLEAR 6}L$" + .string "{CLEAR 11}M{CLEAR 6}N{CLEAR 6}O{CLEAR 26}P{CLEAR 6}Q{CLEAR 6}R{CLEAR 6}S{CLEAR 26} $" + .string "{CLEAR 11}T{CLEAR 6}U{CLEAR 6}V{CLEAR 26}W{CLEAR 6}X{CLEAR 6}Y{CLEAR 6}Z{CLEAR 26} $" + .string "{CLEAR 11}a{CLEAR 6}b{CLEAR 6}c{CLEAR 26}d{CLEAR 6}e{CLEAR 6}f{CLEAR 6} {CLEAR 30}.$" + .string "{CLEAR 11}g{CLEAR 6}h{CLEAR 7}i{CLEAR 27}j{CLEAR 7}k{CLEAR 7}l{CLEAR 7} {CLEAR 30},$" + .string "{CLEAR 11}m{CLEAR 6}n{CLEAR 6}o{CLEAR 26}p{CLEAR 6}q{CLEAR 7}r{CLEAR 6}s{CLEAR 27} $" + .string "{CLEAR 11}t{CLEAR 6}u{CLEAR 6}v{CLEAR 26}w{CLEAR 6}x{CLEAR 6}y{CLEAR 6}z{CLEAR 26} $" + .string "{CLEAR 11}A{CLEAR 6}B{CLEAR 6}C{CLEAR 26}D{CLEAR 6}E{CLEAR 6}F{CLEAR 6} {CLEAR 30}.$" + .string "{CLEAR 11}G{CLEAR 6}H{CLEAR 6}I{CLEAR 26}J{CLEAR 6}K{CLEAR 6}L{CLEAR 6} {CLEAR 30},$" + .string "{CLEAR 11}M{CLEAR 6}N{CLEAR 6}O{CLEAR 26}P{CLEAR 6}Q{CLEAR 6}R{CLEAR 6}S{CLEAR 26} $" + .string "{CLEAR 11}T{CLEAR 6}U{CLEAR 6}V{CLEAR 26}W{CLEAR 6}X{CLEAR 6}Y{CLEAR 6}Z{CLEAR 26} $" + .string "{CLEAR 11}0{CLEAR 16}1{CLEAR 16}2{CLEAR 16}3{CLEAR 16}4{CLEAR 16} $" + .string "{CLEAR 11}5{CLEAR 16}6{CLEAR 16}7{CLEAR 16}8{CLEAR 16}9{CLEAR 16} $" + .string "{CLEAR 12}!{CLEAR 17}?{CLEAR 16}♂{CLEAR 16}♀{CLEAR 16}/{CLEAR 17}-$" + .string "{CLEAR 11}…{CLEAR 16}“{CLEAR 16}”{CLEAR 18}‘{CLEAR 19}’{CLEAR 18} $" + +gUnknown_0862B9F9:: @ 862B9F9 + .string "ABCDE$" + +gUnknown_0862B9FF:: @ 862B9FF + .string "FGHIJ$" + +gUnknown_0862BA05:: @ 862BA05 + .string "KLMNO$" + +gUnknown_0862BA0B:: @ 862BA0B + .string "PQRST$" + +gUnknown_0862BA11:: @ 862BA11 + .string "UVWXY$" + +gUnknown_0862BA17:: @ 862BA17 + .string "Z $" + +gUnknown_0862BA1D:: @ 862BA1D + .string "01234$" + +gUnknown_0862BA23:: @ 862BA23 + .string "56789$" + +gUnknown_0862BA29:: @ 862BA29 + .string ".,!? $" + +gUnknown_0862BA2F:: @ 862BA2F + .string "-/&… $" + +gUnknown_0862BA35:: @ 862BA35 + .string "abcde$" + +gUnknown_0862BA3B:: @ 862BA3B + .string "fghij$" + +gUnknown_0862BA41:: @ 862BA41 + .string "klmno$" + +gUnknown_0862BA47:: @ 862BA47 + .string "pqrst$" + +gUnknown_0862BA4D:: @ 862BA4D + .string "uvwxy$" + +gUnknown_0862BA53:: @ 862BA53 + .string "z $" + +gUnknown_0862BA59:: @ 862BA59 + .string "01234$" + +gUnknown_0862BA5F:: @ 862BA5F + .string "56789$" + +gUnknown_0862BA65:: @ 862BA65 + .string ".,!? $" + +gUnknown_0862BA6B:: @ 862BA6B + .string "-/&… $" + + .string "$$$$$$$$" + +gUnknown_0862BA79:: @ 862BA79 + .string "{UNK_CTRL_F9 245}{UNK_CTRL_F9 246}{UNK_CTRL_F9 247}{UNK_CTRL_F9 248}{UNK_CTRL_F9 254}$" + +gUnknown_0862BA84:: @ 862BA84 + .string "{UNK_CTRL_F9 249}{UNK_CTRL_F9 250}{UNK_CTRL_F9 252}{UNK_CTRL_F9 251}{UNK_CTRL_F9 253}$" + +gUnknown_0862BA8F:: @ 862BA8F + .string "{UNK_CTRL_F9 236}{UNK_CTRL_F9 237}{UNK_CTRL_F9 238}{UNK_CTRL_F9 235}{UNK_CTRL_F9 234}$" + +gUnknown_0862BA9A:: @ 862BA9A + .string "♂♀{UNK_CTRL_F9 212}{UNK_CTRL_F9 213}{UNK_CTRL_F9 211}$" + +gUnknown_0862BAA3:: @ 862BAA3 + .string "{UNK_CTRL_F9 216}{UNK_CTRL_F9 217}{UNK_CTRL_F9 242}{UNK_CTRL_F9 243}{UNK_CTRL_F9 244}$" + +gUnknown_0862BAAE:: @ 862BAAE + .string "{UNK_CTRL_F9 218}{UNK_CTRL_F9 241}{UNK_CTRL_F9 224}{UNK_CTRL_F9 226}{UNK_CTRL_F9 227}$" + +gUnknown_0862BAB9:: @ 862BAB9 + .string "{UNK_CTRL_F9 240}{UNK_CTRL_F9 239}{UNK_CTRL_F9 225}{UNK_CTRL_F9 214}{UNK_CTRL_F9 215}$" + +gUnknown_0862BAC4:: @ 862BAC4 + .string "{UNK_CTRL_F9 228}{UNK_CTRL_F9 229}{UNK_CTRL_F9 230}{UNK_CTRL_F9 231}{UNK_CTRL_F9 232}$" + +gUnknown_0862BACF:: @ 862BACF + .string "{UNK_CTRL_F9 233}{UNK_CTRL_F9 220}{UNK_CTRL_F9 221}{UNK_CTRL_F9 222}{UNK_CTRL_F9 209}$" + +gUnknown_0862BADA:: @ 862BADA + .string "{UNK_CTRL_F9 210}{UNK_CTRL_F9 208}ょ: $" diff --git a/data/fonts.s b/data/fonts.s index 1904eb4df..aa8423acf 100644 --- a/data/fonts.s +++ b/data/fonts.s @@ -7,6 +7,7 @@ gFont8LatinGlyphs:: @ 862BAE4 .incbin "data/graphics/fonts/font8.latfont" + .align 2 gFont8LatinGlyphWidths:: @ 8633AE4 .include "data/graphics/fonts/font8_latin_widths.inc" @@ -14,6 +15,7 @@ gFont8LatinGlyphWidths:: @ 8633AE4 gFont0LatinGlyphs:: @ 8633CE4 .incbin "data/graphics/fonts/font0.latfont" + .align 2 gFont0LatinGlyphWidths:: @ 863BCE4 .include "data/graphics/fonts/font0_latin_widths.inc" @@ -21,6 +23,7 @@ gFont0LatinGlyphWidths:: @ 863BCE4 gFont7LatinGlyphs:: @ 863BEE4 .incbin "data/graphics/fonts/font7.latfont" + .align 2 gFont7LatinGlyphWidths:: @ 8643EE4 .include "data/graphics/fonts/font7_latin_widths.inc" @@ -28,6 +31,7 @@ gFont7LatinGlyphWidths:: @ 8643EE4 gFont2LatinGlyphs:: @ 86440E4 .incbin "data/graphics/fonts/font2.latfont" + .align 2 gFont2LatinGlyphWidths:: @ 864C0E4 .include "data/graphics/fonts/font2_latin_widths.inc" @@ -35,6 +39,7 @@ gFont2LatinGlyphWidths:: @ 864C0E4 gFont1LatinGlyphs:: @ 864C2E4 .incbin "data/graphics/fonts/font1.latfont" + .align 2 gFont1LatinGlyphWidths:: @ 86542E4 .include "data/graphics/fonts/font1_latin_widths.inc" @@ -50,6 +55,7 @@ gFont1JapaneseGlyphs:: @ 86584E4 gUnusedJapaneseFireRedLeafGreenMaleFontGlyphs:: @ 865C4E4 .incbin "data/graphics/fonts/unused_frlg_male.fwjpnfont" + .align 2 gUnusedJapaneseFireRedLeafGreenMaleFontGlyphWidths:: @ 86644E4 .include "data/graphics/fonts/unused_japanese_frlg_male_font_widths.inc" @@ -57,6 +63,7 @@ gUnusedJapaneseFireRedLeafGreenMaleFontGlyphWidths:: @ 86644E4 gUnusedJapaneseFireRedLeafGreenFemaleFontGlyphs:: @ 86646E4 .incbin "data/graphics/fonts/unused_frlg_female.fwjpnfont" + .align 2 gUnusedJapaneseFireRedLeafGreenFemaleFontGlyphWidths:: @ 866C6E4 .include "data/graphics/fonts/unused_japanese_frlg_female_font_widths.inc" @@ -64,5 +71,6 @@ gUnusedJapaneseFireRedLeafGreenFemaleFontGlyphWidths:: @ 866C6E4 gFont2JapaneseGlyphs:: @ 866C8E4 .incbin "data/graphics/fonts/font2.fwjpnfont" + .align 2 gFont2JapaneseGlyphWidths:: @ 86748E4 .include "data/graphics/fonts/font2_japanese_widths.inc" diff --git a/data/graphics.s b/data/graphics.s index 25925e5c8..bf080fd95 100644 --- a/data/graphics.s +++ b/data/graphics.s @@ -952,7 +952,11 @@ gUnknown_08DD4BF0:: @ 8DD4BF0 .incbin "baserom.gba", 0xdd4bf0, 0x5c gUnknown_08DD4C4C:: @ 8DD4C4C - .incbin "baserom.gba", 0xdd4c4c, 0x1c4 + .incbin "baserom.gba", 0xdd4c4c, 0xac + + .align 2 +gUnknown_08DD4CF8:: @ 8DD4CF8 + .incbin "graphics/interface/unk_change_case.4bpp.lz" .align 2 gTilesetPalettes_General:: @ 8DD4E10 diff --git a/data/strings.s b/data/strings.s index 790252952..2f74c5566 100644 --- a/data/strings.s +++ b/data/strings.s @@ -2173,15 +2173,35 @@ gUnknown_085ED233:: @ 85ED233 gUnknown_085ED238:: @ 85ED238 .string "{COLOR BORDER_COLOR2}$" + +gUnknown_085ED23C:: @ 85ED23C .string "UPPER$" + +gUnknown_085ED242:: @ 85ED242 .string "lower$" + +gUnknown_085ED248:: @ 85ED248 .string "OTHERS$" + +gUnknown_085ED24F:: @ 85ED24F .string "SYMBOLS$" + +gUnknown_085ED257:: @ 85ED257 .string "REGISTER$" + +gUnknown_085ED260:: @ 85ED260 .string "EXIT$" + +gUnknown_085ED265:: @ 85ED265 .string "Quit chatting?$" + +gUnknown_085ED274:: @ 85ED274 .string "Register text where?$" + +gUnknown_085ED289:: @ 85ED289 .string "Register text here?$" + +gUnknown_085ED29D:: @ 85ED29D .string "Input text.$" gUnknown_085ED2A9:: @ 85ED2A9 @@ -2189,14 +2209,28 @@ gUnknown_085ED2A9:: @ 85ED2A9 gUnknown_085ED2BD:: @ 85ED2BD .string "{SPECIAL_F7 0x00} left the chat.$" - .string "{SPECIAL_F7 0x00}ç{SPECIAL_F7 0x01}éÊò:$" - .string "{SPECIAL_F7 0x00}ç{SPECIAL_F7 0x01}éÊòè ÁまÓ+$" + .string "{SPECIAL_F7 0x00}の{SPECIAL_F7 0x01}ひきめ:$" @ "{SPECIAL_F7 0x00}'s {SPECIAL_F7 0x01}hikime" + .string "{SPECIAL_F7 0x00}の{SPECIAL_F7 0x01}ひきめは いません$" @ "{SPECIAL_F7 0x00}'s {SPECIAL_F7 0x01}hikimeha imasen" + +gUnknown_085ED2E8:: @ 85ED2E8 .string "Exiting the chat…$" + +gUnknown_085ED2FA:: @ 85ED2FA .string "The LEADER, {SPECIAL_F7 0x00}, has\nleft, ending the chat.$" + +gUnknown_085ED325:: @ 85ED325 .string "The registered text has been changed.\nIs it okay to save the game?$" + +gUnknown_085ED368:: @ 85ED368 .string "There is already a saved file.\nIs it okay to overwrite it?$" + +gUnknown_085ED3A3:: @ 85ED3A3 .string "SAVING…\nDON’T TURN OFF THE POWER.$" + +gUnknown_085ED3C5:: @ 85ED3C5 .string "{SPECIAL_F7 0x00} saved the game.$" + +gUnknown_085ED3D8:: @ 85ED3D8 .string "If the LEADER leaves, the chat\nwill end. Is that okay?$" gUnknown_085ED40F:: @ 85ED40F @@ -2250,30 +2284,39 @@ gUnknown_085ED5BE:: @ 85ED5BE .string "Would you like to nickname the newly\nhatched {STR_VAR_1}?$" .align 2 +gUnknown_085ED5F0:: @ 85ED5F0 .string "Are you ready to BERRY-CRUSH?\nPlease pick a BERRY for use.\p$" .align 2 +gUnknown_085ED62C:: @ 85ED62C .string "Please wait while each member\nchooses a BERRY.$" .align 2 +gUnknown_085ED65C:: @ 85ED65C .string "{PAUSE_MUSIC}{PLAY_BGM BGM_FANFA1}You ended up with {STR_VAR_1} units of\nsilky-smooth BERRY POWDER.{RESUME_MUSIC}\pYour total amount of BERRY POWDER\nis {STR_VAR_2}.\p$" .align 2 +gUnknown_085ED6C8:: @ 85ED6C8 .string "Recording your game results in the\nsave file.\lPlease wait.$" .align 2 +gUnknown_085ED704:: @ 85ED704 .string "Want to play BERRY CRUSH again?$" .align 2 +gUnknown_085ED724:: @ 85ED724 .string "You have no BERRIES.\nThe game will be canceled.$" .align 2 +gUnknown_085ED754:: @ 85ED754 .string "A member dropped out.\nThe game will be canceled.$" .align 2 +gUnknown_085ED788:: @ 85ED788 .string "Time’s up.\pGood BERRY POWDER could not be\nmade…\p$" .align 2 +gUnknown_085ED7BC:: @ 85ED7BC .string "Communication standby…$" .align 2 diff --git a/graphics/interface/unk_change_case.png b/graphics/interface/unk_change_case.png new file mode 100644 index 0000000000000000000000000000000000000000..185c4abf5490d115f5b4faf5493279964ce7790b GIT binary patch literal 247 zcmeAS@N?(olHy`uVBq!ia0vp^3P9|@!VDxk7i7!@QU(D&A+B?dCjB=woMUKcnDn24 zAqgmq44ysvfA#ABHEY%s7Z?Bk|KHKkalz_iazGVLo-U3d7QJsLc=H`L;BeW=_Ri;MsN|L^GNxM1}$IiQMto-U3d5v^~h8S=F#2)IU832(g5 z^78w?>jJ-bo<5Yv*w(ndkgL0r(_|0R{|Pm{fl_LVbl2~DaA#V0d_>dsL|M+t{i<&& z|9@#!XVBN2z}zFn$K4wp$akT?Q6Tn_t&mfaMn&=(F7+m-z{81}T`a=?PkC)#BKD}| zlJCmX77MrB-p?DY$6>8+^U9qmE=Yl0!c;~~YWpIN!*=U_DY}_&KeYPQafur38>*SVA#NT;VuKi2Td1V2Ieaa%pi(`|AWgH25x?a4-Wq?=rRBS0OzL)>;M1& literal 0 HcmV?d00001 diff --git a/graphics/interface/unk_cursor_arrow.png b/graphics/interface/unk_cursor_arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..574758cdfd567aadcda0f49ee230f206e4d8f570 GIT binary patch literal 157 zcmeAS@N?(olHy`uVBq!ia0vp^96&6ZRaQU(D&A+B?dCjB=woMUKcnDn24 zAqgmq44ysvfA#ABHEY%s7Z?Bk|KHKkalz_iazGUto-U3d95a&>4lq@`XX31z&aH4r s+=XGL!z1PiAJ_}+89M*pFflSmdKI;Vst0PxZ;=Kufz literal 0 HcmV?d00001 diff --git a/graphics/interface/unk_dash.png b/graphics/interface/unk_dash.png new file mode 100644 index 0000000000000000000000000000000000000000..34c3709cf80687942bb0e000af6dc51ad92ec0ae GIT binary patch literal 146 zcmeAS@N?(olHy`uVBq!ia0vp^96&6ZRaQU(D&A+B?dCjB=woMUKcnDn24 zAqgmq44ysvfA#ABHEY%s7Z?Bk|KHKkalz_iazGWbo-U3d95a&>6!`D#t^Uq*SX6vE gHxE$B{{{heh9ydzjYf+aW`m6KboFyt=akR{02@&)W&i*H literal 0 HcmV?d00001 diff --git a/graphics/interface/unk_palette1.pal b/graphics/interface/unk_palette1.pal new file mode 100644 index 000000000..12bc76261 --- /dev/null +++ b/graphics/interface/unk_palette1.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 0 0 +0 0 0 +255 255 255 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 diff --git a/graphics/interface/unk_palette2.pal b/graphics/interface/unk_palette2.pal new file mode 100644 index 000000000..d2a55fec6 --- /dev/null +++ b/graphics/interface/unk_palette2.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 0 0 +246 246 255 +0 0 0 +205 205 230 +49 213 0 +222 230 213 +0 0 255 +205 213 222 +255 0 0 +222 213 197 +255 189 0 +230 230 222 +197 197 197 +41 32 32 +0 0 0 +57 57 57 diff --git a/graphics/interface/unk_palette3.pal b/graphics/interface/unk_palette3.pal new file mode 100644 index 000000000..071f73b42 --- /dev/null +++ b/graphics/interface/unk_palette3.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +156 197 98 +255 49 49 +156 49 49 +49 98 255 +0 0 98 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +230 230 255 +213 213 255 +172 172 172 +115 115 115 +255 255 255 +65 65 65 diff --git a/graphics/interface/unk_rbutton.png b/graphics/interface/unk_rbutton.png new file mode 100644 index 0000000000000000000000000000000000000000..168a293f35474ee97ea6a9ed3754d59a6b5c978f GIT binary patch literal 188 zcmeAS@N?(olHy`uVBq!ia0vp^96+qV!VDzu-cxxDqznRlLR{w@P5N(WILFY?FzG)7 zLlRIJ89aOT|LWEMYu2nOE-wE6|G%T7)4&=^XpKBls@JQcqVumvv4FO#qb;@5JmrF*I9xAZy$jzPGEUU3MiJ^NTH`gq9YYoa5{H^2GOVS5z?n|nGSBi z+`ufcCDWxD&42U$=nEkMm~tAAV@k*vlUQp@@w*5yG8n|PoG-7D;4q>&UNvc-->O2C zDF;Q$D;D}^@paQKAI34{BrtJ57< z$yAFyX}3PVS@EBu1z!=z^^-Q6u0@|0+N3b!y`&r4#~#+41LcNsM>a_ZRZh5h`dLaZ P&|U^lS3j3^P6giEDWPzH5yj9LV&Wg0RY=C3u^!X literal 0 HcmV?d00001 diff --git a/graphics/interface/wonder_news_2.png b/graphics/interface/wonder_news_2.png new file mode 100644 index 0000000000000000000000000000000000000000..6a269f861223666ab3fd386caed84de5a6f8cdb0 GIT binary patch literal 160 zcmeAS@N?(olHy`uVBq!ia0vp^96+qW!VDx0dzbYADT4r?5Z9=qQ-XrBnwz_i?!9{U z+5h71qlR7})j)9X|F@(6@7;U%f6kVBbFzxpbT9e;|No`rPLN)0PZ!4!j+w~`3PK!A zj8=kNEH7A`n0z^BwRCrP+Y5dC{r&y_h@)YQjDjo-TXPJW&nDke0-5RQ>gTe~DWM4f D6jwTo literal 0 HcmV?d00001 diff --git a/graphics/interface/wonder_news_3.bin b/graphics/interface/wonder_news_3.bin new file mode 100644 index 0000000000000000000000000000000000000000..c7b2e3e21bd7507ca80d9e899a1e807f49760f42 GIT binary patch literal 1440 zcmZQ%U}9h<12VBNvM@4mkqJS1S;&Jxds!LS7&ys*Y%Hv!dWj6T(Xb*ug^h;QXjtJ2 I0ZP*b0Gz!Sod5s; literal 0 HcmV?d00001 diff --git a/graphics/interface/wonder_news_3.png b/graphics/interface/wonder_news_3.png new file mode 100644 index 0000000000000000000000000000000000000000..518283c86445749510071d3591b39473ac846697 GIT binary patch literal 204 zcmeAS@N?(olHy`uVBq!ia0vp^96%hw!VDy>*01&lQU(D&A+AwJrvwFMH8*!JnX~5T z-mBl<{r}H^gq}V7fAr}8B}=|_cfX5@`v3p`44L{Wpx$s#7sn8ZsZ%Fh4#6!JA_~6Rad%bL{IA2kr%Z;8%Nm{^!lxGI~>hRxo(F`njxgN@xNA3xHfh literal 0 HcmV?d00001 diff --git a/graphics/interface/wonder_news_7.bin b/graphics/interface/wonder_news_7.bin new file mode 100644 index 0000000000000000000000000000000000000000..f8185b28ee04fbb5286e6eaad0d7dcf4d74fd8b0 GIT binary patch literal 1440 zcmeH_OAf#w5JFM0{(Jx9w$Ter*gAPz2nl%s5lJ92kjQuhGRcC9CQw<}F)#%N``=x7 X1=jBRuH|?C*>0G7WijexZuIH{qGKWj literal 0 HcmV?d00001 diff --git a/graphics/interface/wonder_news_7.pal b/graphics/interface/wonder_news_7.pal new file mode 100644 index 000000000..01832b5e2 --- /dev/null +++ b/graphics/interface/wonder_news_7.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +189 123 148 +213 213 213 +74 74 74 +115 123 123 +164 156 90 +164 148 90 +197 197 90 +213 205 90 +222 213 90 +213 213 106 +238 246 98 +230 222 98 +213 205 98 +197 180 98 +238 230 98 +246 238 106 diff --git a/graphics/interface/wonder_news_7.png b/graphics/interface/wonder_news_7.png new file mode 100644 index 0000000000000000000000000000000000000000..6e26cdc06cfd86ecb7571cf0476adc555edd2d77 GIT binary patch literal 223 zcmV<503iQ~P)5bTGh>3-ql*w)oSkcV&>jr)y-nXv|{e&V)pK8rx32b0001L zNklqaTIrg4Pb??zzWz$E75?S^glHDE-wKhX|ZU)>NJJd z90G7WijexZuIH{qGKWj literal 0 HcmV?d00001 diff --git a/graphics/interface/wonder_news_8.pal b/graphics/interface/wonder_news_8.pal new file mode 100644 index 000000000..28a498b57 --- /dev/null +++ b/graphics/interface/wonder_news_8.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +189 123 148 +213 213 213 +74 74 74 +115 123 123 +156 156 156 +139 139 148 +180 180 197 +197 189 205 +205 205 222 +189 189 189 +197 230 222 +189 213 213 +180 197 197 +156 164 172 +222 222 230 +230 230 238 diff --git a/graphics/interface/wonder_news_8.png b/graphics/interface/wonder_news_8.png new file mode 100644 index 0000000000000000000000000000000000000000..f224e184503c815f2526890f2674a0df34940cb0 GIT binary patch literal 223 zcmeAS@N?(olHy`uVBq!ia0vp^5x@^oGb&|n%sBAMr1iSo#=Q)a zixc)Um-of~Vy$cXeAD6o1jaeS;wJ@IwrWjcoGg>q!S$y21eZ_I9wlk7)!R6pXJ@eM XZu`|Ozj*g`psfs^u6{1-oD!M<>nUG- literal 0 HcmV?d00001 From 448497dfbbc1157c640bc09745454b3c97dc947e Mon Sep 17 00:00:00 2001 From: Diegoisawesome Date: Sat, 16 Sep 2017 03:21:09 -0500 Subject: [PATCH 08/13] Finish extracting data2.s --- asm/link.s | 68 +- data/data2.s | 1767 +++++++++++++++-- data/data2b.s | 8 +- data/strings.s | 31 + graphics/interface/berrycrush_background.bin | Bin 0 -> 2048 bytes graphics/interface/berrycrush_btnpress.png | Bin 0 -> 642 bytes .../interface/berrycrush_container_cap.bin | Bin 0 -> 1280 bytes .../interface/berrycrush_grinder_base.pal | 19 + .../interface/berrycrush_grinder_base.png | Bin 0 -> 626 bytes graphics/interface/berrycrush_grinder_top.bin | Bin 0 -> 640 bytes graphics/interface/berrycrush_misc.pal | 19 + graphics/interface/berrycrush_sparkle.png | Bin 0 -> 329 bytes graphics/interface/berrycrush_timerdigits.pal | 19 + graphics/interface/berrycrush_timerdigits.png | Bin 0 -> 282 bytes .../interface/dodrioberry_berrysprites.pal | 19 + .../interface/dodrioberry_berrysprites.png | Bin 0 -> 395 bytes graphics/interface/dodrioberry_bg1.bin | Bin 0 -> 1280 bytes graphics/interface/dodrioberry_bg1.pal | 19 + graphics/interface/dodrioberry_bg1.png | Bin 0 -> 1887 bytes graphics/interface/dodrioberry_bg2.pal | 19 + graphics/interface/dodrioberry_bg2.png | Bin 0 -> 2856 bytes graphics/interface/dodrioberry_bg2left.bin | Bin 0 -> 1280 bytes graphics/interface/dodrioberry_bg2right.bin | Bin 0 -> 1280 bytes graphics/interface/dodrioberry_pkmn.pal | 19 + graphics/interface/dodrioberry_pkmn.png | Bin 0 -> 3330 bytes graphics/interface/dodrioberry_platform.pal | 19 + graphics/interface/dodrioberry_platform.png | Bin 0 -> 310 bytes graphics/interface/dodrioberry_shiny.pal | 19 + graphics/interface/dodrioberry_status.pal | 19 + graphics/interface/dodrioberry_status.png | Bin 0 -> 195 bytes graphics/interface/pkmnjump_321start1.pal | 19 + graphics/interface/pkmnjump_321start1.png | Bin 0 -> 778 bytes graphics/interface/pkmnjump_321start2.pal | 19 + graphics/interface/pkmnjump_321start2.png | Bin 0 -> 815 bytes graphics/interface/pkmnjump_bg.bin | Bin 0 -> 1280 bytes graphics/interface/pkmnjump_bg.pal | 19 + graphics/interface/pkmnjump_bg.png | Bin 0 -> 532 bytes graphics/interface/pkmnjump_pal1.pal | 19 + graphics/interface/pkmnjump_pal2.pal | 19 + graphics/interface/pkmnjump_pal3.pal | 19 + graphics/interface/pkmnjump_results.bin | Bin 0 -> 8192 bytes .../interface/pkmnjump_results.gbapal.bak | Bin 0 -> 48 bytes graphics/interface/pkmnjump_results.pal | 19 + graphics/interface/pkmnjump_results.png | Bin 0 -> 2129 bytes graphics/interface/pkmnjump_rope1.png | Bin 0 -> 318 bytes graphics/interface/pkmnjump_rope2.png | Bin 0 -> 309 bytes graphics/interface/pkmnjump_rope3.png | Bin 0 -> 325 bytes graphics/interface/pkmnjump_rope4.png | Bin 0 -> 243 bytes graphics/interface/pkmnjump_star.png | Bin 0 -> 326 bytes graphics/interface/pkmnjump_venusaur.bin | Bin 0 -> 4096 bytes graphics/interface/pkmnjump_venusaur.pal | 19 + graphics/interface/pkmnjump_venusaur.png | Bin 0 -> 2082 bytes graphics/interface/test.bin | Bin 0 -> 1152 bytes graphics_file_rules.mk | 4 + 54 files changed, 2005 insertions(+), 215 deletions(-) create mode 100644 graphics/interface/berrycrush_background.bin create mode 100644 graphics/interface/berrycrush_btnpress.png create mode 100644 graphics/interface/berrycrush_container_cap.bin create mode 100644 graphics/interface/berrycrush_grinder_base.pal create mode 100644 graphics/interface/berrycrush_grinder_base.png create mode 100644 graphics/interface/berrycrush_grinder_top.bin create mode 100644 graphics/interface/berrycrush_misc.pal create mode 100644 graphics/interface/berrycrush_sparkle.png create mode 100644 graphics/interface/berrycrush_timerdigits.pal create mode 100644 graphics/interface/berrycrush_timerdigits.png create mode 100644 graphics/interface/dodrioberry_berrysprites.pal create mode 100644 graphics/interface/dodrioberry_berrysprites.png create mode 100644 graphics/interface/dodrioberry_bg1.bin create mode 100644 graphics/interface/dodrioberry_bg1.pal create mode 100644 graphics/interface/dodrioberry_bg1.png create mode 100644 graphics/interface/dodrioberry_bg2.pal create mode 100644 graphics/interface/dodrioberry_bg2.png create mode 100644 graphics/interface/dodrioberry_bg2left.bin create mode 100644 graphics/interface/dodrioberry_bg2right.bin create mode 100644 graphics/interface/dodrioberry_pkmn.pal create mode 100644 graphics/interface/dodrioberry_pkmn.png create mode 100644 graphics/interface/dodrioberry_platform.pal create mode 100644 graphics/interface/dodrioberry_platform.png create mode 100644 graphics/interface/dodrioberry_shiny.pal create mode 100644 graphics/interface/dodrioberry_status.pal create mode 100644 graphics/interface/dodrioberry_status.png create mode 100644 graphics/interface/pkmnjump_321start1.pal create mode 100644 graphics/interface/pkmnjump_321start1.png create mode 100644 graphics/interface/pkmnjump_321start2.pal create mode 100644 graphics/interface/pkmnjump_321start2.png create mode 100644 graphics/interface/pkmnjump_bg.bin create mode 100644 graphics/interface/pkmnjump_bg.pal create mode 100644 graphics/interface/pkmnjump_bg.png create mode 100644 graphics/interface/pkmnjump_pal1.pal create mode 100644 graphics/interface/pkmnjump_pal2.pal create mode 100644 graphics/interface/pkmnjump_pal3.pal create mode 100644 graphics/interface/pkmnjump_results.bin create mode 100644 graphics/interface/pkmnjump_results.gbapal.bak create mode 100644 graphics/interface/pkmnjump_results.pal create mode 100644 graphics/interface/pkmnjump_results.png create mode 100644 graphics/interface/pkmnjump_rope1.png create mode 100644 graphics/interface/pkmnjump_rope2.png create mode 100644 graphics/interface/pkmnjump_rope3.png create mode 100644 graphics/interface/pkmnjump_rope4.png create mode 100644 graphics/interface/pkmnjump_star.png create mode 100644 graphics/interface/pkmnjump_venusaur.bin create mode 100644 graphics/interface/pkmnjump_venusaur.pal create mode 100644 graphics/interface/pkmnjump_venusaur.png create mode 100644 graphics/interface/test.bin diff --git a/asm/link.s b/asm/link.s index c9fd1ff96..0b46c6a94 100644 --- a/asm/link.s +++ b/asm/link.s @@ -46151,17 +46151,17 @@ _0802121C: lsls r2, 1 movs r1, 0 bl LoadPalette - ldr r1, =gUnknown_082F3C8C + ldr r1, =gBerryCrushGrinderTopTilemap movs r0, 0x1 movs r2, 0 movs r3, 0 bl CopyToBgTilemapBuffer - ldr r1, =gUnknown_082F3DBC + ldr r1, =gBerryCrushContainerCapTilemap movs r0, 0x2 movs r2, 0 movs r3, 0 bl CopyToBgTilemapBuffer - ldr r1, =gUnknown_082F3F54 + ldr r1, =gBerryCrushBackgroundTilemap movs r0, 0x3 movs r2, 0 movs r3, 0 @@ -46800,7 +46800,7 @@ _0802175A: asrs r0, 24 strh r0, [r2, 0x24] ldr r2, [r3] - ldr r3, =gUnknown_082F41CD + ldr r3, =gUnknown_082F41CC+1 adds r1, r3 movs r0, 0 ldrsb r0, [r1, r0] @@ -46860,7 +46860,7 @@ _080217E8: ldr r0, =sub_8022B28 str r0, [r2, 0x1C] lsls r1, r4, 1 - ldr r3, =gUnknown_082F41D2 + ldr r3, =gUnknown_082F41CC+6 adds r0, r1, r3 movs r4, 0 ldrsb r4, [r0, r4] @@ -46868,7 +46868,7 @@ _080217E8: adds r0, 0x78 strh r0, [r2, 0x20] ldr r2, [r7] - ldr r0, =gUnknown_082F41D3 + ldr r0, =gUnknown_082F41CC+7 adds r1, r0 movs r6, 0 ldrsb r6, [r1, r6] @@ -48771,7 +48771,7 @@ _080227AA: bcc _080227AA _08022822: movs r5, 0 - ldr r4, =gUnknown_082F41D2 + ldr r4, =gUnknown_082F41CC+6 adds r7, r4, 0x1 _08022828: lsls r2, r5, 1 @@ -56589,7 +56589,7 @@ _08026676: lsrs r0, 24 cmp r0, 0x1 bhi _080266D4 - ldr r0, =gUnknown_082F45AF + ldr r0, =gUnknown_082F449C+0x113 lsls r1, r4, 1 adds r1, r4 adds r1, r7, r1 @@ -56625,7 +56625,7 @@ _080266D0: movs r0, 0x1 b _0802670C _080266D4: - ldr r0, =gUnknown_082F45AF + ldr r0, =gUnknown_082F449C+0x113 lsls r1, r4, 1 adds r1, r4 adds r1, r7, r1 @@ -57508,7 +57508,7 @@ _08026D76: sub_8026D8C: @ 8026D8C lsls r0, 24 lsrs r0, 24 - ldr r3, =gUnknown_082F4648 + ldr r3, =gUnknown_082F449C+0x1AC ldr r1, =gUnknown_02022C98 ldr r1, [r1] adds r1, 0x24 @@ -57539,7 +57539,7 @@ sub_8026DB0: @ 8026DB0 subs r2, 0x1 lsls r2, 24 lsrs r2, 24 - ldr r3, =gUnknown_082F45FA + ldr r3, =gUnknown_082F449C+0x15E lsls r1, r0, 1 adds r1, r0 lsls r0, r2, 4 @@ -57556,7 +57556,7 @@ sub_8026DB0: @ 8026DB0 ldrb r1, [r1] mov r8, r1 movs r3, 0 - ldr r1, =gUnknown_082F467F + ldr r1, =gUnknown_082F449C+0x1E3 lsls r0, r2, 2 adds r2, r0, r2 adds r0, r2, r1 @@ -60392,7 +60392,7 @@ sub_80283A8: @ 80283A8 ldr r0, [r0] str r0, [sp, 0x10] str r1, [sp, 0x14] - ldr r0, =gUnknown_082F98BC + ldr r0, =gDodrioBerryPkmnGfx adds r1, r4, 0 bl LZ77UnCompWram cmp r4, 0 @@ -60848,7 +60848,7 @@ sub_8028734: @ 8028734 ldr r0, [r0] str r0, [sp, 0x20] str r1, [sp, 0x24] - ldr r0, =gUnknown_082F96E0 + ldr r0, =gDodrioBerryStatusGfx adds r1, r6, 0 bl LZ77UnCompWram cmp r6, 0 @@ -61225,7 +61225,7 @@ sub_8028A34: @ 8028A34 ldr r0, [r0] str r0, [sp, 0x8] str r1, [sp, 0xC] - ldr r0, =gUnknown_082F7EB0 + ldr r0, =gDodrioBerrySpritesGfx adds r1, r4, 0 bl LZ77UnCompWram cmp r4, 0 @@ -61611,7 +61611,7 @@ sub_8028D44: @ 8028D44 ldr r0, [r0] str r0, [sp, 0x20] str r1, [sp, 0x24] - ldr r0, =gUnknown_082F9774 + ldr r0, =gDodrioBerryPlatformGfx adds r1, r6, 0 bl LZ77UnCompWram cmp r6, 0 @@ -62386,17 +62386,17 @@ _0802937A: b _0802941C .pool _08029394: - ldr r1, =gUnknown_082FAAD8 + ldr r1, =gDodrioBerryBgTilemap1 movs r0, 0x3 movs r2, 0 movs r3, 0 bl CopyToBgTilemapBuffer - ldr r1, =gUnknown_082FAF94 + ldr r1, =gDodrioBerryBgTilemap2Left movs r0, 0x1 movs r2, 0 movs r3, 0 bl CopyToBgTilemapBuffer - ldr r1, =gUnknown_082FAD44 + ldr r1, =gDodrioBerryBgTilemap2Right movs r0, 0x2 movs r2, 0 movs r3, 0 @@ -64749,7 +64749,7 @@ _0802A910: .4byte _0802A964 .4byte _0802A972 _0802A928: - ldr r0, =gUnknown_082F7DF0 + ldr r0, =gDodrioBerryBgPal1 movs r1, 0 movs r2, 0x40 bl LoadPalette @@ -64759,14 +64759,14 @@ _0802A938: bl reset_temp_tile_data_buffers b _0802A98A _0802A93E: - ldr r1, =gUnknown_082F8084 + ldr r1, =gDodrioBerryBgGfx1 movs r0, 0 str r0, [sp] movs r0, 0x3 b _0802A954 .pool _0802A94C: - ldr r1, =gUnknown_082F8914 + ldr r1, =gDodrioBerryBgGfx2 movs r0, 0 str r0, [sp] movs r0, 0x1 @@ -64995,7 +64995,7 @@ sub_802AB20: @ 802AB20 ldr r7, =gUnknown_02022CFC movs r6, 0 movs r5, 0 - ldr r0, =gUnknown_082FB464 + ldr r0, =gPkmnJumpSpecies mov r8, r0 movs r4, 0x4 _0802AB32: @@ -65091,7 +65091,7 @@ sub_802AC00: @ 802AC00 lsls r0, 16 lsrs r3, r0, 16 movs r1, 0 - ldr r2, =gUnknown_082FB464 + ldr r2, =gPkmnJumpSpecies _0802AC0A: ldrh r0, [r2] cmp r0, r3 @@ -69939,56 +69939,56 @@ _0802D178: ldr r0, [r6] bl sub_802C974 bl sub_802DD08 - ldr r0, =gUnknown_082FC044 + ldr r0, =gPkmnJumpBgPal movs r1, 0 movs r2, 0x20 bl LoadPalette - ldr r1, =gUnknown_082FC064 + ldr r1, =gPkmnJumpBgGfx str r5, [sp] movs r0, 0x3 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram - ldr r1, =gUnknown_082FC290 + ldr r1, =gPkmnJumpBgTilemap movs r4, 0x1 str r4, [sp] movs r0, 0x3 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram - ldr r0, =gUnknown_082FC440 + ldr r0, =gPkmnJumpVenusaurPal movs r1, 0x30 movs r2, 0x20 bl LoadPalette - ldr r1, =gUnknown_082FC460 + ldr r1, =gPkmnJumpVenusaurGfx str r5, [sp] movs r0, 0x2 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram - ldr r1, =gUnknown_082FCDB0 + ldr r1, =gPkmnJumpVenusaurTilemap str r4, [sp] movs r0, 0x2 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram - ldr r0, =gUnknown_082FD168 + ldr r0, =gPkmnJumpResultsPal movs r1, 0x10 movs r2, 0x20 bl LoadPalette - ldr r1, =gUnknown_082FD188 + ldr r1, =gPkmnJumpResultsGfx str r5, [sp] movs r0, 0x1 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram - ldr r1, =gUnknown_082FDC38 + ldr r1, =gPkmnJumpResultsTilemap str r4, [sp] movs r0, 0x1 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram - ldr r0, =gUnknown_082FC024 + ldr r0, =gPkmnJumpPal3 movs r1, 0x20 movs r2, 0x20 bl LoadPalette diff --git a/data/data2.s b/data/data2.s index a3fcbd536..900659502 100644 --- a/data/data2.s +++ b/data/data2.s @@ -2988,7 +2988,7 @@ gUnknown_082F322C:: @ 82F322C .2byte 0x0000 @ paletteTag .4byte gUnknown_082F31EC .4byte gDummySpriteAnimTable - .4byte 0x00000000 + .4byte NULL .4byte gDummySpriteAffineAnimTable .4byte SpriteCallbackDummy @@ -2998,7 +2998,7 @@ gUnknown_082F3244:: @ 82F3244 .2byte 0x0000 @ paletteTag .4byte gUnknown_082F31F4 .4byte gUnknown_082F321C - .4byte 0x00000000 + .4byte NULL .4byte gDummySpriteAffineAnimTable .4byte SpriteCallbackDummy @@ -3041,414 +3041,1821 @@ gUnknown_082F32C8:: @ 82F32C8 struct BgTemplate .4byte 0x000000F8 .align 2 -gUnknown_082F32CC:: @ 82F32CC - .incbin "baserom.gba", 0x2f32cc, 0xc +gUnknown_082F32CC:: @ 82F32CC struct WindowTemplate? not sure + .byte 0xd1, 0x14, 0x00, 0x00, 0xc2, 0x20, 0x00, 0x00 + .byte 0xb3, 0x30, 0x00, 0x00 + .align 2 gUnknown_082F32D8:: @ 82F32D8 - .incbin "baserom.gba", 0x2f32d8, 0x3 + .byte 0x01, 0x02, 0x03 gUnknown_082F32DB:: @ 82F32DB - .incbin "baserom.gba", 0x2f32db, 0x3 + .byte 0x00, 0x01, 0x02 gUnknown_082F32DE:: @ 82F32DE - .incbin "baserom.gba", 0x2f32de, 0x3 + .byte 0x00, 0x03, 0x04 gUnknown_082F32E1:: @ 82F32E1 - .incbin "baserom.gba", 0x2f32e1, 0x6 + .byte 0x01, 0x08, 0x09 + .byte 0x01, 0x06, 0x07 gUnknown_082F32E7:: @ 82F32E7 - .incbin "baserom.gba", 0x2f32e7, 0x5 + .byte 0x01, 0x04, 0x05 + .align 2 gUnknown_082F32EC:: @ 82F32EC - .incbin "baserom.gba", 0x2f32ec, 0x8 + window_template 0x00, 0x03, 0x04, 0x18, 0x0d, 0x0f, 0x0001 + .align 2 gUnknown_082F32F4:: @ 82F32F4 - .incbin "baserom.gba", 0x2f32f4, 0x50 + window_template 0x00, 0x00, 0x00, 0x09, 0x02, 0x08, 0x03ed + window_template 0x00, 0x00, 0x03, 0x09, 0x02, 0x08, 0x03db + window_template 0x00, 0x00, 0x06, 0x09, 0x02, 0x08, 0x03c9 + window_template 0x00, 0x15, 0x03, 0x09, 0x02, 0x08, 0x03b7 + window_template 0x00, 0x15, 0x06, 0x09, 0x02, 0x08, 0x03a5 + window_template 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 + window_template 0x00, 0x05, 0x02, 0x14, 0x10, 0x0f, 0x0001 + window_template 0x00, 0x05, 0x02, 0x14, 0x10, 0x0f, 0x0001 + window_template 0x00, 0x04, 0x02, 0x16, 0x10, 0x0f, 0x0001 + window_template 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 + .align 2 gUnknown_082F3344:: @ 82F3344 - .incbin "baserom.gba", 0x2f3344, 0x8 + .byte 0x06, 0x08, 0x09, 0x0b, 0x0c, 0x0e, 0x0f, 0x10 + .align 2 gUnknown_082F334C:: @ 82F334C - .incbin "baserom.gba", 0x2f334c, 0x940 + .byte 0x80, 0xf0, 0xfa, 0x02, 0x40, 0x78, 0x7d, 0x01 + .byte 0x20, 0xbc, 0xbe, 0x00, 0x10, 0x5e, 0x5f, 0x00 + .byte 0x08, 0xaf, 0x2f, 0x00, 0x84, 0xd7, 0x17, 0x00 + .byte 0xc2, 0xeb, 0x0b, 0x00, 0xe1, 0xf5, 0x05, 0x00 -gUnknown_082F3C8C:: @ 82F3C8C - .incbin "baserom.gba", 0x2f3c8c, 0x130 + .align 2 +gBerryCrushGrinderBasePal:: @ 82F336C + .incbin "graphics/interface/berrycrush_grinder_base.gbapal" -gUnknown_082F3DBC:: @ 82F3DBC - .incbin "baserom.gba", 0x2f3dbc, 0x198 + .align 2 +gBerryCrushMiscSpritesPal:: @ 82F338C + .incbin "graphics/interface/berrycrush_misc.gbapal" -gUnknown_082F3F54:: @ 82F3F54 - .incbin "baserom.gba", 0x2f3f54, 0x228 + .align 2 +gBerryCrushTimerDigitsPal:: @ 82F33AC + .incbin "graphics/interface/berrycrush_timerdigits.gbapal" + .align 2 +gBerryCrushGrinderBaseGfx:: @ 82F33CC + .incbin "graphics/interface/berrycrush_grinder_base.4bpp.lz" + + .align 2 +gBerryCrushBtnPressGfx:: @ 82F36F8 + .incbin "graphics/interface/berrycrush_btnpress.4bpp.lz" + + .align 2 +gBerryCrushSparkleGfx:: @ 82F3A74 + .incbin "graphics/interface/berrycrush_sparkle.4bpp.lz" + + .align 2 +gBerryCrushTimerDigitsGfx:: @ 82F3BC0 + .incbin "graphics/interface/berrycrush_timerdigits.4bpp.lz" + + .align 2 +gBerryCrushGrinderTopTilemap:: @ 82F3C8C + .incbin "graphics/interface/berrycrush_grinder_top.bin.lz" + + .align 2 +gBerryCrushContainerCapTilemap:: @ 82F3DBC + .incbin "graphics/interface/berrycrush_container_cap.bin.lz" + + .align 2 +gBerryCrushBackgroundTilemap:: @ 82F3F54 + .incbin "graphics/interface/berrycrush_background.bin.lz" + + .align 2 gUnknown_082F417C:: @ 82F417C - .incbin "baserom.gba", 0x2f417c, 0x14 + .byte 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03 + .byte 0x00, 0x00, 0x01, 0x03, 0x02, 0x04, 0x00, 0x00 + .byte 0x01, 0x03, 0x02, 0x04 + .align 2 gUnknown_082F4190:: @ 82F4190 - .incbin "baserom.gba", 0x2f4190, 0x3c + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff + .byte 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x00 + .byte 0xe4, 0xff, 0xfc, 0xff, 0xe8, 0xff, 0x10, 0x00 + .byte 0x02, 0x00, 0x06, 0x00, 0xf0, 0xff, 0x14, 0x00 + .byte 0xf8, 0xff, 0x10, 0x00, 0x03, 0x14, 0x03, 0x00 + .byte 0x1c, 0x00, 0xfc, 0xff, 0x20, 0x00, 0xf8, 0xff + .byte 0x04, 0x14, 0x06, 0x00, 0x10, 0x00, 0x14, 0x00 + .byte 0x10, 0x00, 0xf8, 0xff + .align 2 gUnknown_082F41CC:: @ 82F41CC - .incbin "baserom.gba", 0x2f41cc, 0x1 - -gUnknown_082F41CD:: @ 82F41CD - .incbin "baserom.gba", 0x2f41cd, 0x5 - -gUnknown_082F41D2:: @ 82F41D2 - .incbin "baserom.gba", 0x2f41d2, 0x1 - -gUnknown_082F41D3:: @ 82F41D3 - .incbin "baserom.gba", 0x2f41d3, 0x15 + .byte 0x00, 0x00, 0xff, 0x00, 0x01, 0x01, 0x00, 0x00 + .byte 0xf0, 0xfc, 0x10, 0xfc, 0xf8, 0xfe, 0x08, 0xfe + .byte 0xe8, 0xf8, 0x18, 0xf8, 0xe0, 0xf4, 0x20, 0xf4 + .byte 0xd8, 0xf0, 0x28, 0xf0 + .align 2 gUnknown_082F41E8:: @ 82F41E8 - .incbin "baserom.gba", 0x2f41e8, 0xc + .2byte 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x0000 + .align 2 gUnknown_082F41F4:: @ 82F41F4 - .incbin "baserom.gba", 0x2f41f4, 0x28 + .4byte gBerryCrushGrinderBaseGfx + .2byte 0x0800, 0x0001 + .4byte gBerryCrushBtnPressGfx + .2byte 0x0e00, 0x0002 + + .4byte gBerryCrushSparkleGfx + .2byte 0x0700, 0x0003 + + .align 2 +gUnknown_082F420C:: @ 82F420C + .4byte gBerryCrushTimerDigitsGfx + .2byte 0x02c0, 0x0004 + + .4byte NULL + .2byte 0x0000, 0x0000 + + .align 2 gUnknown_082F421C:: @ 82F421C - .incbin "baserom.gba", 0x2f421c, 0xf0 + .4byte gBerryCrushGrinderBasePal + .2byte 0x0001 + .align 2 + .4byte gBerryCrushMiscSpritesPal + .2byte 0x0002 + + .align 2 +gUnknown_082F422C:: @ 82F422C + .align 2 + .4byte gBerryCrushTimerDigitsPal + .2byte 0x0004 + + .align 2 + .4byte NULL + .2byte 0x0000 + + .align 2 +gUnknown_082F423C:: @ 82F423C + .2byte 0x0000, 0x0000, 0xffff, 0x0000 + + .align 2 +gUnknown_082F4244:: @ 82F4244 + .2byte 0x0000, 0x0004, 0x0010, 0x0004, 0x0020, 0x0004, 0xffff, 0x0000 + + .align 2 +gUnknown_082F4254:: @ 82F4254 + .2byte 0x0030, 0x0002, 0x0040, 0x0002, 0x0050, 0x0002, 0x0060, 0x0002 + .2byte 0xffff, 0x0000 + + .align 2 +gUnknown_082F4268:: @ 82F4268 + .2byte 0x0000, 0x0002, 0x0004, 0x0002, 0x0008, 0x0002, 0x000c, 0x0002 + .2byte 0x0010, 0x0002, 0x0014, 0x0002, 0xfffe, 0x0000 + + .align 2 +gUnknown_082F4284:: @ 82F4284 + .2byte 0x0018, 0x0004, 0x001c, 0x0004, 0x0020, 0x0004, 0x0024, 0x0004 + .2byte 0x0028, 0x0004, 0x002c, 0x0004, 0x0030, 0x0004, 0x0034, 0x0004 + .2byte 0xfffe, 0x0000 + + .align 2 +gUnknown_082F42A8:: @ 82F42A8 + .2byte 0x0014, 0x0000, 0xffff, 0x0000 + + .align 2 +gUnknown_082F42B0:: @ 82F42B0 + .2byte 0x0000, 0x0000, 0xffff, 0x0000 + + .align 2 +gUnknown_082F42B8:: @ 82F42B8 + .2byte 0x0100, 0x0100, 0x0000, 0x0000, 0x0000, 0x0000, 0x0102, 0x0000 + .2byte 0x7ffe, 0x0001, 0x0000, 0x0000 + + .align 2 +gUnknown_082F42D0:: @ 82F42D0 + .2byte 0x0100, 0x0100, 0x0000, 0x0000, 0x0000, 0x0000, 0x01fe, 0x0000 + .2byte 0x7ffe, 0x0001, 0x0000, 0x0000 + + .align 2 +gUnknown_082F42E8:: @ 82F42E8 + .4byte gUnknown_082F423C + + .align 2 +gUnknown_082F42EC:: @ 82F42EC + .4byte gUnknown_082F4244 + .4byte gUnknown_082F4254 + + .align 2 +gUnknown_082F42F4:: @ 82F42F4 + .4byte gUnknown_082F4268 + .4byte gUnknown_082F4284 + + .align 2 +gUnknown_082F42FC:: @ 82F42FC + .4byte gUnknown_082F42A8 + + .align 2 +gUnknown_082F4300:: @ 82F4300 + .4byte gUnknown_082F42B0 + + .align 2 +gUnknown_082F4304:: @ 82F4304 + .4byte gUnknown_082F42B8 + .4byte gUnknown_082F42D0 + + .align 2 gUnknown_082F430C:: @ 82F430C - .incbin "baserom.gba", 0x2f430c, 0x18 + .2byte 0x0001 @ tileTag + .2byte 0x0001 @ paletteTag + .4byte gUnknown_0852491C + .4byte gUnknown_082F42E8 + .4byte NULL + .4byte gDummySpriteAffineAnimTable + .4byte SpriteCallbackDummy + .align 2 gUnknown_082F4324:: @ 82F4324 - .incbin "baserom.gba", 0x2f4324, 0x18 + .2byte 0x0002 @ tileTag + .2byte 0x0002 @ paletteTag + .4byte gUnknown_08524914 + .4byte gUnknown_082F42EC + .4byte NULL + .4byte gDummySpriteAffineAnimTable + .4byte sub_8022A20 + .align 2 gUnknown_082F433C:: @ 82F433C - .incbin "baserom.gba", 0x2f433c, 0x18 + .2byte 0x0003 @ tileTag + .2byte 0x0002 @ paletteTag + .4byte gUnknown_0852490C + .4byte gUnknown_082F42F4 + .4byte NULL + .4byte gDummySpriteAffineAnimTable + .4byte SpriteCallbackDummy + .align 2 gUnknown_082F4354:: @ 82F4354 - .incbin "baserom.gba", 0x2f4354, 0x18 + .2byte 0x0004 @ tileTag + .2byte 0x0004 @ paletteTag + .4byte gUnknown_08524944 + .4byte gUnknown_082F42FC + .4byte NULL + .4byte gDummySpriteAffineAnimTable + .4byte SpriteCallbackDummy + .align 2 gUnknown_082F436C:: @ 82F436C - .incbin "baserom.gba", 0x2f436c, 0x18 + .2byte 0x0005 @ tileTag + .2byte 0x0005 @ paletteTag + .4byte gUnknown_085249D4 + .4byte gUnknown_082F4300 + .4byte NULL + .4byte gUnknown_082F4304 + .4byte SpriteCallbackDummy + .align 2 gUnknown_082F4384:: @ 82F4384 - .incbin "baserom.gba", 0x2f4384, 0x30 + .byte 0x09, 0x02, 0x08, 0x00, 0x9c, 0x00, 0x00, 0x00 + .4byte gUnknown_082F420C + .4byte gUnknown_082F422C + .byte 0x08, 0x02, 0x08, 0x00, 0xb4, 0x00, 0x00, 0x00 + .4byte gUnknown_082F420C + .4byte gUnknown_082F422C + + .byte 0x08, 0x02, 0x08, 0x00, 0xcc, 0x00, 0x00, 0x00 + .4byte gUnknown_082F420C + .4byte gUnknown_082F422C + + .align 2 gUnknown_082F43B4:: @ 82F43B4 - .incbin "baserom.gba", 0x2f43b4, 0x18 + .4byte gUnknown_085ED7E8 + .4byte gUnknown_085ED7F4 + .4byte gUnknown_085ED7FC + .4byte gUnknown_085ED88C + .4byte gUnknown_085ED8A0 + .4byte gUnknown_085ED8B8 + .align 2 gUnknown_082F43CC:: @ 82F43CC - .incbin "baserom.gba", 0x2f43cc, 0x68 + .4byte NULL + .4byte sub_8022C58 + .4byte sub_8022CB0 + .4byte sub_8022D14 + .4byte sub_8022E1C + .4byte sub_8022E3C + .4byte sub_8022E5C + .4byte sub_8022EAC + .4byte sub_8022F04 + .4byte sub_8022F1C + .4byte sub_8023070 + .4byte sub_80231B8 + .4byte sub_80232EC + .4byte sub_80238F0 + .4byte sub_8023998 + .4byte sub_8023A30 + .4byte sub_8023BC0 + .4byte sub_8023CAC + .4byte sub_8024048 + .4byte sub_8024134 + .4byte sub_8024228 + .4byte sub_80242E0 + .4byte sub_80243BC + .4byte sub_8024444 + .4byte sub_8024508 + .4byte sub_8024568 + .align 2 gUnknown_082F4434:: @ 82F4434 - .incbin "baserom.gba", 0x2f4434, 0x10 + .byte 0x02, 0x04, 0x06, 0x07, 0x03, 0x05, 0x08, 0x0b + .byte 0x03, 0x07, 0x0b, 0x0f, 0x04, 0x08, 0x0c, 0x11 gUnknown_082F4444:: @ 82F4444 - .incbin "baserom.gba", 0x2f4444, 0x4 + .byte 0x05, 0x07, 0x09, 0x0c gUnknown_082F4448:: @ 82F4448 - .incbin "baserom.gba", 0x2f4448, 0x54 + .byte 0x03, 0x07, 0x0f, 0x1f + .align 2 +gUnknown_082F7BA4_UnrefDupe:: @ 82F444C struct BgTemplate + .4byte 0x000001e0 + .4byte 0x000012c9 + .4byte 0x000012ea + .4byte 0x000021ff + .4byte 0x000000ff + .4byte 0x00000000 + + .align 2 +gUnknown_082F7BBC_UnrefDupe:: @ 82F4464 + window_template 0x00, 0x01, 0x01, 0x1c, 0x02, 0x0d, 0x0013 + window_template 0x00, 0x01, 0x05, 0x1c, 0x0e, 0x0d, 0x004b + + .align 2 +gUnknown_082F7BCC_UnrefDupe:: @ 82F4474 + window_template 0x00, 0x01, 0x05, 0x1c, 0x07, 0x0d, 0x004b + + .align 2 +gUnknown_082F7BD4_UnrefDupe:: @ 82F447C + window_template 0x00, 0x01, 0x08, 0x13, 0x03, 0x0d, 0x0013 + window_template 0x00, 0x16, 0x07, 0x06, 0x04, 0x0d, 0x004c + + .align 2 +gUnknown_082F7BE4_UnrefDupe:: @ 82F448C + window_template 0x00, 0x04, 0x06, 0x16, 0x05, 0x0d, 0x0013 + + .align 2 +gUnknown_082F7BEC_UnrefDupe:: @ 82F4494 + window_template 0x00, 0x05, 0x08, 0x13, 0x03, 0x0d, 0x0013 + + .align 2 gUnknown_082F449C:: @ 82F449C - .incbin "baserom.gba", 0x2f449c, 0x113 + .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 + .byte 0x08, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x03, 0x08 + .byte 0x09, 0x00, 0x00, 0x01, 0x02, 0x05, 0x06, 0x03 + .byte 0x04, 0x05, 0x08, 0x09, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 + .byte 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x02, 0x09 + .byte 0x00, 0x00, 0x01, 0x04, 0x05, 0x06, 0x07, 0x02 + .byte 0x03, 0x04, 0x09, 0x00, 0x00, 0x01, 0x06, 0x07 + .byte 0x02, 0x03, 0x04, 0x05, 0x06, 0x09, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02 + .byte 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x01, 0x00 + .byte 0x00, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x01 + .byte 0x02, 0x03, 0x00, 0x00, 0x05, 0x06, 0x07, 0x08 + .byte 0x01, 0x02, 0x03, 0x04, 0x05, 0x00, 0x00, 0x07 + .byte 0x08, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03 + .byte 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x00, 0x02 + .byte 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x00 + .byte 0x01, 0x02, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09 + .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x06, 0x07, 0x08 + .byte 0x09, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 + .byte 0x08, 0x09, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05 + .byte 0x06, 0x07, 0x08, 0x04, 0x05, 0x06, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x03, 0x04, 0x05, 0x05, 0x06, 0x03 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x04, 0x05, 0x06, 0x06, 0x07, 0x02, 0x02 + .byte 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x03, 0x04, 0x05, 0x05, 0x06, 0x07, 0x07, 0x08 + .byte 0x01, 0x01, 0x02, 0x03, 0x00, 0x00, 0x00, 0x04 + .byte 0x05, 0x06, 0x06, 0x07, 0x08, 0x08, 0x09, 0x00 + .byte 0x00, 0x01, 0x02, 0x02, 0x03, 0x04, 0x01, 0x00 + .byte 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01 + .byte 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00 + .byte 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x03, 0x00, 0x01, 0x00, 0x01 + .byte 0x02, 0x01, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00 + .byte 0x00, 0x00, 0x04, 0x00, 0x01, 0x00, 0x01, 0x02 + .byte 0x01, 0x02, 0x03, 0x02, 0x03, 0x04, 0x03, 0x04 + .byte 0x00, 0x00, 0x00, 0x00, 0x09, 0x09, 0x09, 0x09 + .byte 0x01, 0x01, 0x01, 0x09, 0x09, 0x09, 0x09, 0x09 + .byte 0x09, 0x09, 0x00, 0x00, 0x01, 0x01, 0x00, 0x09 + .byte 0x09, 0x09, 0x09, 0x09, 0x02, 0x02, 0x00, 0x00 + .byte 0x01, 0x01, 0x01, 0x09, 0x09, 0x09, 0x03, 0x03 + .byte 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x09 + .byte 0x03, 0x03, 0x04, 0x04, 0x00, 0x00, 0x01, 0x01 + .byte 0x02, 0x02, 0x03, 0x05, 0x00, 0x00, 0x00, 0x00 + .byte 0x04, 0x06, 0x00, 0x00, 0x00, 0x03, 0x05, 0x07 + .byte 0x00, 0x00, 0x02, 0x04, 0x06, 0x08, 0x00, 0x01 + .byte 0x03, 0x05, 0x06, 0x09 -gUnknown_082F45AF:: @ 82F45AF - .incbin "baserom.gba", 0x2f45af, 0x4b + .align 2 +gUnknown_082F7DF0_UnrefDupe:: @ 82F4698 + .incbin "graphics/interface/dodrioberry_bg1.gbapal" -gUnknown_082F45FA:: @ 82F45FA - .incbin "baserom.gba", 0x2f45fa, 0x4e + .align 2 + .incbin "graphics/interface/dodrioberry_bg2.gbapal" -gUnknown_082F4648:: @ 82F4648 - .incbin "baserom.gba", 0x2f4648, 0x37 + .align 2 +gUnknown_082F7E30_UnrefDupe:: @ 82F46B8 + .incbin "graphics/interface/dodrioberry_pkmn.gbapal" -gUnknown_082F467F:: @ 82F467F - .incbin "baserom.gba", 0x2f467f, 0x3409 + .align 2 +gUnknown_082F7E50_UnrefDupe:: @ 82F46D8 + .incbin "graphics/interface/dodrioberry_shiny.gbapal" + .align 2 +gUnknown_082F7E70_UnrefDupe:: @ 82F46F8 + .incbin "graphics/interface/dodrioberry_status.gbapal" + + .align 2 +gUnknown_082F7E90_UnrefDupe:: @ 82F4718 + .incbin "graphics/interface/dodrioberry_berrysprites.gbapal" + + .align 2 +gUnknown_082F7EB0_UnrefDupe:: @ 82F4738 + .incbin "graphics/interface/dodrioberry_berrysprites.4bpp.lz" + + .align 2 +gUnknown_082F8064_UnrefDupe:: @ 82F490C + .incbin "graphics/interface/dodrioberry_platform.gbapal" + + .align 2 +gUnknown_082F8084_UnrefDupe:: @ 82F492C + .incbin "graphics/interface/dodrioberry_bg1.4bpp.lz" + + .align 2 +gUnknown_082F8914_UnrefDupe:: @ 82F51BC + .incbin "graphics/interface/dodrioberry_bg2.4bpp.lz" + + .align 2 +gUnknown_082F96E0_UnrefDupe:: @ 82F5F88 + .incbin "graphics/interface/dodrioberry_status.4bpp.lz" + + .align 2 +gUnknown_082F9774_UnrefDupe:: @ 82F601C + .incbin "graphics/interface/dodrioberry_platform.4bpp.lz" + + .align 2 +gUnknown_082F98BC_UnrefDupe:: @ 82F6164 + .incbin "graphics/interface/dodrioberry_pkmn.4bpp.lz" + + .align 2 +gUnknown_082FAAD8_UnrefDupe:: @ 82F7380 + .incbin "graphics/interface/dodrioberry_bg1.bin.lz" + + .align 2 +gUnknown_082FAD44_UnrefDupe:: @ 82F75EC + .incbin "graphics/interface/dodrioberry_bg2right.bin.lz" + + .align 2 +gUnknown_082FAF94_UnrefDupe:: @ 82F783C + .incbin "graphics/interface/dodrioberry_bg2left.bin.lz" + + .align 2 gUnknown_082F7A88:: @ 82F7A88 - .incbin "baserom.gba", 0x2f7a88, 0xc + .byte 0x28, 0x18, 0x0d, 0x20, 0x13, 0x0a, 0x16, 0x0d + .byte 0x07, 0x00, 0x00, 0x00 + .align 2 gUnknown_082F7A94:: @ 82F7A94 - .incbin "baserom.gba", 0x2f7a94, 0x8 + .byte 0x08, 0x05, 0x08, 0x0b, 0x0f, 0x00, 0x00, 0x00 + .align 2 gUnknown_082F7A9C:: @ 82F7A9C - .incbin "baserom.gba", 0x2f7a9c, 0x8 + .byte 0x05, 0x0a, 0x14, 0x1e, 0x32, 0x46, 0x64, 0x00 + .align 2 gUnknown_082F7AA4:: @ 82F7AA4 - .incbin "baserom.gba", 0x2f7aa4, 0x20 + .byte 0x0f, 0x10, 0x11, 0x12, 0x13, 0x13, 0x12, 0x11 + .byte 0x10, 0x0f, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19 + .byte 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21 + .byte 0x22, 0x22, 0x21, 0x20, 0x1f, 0x1e, 0x00, 0x00 + .align 2 gUnknown_082F7AC4:: @ 82F7AC4 - .incbin "baserom.gba", 0x2f7ac4, 0x30 + .4byte sub_8024DBC + .4byte sub_8024E00 + .4byte sub_8024E38 + .4byte sub_8024F10 + .4byte sub_8024F38 + .4byte sub_8025198 + .4byte sub_8025324 + .4byte sub_8025470 + .4byte sub_8025644 + .4byte sub_80256AC + .4byte sub_8025758 + .4byte sub_80250D4 + .align 2 gUnknown_082F7AF4:: @ 82F7AF4 - .incbin "baserom.gba", 0x2f7af4, 0x30 + .4byte sub_8024DBC + .4byte sub_8024E00 + .4byte sub_8024E38 + .4byte sub_8024F10 + .4byte sub_8024FFC + .4byte sub_8025230 + .4byte sub_8025324 + .4byte sub_8025470 + .4byte sub_8025644 + .4byte sub_80256AC + .4byte sub_8025758 + .4byte sub_8025158 + .align 2 gUnknown_082F7B24:: @ 82F7B24 - .incbin "baserom.gba", 0x2f7b24, 0x8 + .2byte 0x000a, 0x001e, 0x0032, 0x0032 + .align 2 gUnknown_082F7B2C:: @ 82F7B2C - .incbin "baserom.gba", 0x2f7b2c, 0x8 + .byte 0x00, 0x05, 0x01, 0x14, 0x0b, 0x0f, 0x01, 0x00 + .align 2 gUnknown_082F7B34:: @ 82F7B34 - .incbin "baserom.gba", 0x2f7b34, 0xc + .4byte gUnknown_085EDD02 + .4byte gUnknown_085EDD12 + .4byte gUnknown_085EDD1E + .align 2 gUnknown_082F7B40:: @ 82F7B40 - .incbin "baserom.gba", 0x2f7b40, 0x4 + .byte 0x04, 0x07, 0x04, 0x00 + .align 2 gUnknown_082F7B44:: @ 82F7B44 - .incbin "baserom.gba", 0x2f7b44, 0x6 + .2byte 0x0019, 0x0029, 0x0039 gUnknown_082F7B4A:: @ 82F7B4A - .incbin "baserom.gba", 0x2f7b4a, 0x6 + .2byte 0x0019, 0x0029, 0x0049 + .align 2 gUnknown_082F7B50:: @ 82F7B50 - .incbin "baserom.gba", 0x2f7b50, 0x40 + .2byte 0x270f, 0x0000, 0x005a, 0x270f, 0x270f, 0x270f, 0x0046, 0x270f + .2byte 0x270f, 0x0000, 0x270f, 0x0000, 0x270f, 0x270f, 0x003c, 0x0000 + .2byte 0x270f, 0x270f, 0x270f, 0x0000 + .align 2 +gUnknown_082F7B78:: @ 82F7B78 + .string "ÀÁÂÇÈÉÊ$" + + .align 2 +gUnknown_082F7B80:: @ 82F7B80 + .string "ABCDEFG$" + + .align 2 +gUnknown_082F7B88:: @ 82F7B88 + .string "0123456$" + + .align 2 gUnknown_082F7B90:: @ 82F7B90 - .incbin "baserom.gba", 0x2f7b90, 0x14 + .4byte gUnknown_082F7B78 + .4byte gUnknown_082F7B78 + .4byte gUnknown_082F7B78 + .4byte gUnknown_082F7B80 + .4byte gUnknown_082F7B88 -gUnknown_082F7BA4:: @ 82F7BA4 - .incbin "baserom.gba", 0x2f7ba4, 0x18 + .align 2 +gUnknown_082F7BA4:: @ 82F7BA4 struct BgTemplate + .4byte 0x000001e0 + .4byte 0x000012c9 + .4byte 0x000012ea + .4byte 0x000021ff + .4byte 0x000000ff + .4byte 0x00000000 + .align 2 gUnknown_082F7BBC:: @ 82F7BBC - .incbin "baserom.gba", 0x2f7bbc, 0x10 + window_template 0x00, 0x01, 0x01, 0x1c, 0x02, 0x0d, 0x0013 + window_template 0x00, 0x01, 0x05, 0x1c, 0x0e, 0x0d, 0x004b + .align 2 gUnknown_082F7BCC:: @ 82F7BCC - .incbin "baserom.gba", 0x2f7bcc, 0x8 + window_template 0x00, 0x01, 0x05, 0x1c, 0x07, 0x0d, 0x004b + .align 2 gUnknown_082F7BD4:: @ 82F7BD4 - .incbin "baserom.gba", 0x2f7bd4, 0x10 + window_template 0x00, 0x01, 0x08, 0x13, 0x03, 0x0d, 0x0013 + window_template 0x00, 0x16, 0x07, 0x06, 0x04, 0x0d, 0x004c + .align 2 gUnknown_082F7BE4:: @ 82F7BE4 - .incbin "baserom.gba", 0x2f7be4, 0x8 + window_template 0x00, 0x04, 0x06, 0x16, 0x05, 0x0d, 0x0013 + .align 2 gUnknown_082F7BEC:: @ 82F7BEC - .incbin "baserom.gba", 0x2f7bec, 0x204 + window_template 0x00, 0x05, 0x08, 0x13, 0x03, 0x0d, 0x0013 -gUnknown_082F7DF0:: @ 82F7DF0 - .incbin "baserom.gba", 0x2f7df0, 0xc0 + .align 2 +gUnknown_082F449C_UnrefDupe:: @ 82F7BF4 + .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 + .byte 0x08, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x03, 0x08 + .byte 0x09, 0x00, 0x00, 0x01, 0x02, 0x05, 0x06, 0x03 + .byte 0x04, 0x05, 0x08, 0x09, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 + .byte 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x02, 0x09 + .byte 0x00, 0x00, 0x01, 0x04, 0x05, 0x06, 0x07, 0x02 + .byte 0x03, 0x04, 0x09, 0x00, 0x00, 0x01, 0x06, 0x07 + .byte 0x02, 0x03, 0x04, 0x05, 0x06, 0x09, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02 + .byte 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x01, 0x00 + .byte 0x00, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x01 + .byte 0x02, 0x03, 0x00, 0x00, 0x05, 0x06, 0x07, 0x08 + .byte 0x01, 0x02, 0x03, 0x04, 0x05, 0x00, 0x00, 0x07 + .byte 0x08, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03 + .byte 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x00, 0x02 + .byte 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x00 + .byte 0x01, 0x02, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09 + .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x06, 0x07, 0x08 + .byte 0x09, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 + .byte 0x08, 0x09, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05 + .byte 0x06, 0x07, 0x08, 0x04, 0x05, 0x06, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x03, 0x04, 0x05, 0x05, 0x06, 0x03 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x04, 0x05, 0x06, 0x06, 0x07, 0x02, 0x02 + .byte 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x03, 0x04, 0x05, 0x05, 0x06, 0x07, 0x07, 0x08 + .byte 0x01, 0x01, 0x02, 0x03, 0x00, 0x00, 0x00, 0x04 + .byte 0x05, 0x06, 0x06, 0x07, 0x08, 0x08, 0x09, 0x00 + .byte 0x00, 0x01, 0x02, 0x02, 0x03, 0x04, 0x01, 0x00 + .byte 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01 + .byte 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00 + .byte 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x03, 0x00, 0x01, 0x00, 0x01 + .byte 0x02, 0x01, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00 + .byte 0x00, 0x00, 0x04, 0x00, 0x01, 0x00, 0x01, 0x02 + .byte 0x01, 0x02, 0x03, 0x02, 0x03, 0x04, 0x03, 0x04 + .byte 0x00, 0x00, 0x00, 0x00, 0x09, 0x09, 0x09, 0x09 + .byte 0x01, 0x01, 0x01, 0x09, 0x09, 0x09, 0x09, 0x09 + .byte 0x09, 0x09, 0x00, 0x00, 0x01, 0x01, 0x00, 0x09 + .byte 0x09, 0x09, 0x09, 0x09, 0x02, 0x02, 0x00, 0x00 + .byte 0x01, 0x01, 0x01, 0x09, 0x09, 0x09, 0x03, 0x03 + .byte 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x09 + .byte 0x03, 0x03, 0x04, 0x04, 0x00, 0x00, 0x01, 0x01 + .byte 0x02, 0x02, 0x03, 0x05, 0x00, 0x00, 0x00, 0x00 + .byte 0x04, 0x06, 0x00, 0x00, 0x00, 0x03, 0x05, 0x07 + .byte 0x00, 0x00, 0x02, 0x04, 0x06, 0x08, 0x00, 0x01 + .byte 0x03, 0x05, 0x06, 0x09 -gUnknown_082F7EB0:: @ 82F7EB0 - .incbin "baserom.gba", 0x2f7eb0, 0x1d4 + .align 2 +gDodrioBerryBgPal1:: @ 82F7DF0 + .incbin "graphics/interface/dodrioberry_bg1.gbapal" -gUnknown_082F8084:: @ 82F8084 - .incbin "baserom.gba", 0x2f8084, 0x890 + .align 2 + .incbin "graphics/interface/dodrioberry_bg2.gbapal" -gUnknown_082F8914:: @ 82F8914 - .incbin "baserom.gba", 0x2f8914, 0xdcc + .align 2 +gDodrioBerryPkmnPal:: @ 82F7E30 + .incbin "graphics/interface/dodrioberry_pkmn.gbapal" -gUnknown_082F96E0:: @ 82F96E0 - .incbin "baserom.gba", 0x2f96e0, 0x94 + .align 2 +gDodrioBerryShinyPal:: @ 82F7E50 + .incbin "graphics/interface/dodrioberry_shiny.gbapal" -gUnknown_082F9774:: @ 82F9774 - .incbin "baserom.gba", 0x2f9774, 0x148 + .align 2 +gDodrioBerryStatusPal:: @ 82F7E70 + .incbin "graphics/interface/dodrioberry_status.gbapal" -gUnknown_082F98BC:: @ 82F98BC - .incbin "baserom.gba", 0x2f98bc, 0x121c + .align 2 +gDodrioBerrySpritesPal:: @ 82F7E90 + .incbin "graphics/interface/dodrioberry_berrysprites.gbapal" -gUnknown_082FAAD8:: @ 82FAAD8 - .incbin "baserom.gba", 0x2faad8, 0x26c + .align 2 +gDodrioBerrySpritesGfx:: @ 82F7EB0 + .incbin "graphics/interface/dodrioberry_berrysprites.4bpp.lz" -gUnknown_082FAD44:: @ 82FAD44 - .incbin "baserom.gba", 0x2fad44, 0x250 + .align 2 +gDodrioBerryPlatformPal:: @ 82F8064 + .incbin "graphics/interface/dodrioberry_platform.gbapal" -gUnknown_082FAF94:: @ 82FAF94 - .incbin "baserom.gba", 0x2faf94, 0x24c + .align 2 +gDodrioBerryBgGfx1:: @ 82F8084 + .incbin "graphics/interface/dodrioberry_bg1.4bpp.lz" + .align 2 +gDodrioBerryBgGfx2:: @ 82F8914 + .incbin "graphics/interface/dodrioberry_bg2.4bpp.lz" + + .align 2 +gDodrioBerryStatusGfx:: @ 82F96E0 + .incbin "graphics/interface/dodrioberry_status.4bpp.lz" + + .align 2 +gDodrioBerryPlatformGfx:: @ 82F9774 + .incbin "graphics/interface/dodrioberry_platform.4bpp.lz" + + .align 2 +gDodrioBerryPkmnGfx:: @ 82F98BC + .incbin "graphics/interface/dodrioberry_pkmn.4bpp.lz" + + .align 2 +gDodrioBerryBgTilemap1:: @ 82FAAD8 + .incbin "graphics/interface/dodrioberry_bg1.bin.lz" + + .align 2 +gDodrioBerryBgTilemap2Right:: @ 82FAD44 + .incbin "graphics/interface/dodrioberry_bg2right.bin.lz" + + .align 2 +gDodrioBerryBgTilemap2Left:: @ 82FAF94 + .incbin "graphics/interface/dodrioberry_bg2left.bin.lz" + + .align 2 gUnknown_082FB1E0:: @ 82FB1E0 - .incbin "baserom.gba", 0x2fb1e0, 0x48 + .byte 0x00, 0x00, 0x00, 0xc0, 0x00, 0x08, 0x00, 0x00 + .align 2 +gUnknown_082FB1E8:: @ 82FB1E8 + .byte 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00 + + .align 2 +gUnknown_082FB1F0:: @ 82FB1F0 + .byte 0x00, 0x00, 0x00, 0x40, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_082FB1F8:: @ 82FB1F8 + .byte 0x00, 0x40, 0x00, 0xc0, 0x00, 0x0c, 0x00, 0x00 + + .align 2 +gUnknown_082FB200:: @ 82FB200 + .2byte 0x0000, 0x0014 + .2byte 0xfffe, 0x0000 + + .align 2 +gUnknown_082FB208:: @ 82FB208 + .2byte 0x0040, 0x0014 + .2byte 0xfffe, 0x0000 + + .align 2 +gUnknown_082FB210:: @ 82FB210 + .2byte 0x0080, 0x0014 + .2byte 0xfffe, 0x0000 + + .align 2 +gUnknown_082FB218:: @ 82FB218 + .2byte 0x00c0, 0x0014 + .2byte 0xfffe, 0x0000 + + .align 2 +gUnknown_082FB220:: @ 82FB220 + .2byte 0x0100, 0x0014 + .2byte 0xfffe, 0x0000 + + .align 2 gUnknown_082FB228:: @ 82FB228 - .incbin "baserom.gba", 0x2fb228, 0xb0 + .4byte gUnknown_082FB200 + .4byte gUnknown_082FB208 + .4byte gUnknown_082FB210 + .4byte gUnknown_082FB218 + .4byte gUnknown_082FB220 + .align 2 +gUnknown_082FB23C:: @ 82FB23C + .2byte 0x0000, 0x0014 + .2byte 0xfffe, 0x0000 + + .align 2 +gUnknown_082FB244:: @ 82FB244 + .2byte 0x0004, 0x0014 + .2byte 0xfffe, 0x0000 + + .align 2 +gUnknown_082FB24C:: @ 82FB24C + .2byte 0x0008, 0x0014 + .2byte 0xfffe, 0x0000 + + .align 2 +gUnknown_082FB254:: @ 82FB254 + .4byte gUnknown_082FB23C + .4byte gUnknown_082FB244 + .4byte gUnknown_082FB24C + + .align 2 +gUnknown_082FB260:: @ 82FB260 + .2byte 0x0000, 0x0014 + .2byte 0xfffe, 0x0000 + + .align 2 +gUnknown_082FB268:: @ 82FB268 + .2byte 0x0004, 0x0014 + .2byte 0xfffe, 0x0000 + + .align 2 +gUnknown_082FB270:: @ 82FB270 + .2byte 0x0008, 0x0014 + .2byte 0xfffe, 0x0000 + + .align 2 +gUnknown_082FB278:: @ 82FB278 + .2byte 0x000c, 0x0014 + .2byte 0xfffe, 0x0000 + + .align 2 +gUnknown_082FB280:: @ 82FB280 + .2byte 0x0010, 0x0014 + .2byte 0xfffe, 0x0000 + + .align 2 +gUnknown_082FB288:: @ 82FB288 + .2byte 0x0014, 0x0014 + .2byte 0xfffe, 0x0000 + + .align 2 +gUnknown_082FB290:: @ 82FB290 + .2byte 0x0018, 0x0014 + .2byte 0xfffe, 0x0000 + + .align 2 +gUnknown_082FB298:: @ 82FB298 + .2byte 0x001c, 0x0014 + .2byte 0xfffe, 0x0000 + + .align 2 +gUnknown_082FB2A0:: @ 82FB2A0 + .2byte 0x0020, 0x0014 + .2byte 0xfffe, 0x0000 + + .align 2 +gUnknown_082FB2A8:: @ 82FB2A8 + .4byte gUnknown_082FB260 + .4byte gUnknown_082FB268 + .4byte gUnknown_082FB270 + .4byte gUnknown_082FB278 + .4byte gUnknown_082FB280 + .4byte gUnknown_082FB288 + .4byte gUnknown_082FB290 + .4byte gUnknown_082FB298 + .4byte gUnknown_082FB2A0 + + .align 2 +gUnknown_082FB2CC:: @ 82FB2CC + .2byte 0x0000, 0x0014 + .2byte 0xfffe, 0x0000 + + .align 2 +gUnknown_082FB2D4:: @ 82FB2D4 + .4byte gUnknown_082FB2CC + + .align 2 gUnknown_082FB2D8:: @ 82FB2D8 - .incbin "baserom.gba", 0x2fb2d8, 0x8 + .4byte gDodrioBerryPkmnPal + .2byte 0x0000 + .align 2 gUnknown_082FB2E0:: @ 82FB2E0 - .incbin "baserom.gba", 0x2fb2e0, 0x8 + .4byte gDodrioBerryShinyPal + .2byte 0x0001 + .align 2 gUnknown_082FB2E8:: @ 82FB2E8 - .incbin "baserom.gba", 0x2fb2e8, 0x8 + .4byte gDodrioBerryStatusPal + .2byte 0x0002 -gUnknown_082FB2F0:: @ 82FB2F0 - .incbin "baserom.gba", 0x2fb2f0, 0x24 + .align 2 +gUnknown_082FB2F0:: @ 82FB2F0 struct SpriteTemplate + .2byte 0x0001 @ tileTag + .2byte 0x0002 @ paletteTag + .4byte gUnknown_082FB1E8 + .4byte gUnknown_082FB254 + .4byte NULL + .4byte gDummySpriteAffineAnimTable + .4byte nullsub_15 + .align 2 + .byte 0xD4, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44 + .byte 0x45, 0xFB, 0x00, 0x00 + + .align 2 gUnknown_082FB314:: @ 82FB314 - .incbin "baserom.gba", 0x2fb314, 0x8 + .4byte gDodrioBerrySpritesPal + .2byte 0x0003 + .align 2 gUnknown_082FB31C:: @ 82FB31C - .incbin "baserom.gba", 0x2fb31c, 0x8 + .2byte 0x0058, 0x0080, 0x00a8, 0x00d0 -gUnknown_082FB324:: @ 82FB324 - .incbin "baserom.gba", 0x2fb324, 0x18 + .align 2 +gUnknown_082FB324:: @ 82FB324 struct SpriteTemplate + .2byte 0x0002 @ tileTag + .2byte 0x0003 @ paletteTag + .4byte gUnknown_082FB1F0 + .4byte gUnknown_082FB2A8 + .4byte NULL + .4byte gDummySpriteAffineAnimTable + .4byte SpriteCallbackDummy -gUnknown_082FB33C:: @ 82FB33C - .incbin "baserom.gba", 0x2fb33c, 0x18 + .align 2 +gUnknown_082FB33C:: @ 82FB33C struct SpriteTemplate + .2byte 0x0002 @ tileTag + .2byte 0x0003 @ paletteTag + .4byte gUnknown_082FB1E8 + .4byte gUnknown_082FB2A8 + .4byte NULL + .4byte gDummySpriteAffineAnimTable + .4byte SpriteCallbackDummy + .align 2 gUnknown_082FB354:: @ 82FB354 - .incbin "baserom.gba", 0x2fb354, 0x2 + .byte 0x1E, 0x14 gUnknown_082FB356:: @ 82FB356 - .incbin "baserom.gba", 0x2fb356, 0xa + .byte 0xE6, 0x00 + .align 2 +gUnknown_082FB358:: @ 82FB358 + .2byte 0x0037, 0x001e, 0x004a, 0x0000 + + .align 2 gUnknown_082FB360:: @ 82FB360 - .incbin "baserom.gba", 0x2fb360, 0x8 + .4byte gDodrioBerryPlatformPal + .2byte 0x0006 -gUnknown_082FB368:: @ 82FB368 - .incbin "baserom.gba", 0x2fb368, 0x18 + .align 2 +gUnknown_082FB368:: @ 82FB368 struct SpriteTemplate + .2byte 0x0005 @ tileTag + .2byte 0x0006 @ paletteTag + .4byte gUnknown_082FB1F8 + .4byte gUnknown_082FB2D4 + .4byte NULL + .4byte gDummySpriteAffineAnimTable + .4byte sub_8028CF4 + .align 2 gUnknown_082FB380:: @ 82FB380 - .incbin "baserom.gba", 0x2fb380, 0x3 + .byte 0x01, 0x02, 0x03 gUnknown_082FB383:: @ 82FB383 - .incbin "baserom.gba", 0x2fb383, 0x45 + .byte 0x01, 0x04, 0x05 + .byte 0x01, 0x08, 0x09 + .byte 0x01, 0x06, 0x07 + .align 2 +gUnknown_082FB38C:: @ 82FB38C + .byte 0x0c, 0x06, 0x00, 0x00 + + .align 2 +gUnknown_082FB390:: @ 82FB390 + .byte 0x09, 0x0a, 0x00, 0x00, 0x0f, 0x06, 0x00, 0x00 + + .align 2 +gUnknown_082FB398:: @ 82FB398 + .byte 0x0c, 0x06, 0x00, 0x00, 0x12, 0x0a, 0x00, 0x00 + .byte 0x06, 0x0a, 0x00, 0x00 + + .align 2 +gUnknown_082FB3A4:: @ 82FB3A4 + .byte 0x09, 0x0a, 0x00, 0x00, 0x0f, 0x06, 0x00, 0x00 + .byte 0x15, 0x0a, 0x00, 0x00, 0x03, 0x06, 0x00, 0x00 + + .align 2 +gUnknown_082FB3B4:: @ 82FB3B4 + .byte 0x0c, 0x06, 0x00, 0x00, 0x12, 0x0a, 0x00, 0x00 + .byte 0x17, 0x06, 0x00, 0x00, 0x01, 0x06, 0x00, 0x00 + .byte 0x06, 0x0a, 0x00, 0x00 + + .align 2 gUnknown_082FB3C8:: @ 82FB3C8 - .incbin "baserom.gba", 0x2fb3c8, 0x14 + .4byte gUnknown_082FB38C + .4byte gUnknown_082FB390 + .4byte gUnknown_082FB398 + .4byte gUnknown_082FB3A4 + .4byte gUnknown_082FB3B4 + .align 2 gUnknown_082FB3DC:: @ 82FB3DC - .incbin "baserom.gba", 0x2fb3dc, 0x14 + .4byte gUnknown_085EDDAE + .4byte gUnknown_085EDDB1 + .4byte gUnknown_085EDDB4 + .4byte gUnknown_085EDDB7 + .4byte gUnknown_085EDDBA + .align 2 gUnknown_082FB3F0:: @ 82FB3F0 - .incbin "baserom.gba", 0x2fb3f0, 0x8 + .2byte 0x005c, 0x0084, 0x00ac, 0x00d4 gUnknown_082FB3F8:: @ 82FB3F8 - .incbin "baserom.gba", 0x2fb3f8, 0xa + .2byte 0x0021, 0x0031, 0x0041, 0x0051, 0x0061 gUnknown_082FB402:: @ 82FB402 - .incbin "baserom.gba", 0x2fb402, 0xa + .2byte 0x0011, 0x0021, 0x0031, 0x0041, 0x0051 + .align 2 gUnknown_082FB40C:: @ 82FB40C - .incbin "baserom.gba", 0x2fb40c, 0x50 + .4byte 0x00000000, sub_8029338 + .4byte 0x00000001, sub_8029440 + .4byte 0x00000002, sub_802988C + .4byte 0x00000003, sub_802A010 + .4byte 0x00000004, sub_802A380 + .4byte 0x00000005, sub_802A454 + .4byte 0x00000006, sub_802A534 + .4byte 0x00000007, sub_802A588 + .4byte 0x00000008, unused_0 + .4byte 0x00000009, nullsub_16 + .align 2 gUnknown_082FB45C:: @ 82FB45C - .incbin "baserom.gba", 0x2fb45c, 0x8 + .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00 -gUnknown_082FB464:: @ 82FB464 - .incbin "baserom.gba", 0x2fb464, 0x190 + .align 2 +gPkmnJumpSpecies:: @ 82FB464 + .2byte SPECIES_BULBASAUR, 0x0002 + .2byte SPECIES_CHARMANDER, 0x0001 + .2byte SPECIES_SQUIRTLE, 0x0000 + .2byte SPECIES_CATERPIE, 0x0001 + .2byte SPECIES_METAPOD, 0x0001 + .2byte SPECIES_WEEDLE, 0x0001 + .2byte SPECIES_KAKUNA, 0x0001 + .2byte SPECIES_RATTATA, 0x0001 + .2byte SPECIES_RATICATE, 0x0001 + .2byte SPECIES_PIKACHU, 0x0000 + .2byte SPECIES_SANDSHREW, 0x0000 + .2byte SPECIES_NIDORAN_F, 0x0000 + .2byte SPECIES_NIDORAN_M, 0x0000 + .2byte SPECIES_CLEFAIRY, 0x0000 + .2byte SPECIES_VULPIX, 0x0000 + .2byte SPECIES_JIGGLYPUFF, 0x0002 + .2byte SPECIES_ODDISH, 0x0002 + .2byte SPECIES_PARAS, 0x0001 + .2byte SPECIES_MEOWTH, 0x0000 + .2byte SPECIES_PSYDUCK, 0x0002 + .2byte SPECIES_MANKEY, 0x0001 + .2byte SPECIES_GROWLITHE, 0x0001 + .2byte SPECIES_POLIWAG, 0x0002 + .2byte SPECIES_BELLSPROUT, 0x0002 + .2byte SPECIES_SHELLDER, 0x0001 + .2byte SPECIES_KRABBY, 0x0001 + .2byte SPECIES_EXEGGCUTE, 0x0002 + .2byte SPECIES_CUBONE, 0x0000 + .2byte SPECIES_DITTO, 0x0002 + .2byte SPECIES_EEVEE, 0x0000 + .2byte SPECIES_OMANYTE, 0x0001 + .2byte SPECIES_KABUTO, 0x0001 + .2byte SPECIES_CHIKORITA, 0x0002 + .2byte SPECIES_CYNDAQUIL, 0x0001 + .2byte SPECIES_TOTODILE, 0x0000 + .2byte SPECIES_SPINARAK, 0x0001 + .2byte SPECIES_PICHU, 0x0000 + .2byte SPECIES_CLEFFA, 0x0000 + .2byte SPECIES_IGGLYBUFF, 0x0002 + .2byte SPECIES_TOGEPI, 0x0002 + .2byte SPECIES_MAREEP, 0x0000 + .2byte SPECIES_BELLOSSOM, 0x0002 + .2byte SPECIES_MARILL, 0x0002 + .2byte SPECIES_SUNKERN, 0x0002 + .2byte SPECIES_WOOPER, 0x0002 + .2byte SPECIES_PINECO, 0x0002 + .2byte SPECIES_SNUBBULL, 0x0000 + .2byte SPECIES_SHUCKLE, 0x0002 + .2byte SPECIES_TEDDIURSA, 0x0000 + .2byte SPECIES_SLUGMA, 0x0002 + .2byte SPECIES_SWINUB, 0x0000 + .2byte SPECIES_HOUNDOUR, 0x0001 + .2byte SPECIES_PHANPY, 0x0000 + .2byte SPECIES_PORYGON2, 0x0000 + .2byte SPECIES_TYROGUE, 0x0001 + .2byte SPECIES_SMOOCHUM, 0x0002 + .2byte SPECIES_ELEKID, 0x0001 + .2byte SPECIES_MAGBY, 0x0001 + .2byte SPECIES_LARVITAR, 0x0001 + .2byte SPECIES_TREECKO, 0x0001 + .2byte SPECIES_TORCHIC, 0x0002 + .2byte SPECIES_MUDKIP, 0x0000 + .2byte SPECIES_MARSHTOMP, 0x0000 + .2byte SPECIES_POOCHYENA, 0x0001 + .2byte SPECIES_ZIGZAGOON, 0x0000 + .2byte SPECIES_LINOONE, 0x0000 + .2byte SPECIES_WURMPLE, 0x0001 + .2byte SPECIES_SILCOON, 0x0002 + .2byte SPECIES_CASCOON, 0x0002 + .2byte SPECIES_LOTAD, 0x0002 + .2byte SPECIES_SEEDOT, 0x0001 + .2byte SPECIES_RALTS, 0x0000 + .2byte SPECIES_KIRLIA, 0x0000 + .2byte SPECIES_SURSKIT, 0x0002 + .2byte SPECIES_SHROOMISH, 0x0002 + .2byte SPECIES_NINCADA, 0x0001 + .2byte SPECIES_WHISMUR, 0x0000 + .2byte SPECIES_AZURILL, 0x0002 + .2byte SPECIES_SKITTY, 0x0000 + .2byte SPECIES_SABLEYE, 0x0000 + .2byte SPECIES_MAWILE, 0x0000 + .2byte SPECIES_ARON, 0x0001 + .2byte SPECIES_MEDITITE, 0x0002 + .2byte SPECIES_ELECTRIKE, 0x0001 + .2byte SPECIES_PLUSLE, 0x0001 + .2byte SPECIES_MINUN, 0x0001 + .2byte SPECIES_VOLBEAT, 0x0000 + .2byte SPECIES_ILLUMISE, 0x0000 + .2byte SPECIES_ROSELIA, 0x0002 + .2byte SPECIES_GULPIN, 0x0002 + .2byte SPECIES_NUMEL, 0x0002 + .2byte SPECIES_TORKOAL, 0x0002 + .2byte SPECIES_SPOINK, 0x0000 + .2byte SPECIES_TRAPINCH, 0x0002 + .2byte SPECIES_CACNEA, 0x0002 + .2byte SPECIES_ANORITH, 0x0001 + .2byte SPECIES_WYNAUT, 0x0000 + .2byte SPECIES_SNORUNT, 0x0000 + .2byte SPECIES_CLAMPERL, 0x0001 + .2byte SPECIES_BAGON, 0x0001 + .align 2 gUnknown_082FB5F4:: @ 82FB5F4 - .incbin "baserom.gba", 0x2fb5f4, 0x24 + .4byte sub_802B248 + .4byte sub_802B2D4 + .4byte sub_802B368 + .4byte sub_802B3D4 + .4byte sub_802B4CC + .4byte sub_802B5C8 + .4byte sub_802B664 + .4byte sub_802B6B8 + .4byte sub_802B720 + .align 2 gUnknown_082FB618:: @ 82FB618 - .incbin "baserom.gba", 0x2fb618, 0x24 + .4byte sub_802B29C + .4byte sub_802B31C + .4byte sub_802B3B4 + .4byte sub_802B470 + .4byte sub_802B568 + .4byte sub_802B628 + .4byte sub_802B664 + .4byte sub_802B704 + .4byte sub_802B720 + .align 2 gUnknown_082FB63C:: @ 82FB63C - .incbin "baserom.gba", 0x2fb63c, 0x10 + .2byte 0x001a, 0x001f, 0x0024, 0x0029, 0x002e, 0x0033, 0x0038, 0x003d + .align 2 gUnknown_082FB64C:: @ 82FB64C - .incbin "baserom.gba", 0x2fb64c, 0x8 + .2byte 0x0000, 0x0001, 0x0001, 0x0002 + .align 2 gUnknown_082FB654:: @ 82FB654 - .incbin "baserom.gba", 0x2fb654, 0x8 + .2byte 0x005f, 0x0066, 0x00e4, 0x0105 + .align 2 gUnknown_082FB65C:: @ 82FB65C - .incbin "baserom.gba", 0x2fb65c, 0x90 + .byte 0xfd, 0xfa, 0xf8, 0xf6, 0xf3, 0xf1, 0xef, 0xed + .byte 0xeb, 0xe9, 0xe7, 0xe5, 0xe4, 0xe3, 0xe2, 0xe2 + .byte 0xe2, 0xe4, 0xe5, 0xe6, 0xe7, 0xe9, 0xea, 0xec + .byte 0xee, 0xef, 0xf1, 0xf3, 0xf5, 0xf8, 0xfa, 0xfc + .byte 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0xfd, 0xfa, 0xf7, 0xf5, 0xf2, 0xf0, 0xee, 0xec + .byte 0xea, 0xe8, 0xe6, 0xe4, 0xe3, 0xe2, 0xe2, 0xe4 + .byte 0xe6, 0xe8, 0xea, 0xec, 0xee, 0xf0, 0xf2, 0xf5 + .byte 0xf7, 0xfa, 0xfc, 0xff, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .byte 0xfd, 0xfa, 0xf7, 0xf5, 0xf3, 0xf1, 0xef, 0xed + .byte 0xeb, 0xe9, 0xe7, 0xe5, 0xe4, 0xe3, 0xe2, 0xe2 + .byte 0xe2, 0xe2, 0xe3, 0xe3, 0xe4, 0xe4, 0xe5, 0xe5 + .byte 0xe6, 0xe7, 0xe8, 0xea, 0xec, 0xee, 0xf0, 0xf2 + .byte 0xf4, 0xf5, 0xf7, 0xfa, 0xfc, 0xff, 0x00, 0x00 + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + .align 2 gUnknown_082FB6EC:: @ 82FB6EC - .incbin "baserom.gba", 0x2fb6ec, 0x18 + .4byte 0x00000000, 0x00000000, 0x00000032, 0x00000064 + .4byte 0x000000c8, 0x000001f4 + .align 2 gUnknown_082FB704:: @ 82FB704 - .incbin "baserom.gba", 0x2fb704, 0x10 + .2byte 0x008a, 0x008d, 0x008e, 0x008f, 0x0090, 0x0091, 0x0092, 0x0093 + .align 2 gUnknown_082FB714:: @ 82FB714 - .incbin "baserom.gba", 0x2fb714, 0x6f4 + .4byte 0x00001388, 0x00000001, 0x00001f40, 0x00000002 + .4byte 0x00002ee0, 0x00000003, 0x00003e80, 0x00000004 + .4byte 0x00004e20, 0x00000005 + .align 2 +gPkmnJumpPal1:: @ 82FB73C + .incbin "graphics/interface/pkmnjump_pal1.gbapal" + + .align 2 +gPkmnJumpPal2:: @ 82FB75C + .incbin "graphics/interface/pkmnjump_pal2.gbapal" + + .align 2 +gPkmnJumpRopeGfx1:: @ 82FB77C + .incbin "graphics/interface/pkmnjump_rope1.4bpp.lz" + + .align 2 +gPkmnJumpRopeGfx2:: @ 82FB89C + .incbin "graphics/interface/pkmnjump_rope2.4bpp.lz" + + .align 2 +gPkmnJumpRopeGfx3:: @ 82FBA70 + .incbin "graphics/interface/pkmnjump_rope3.4bpp.lz" + + .align 2 +gPkmnJumpRopeGfx4:: @ 82FBBA0 + .incbin "graphics/interface/pkmnjump_rope4.4bpp.lz" + + .align 2 +gPkmnJumpStarGfx:: @ 82FBC9C + .incbin "graphics/interface/pkmnjump_star.4bpp.lz" + + .align 2 gUnknown_082FBE08:: @ 82FBE08 - .incbin "baserom.gba", 0x2fbe08, 0x28 + .4byte gPkmnJumpRopeGfx1 + .2byte 0x0600, 0x0005 + .align 2 + .4byte gPkmnJumpRopeGfx2 + .2byte 0x0c00, 0x0006 + + .align 2 + .4byte gPkmnJumpRopeGfx3 + .2byte 0x0600, 0x0007 + + .align 2 + .4byte gPkmnJumpRopeGfx4 + .2byte 0x0600, 0x0008 + + .align 2 + .4byte gPkmnJumpStarGfx + .2byte 0x0200, 0x000a + + .align 2 gUnknown_082FBE30:: @ 82FBE30 - .incbin "baserom.gba", 0x2fbe30, 0x10 + .4byte gPkmnJumpPal1 + .2byte 0x0005 + .align 2 + .4byte gPkmnJumpPal2 + .2byte 0x0006 + + .align 2 gUnknown_082FBE40:: @ 82FBE40 - .incbin "baserom.gba", 0x2fbe40, 0x18 + .2byte 0x0000 @ tileTag + .2byte 0x0000 @ paletteTag + .4byte gUnknown_082FBEC8 + .4byte gDummySpriteAnimTable + .4byte NULL + .4byte gDummySpriteAffineAnimTable + .4byte SpriteCallbackDummy gUnknown_082FBE58:: @ 82FBE58 - .incbin "baserom.gba", 0x2fbe58, 0x50 + .2byte 0x0060, 0x0060, 0x0060, 0x0072, 0x0078, 0x0078, 0x0078, 0x0072 + .2byte 0x0060, 0x0060, 0x0046, 0x0050, 0x0060, 0x0072, 0x0078, 0x0080 + .2byte 0x0078, 0x0072, 0x0060, 0x0050, 0x0032, 0x0048, 0x0060, 0x0072 + .2byte 0x0080, 0x0088, 0x0080, 0x0072, 0x0060, 0x0048, 0x002a, 0x0048 + .2byte 0x0060, 0x0072, 0x0080, 0x0088, 0x0080, 0x0072, 0x0060, 0x0048 gUnknown_082FBEA8:: @ 82FBEA8 - .incbin "baserom.gba", 0x2fbea8, 0x10 + .2byte 0x0010, 0x0028, 0x0048, 0x0068, 0x0088, 0x00a8, 0x00c8, 0x00e0 + .align 2 gUnknown_082FBEB8:: @ 82FBEB8 - .incbin "baserom.gba", 0x2fbeb8, 0x154 + .4byte gUnknown_082FBF78 + .4byte gUnknown_082FBF90 + .4byte gUnknown_082FBFA8 + .4byte gUnknown_082FBFC0 + .align 2 +gUnknown_082FBEC8:: @ 82FBED0 + .byte 0x00, 0x00, 0x00, 0xc0, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_082FBED0:: @ 82FBED0 + .byte 0x00, 0x80, 0x00, 0x80, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_082FBED8:: @ 82FBED8 + .byte 0x00, 0x00, 0x00, 0x80, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_082FBEE0:: @ 82FBEE0 + .byte 0x00, 0x40, 0x00, 0x80, 0x00, 0x08, 0x00, 0x00 + + .align 2 +gUnknown_082FBEE8:: @ 82FBEE8 + .2byte 0x0000, 0x0001 + .2byte 0xffff, 0x0000 + + .align 2 +gUnknown_082FBEF0:: @ 82FBEF0 + .2byte 0x0008, 0x0001 + .2byte 0xffff, 0x0000 + + .align 2 +gUnknown_082FBEF8:: @ 82FBEF8 + .2byte 0x0010, 0x0001 + .2byte 0xffff, 0x0000 + + .align 2 +gUnknown_082FBF00:: @ 82FBF00 + .2byte 0x0018, 0x0001 + .2byte 0xffff, 0x0000 + + .align 2 +gUnknown_082FBF08:: @ 82FBF08 + .2byte 0x0020, 0x0001 + .2byte 0xffff, 0x0000 + + .align 2 +gUnknown_082FBF10:: @ 82FBF10 + .2byte 0x0028, 0x0001 + .2byte 0xffff, 0x0000 + + .align 2 +gUnknown_082FBF18:: @ 82FBF18 + .2byte 0x0000, 0x0001 + .2byte 0xffff, 0x0000 + + .align 2 +gUnknown_082FBF20:: @ 82FBF20 + .2byte 0x0010, 0x0001 + .2byte 0xffff, 0x0000 + + .align 2 +gUnknown_082FBF28:: @ 82FBF28 + .2byte 0x0020, 0x0001 + .2byte 0xffff, 0x0000 + + .align 2 +gUnknown_082FBF30:: @ 82FBF30 + .2byte 0x0030, 0x0001 + .2byte 0xffff, 0x0000 + + .align 2 +gUnknown_082FBF38:: @ 82FBF38 + .2byte 0x0040, 0x0001 + .2byte 0xffff, 0x0000 + + .align 2 +gUnknown_082FBF40:: @ 82FBF40 + .2byte 0x0050, 0x0001 + .2byte 0xffff, 0x0000 + + .align 2 +gUnknown_082FBF48:: @ 82FBF48 + .4byte gUnknown_082FBEE8 + .4byte gUnknown_082FBEF0 + .4byte gUnknown_082FBEF8 + .4byte gUnknown_082FBF00 + .4byte gUnknown_082FBF08 + .4byte gUnknown_082FBF10 + + .align 2 +gUnknown_082FBF60:: @ 82FBF60 + .4byte gUnknown_082FBF18 + .4byte gUnknown_082FBF20 + .4byte gUnknown_082FBF28 + .4byte gUnknown_082FBF30 + .4byte gUnknown_082FBF38 + .4byte gUnknown_082FBF40 + + .align 2 +gUnknown_082FBF78:: @ 82FBF78 + .2byte 0x0005 @ tileTag + .2byte 0x0005 @ paletteTag + .4byte gUnknown_082FBED0 + .4byte gUnknown_082FBF48 + .4byte NULL + .4byte gDummySpriteAffineAnimTable + .4byte SpriteCallbackDummy + + .align 2 +gUnknown_082FBF90:: @ 82FBF90 + .2byte 0x0006 @ tileTag + .2byte 0x0005 @ paletteTag + .4byte gUnknown_082FBED8 + .4byte gUnknown_082FBF60 + .4byte NULL + .4byte gDummySpriteAffineAnimTable + .4byte SpriteCallbackDummy + + .align 2 +gUnknown_082FBFA8:: @ 82FBFA8 + .2byte 0x0007 @ tileTag + .2byte 0x0005 @ paletteTag + .4byte gUnknown_082FBEE0 + .4byte gUnknown_082FBF48 + .4byte NULL + .4byte gDummySpriteAffineAnimTable + .4byte SpriteCallbackDummy + + .align 2 +gUnknown_082FBFC0:: @ 82FBFC0 + .2byte 0x0008 @ tileTag + .2byte 0x0005 @ paletteTag + .4byte gUnknown_082FBEE0 + .4byte gUnknown_082FBF48 + .4byte NULL + .4byte gDummySpriteAffineAnimTable + .4byte SpriteCallbackDummy + + .align 2 +gUnknown_082FBFD8:: @ 82FBFD8 + .byte 0x00, 0x00, 0x00, 0x40, 0x00, 0x04, 0x00, 0x00 + + .align 2 +gUnknown_082FBFE0:: @ 82FBFE0 + .2byte 0x0000, 0x0000 + .2byte 0xffff, 0x0000 + + .align 2 +gUnknown_082FBFE8:: @ 82FBFE8 + .2byte 0x0000, 0x0004 + .2byte 0x0004, 0x0004 + .2byte 0x0008, 0x0004 + .2byte 0x000c, 0x0004 + .2byte 0xfffd, 0x0001 + .2byte 0x0000, 0x0004 + .2byte 0xffff, 0x0000 + + .align 2 +gUnknown_082FC004:: @ 82FC004 + .4byte gUnknown_082FBFE0 + .4byte gUnknown_082FBFE8 + + .align 2 gUnknown_082FC00C:: @ 82FC00C - .incbin "baserom.gba", 0x2fc00c, 0x18 + .2byte 0x000a @ tileTag + .2byte 0x0005 @ paletteTag + .4byte gUnknown_082FBFD8 + .4byte gUnknown_082FC004 + .4byte NULL + .4byte gDummySpriteAffineAnimTable + .4byte SpriteCallbackDummy -gUnknown_082FC024:: @ 82FC024 - .incbin "baserom.gba", 0x2fc024, 0x20 + .align 2 +gPkmnJumpPal3:: @ 82FC024 + .incbin "graphics/interface/pkmnjump_pal3.gbapal" -gUnknown_082FC044:: @ 82FC044 - .incbin "baserom.gba", 0x2fc044, 0x20 + .align 2 +gPkmnJumpBgPal:: @ 82FC044 + .incbin "graphics/interface/pkmnjump_bg.gbapal" -gUnknown_082FC064:: @ 82FC064 - .incbin "baserom.gba", 0x2fc064, 0x22c + .align 2 +gPkmnJumpBgGfx:: @ 82FC064 + .incbin "graphics/interface/pkmnjump_bg.4bpp.lz" -gUnknown_082FC290:: @ 82FC290 - .incbin "baserom.gba", 0x2fc290, 0x1b0 + .align 2 +gPkmnJumpBgTilemap:: @ 82FC290 + .incbin "graphics/interface/pkmnjump_bg.bin.lz" -gUnknown_082FC440:: @ 82FC440 - .incbin "baserom.gba", 0x2fc440, 0x20 + .align 2 +gPkmnJumpVenusaurPal:: @ 82FC440 + .incbin "graphics/interface/pkmnjump_venusaur.gbapal" -gUnknown_082FC460:: @ 82FC460 - .incbin "baserom.gba", 0x2fc460, 0x950 + .align 2 +gPkmnJumpVenusaurGfx:: @ 82FC460 + .incbin "graphics/interface/pkmnjump_venusaur.4bpp.lz" -gUnknown_082FCDB0:: @ 82FCDB0 - .incbin "baserom.gba", 0x2fcdb0, 0x3b8 + .align 2 +gPkmnJumpVenusaurTilemap:: @ 82FCDB0 + .incbin "graphics/interface/pkmnjump_venusaur.bin.lz" -gUnknown_082FD168:: @ 82FD168 - .incbin "baserom.gba", 0x2fd168, 0x20 + .align 2 +gPkmnJumpResultsPal:: @ 82FD168 + .incbin "graphics/interface/pkmnjump_results.gbapal" -gUnknown_082FD188:: @ 82FD188 - .incbin "baserom.gba", 0x2fd188, 0xab0 + .align 2 +gPkmnJumpResultsGfx:: @ 82FD188 + .incbin "graphics/interface/pkmnjump_results.4bpp.lz" -gUnknown_082FDC38:: @ 82FDC38 - .incbin "baserom.gba", 0x2fdc38, 0x52c + .align 2 +gPkmnJumpResultsTilemap:: @ 82FDC38 + .incbin "graphics/interface/pkmnjump_results.bin.lz" -gUnknown_082FE164:: @ 82FE164 - .incbin "baserom.gba", 0x2fe164, 0x10 + .align 2 +gUnknown_082FE164:: @ 82FE164 struct BgTemplate + .4byte 0x000001b0, 0x000025e6, 0x000016c9, 0x000031df + .align 2 gUnknown_082FE174:: @ 82FE174 - .incbin "baserom.gba", 0x2fe174, 0x18 + window_template 0x00, 0x13, 0x00, 0x06, 0x02, 0x02, 0x0013 + window_template 0x00, 0x08, 0x00, 0x06, 0x02, 0x02, 0x001f + window_template 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 + .align 2 gUnknown_082FE18C:: @ 82FE18C - .incbin "baserom.gba", 0x2fe18c, 0x50 + .4byte 0x00000000, sub_802D150 + .4byte 0x00000001, sub_802D2E4 + .4byte 0x00000002, sub_802D350 + .4byte 0x00000003, sub_802D3BC + .4byte 0x00000004, sub_802D448 + .4byte 0x00000005, sub_802D4F4 + .4byte 0x00000006, sub_802D598 + .4byte 0x00000007, sub_802D5E4 + .4byte 0x00000009, sub_802D72C + .4byte 0x00000008, sub_802D688 + .align 2 gUnknown_082FE1DC:: @ 82FE1DC - .incbin "baserom.gba", 0x2fe1dc, 0x3 + .byte 0x00, 0x02, 0x03 gUnknown_082FE1DF:: @ 82FE1DF - .incbin "baserom.gba", 0x2fe1df, 0xd + .byte 0x02, 0x02, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00 + .byte 0x00, 0x02, 0x00, 0x00, 0x00 + .align 2 gUnknown_082FE1EC:: @ 82FE1EC - .incbin "baserom.gba", 0x2fe1ec, 0x8 + .4byte gUnknown_082FF1F8 + .2byte 0x0000, 0x0320 + .align 2 gUnknown_082FE1F4:: @ 82FE1F4 - .incbin "baserom.gba", 0x2fe1f4, 0x40 + .4byte gUnknown_082FF1D8 + .2byte 0x0320, 0x0000 + .align 2 +gUnknown_082FE1FC:: @ 82FE1FC + .2byte 0x0006, 0x0008, 0x0010, 0x0008 + + .align 2 +gUnknown_082FE204:: @ 82FE204 + .2byte 0x0006, 0x0008, 0x000b, 0x0006, 0x0010, 0x0008 + + .align 2 +gUnknown_082FE210:: @ 82FE210 + .2byte 0x0002, 0x0006, 0x0006, 0x0008, 0x0010, 0x0008, 0x0014, 0x0006 + + .align 2 +gUnknown_082FE220:: @ 82FE220 + .2byte 0x0002, 0x0006, 0x0006, 0x0008, 0x000b, 0x0006 + .2byte 0x0010, 0x0008, 0x0014, 0x0006 + + .align 2 gUnknown_082FE234:: @ 82FE234 - .incbin "baserom.gba", 0x2fe234, 0x2c + .4byte gUnknown_082FE1FC + .4byte gUnknown_082FE204 + .4byte gUnknown_082FE210 + .4byte gUnknown_082FE220 + .align 2 +gUnknown_082FE244:: @ 82FE244 + .2byte 0x0058, 0x0098 + +gUnknown_082FE248:: @ 82FE248 + .2byte 0x0058, 0x0078, 0x0098 + +gUnknown_082FE24E:: @ 82FE24E + .2byte 0x0038, 0x0058, 0x0098, 0x00b8 + +gUnknown_082FE256:: @ 82FE256 + .2byte 0x0038, 0x0058, 0x0078, 0x0098, 0x00b8 + + .align 2 gUnknown_082FE260:: @ 82FE260 - .incbin "baserom.gba", 0x2fe260, 0x10 + .4byte gUnknown_082FE244 + .4byte gUnknown_082FE248 + .4byte gUnknown_082FE24E + .4byte gUnknown_082FE256 + .align 2 gUnknown_082FE270:: @ 82FE270 - .incbin "baserom.gba", 0x2fe270, 0x8 + .4byte 0x1c010100, 0x00010f09 + .align 2 gUnknown_082FE278:: @ 82FE278 - .incbin "baserom.gba", 0x2fe278, 0x450 + .4byte gUnknown_085EDEA2 + .4byte gUnknown_085EDEB2 + .4byte gUnknown_085EDEBE + .align 2 +gPkmnJump321StartPal1:: @ 82FE284 + .incbin "graphics/interface/pkmnjump_321start1.gbapal" + + .align 2 +gPkmnJump321StartGfx1:: @ 82FE2A4 + .incbin "graphics/interface/pkmnjump_321start1.4bpp.lz" + + .align 2 gUnknown_082FE6C8:: @ 82FE6C8 - .incbin "baserom.gba", 0x2fe6c8, 0x10 + .4byte gPkmnJump321StartGfx1 + .2byte 0x0c00, 0x2000 + .4byte 0x00000000, 0x00000000 + + .align 2 gUnknown_082FE6D8:: @ 82FE6D8 - .incbin "baserom.gba", 0x2fe6d8, 0x58 + .4byte gPkmnJump321StartPal1 + .2byte 0x2000, 0x0000 + .4byte 0x00000000, 0x00000000 + + .align 2 +gUnknown_082FE6E8:: @ 82FE6E8 + .2byte 0x0000, 0x0000 + .2byte 0xffff, 0x0000 + + .align 2 +gUnknown_082FE6F0:: @ 82FE6F0 + .2byte 0x0010, 0x0000 + .2byte 0xffff, 0x0000 + + .align 2 +gUnknown_082FE6F8:: @ 82FE6F8 + .2byte 0x0020, 0x0000 + .2byte 0xffff, 0x0000 + + .align 2 +gUnknown_082FE700:: @ 82FE700 + .2byte 0x0040, 0x0000 + .2byte 0xffff, 0x0000 + + .align 2 +gUnknown_082FE708:: @ 82FE708 + .2byte 0x0030, 0x0000 + .2byte 0xffff, 0x0000 + + .align 2 +gUnknown_082FE710:: @ 82FE710 + .2byte 0x0050, 0x0000 + .2byte 0xffff, 0x0000 + + .align 2 +gUnknown_082FE718:: @ 82FE718 + .4byte gUnknown_082FE6E8 + .4byte gUnknown_082FE6F0 + .4byte gUnknown_082FE6F8 + .4byte gUnknown_082FE700 + .4byte gUnknown_082FE708 + .4byte gUnknown_082FE710 + + .align 2 gUnknown_082FE730:: @ 82FE730 - .incbin "baserom.gba", 0x2fe730, 0x18 + .2byte 0x2000 @ tileTag + .2byte 0x2000 @ paletteTag + .4byte gUnknown_08524914 + .4byte gUnknown_082FE718 + .4byte NULL + .4byte gDummySpriteAffineAnimTable + .4byte SpriteCallbackDummy + .align 2 gUnknown_082FE748:: @ 82FE748 - .incbin "baserom.gba", 0x2fe748, 0x484 + .4byte sub_802E83C + .4byte sub_802E8C8 + .4byte sub_802EA50 + .4byte sub_802EAB0 + .align 2 +gPkmnJump321StartPal2:: @ 82FE758 + .incbin "graphics/interface/pkmnjump_321start2.gbapal" + + .align 2 +gPkmnJump321StartGfx2:: @ 82FE778 + .incbin "graphics/interface/pkmnjump_321start2.4bpp.lz" + + .align 2 gUnknown_082FEBCC:: @ 82FEBCC - .incbin "baserom.gba", 0x2febcc, 0x8 + .4byte gPkmnJump321StartGfx2 + .2byte 0x0e00 + .align 2 gUnknown_082FEBD4:: @ 82FEBD4 - .incbin "baserom.gba", 0x2febd4, 0xbc + .4byte gPkmnJump321StartPal2 + .2byte 0x0000, 0x0000 + + .align 2 +gUnknown_082FEBDC:: @ 82FEBDC + .byte 0x00, 0x03, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00 + + .align 2 +gUnknown_082FEBE4:: @ 82FEBE4 + .byte 0x00, 0x40, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00 + + .align 2 +gUnknown_082FEBEC:: @ 82FEBEC + .2byte 0x0000, 0x0001 + .2byte 0xffff, 0x0000 + + .align 2 +gUnknown_082FEBF4:: @ 82FEBF4 + .2byte 0x0010, 0x0001 + .2byte 0xffff, 0x0000 + + .align 2 +gUnknown_082FEBFC:: @ 82FEBFC + .2byte 0x0020, 0x0001 + .2byte 0xffff, 0x0000 + + .align 2 +gUnknown_082FEC04:: @ 82FEC04 + .4byte gUnknown_082FEBEC + .4byte gUnknown_082FEBF4 + .4byte gUnknown_082FEBFC + + .align 2 +gUnknown_082FEC10:: @ 82FEC10 + .2byte 0x0030, 0x0001 + .2byte 0xffff, 0x0000 + + .align 2 +gUnknown_082FEC18:: @ 82FEC18 + .2byte 0x0050, 0x0001 + .2byte 0xffff, 0x0000 + + .align 2 +gUnknown_082FEC20:: @ 82FEC20 + .4byte gUnknown_082FEC10 + .4byte gUnknown_082FEC18 + + .align 2 +gUnknown_082FEC28:: @ 82FEC28 + .2byte 0x0100, 0x0100 + .2byte 0x0000, 0x0000 + .2byte 0x7fff, 0x0000 + .2byte 0x0000, 0x0000 + + .align 2 +gUnknown_082FEC38:: @ 82FEC38 + .2byte 0x0100, 0x0100 + .2byte 0x0000, 0x0000 + .2byte 0x0010, 0xfff0 + .2byte 0x0800, 0x0000 + .2byte 0x7fff, 0x0000 + .2byte 0x0000, 0x0000 + + .align 2 +gUnknown_082FEC50:: @ 82FEC50 + .2byte 0xffee, 0x0012 + .2byte 0x0800, 0x0000 + .2byte 0x7fff, 0x0000 + .2byte 0x0000, 0x0000 + + .align 2 +gUnknown_082FEC60:: @ 82FEC60 + .2byte 0x0006, 0xfffa + .2byte 0x0800, 0x0000 + .2byte 0xfffc, 0x0004 + .2byte 0x0800, 0x0000 + .2byte 0x0100, 0x0100 + .2byte 0x0000, 0x0000 + .2byte 0x7fff, 0x0000 + .2byte 0x0000, 0x0000 + + .align 2 +gUnknown_082FEC80:: @ 82FEC80 + .4byte gUnknown_082FEC28 + .4byte gUnknown_082FEC38 + .4byte gUnknown_082FEC50 + .4byte gUnknown_082FEC60 gUnknown_082FEC90:: @ 82FEC90 - .incbin "baserom.gba", 0x2fec90, 0x18 + .2byte 0x0000 @ tileTag + .2byte 0x0000 @ paletteTag + .4byte gUnknown_082FEBDC + .4byte gUnknown_082FEC04 + .4byte NULL + .4byte gUnknown_082FEC80 + .4byte SpriteCallbackDummy gUnknown_082FECA8:: @ 82FECA8 - .incbin "baserom.gba", 0x2feca8, 0x18 + .2byte 0x0000 @ tileTag + .2byte 0x0000 @ paletteTag + .4byte gUnknown_082FEBE4 + .4byte gUnknown_082FEC20 + .4byte NULL + .4byte gDummySpriteAffineAnimTable + .4byte SpriteCallbackDummy diff --git a/data/data2b.s b/data/data2b.s index 19bab9c20..28d34f79b 100644 --- a/data/data2b.s +++ b/data/data2b.s @@ -75,7 +75,13 @@ gUnknown_082FF178:: @ 82FF178 .incbin "baserom.gba", 0x2ff178, 0x50 gUnknown_082FF1C8:: @ 82FF1C8 - .incbin "baserom.gba", 0x2ff1c8, 0x450 + .incbin "baserom.gba", 0x2ff1c8, 0x10 + +gUnknown_082FF1D8:: @ 82FF1D8 + .incbin "baserom.gba", 0x2ff1d8, 0x20 + +gUnknown_082FF1F8:: @ 82FF1F8 + .incbin "baserom.gba", 0x2ff1f8, 0x420 gUnknown_082FF618:: @ 82FF618 .incbin "baserom.gba", 0x2ff618, 0x7c diff --git a/data/strings.s b/data/strings.s index 2f74c5566..7ab4e7540 100644 --- a/data/strings.s +++ b/data/strings.s @@ -2328,12 +2328,15 @@ gUnknown_085ED7E0:: @ 85ED7E0 .string "1. {SPECIAL_F7 0x00}$" .align 2 +gUnknown_085ED7E8:: @ 85ED7E8 .string " time(s)$" .align 2 +gUnknown_085ED7F4:: @ 85ED7F4 .string "{STR_VAR_1}.{STR_VAR_2}$" .align 2 +gUnknown_085ED7FC:: @ 85ED7FC .string "{STR_VAR_1} BERRY$" .align 2 @@ -2372,22 +2375,28 @@ gUnknown_085ED848:: @ 85ED848 gUnknown_085ED850:: @ 85ED850 .string " Times/sec.$" + .align 2 gUnknown_085ED85C:: @ 85ED85C .string "{STR_VAR_1}%$" + .align 2 gUnknown_085ED860:: @ 85ED860 .string "No. of Presses Rankings$" + .align 2 gUnknown_085ED878:: @ 85ED878 .string "Crushing Results$" .align 2 +gUnknown_085ED88C:: @ 85ED88C .string "Neatness Rankings$" .align 2 +gUnknown_085ED8A0:: @ 85ED8A0 .string "Cooperative Rankings$" .align 2 +gUnknown_085ED8B8:: @ 85ED8B8 .string "Pressing-Power Rankings$" gUnknown_085ED8D0:: @ 85ED8D0 @@ -2455,8 +2464,14 @@ gUnknown_085EDCDE:: @ 85EDCDE gUnknown_085EDCE5:: @ 85EDCE5 .string "DODRIO BERRY-PICKING RECORDS$" + +gUnknown_085EDD02:: @ 85EDD02 .string "BERRIES picked:$" + +gUnknown_085EDD12:: @ 85EDD12 .string "Best score:$" + +gUnknown_085EDD1E:: @ 85EDD1E .string "BERRIES picked in a row with\nfive players:$" gUnknown_085EDD49:: @ 85EDD49 @@ -2470,10 +2485,20 @@ gUnknown_085EDD86:: @ 85EDD86 gUnknown_085EDD9B:: @ 85EDD9B .string "Announcing prizes!$" + +gUnknown_085EDDAE:: @ 85EDDAE .string "1:$" + +gUnknown_085EDDB1:: @ 85EDDB1 .string "2:$" + +gUnknown_085EDDB4:: @ 85EDDB4 .string "3:$" + +gUnknown_085EDDB7:: @ 85EDDB7 .string "4:$" + +gUnknown_085EDDBA:: @ 85EDDBA .string "5:$" gUnknown_085EDDBD:: @ 85EDDBD @@ -2505,8 +2530,14 @@ gUnknown_085EDE84:: @ 85EDE84 gUnknown_085EDE8D:: @ 85EDE8D .string "POKéMON JUMP RECORDS$" + +gUnknown_085EDEA2:: @ 85EDEA2 .string "Jumps in a row:$" + +gUnknown_085EDEB2:: @ 85EDEB2 .string "Best score:$" + +gUnknown_085EDEBE:: @ 85EDEBE .string "EXCELLENTS in a row:$" gUnknown_085EDED3:: @ 85EDED3 diff --git a/graphics/interface/berrycrush_background.bin b/graphics/interface/berrycrush_background.bin new file mode 100644 index 0000000000000000000000000000000000000000..1967c9f452ab21ab830dc97babb208c03ba6ec5d GIT binary patch literal 2048 zcmeIzxo*Nh5C-5p(iHOmE_k3R=83q(9qy}0#3`UixS@);+i(-EI9`a565H4!U6TDZ z&8)xO)k@X|q<~KDmHzd*Q^td&mq%shdI|p|eb2MfF;~LBNViA$SLyZ$FH7pYD?KwM zycM)!13Ngt2~KpN9c^gUjQ0L6aDxZD-~&JS(T862pc`GNKBtxsLI}bTfhfcv4sncO z6eAeM5C&B%sC|`clz}YdAP)s7LJ{|No2C|Nj90{{a900RR60|Nj90#sAI!)r0^4od5s-gX}>O0006F zNklADFxdj6Py6$p zY-Vuo4dZJM91S?e7&VEpOK~>C4mrLo@IQVVA07BKV4BP}2NtBwghjc7>N3d(cElz& zqsV&Nv>V$A>!jZ?=Q{AtaoPoEvp<|q7UYxz?o-O))OP8dJ}}=k;7UiXkR^g$aR+RL zKuBG*1Z$*f#114K)5wknHshp}S0SD9_l;o}TrcYQnnIDZ9TXZa89EIHtQp)cuqAnb z>PcgJX-}lPSKR)U7=I3yxt-g}dIz98EFpkRo6&{638>bZ^hJ4uBWu6dgkE$unoHCdU)BnUVh~@hp#t|p zJb4{zLzr1T10b1Lvp8?c%Y{mI78nG~6{HmJz>W_kOFH{)^;|{~VhEcC+ihzPH?_FM z2q1*?XEbgB$Sso)0`wr_bPCQjO-V--9V5*t!bo~DNLJWOey-Fm%TT|id`tMd%Kp_W zk#A_^bjIfWglAJq;T5VY09CVqS$%`+;R literal 0 HcmV?d00001 diff --git a/graphics/interface/berrycrush_container_cap.bin b/graphics/interface/berrycrush_container_cap.bin new file mode 100644 index 0000000000000000000000000000000000000000..934d95779d844381dfcd53bea1a383d3a75190c5 GIT binary patch literal 1280 zcmeIwxlV#n5J2Jo5l?Y~l*kTJup?k0B81f_TUdk_(T9^rEbOj{C3lir%{PL|+v6*k20+X~PLZeAFZjck7Tah!eKg!my%7U&RSGx}q0hpo84f z@0pS?xU6aRF^5f6)q+DphzH3bMWkE|2~C5Tj~o)jssdrCGepm-=in(J)|p%r5SjKU zK0?HyPC~*UPRO&E1Eg`n0VW*EfcGMRV#?tl9RO*>;mva>{TukIf0M#<_%#{=2k{st za1e&$nL~Kc9qoeZRq=9B!>JxLw!PF^8;ekCKBW zrY$&BL^k5kbwoIFK%%ydIP5r~!LsL2FeRd6%z-#Th>ueaKH(xxh&cSS7P2^@25Y}d zP(LA&h8%uOK=BnA>&$^9DD}o`-tz*fukx=0x4h;!f**p%u0{?GAH@jVgA*nk+E#Sn z9&-+|L-?;J94HFl2c0H3HPLIF@Gz~b)nA$L?PX?A&W&|9Yv3b(JGb%Gy>ovS0+jlA zI=P_J)ALeYtv*hVzW#oCUJPKzdvAFBq|T1M#i#YK%HjfF`qEkd0sDX^VCY#1qyPW_ M07*qoM6N<$fXp42Izsts>y4P{C~#WMja|OxWX$dH=VfUVzDeV9%eg{gT4}PlP@85f1#& zqk5zm6&&v40=Uh9p91td7;gj3FNfAlBMdQP7;uZ2Jlx7=~h19fls ztH1d>ANr|Z!M;d|G8L-Syq2q4#mZKamtfzdMVk&?di11g9cx=lniAF@`V1H{V$6hz tjBR8?8%RIcFIll>!wjx@ZS#$7E%BJ literal 0 HcmV?d00001 diff --git a/graphics/interface/berrycrush_misc.pal b/graphics/interface/berrycrush_misc.pal new file mode 100644 index 000000000..e3c607926 --- /dev/null +++ b/graphics/interface/berrycrush_misc.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +255 189 189 +255 238 172 +255 255 0 +255 230 74 +255 139 0 +197 255 255 +139 213 255 +255 0 255 +255 0 255 +255 0 255 +255 0 255 +255 0 255 +197 255 205 +255 213 131 +255 255 156 +255 255 255 diff --git a/graphics/interface/berrycrush_sparkle.png b/graphics/interface/berrycrush_sparkle.png new file mode 100644 index 0000000000000000000000000000000000000000..be2030bc4e68c856724248d79fcd506633315df5 GIT binary patch literal 329 zcmeAS@N?(olHy`uVBq!ia0vp^0zmwLg&9cx@c-=%qznRlLR|mv-TVLDn*aY9{y+2j z-_3CJ|Nri*ARaP0`v2_ztIhxa&-wrVfAbqhL7?6%o-U3d7QIJ94)PvW;7MT!`F8&p z^A;uL4GydMF0^$`E7lD-u*9=!e#E)LIp-P-rFKl{zN~WFxa)NktEf)*0zvr~K9h}A{~Uj>x=y&}#1ro)TsEGO*Pfbrk0st_DqnQYZ2sggwkcnP)_q|5Y1MUl UN45JKp#K;=UHx3vIVCg!02y(f82|tP literal 0 HcmV?d00001 diff --git a/graphics/interface/berrycrush_timerdigits.pal b/graphics/interface/berrycrush_timerdigits.pal new file mode 100644 index 000000000..956db48b1 --- /dev/null +++ b/graphics/interface/berrycrush_timerdigits.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 0 0 +148 222 164 +164 230 172 +180 238 189 +197 246 205 +213 255 222 +238 255 238 +205 106 255 +172 82 222 +148 148 148 +123 123 123 +255 0 255 +255 0 255 +255 0 255 +180 189 189 +255 255 255 diff --git a/graphics/interface/berrycrush_timerdigits.png b/graphics/interface/berrycrush_timerdigits.png new file mode 100644 index 0000000000000000000000000000000000000000..a6566f058cbeb16b2f28b918d3d6ab00e859ff14 GIT binary patch literal 282 zcmeAS@N?(olHy`uVBq!ia0vp^96-E*g&9a5*kQB)NErn9gt!9fDfgBvdA4TDyS+!h zoxS@1-n;+r&Sw2z6LfFNlquEK)&Cj(L(rDJd;kCc|3&42AyCg!PZ!4!jfuTMw*`+V za4cc^t*!(AfxwIxU*>gHX zHu7&^>XeIGdXztK_UqQBw{6AWG?HU(^DUooqC#lR7q`@?BY$sPc)k4U^^6m2{(4RK ztBTz^W})^;;{&TMKkBgQu&X%Q~loCIF1kfdv2n literal 0 HcmV?d00001 diff --git a/graphics/interface/dodrioberry_berrysprites.pal b/graphics/interface/dodrioberry_berrysprites.pal new file mode 100644 index 000000000..98266fb46 --- /dev/null +++ b/graphics/interface/dodrioberry_berrysprites.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +230 255 255 +65 65 65 +156 156 230 +115 115 189 +139 246 213 +98 213 172 +255 213 57 +246 172 57 +238 238 238 +0 148 213 +230 131 49 +0 156 189 +255 148 139 +0 230 255 +213 98 90 +0 238 255 diff --git a/graphics/interface/dodrioberry_berrysprites.png b/graphics/interface/dodrioberry_berrysprites.png new file mode 100644 index 0000000000000000000000000000000000000000..81d3a6f97ca27078cf92a551eb4db9ae7370394c GIT binary patch literal 395 zcmV;60d)R}P)8A2FJN)U#SkusE_1eIbmHWonDPBFlAj|bE} zts#LBhKmb?Arj&WWw=147(+v8@16{(d)mtiA&j&%2t%wa9m+_9N->s~Q`~dUFHyH^wLK^{pwS%+-9F|pphm97-Wcf7Fc9XvzpNiv&?YLoRt-2bg)vRgSWirA%d*FQJq& z%BdjOQK52`sZ=HAn`xnywqUXEoZ8f?7B!n6W`t2U+VN;qBN{fp#IieW9xZFh{1L}L z^2a(df5PdH{HadNudvFPyBnPMk7-pa<}0b9ni@AZs7BSQQlz&aLW)SnLoq%4aq{mk+2hwwc5<;i>Y+%5=HCE{^`3+P literal 0 HcmV?d00001 diff --git a/graphics/interface/dodrioberry_bg1.pal b/graphics/interface/dodrioberry_bg1.pal new file mode 100644 index 000000000..c06550002 --- /dev/null +++ b/graphics/interface/dodrioberry_bg1.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +230 246 255 +82 180 172 +82 205 189 +156 156 131 +106 156 148 +123 123 98 +189 172 98 +189 189 139 +74 172 156 +172 172 131 +74 156 123 +115 115 82 +139 139 106 +164 164 115 +197 197 148 +230 246 255 diff --git a/graphics/interface/dodrioberry_bg1.png b/graphics/interface/dodrioberry_bg1.png new file mode 100644 index 0000000000000000000000000000000000000000..7079e8094308b227e0d656f486486159cf5f05e0 GIT binary patch literal 1887 zcmV-l2cYv2CShN?n+yJ=-WW>K{>OE)2Sx>c1|aD*wi-0ib{1_vV~$ zHtMB%VgWR~7DfoO24I2q8i2*ZT(d=eEgfL7>hw2ygQhOk(gOI}%|TSvwVW)`px|)1 ztjpxmtek?CDbr~?0S~xzQxIzk03_7cuexnDOU}&7Dp<`;sfvCJ_!q5-!KrpZsLFD? zRc%|91Sk*DVZH!h+(z)}4uHEkR5ZSlvISTL7XU2h6vF@zPCy4BEMWb9O9IlAz95dV z3RrBGvjqS}n}Vk|0H^gD*op+SEmdYdJu^$zTgpcUGspwr`DfQu&OD$J)w-(RhX@4B zqjEZ4tS)+rp;sxJ5Cp)KvDC+ai@Ki8LdUHKy`IbQV##9mh-@@{;O1|%@BdlO=cNaj zxTTl!d$E8LX(R!O1?Z^L+SORQ`4c55XaH70DOJ*^0RD6f zK<=nR{JTE30F@k;>=5fgk`0lqsLW%TYQYED&`}7my8^m^GC3jzB~#O}8-A7_No0kO zTEJpq0}!-tgBO%EbCtwUFqgUYF#$@}D^n6P$UFe+-djI}p$P{mh-dPs%ySZ80|-H{ zWf$xwXYr488wZSsj)*)krJy?CUK9&ypG07$~nir4}Ch8V1?sy0;(2_~At zAw`h~0QaMF`<7*U`0oHjhA?C`4Q*clloP3nLMrJ1T4>?xqLn}`QpN8cKmkH1*A-ag z1umjDuxKIki(@|p3YBpiF^n`I4bk+=m#qf~t~~%J1@c3LLL>{xn9mq}Y5~@4+@?Kx zh1%|V6F_8@A;1-h;L#g~G^Q>5NRWOK9ZSA2>XGW+*j;G$ zBc12!a)JQ*B#?1k5@{MnvvaIze&PV#8qmFelL9aSV}gzCA?krM61{PDPLC1*XT7!t zz^k2moF5n~WX}QiBH@fgfjnseIP0}Fz#dnddkGr=a0~z&KZMf}ENw+XL5@lj_Xu#Q z+8O{r=U%1&9I#{5>!b(gQZ;hx01_rifps=(BuPw-xYT#$g!IrM>4@tCGS*a zZ2`tKfIVO1yYFaHp3NJ;A9i1Ga{%BZ7>N$e(VnmId-R?S-90I|2`~--J2gfkz+R~F zsF7H9k-OjfiUKl{-CmJK)&UHCjmPL(DtCD zZ9|#hJVJm8O7pP;&>Te9NOWW^?qiw36xoed+{d%XHNNMxbi;KgRTj|KHYK+JIGk$w z4S6@fd<$SdFJhOnaJ>!iU+lYc&WrtQFru0tKA#>GHsaxW3lP2-n+bW5A3^AZG$y>+;k`oUCP4sHXuB(6Ya;v*FWFQ Z!v7K2ZmhO?^_u_y002ovPDHLkV1f-LV{-ri literal 0 HcmV?d00001 diff --git a/graphics/interface/dodrioberry_bg2.pal b/graphics/interface/dodrioberry_bg2.pal new file mode 100644 index 000000000..be2b62cc9 --- /dev/null +++ b/graphics/interface/dodrioberry_bg2.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +230 246 255 +246 246 222 +230 230 180 +139 238 139 +246 246 189 +197 246 164 +246 230 197 +230 246 255 +230 213 180 +205 197 164 +148 222 148 +222 238 255 +139 205 139 +213 238 246 +222 246 255 +213 205 164 diff --git a/graphics/interface/dodrioberry_bg2.png b/graphics/interface/dodrioberry_bg2.png new file mode 100644 index 0000000000000000000000000000000000000000..ee343dd1321ed036047856d753902ff0be4cfc87 GIT binary patch literal 2856 zcmV+@3)l3CP)A=I8OHbigPY9+rnkyY76(LKyq04cykb{_Gc{2Y$QuL}uQ=GC0pnuW z#sLeKIiTT%~)hv=Bm$IRsF$$>W_MPE))^01E2ymF46c{1lC$Y8Ld|oxcbc|3m^r8 zB*;pF)|Gl|4VuSiQ5+aEt`y*jYXzf9!3ck?H9F3K74;eox65`>fFsUPFj^?UBbNZF z*+&wO<`3wHDU+--TTwtxjz$X)d?Kg~XQB}1jwbU^6Q6x3Fs3}ugQWr$f{;27POSa@ zpBz5a;%>Cz0hyT1oQAjxq-%fZq5y#Lyfdv-K2a;{6iCj4fB>hQZZ7*-ziYJ?QE0~1 zI}JeS03WA7b0XCWrj%{xE11p5hFZe%olZ%@1qzy!ahE9|fI<*D@5LI)evSwAJ7)kW z6a^ws7F^&#uXl+8%4GB0`>-f1$HGb`YT@!2x#Iq2F=Cfd(DpFfJDG6GV4NP#s`7mP zV=iP^1DwkF^sEAX2o0`MaB^%r^F3Gou{i`lU9P}TF7F*v#t>@WnsNF2!6+v{cuGO# zR6S|*7|`jEgfQs1nQ4#8&E^ma0uG{6z+RtG(CZ!2U?K_OA<~&1NC+VS@bI~H^VvEN zIE;{BZD+~?A;DUgWNsq3!~=den^7C?ZL2k((!2`z^CjRC1?b?bMJB~_wg_r=JU73>32||O|joD zggxy+-Tp#B)_Gg(Ox>Jxy&g+|_q8o(JbCrB`Mv^hY6Wi#UBA1zRV(QAiguwPV49N3~B}F!17(c+5B$Xd4Tn2A1mM)58hWWs|3{V`lHczeWyU{ zqy2z9ph1Bl&g+a8C3=5?C(jzQu04Qs}jmAZps$b5EVyDyjM=QRz zRV$#cUN46ONQEUprb?z`1XtL}hPFzZhAow9a1WwsthVB73jix9B;``zg{}|SAn6pT zVWss0JqgS32#Y)j0KD00U5jFT-ef?Zqi|I8i-V&g@Du@*khE6YM!%F}g{C8$VzZE; zV*seFDFop2X0gQpQb2&>s5l@17FvM~j_}R6&}O3SM9Bjk0&qvEo%x$+eobw?iKf%H za(fgv`WyuVwZ#DeNWPL3MeLD^zE)v5QHd%2z-E6+RrFd#sI67BqxXGuq2Ux@Cu5EZ zq%r`s$5IY}*s2YrKmtdQ2Ss10H%cckSkaa$0zfzq5Cd$<+I<2(td>cenJ3A3WmI!!G6f|m84!MP9$VkssiYiy3tp`A7ql^7onmA7{oi- z{tK4m-#|gnVmH|C7kzK6QU^dMbgBWcNC}zvksrYwyhsEwG^$7Yw5IEA@_=%#fiQT+ z@^Zx+mNe3RUs2!W7u0GJyBa3f)p_3=fNMqr``m zs2M2&L}`Q{Li?Ih<_Znxz}SX90wApcQKTt-CrG0PAZ$DU5%mDS_$rZ!e9dC7 zasYt!)dv0qrVESwZ~(OIIOrBe?lwokCIZ{@VgaDNw>1WUP?20s${3KkROD2WEP%&C zfX#g=8hww>DHK772(Zm|0O~naOOyjBX8{8eR?tJ*2DTKM0TWJV5tzu3$I7XOvc$oX zN`&x36>1CzA#%*VmJSFWjltsy=K|8iGJqP@)bpU2MTand2w=F z0n&{nz*nhLqnrhyrZExX7Zh*j2suXYSb7FS{{?O3I1*J(V}f#fVF&Y_1rVTJeMI49 zmhIj`A3QUblmZKYI}fG;Z7RP8Q00h3P<^2hg#0Aijc+0Do~9$4w%qPQ0zCaD;n>g+ z`Qj;AAX&s`|5g#LdilxAEPjZJ1fVl71Dpt+;nV{L5KVUq(l8$lNx?(R ziv*xkBlRJuyMb9&b-(d_5fb2wF3O4{;(yld{-@bw1sN3BB>*mLST=%k5({qkfnOQY z?V=opDY=01qrr$hc)1(j#{t>HVn(@yDYi5`EwPLV{`4s?+6s-Lj2RBjaQVMb@Z>fr zxX&h9p3e;(S~&phCIKFip*}T=vL8_=Tp0?)ZSvr{rZApRANahPxd8Bvz5>96KRQ52 zQFY~J?@5&JW!dI+Qea-;;2Zo6#q6DQnMdbA2OvGJ61!2A2SZ=dX=d{lPT1ayy`QW- zyo0mFjjyHVkw@pj2?IhAhBW}=$gdPU3vZKx-CJcTypvb2cH>R_cH>@)*7)i?Xc&Ny zECBRTDe$A50NHPCnRqXMnt%Q|HXr}$#+#f*JO;+n0mK3TR1IhSvtI*x4v6764HJK&VZ8rf%o?i)=UhN?>i=Z2i#vGac+UGwW7ZOBXWY41f@> zd<_=lrPzjzNURxcGoQswCJ7>2&=Lm(b|Y9{9%GH#;qIoVgNSpmTrE>?(qVE zSO9+a^vdGE5yxFvm}PfMleip8E&~WT2v-63s6M7gTzfQEFg&tchx(yny2SnRXKSkY;zQw!Q$#H41Xc$Qn zHt0GDGS&j5PXauj063nb|0Qf2ix-$xN&qMu=F7jIpDsVbrj7ug{0iStAM#7g2Z{Lo zF<3-GHmn7t%0+<`y!&}}mmH+8fUfWuAoW^+3WsFjV}krV&-gZwre>_JP!RC6y4C}A zHGllcr{0hNa}pqUb)abtZt@&=3E&sQ$G+$Nl>js3fS^_-9c1;cwLHtN2ZYTh6o)RK zosZ3!whHhKb+dT0G<%=|x9+3b>mc#&WL0000XhY;LO>T(!=DQz$`sKGj zK{hErZnzv7$|~Da91{rLKp@s$aA7iZ1B91fO1QSg%*%VU)^Jkl5 zmWXrBGv5LWEwb2>!2WBjwOX3%thd2Nn*#Iq*lV{m_u21&gAN7yXPk9fn&+H%!9|x` V4%%?XUALuq&wUR(^vL5N|1bSVaCiU! literal 0 HcmV?d00001 diff --git a/graphics/interface/dodrioberry_bg2right.bin b/graphics/interface/dodrioberry_bg2right.bin new file mode 100644 index 0000000000000000000000000000000000000000..a93db06df057f30db2c2ce2bca06d75d7cc93ee8 GIT binary patch literal 1280 zcmb8tMUNCw6oAnJ4#C~s-Q5Z9?moCPgS)%CTjLIc%MN$`6Wz_E)2o?BCGT6@%6T`b zR21d*lv2_vee~8Vr)#WEO>&d}-qljmE@O-~DyMtwPEGRmt+aH?Y_rVF=^3X}le~Q- zriJF3X{w3F8oBM3n^sz3xey;Ip}1m-Dx$DLZn*B6op#tBCkk9tj7oUCd(FgD2zGwW*u+7#WANk|AUw-=GyKixu z(3!zLrlJbUE2pe7N*if}tpD(lh8n1^p1SI&9rua-8NvIrb<{z7?X=ZK>$ps8&kFXD z9=hwMt1de0l+>B=8;&^|^!;Ln8)m2>1{-9c0s8BwZ?a+k-*nSVHN|9;Of$$%gpI7MpFd(FW_Svo@_^{)od4Ip~1>_Su`(5P#JbmtAtv a1?Qb}HmxE4iN_v!=z;t0x$90^6aFvoEOjUV literal 0 HcmV?d00001 diff --git a/graphics/interface/dodrioberry_pkmn.pal b/graphics/interface/dodrioberry_pkmn.pal new file mode 100644 index 000000000..ed27897b7 --- /dev/null +++ b/graphics/interface/dodrioberry_pkmn.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +238 255 238 +41 41 41 +255 197 115 +230 164 74 +115 90 65 +246 131 164 +172 74 74 +255 238 189 +213 197 148 +115 106 82 +148 148 148 +106 98 90 +255 205 230 +180 139 90 +0 0 0 +255 255 255 diff --git a/graphics/interface/dodrioberry_pkmn.png b/graphics/interface/dodrioberry_pkmn.png new file mode 100644 index 0000000000000000000000000000000000000000..41ecd921d3d07c4ba215d1f72dd1fd6a400c5e68 GIT binary patch literal 3330 zcmV+d4gKe zwFl5>Ak0HLAv}!p4Gm4+L91{mQWRUJ{i1^TQ1)s_P7K(e9>!E^SA3t(Ftmgzhsy z$cugb&}t0>yPF2uf;#^M5LQv4RL^F9#HW{heNFCJU~$V&oF-OE4+F^)I5wepBq3} z(0oPly{p^+Pa2-)X@wiS5Eq_Y^$QJu;l^VgaPZh)xaz|%UK0n8_ZP12UpU|ov+o=n z^d0^%g%IG^OLiCTUAsFAh<@-|2mx*z1FQWfK{)SP15SO*vPcBW+Q}rOZ`|!7MDKSN z+aF|gLo9tGi(^4pmc&>qpPteJc*As3xBPTWEs5YQ`ggzJQD? zXb%M{W?UccIOC718q{wUQHE?inPzz)_KjMxa34 z^i&Di@UUpB6BVy7SJDAs>Vr02TZOSqjsmxp3P7_zr~@=;4RBzkr`j<4yPZ|bvWLZV zfKY(I=&@@#xRfzhyJ2!C0%I89j0cj6g%?#bD7AVeJW4-L^rF0I82GR?7~qWDP1S^0 zMJ52ltO&Hgl>lIfvmyvl1a$ZZsGku5nGWVhfLpaPf-dS$IrVU>DsU$S9#6u60`X7L z51LQ)13z{D3IN|P@C1f<@Jr2WYTix0I=H5JI zHP$^K0%P>0pqh)@ko8sAT0`+UoeB)|DX4-#rvNGOIh_iOQ4k6XSy0!PCulkTS~?XN zBD^xg44|S3I6{FT2;np;>DX;C zGjb#_=-Zw`vb=tnvKNTJ=qg6vF%+p~_ev}f2@Jy@5UM`a7=-}6Ozbd)D1vz$ zA*-l{N(N65pR~BMvmJUC4tQ!ifQqkOu|p_T&h~{e^@)D7@Vc-GeERln0fj1DW{* zNXdi3I}Y^*rUpb(9*FNaLzw7;V;~_9#J)3}CV|j^NXUc1V3%eI5;8O(Qu07N&QzfR zk(LL?c0*`Dq~(DKx}ylUMPxvvrex`65QLdo$NBh-g-3ITWY*57e-e_-#l;9SG+$Y`Li3rGR8vPBzhRb*P~3EN1Hm z>6?zc+!ds6WsZIjBkw`s>xbiVrXSAASvf1olIKscQSm?$&Csrb;Fm1>kI@ThR$9qv zUd!?I4Q_h_?9adH;ZTC*(;*~l_+0mOJV*oihk`Flu04Fy^OVD#t_T{L0emm-dy6gS zsR4Mk4{AQe9w(g;AJ@ue8xwm~=RSS4R^ z1X$J)9u4D7h%OO7AU(*ZCOQBkw8}_QP>K##1U*o8T8d80Gvr!vNh(=;rkemrE(M9Q*a-~^>0L&&y4?bK*?O`>fcw|vBp_K7 zAS)n!XX#_AKnC#-UZgg)i!OX&f7o|Gg@h7?1?bu6+jp-!U)a$%Luo*=oeKwdA5RSk zDb`8)C$S$yMUkflMBEAE+tL5fDn|pJ(NNP$W9L zWu4{w(eGPuvG=p4>+{jhnx&F;=G3HkX^CBeaXUAA zWZnRP2Dq}aodA002+)$l7INtJ%Nh&F=VZD%@Uzz3CGtII`8EsmLvyO%d8IWE7iz0q zEnj37aU^i2L^&`-N*a54gaf&=@S-_?!z!cHz2RI5=oFv+Kz#{VjX%;NWvkeF)tB zHLn5sV2JizZUdpe)ZgP)hYNPI&52I0t`75&O{Qv*} M07*qoM6N<$g0`|BW&i*H literal 0 HcmV?d00001 diff --git a/graphics/interface/dodrioberry_platform.pal b/graphics/interface/dodrioberry_platform.pal new file mode 100644 index 000000000..fc1f6a7e8 --- /dev/null +++ b/graphics/interface/dodrioberry_platform.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 0 0 +230 246 255 +255 255 255 +238 255 255 +246 255 255 +230 230 246 +222 238 246 +222 246 246 +238 238 255 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 diff --git a/graphics/interface/dodrioberry_platform.png b/graphics/interface/dodrioberry_platform.png new file mode 100644 index 0000000000000000000000000000000000000000..9074ec74045a74cc91f48ab5954a634d7e7d6965 GIT binary patch literal 310 zcmeAS@N?(olHy`uVBq!ia0vp^4nVBH!VDw>HYaZfQU(D&A+A9B*|+~d@b3SAApPvw zw|not-TU_K-MjxlDNL|O|D_U8^q{AUV~9oX+lk(MEebpiJDFyB-jLRJcy-A13ztgV zVIQ^9{2rNVuTZv&%0I$d_SI>4{dfG*(7~{6N67Jqy-nG(rpZQg%Vco{Noufo+Dwj; zJ+%6;)gI|GVTSiD)7(FXNl)d9kuo?}$a}ttafjfomMHb++j5?zpDMMWS-Hf z3HK$f&SXz=U7GS@`i8EAX&eo#^R|mPb1?VbUX;PLCg+P`Ys=J6YG*~V!n|Jo)bE(4 mY&5~(+I~;TS~pu8kv|OaW{DaWb)pAAUi5VJb6Mw<&;$TYW_e2h literal 0 HcmV?d00001 diff --git a/graphics/interface/dodrioberry_shiny.pal b/graphics/interface/dodrioberry_shiny.pal new file mode 100644 index 000000000..5d8b5b7a5 --- /dev/null +++ b/graphics/interface/dodrioberry_shiny.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +238 255 238 +41 41 41 +213 222 90 +172 180 49 +90 98 16 +246 131 164 +197 82 82 +255 255 156 +255 205 98 +139 106 16 +148 148 148 +82 82 82 +255 205 230 +131 139 16 +0 0 0 +255 255 255 diff --git a/graphics/interface/dodrioberry_status.pal b/graphics/interface/dodrioberry_status.pal new file mode 100644 index 000000000..028e4e20a --- /dev/null +++ b/graphics/interface/dodrioberry_status.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +230 255 255 +65 65 65 +255 255 189 +255 238 115 +255 197 0 +197 197 213 +164 164 180 +131 131 148 +255 197 197 +255 139 139 +255 49 49 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +255 49 0 diff --git a/graphics/interface/dodrioberry_status.png b/graphics/interface/dodrioberry_status.png new file mode 100644 index 0000000000000000000000000000000000000000..e48d499f03853a0f3ff5310d998412e1069c6140 GIT binary patch literal 195 zcmeAS@N?(olHy`uVBq!ia0vp^0zhoQ!VDx|6+TY^aRPioT%Y~_@960G|Nq|q?~4B) zWjK2D>XIc}nwzKmKYH|kclUooL!d%9_;1L-{rAQuAm7i^#W6%;YI4E>W(n3t2ZkdB zj7$cHZ{E1Uaws53=}d!WTXwsohn&NX zfFaO0dR1h~{Qi`42tusRf<8hBPnGzOr)62*1K9+OIbxpTla7~b0sDD=4q=`zWZ)8s z7{~IHITAh#a1@Y613VGuv9~oi_`e*NbqksqlSDLtH3EaW8{B4?P9;^@r>}tX;BR$? zPty*G9j7saVLJ1gJ6n{2#@RM^R4|srC7&He;V;Tx$n8 zj9T4|K1@Qm!1e*sD>iDd?y#F~o$p9X6#Tv6;LS#wd~YI6~w-6d5Z z-NjeHU*R3Q3I>secAEn9w)T@_?KXK)khAVqZz~U1Zccc}RtEk0w?%L_B&Vzlr09^f zh?{qdO*ja_AM|X2`U?<=T&V(8MpS?`AQ67GS6m$`4@L0bDldGL>I$F&aFxM5V6uz4 zX!ayX1lj>8r8=P}+yN(EV-OHBP|1jC#C#I*e-xmx;sN86VAZQsLhIo-X8un@HQQL5 zsM_3*_rL{b#T@DZbTNT6;MxK`cqBPns?hl0F&B}@bI8XE_((C_9>8rnP)@1_%1PBg zd57(+c>~}jrxp}1smD{%O9!;sGzZx40HTVl61|P8;=$U>FF<)?nVNk1m;e9(07*qo IM6N<$g5m~YMgRZ+ literal 0 HcmV?d00001 diff --git a/graphics/interface/pkmnjump_321start2.pal b/graphics/interface/pkmnjump_321start2.pal new file mode 100644 index 000000000..9fa1875d3 --- /dev/null +++ b/graphics/interface/pkmnjump_321start2.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +156 213 230 +255 0 255 +255 0 255 +255 0 255 +255 0 255 +255 0 255 +255 0 255 +255 0 255 +32 32 32 +131 49 49 +230 65 41 +156 65 65 +255 90 74 +172 115 57 +255 189 74 +255 255 255 diff --git a/graphics/interface/pkmnjump_321start2.png b/graphics/interface/pkmnjump_321start2.png new file mode 100644 index 0000000000000000000000000000000000000000..2823feb818c2e9928ad421c5cf786ce0a47b6d12 GIT binary patch literal 815 zcmV+~1JL}5P)<*0000mP)t-soYm(4 z0RR60|Nj90{{a900RR60|Nj90ARr)vF)`*rDV#w;|5{3{b2p21CxG89&|d)nSzZwgH6;LF#+XAU zGyt~u#RvU$K%YNN@d>|1yQMGSz}vE}0mK(;FdLmbbMsUHTGJrlVk;1*G9$SKu&fss zTf`d+WtawZ2ABuA01;(|K62}h0&`wZ6JS}dxa2N7IRMzMlf&tkjQQ~XI3IpI%ZHck z?Qilyg#(-CgHzQEeLm1f`{F~)hff(N@YOCfcnoBWbPilO8$92I0yzV4oSMl8?M<|_ zW*W~qnk{yO94zC5$c6DLhiU+wI#p{9fM#3I432b-=HohCtVh89IdE$MnGUpsX#k3@ z2m%=20OYpl(9i%O(W@`o8Au>XM~a+`+aChnbVpMGs!4|)=nTaHfmu56nwT=PbQpX6 zT}?-o&?!z%)xm;yRtZQq4`}~l0{@d$B8lAHYD^O`!7+9h04g9?%L33ZvBI_)u9o2+ z`9NI-V0APofn4!`N~ctz(9%)@JK)VGxnv;BQ~B_k>d**CrO@UX*liJqeJPdQg)=GwxLlP*jOpzg z?=vdKv40TXKOod49002ovPDHLkV1nb^Y$^Z% literal 0 HcmV?d00001 diff --git a/graphics/interface/pkmnjump_bg.bin b/graphics/interface/pkmnjump_bg.bin new file mode 100644 index 0000000000000000000000000000000000000000..68303ba7e4539a35e96a88a2c56ca98f97cc3d61 GIT binary patch literal 1280 zcmeIw$8N$v6ougvICK)zJD6UE-aGIASee0$;>LoIW&BIF7yj-@R~8WW>S)09M$=V; zby`9|UHW~9kypd5O^!J9^;_()_fBw~zUPixU*ALvZFJld9KORgTWtDzfiWhSV&^i!{QdBz1-Iqim<6jxq&ww%5{ zwr=0Qwy!+@{m=jV%HH(1f3d$${62O5#~UgC^+w7E5CjoI7!gDfLtK_XQpe=I1mm(8 zql_@j5Xm3|RNg=eX=IQ^4tW$%L zNklN{-JtarEuMB<*raeO4f zUwlZCS*{?U5URH;(H066=JA0cHf^9#8}d|Yf)~=Vle5Gy4PhDs@upx{^#uJvng%kS z-a~T!(mO)6b^}o`1lGax=#-||Le$p?jY+O#nPPPLv}jHY(cBVRf=6T^SJ^$9S{Ev9 zW@@5$1O*F)$QYhgv=H>)g-DZy@Gvf+XdpU31+lNH0f+4JeUo>f9F literal 0 HcmV?d00001 diff --git a/graphics/interface/pkmnjump_pal1.pal b/graphics/interface/pkmnjump_pal1.pal new file mode 100644 index 000000000..936a2b39f --- /dev/null +++ b/graphics/interface/pkmnjump_pal1.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +156 156 197 +65 148 74 +82 180 74 +106 205 74 +255 0 255 +255 0 255 +255 0 255 +255 0 255 +255 0 255 +255 0 255 +98 98 82 +205 189 82 +255 246 82 +255 255 255 +238 172 131 +238 230 131 diff --git a/graphics/interface/pkmnjump_pal2.pal b/graphics/interface/pkmnjump_pal2.pal new file mode 100644 index 000000000..d7fc1394b --- /dev/null +++ b/graphics/interface/pkmnjump_pal2.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 0 0 +49 123 57 +65 139 57 +82 164 57 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 diff --git a/graphics/interface/pkmnjump_pal3.pal b/graphics/interface/pkmnjump_pal3.pal new file mode 100644 index 000000000..6b73be372 --- /dev/null +++ b/graphics/interface/pkmnjump_pal3.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 0 0 +246 246 255 +0 0 0 +222 222 213 +255 156 24 +255 222 189 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 diff --git a/graphics/interface/pkmnjump_results.bin b/graphics/interface/pkmnjump_results.bin new file mode 100644 index 0000000000000000000000000000000000000000..b17c5052c352e975a19636f0f03bd17eca6fe345 GIT binary patch literal 8192 zcmeI!Rc{+n5C+g}nS08cGBYzXGc%{m3@I}+rp)j!t3E`LWykirN8iKlm3E}PMBXdg^PSp+*{OqN!$@YvF>6E)`YZ60Nk>MqBN)*Fmb>WmjA+ zsy<0O>XakbRHik58E+vF0wE9rArJ!90*Ub^WxK|Dhs1VSJL zN=+cqS(jRJy}c024; zVVB+Z*sIDr?|tymC!c-EnnU~Scfdi19CpM}#~gP;MS9XHr=9WDH{bp6(=WgM$*ND% av(6Qnzp)2o`IUPA$NfVf1VW(n1pWb916OhY literal 0 HcmV?d00001 diff --git a/graphics/interface/pkmnjump_results.gbapal.bak b/graphics/interface/pkmnjump_results.gbapal.bak new file mode 100644 index 0000000000000000000000000000000000000000..8b89d28707df09d365ef84f8375e7c0440fa1c01 GIT binary patch literal 48 zcmXR;60$C}za?j@Jjdx@SdV6i-cPOl>XVDIO+(FW?7vkBIEXS>Ffe>z{J@yNc!q%i E0I|*xXaE2J literal 0 HcmV?d00001 diff --git a/graphics/interface/pkmnjump_results.pal b/graphics/interface/pkmnjump_results.pal new file mode 100644 index 000000000..aca961de3 --- /dev/null +++ b/graphics/interface/pkmnjump_results.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +156 156 197 +148 197 115 +172 222 123 +213 180 57 +238 205 65 +230 164 131 +246 189 172 +98 98 82 +164 148 90 +205 189 82 +255 238 74 +156 164 230 +90 90 106 +172 148 106 +230 205 123 +180 189 246 diff --git a/graphics/interface/pkmnjump_results.png b/graphics/interface/pkmnjump_results.png new file mode 100644 index 0000000000000000000000000000000000000000..fe1cb2609ee6462354d6e3242e26e889b644ada0 GIT binary patch literal 2129 zcmV-X2(I^uP)LqZ0000mP)t-soSem! z#dECQd)2f#?#)5wq=WXotYTtPq?B6Cy;A?~N}QzTT3TwXlxpV9d$hgwK!bc3000Nv zNkl^!19k@I0z-HQ=Y0f#fE=9>2;1wVii~Lx1@2R@=qY!q}V|%k+$GBeqjMvI> z!F2;1+$$Y?fBk#?v#hVz^QKT9%chPS@c!YO(n0$Jl{L-vdeKzOf0j+t)Yl#Ny|r}E zJ_#&3uwioWz`6FJ{aaw=;2aH?P0@MKKHVriCa}3q;KII16@tTirpNZr)#|Qk76slS zze2W(@yfu5_DAB@UgM(b)rb_R5(G=>r%DdTW&;O#UpP3YhlMvE%T4n^-dAhu3|P&Q zg8+6w)TmA{uy}CrE`g8;U@aTf8PowKh@QaGK>Xf@JKOy=|yu(4O{|z!kzWr;gMqa(u*l$Jq6;5Ekkt-&dU_TUPPxcV?7mo zA&6@DTd102i@|@*-vGKnOn=3`}Cy%!<9ZFlQY60nqx6HN&S1 zFA9tUvjT&IZF4kS3-kR!RlFv;=vI z$;kRtS#2dNFyDYEXq40wWfPSudxjiUPpoIUhXQK{yBg=boCJ={i2|5lK^qs%Ex;3X z?1V*D8zv_rs*?_cx{(zd(ShUR7>BrrRAV(gKIXF8jE8(W91d0Sa2TY4%^k^^6Mr$WPo=d z2Ip{SUsu}-EbM_me1hQ)&^o*iHhmCImk1!X%^)6wFOExdgV%x&P>Z}~NTNzeKjw8j zgmuRhScPLf4Lwm$r~s-~>c@3{&Iw@CO~=Ha64{IEKk_-J6oO_jz#{I6>pWlV1K-AV zACzZm`fXhQL9j@mc}DPUTsv3{Jss2QF0S#O>9PGi%h)ul@a{Z|9EQsdqC*ROX1vEBbd@XIoABKr32`JP}pO0U;{ zwFGY+yt!GnA;J&mD-5_&RVdWYw^r;H^8LqYKYL zFhizsF2oyY9bWjNvORdz_Wwisg3Z(W zz-qgr363Nm&{Snx>!>Z`dxGzmfrb+Cqs$?UuS~i`_-?a~P3U{q5yzAdyK-m~&doQz+tLyHn*Ppl z#FyHK*;Y*3CFxjjKepL9j!w~>HXgRW&<0F8))U)!XbZsY8ywJ9rWAN9P&%f4mhZzx zO9S~#OKt+&H{faeT#t7^>PV2ybX&GlNM!r6LThsk5Kos)GW^VUjvw0>>?2DNa&Sm+ zbh;}AYmByhYd6F-J@6sc^pDgtt>xV2M6Ka5t>RdT0-FK1q@J?`nsv$wt=3qH1kxeu zIZI2v`J2}7^cBHpkJwpS^6dbg)^Ga?U>a{EeG=DyG_zeWjW;&m18teLWt= literal 0 HcmV?d00001 diff --git a/graphics/interface/pkmnjump_rope1.png b/graphics/interface/pkmnjump_rope1.png new file mode 100644 index 0000000000000000000000000000000000000000..cdf6075d06279423322dc34ad156bc95dddadfa0 GIT binary patch literal 318 zcmeAS@N?(olHy`uVBq!ia0vp^3P7B|!VDz)cyd<*DT4r?5Z5_#jyg{93fkh8b=K=Y z!+$iCloWJ!Z_xj5LI3~%f48Rj-LvLdGiRy-^`7)}aSXBO-8<#BRI>t4^KJ75@BeR- zKB1_x<7?7p@j3zFDfbuM485l(Xr`sNuxF<^BahOShtoPTH*b|v&rzu=Vf~fC`p9p_ z`8SI-E1Vb@I+NtzmdKI;Vst E0LYStg#Z8m literal 0 HcmV?d00001 diff --git a/graphics/interface/pkmnjump_rope2.png b/graphics/interface/pkmnjump_rope2.png new file mode 100644 index 0000000000000000000000000000000000000000..09a4b1dfc925d81b942ae09263335121334f07fb GIT binary patch literal 309 zcmeAS@N?(olHy`uVBq!ia0vp^3P5~-g&9ar7pQRsQU(D&A+B@g9Ce)H6|}`G>#Wy* zhW}_NDJkge-k|^Ag8u*i|87n5yJyX_X3kUv8RY5W7~;|Sc3L)Hvja!VL$=d@^>1(K z41BhD-7)veYd+_Txx}~~$kBJI)Zl-bdvfpLUK{q3PoL!@{5_Tb9by#Ef7K8)(~5^x z{M;gUv*ptDvmfu?`9#XE!g_N4#dcc@7LgLGA05ed9jrpRCub>jZhLan`TvgpJl~$I z3RLl|U^zEQ`cdqR|IM=-lQ#8=zxGz-%87jRgi(L_0j`UpT2~%M)Svv|Ag;fQxy|DH vp`^lxeD|()Op=obc0S3j3^P6ubXbAoi2RN}3O|~E z{NFEXB6h{E`jyFDVd*jvF{O*_OJ*|Jqz1l{)I80&W0va#=P1plJ6Apy^kqHOny)wi z>9Nn&emyfUpUQl?pJ9=@m%>&n;iFG8vwS@B58pAHHa}^zdC8H>C%-KE`(A0`!Q{2u zBZ|Xy!t#R++-$Ut2K|<0`x@V{c=mOlcNVkuI$nJK$m2G{Ki=rSJ^PXZ5AJKWeK@;v z+Cz7zkUPS+-!mrEa^Jq9e)NT1d%n)c-i6uyOQuw{T%M(#y1QicYsOSP>8ZjQN>6}( OWAJqKb6Mw<&;$TcQ>%2uHfrGuyr#xdED+;On*ard$zz?cAoRy fIbpH~uB~8<>r#jcXm(x#bP0o}tDnm{r-UW|68dZP literal 0 HcmV?d00001 diff --git a/graphics/interface/pkmnjump_star.png b/graphics/interface/pkmnjump_star.png new file mode 100644 index 0000000000000000000000000000000000000000..6faef11f869d52bc2b53e42504d5a48e14e548e6 GIT binary patch literal 326 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnF3?v&v(vJfvg8-ip*Ew^JI!^Hl+TxXU*6TmR ze>9Yo6m)iP(Eo2i|NsAgx2E~sv*uYdXQ~4AUi5Tv4AGeAJK><1c@Vej|&N|e8e&Rf%n$wy}#F|PCRr)`ulmQ+Cx(DdhaiCbaicQ zbN8CIe3ILWr7Irl8K&86^E}fc5t_V4E$`FaI}8h))>&GJ6h~b>z~+$XE3?mAEwb4& zjlo+|A@0XfDOvx_Zr+cF^KMLL)^%|ICVFD}C)JbJze)5hNekF*xcJV)a~t}9lr{xC zpDlh@%*~*=$+zjlrD>HOo>d#Y87J!MNA7rcNdMXj``9GCeQ%fjmH+cs>5ZYR>K~xz O7(8A5T-G@yGywpyVw8&j literal 0 HcmV?d00001 diff --git a/graphics/interface/pkmnjump_venusaur.bin b/graphics/interface/pkmnjump_venusaur.bin new file mode 100644 index 0000000000000000000000000000000000000000..093c0a5a5c34af0dcd8ccf98ebe7a2cdeaede936 GIT binary patch literal 4096 zcmeH}2TxT&5QQH_Dbl1#QJOTVpKt(a(z}l$AiYShQkACg*SU`u6Coj)3nXfCv&m*} z?tGJ(lbw_G;q#WKz~56qzCV}iI>HsEP=)-?Vd6swC5&*M@tk;dj0{^rE!FwOrA9kA`$ww!*_WhxD1 zFez9{8Rb+^3B0FSO=?tw>dkyT4K&h3GaqSTK>g}duX@aU554r!&j6op{BK-i8V&lN zseV7Bj4|%`-Y+SZmf&HN@?Y_r2I-`L|=M>^Dj_Rai0 z2OM(5G2i*Yh0b-RQ=ORk6HYnfoC|*P%X$A@Ioe$Y{O`7#-TUR|()oAgz5ni2$g1R1 G#9aeFHM~av literal 0 HcmV?d00001 diff --git a/graphics/interface/pkmnjump_venusaur.pal b/graphics/interface/pkmnjump_venusaur.pal new file mode 100644 index 000000000..a3514b004 --- /dev/null +++ b/graphics/interface/pkmnjump_venusaur.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +213 213 213 +32 98 49 +98 156 115 +90 205 148 +139 238 189 +139 57 0 +189 106 49 +16 16 16 +230 74 65 +255 131 115 +156 246 139 +222 205 49 +255 238 82 +65 164 24 +106 205 65 +255 255 255 diff --git a/graphics/interface/pkmnjump_venusaur.png b/graphics/interface/pkmnjump_venusaur.png new file mode 100644 index 0000000000000000000000000000000000000000..d555d324dc31917549ee303d267aa06b175b5367 GIT binary patch literal 2082 zcmV+-2;KLIP)p;sMj*wZM7?7{Y~ zrnG+?=dg{+cp;}HYSx#z3dXk?Y~<@C2=zsWU@){`P6GpO7|#ap&G}wcx7-?QAR#3r z<9=VgdiCqq^g03oDY;3PO2gkc~9|HmlQfPx%B zA3&l(*lo1rK{yCCAWcv!{6h$a4bkw`S_DXD1l2n2{z3RmFd-URpaE%u3Q+s-w6V8!IY2>5Gn;r2c4aC^0cnDRY+@JpFqi_Q35MCk5TUj5 zfKq}on+OK7lLM3yoJ@>PgH)gZr34i`eLWgTUm^4rAdwNAOk{INK|Wu2)Dqv(K8I5J z+jLz6!zjq#^LSKhK5B?4RIzuqvxx>TF=mJuqt$GBjZ+`1P zeFJ-t3G_t4mXenuN%)7JXnF1KA@(NK3fV-)&-Z%A$tA@95+&I`ksTdlHjx?M9>4BA zjT0!&OY-nU1`V|WPwpQlNfI;TFRy#O1WuqRQG|P=d9}p(x43>8tIRo~`uW0Y;;eGoj4xx?CG8&D3V5GHXZ$WtWmOm-}e`<{&F?@}c1Og5}C36lA{ z6ycq-&R(_y!`*P*b>Zk?H!N%EGD#TO^$tGx#l>*4QGy^&#%#p-SO;ic)k#r@(ZYAt zvdT*dX9P?MjLNTXQ$e*}ah#e31veoW>m3;N>-}_%71u@(rUQw^VAne^+_f}_nvUcv z2YwtjqAjW=R$Mm|Jba@BHa>WQGQonIhEQAXkf7o!L5g@Pi$GVw8{(HtdULq%%X@bDqES&q^KCwbduQ_Am@7j zt@7a(i;kYS;v$XL-E0SIH(1|ZaaYWutpy7taKCm}w7|A-f6DO2O}#~UXCGAEPvF2x z2~;cyR=A}F@Q(Q0x;a7gk!2O>f~8i#{uu;-j!9_K^P7fC4C&j#@@*ycf%<<53Z~SZ?@Tv z%E{?0s=D<`(Jl$|<{BPwh6;9vV%fBiU?Mxw*t-<#>u{SN(-a-#m1e+l9&!|I$E|4w zlfkDb!pqKsX@SY}6p<_`gUKihRv-o4oGWolw3f;6cejEFY2VlEmgsfP$^KjGs(h`* ziXOb~=LH3^d;?^95WQ`>HWi4N{`Y?wh5uJj@Mm1y98j;)4WeQ6VzYnOK6f?-#0__N?d9P`mG zhCib*_%V8Z*56bOXW{T9^y2t&qakQJ5j&8#ZvzF{|GNz-e@28;R1OQ{!#jq)}3EaO{Kam+7bfFqhVKeQh~t@RLqMfsH*XK z8|f{mC5V2KS?ghJn7s>Kb}!=*>?mg{lWE*@*ZJ$?UT^#|8O7j;a-a4Csr!3B)NAk$ zf#Aj8Q88W2H60l3KUCLyPlQ^NHCni6Bc7F_t!m~QohSvI)f<(xDX?`x(?vBs z26tJto;3}hS#;QEMK#T|eI`tOfBx-RWs?dDx9nV=6qvI^uj_bjuPhwv6;(5H0>+$& z=0|wMaC{3Sn@zpNbUA>*r1QBXgheGWtC^Ew>UT?ehExm0->Db>0n`NHt-Hi8oB#j- M07*qoM6N<$f*bMRHvj+t literal 0 HcmV?d00001 diff --git a/graphics/interface/test.bin b/graphics/interface/test.bin new file mode 100644 index 0000000000000000000000000000000000000000..34b783c7641102ec5b9a531d517f1790e4d980f1 GIT binary patch literal 1152 zcmeH^KTE?<6vdB&LlX&+QW_Kl({Ip#xC-evXh6`RF0bGRXj~lpzh>=}iqOG9>f|7W z&Jv`%1nS^c+%v`VVj_`tc}_Ib4KCszVi-h2E1sF=)=ILHZc_Tsv`8? zv@p8qP2XaH(P<1Ej5(|q{^F5$P}kwdW5iE7o>!;(@8tp0phAV{Cn Date: Sat, 16 Sep 2017 03:24:19 -0500 Subject: [PATCH 09/13] Remove unneeded files --- graphics/interface/pkmnjump_results.gbapal.bak | Bin 48 -> 0 bytes graphics/interface/unk_cursor_arrow.4bpp.lz.bak | Bin 44 -> 0 bytes graphics/interface/wonder_news_1.4bpp.bak | Bin 348 -> 0 bytes 3 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 graphics/interface/pkmnjump_results.gbapal.bak delete mode 100644 graphics/interface/unk_cursor_arrow.4bpp.lz.bak delete mode 100644 graphics/interface/wonder_news_1.4bpp.bak diff --git a/graphics/interface/pkmnjump_results.gbapal.bak b/graphics/interface/pkmnjump_results.gbapal.bak deleted file mode 100644 index 8b89d28707df09d365ef84f8375e7c0440fa1c01..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 48 zcmXR;60$C}za?j@Jjdx@SdV6i-cPOl>XVDIO+(FW?7vkBIEXS>Ffe>z{J@yNc!q%i E0I|*xXaE2J diff --git a/graphics/interface/unk_cursor_arrow.4bpp.lz.bak b/graphics/interface/unk_cursor_arrow.4bpp.lz.bak deleted file mode 100644 index 4f741ccd10c11c7a4c45f6354ad01679d3926223..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 44 wcmWe|U|>*SVA#NT;VuKi2Td1V2Ieaa%pi(`|AWgH25x?a4-Wq?=rRBS0OzL)>;M1& diff --git a/graphics/interface/wonder_news_1.4bpp.bak b/graphics/interface/wonder_news_1.4bpp.bak deleted file mode 100644 index 937b84e84a31fc56366b7d6f93d49a52e174645d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 348 zcmaisF>b;@5JmrF*I9xAZy$jzPGEUU3MiJ^NTH`gq9YYoa5{H^2GOVS5z?n|nGSBi z+`ufcCDWxD&42U$=nEkMm~tAAV@k*vlUQp@@w*5yG8n|PoG-7D;4q>&UNvc-->O2C zDF;Q$D;D}^@p Date: Sat, 16 Sep 2017 14:08:47 -0500 Subject: [PATCH 10/13] Add missing file and rename data2.s to link.s --- data/{data2.s => link.s} | 0 graphics/interface/wonder_news_1.bin | Bin 0 -> 1440 bytes ld_script.txt | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-) rename data/{data2.s => link.s} (100%) create mode 100644 graphics/interface/wonder_news_1.bin diff --git a/data/data2.s b/data/link.s similarity index 100% rename from data/data2.s rename to data/link.s diff --git a/graphics/interface/wonder_news_1.bin b/graphics/interface/wonder_news_1.bin new file mode 100644 index 0000000000000000000000000000000000000000..f8185b28ee04fbb5286e6eaad0d7dcf4d74fd8b0 GIT binary patch literal 1440 zcmeH_OAf#w5JFM0{(Jx9w$Ter*gAPz2nl%s5lJ92kjQuhGRcC9CQw<}F)#%N``=x7 X1=jBRuH|?C*>0G7WijexZuIH{qGKWj literal 0 HcmV?d00001 diff --git a/ld_script.txt b/ld_script.txt index d05b56fb6..ba20f2ad6 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -292,7 +292,7 @@ SECTIONS { src/sprite.o(.rodata); data/io_reg.o(.rodata); src/string_util.o(.rodata); - data/data2.o(.rodata); + data/link.o(.rodata); src/rtc.o(.rodata); data/data2b.o(.rodata); src/battle_4.o(.rodata); From 5e12833b13223ecc6a5a9c91332ed71303358680 Mon Sep 17 00:00:00 2001 From: Diegoisawesome Date: Sat, 16 Sep 2017 15:50:08 -0500 Subject: [PATCH 11/13] Finish merge --- include/global.berry.h | 4 ---- src/pokemon_2.c | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/include/global.berry.h b/include/global.berry.h index 4b9ca644c..a77da20ba 100644 --- a/include/global.berry.h +++ b/include/global.berry.h @@ -46,10 +46,6 @@ struct EnigmaBerry u8 holdEffect; u8 holdEffectParam; u32 checksum; - u8 pic[(6 * 6) * TILE_SIZE_4BPP]; - u16 palette[16]; - u8 description1[45]; - u8 description2[45]; }; struct BattleEnigmaBerry diff --git a/src/pokemon_2.c b/src/pokemon_2.c index 9549a6dcd..30e788874 100644 --- a/src/pokemon_2.c +++ b/src/pokemon_2.c @@ -32,7 +32,7 @@ extern const union AnimCmd* const * const gUnknown_08309AAC[]; extern const union AnimCmd* const * const gUnknown_08305D0C[]; extern const union AnimCmd* const * const gUnknown_0830536C[]; extern const u8 gBadEggNickname[]; -extern const u8 gEggNickname[]; +extern const u8 gText_EggNickname[]; extern u8 GetBankSide(u8 bank); extern u8 GetBankByPlayerAI(u8 bank); @@ -416,7 +416,7 @@ u32 GetBoxMonData(struct BoxPokemon *boxMon, s32 field, u8 *data) } else if (boxMon->isEgg) { - StringCopy(data, gEggNickname); + StringCopy(data, gText_EggNickname); retVal = StringLength(data); } else if (boxMon->language == LANGUAGE_JAPANESE) From 16c05694fb02eb979f62a0de2f728772f715c883 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Sat, 16 Sep 2017 21:32:37 -0400 Subject: [PATCH 12/13] split remaining rom files. --- asm/{rom_8034C54.s => battle_1.s} | 0 asm/battle_anim_80D51AC.s | 2446 + asm/{rom_815A0D4.s => battle_anim_815A0D4.s} | 1970 - asm/{rom_818CFC8.s => battle_dome_cards.s} | 0 asm/battle_frontier_1.s | 16014 +++ asm/battle_frontier_2.s | 31336 ++++++ asm/{rom_8072304.s => battle_interface.s} | 3059 - asm/{rom_817C95C.s => battle_link_817C95C.s} | 0 asm/battle_records.s | 522 + asm/battle_tent.s | 1028 + asm/{rom_8161F74.s => battle_tower.s} | 3765 +- asm/berry_fix_program.s | 592 + asm/contest_link_81D9DE4.s | 890 + asm/{weather.s => field_screen.s} | 2690 + asm/fldeff_cut.s | 1486 + asm/fldeff_groundshake.s | 596 + asm/fldeff_softboiled.s | 339 + asm/fossil_specials.s | 998 + asm/international_string_util.s | 476 + asm/item_icon.s | 468 + asm/item_menu.s | 6452 ++ asm/item_menu_icons.s | 637 + asm/learn_move.s | 1646 + asm/list_menu.s | 1643 + asm/mail_data.s | 589 + asm/map_name_popup.s | 570 + asm/{rom_8151534.s => math_util.s} | 0 asm/menu.s | 5505 + asm/menu_indicators.s | 1442 + asm/new_menu_helpers.s | 1178 + asm/party_menu.s | 17828 ++++ asm/pokeball.s | 2861 + asm/pokemon_icon.s | 822 + ...rom_80C6FA0.s => pokemon_storage_system.s} | 7071 -- asm/pokemon_summary_screen.s | 13904 +++ asm/{rom_81BE66C.s => pokenav.s} | 25705 ----- asm/rayquaza_scene.s | 5993 ++ asm/{rom_81700F8.s => reset_save_heap.s} | 0 asm/rom_80AEFFC.s | 2698 - asm/rom_813C5BC.s | 530 - asm/rom_818E9AC.s | 83686 ---------------- asm/save_location.s | 205 + asm/script_movement.s | 577 + asm/smokescreen.s | 214 + asm/trainer_rematch.s | 206 + asm/{rom_81BAD84.s => unk_81BAD84.s} | 0 asm/unk_sprite_file.s | 607 + asm/unk_text_util.s | 99 + asm/unk_text_util_2.s | 583 + asm/unk_transition.s | 725 + asm/unk_transition_2.s | 268 + asm/use_pokeblock.s | 3771 + asm/walda_phrase.s | 543 + ld_script.txt | 64 +- 54 files changed, 128799 insertions(+), 128498 deletions(-) rename asm/{rom_8034C54.s => battle_1.s} (100%) create mode 100755 asm/battle_anim_80D51AC.s rename asm/{rom_815A0D4.s => battle_anim_815A0D4.s} (86%) mode change 100644 => 100755 rename asm/{rom_818CFC8.s => battle_dome_cards.s} (100%) create mode 100755 asm/battle_frontier_1.s create mode 100755 asm/battle_frontier_2.s rename asm/{rom_8072304.s => battle_interface.s} (64%) mode change 100644 => 100755 rename asm/{rom_817C95C.s => battle_link_817C95C.s} (100%) create mode 100755 asm/battle_tent.s rename asm/{rom_8161F74.s => battle_tower.s} (67%) mode change 100644 => 100755 create mode 100755 asm/berry_fix_program.s create mode 100755 asm/contest_link_81D9DE4.s rename asm/{weather.s => field_screen.s} (73%) create mode 100755 asm/fldeff_cut.s create mode 100755 asm/fldeff_groundshake.s create mode 100755 asm/fldeff_softboiled.s create mode 100755 asm/fossil_specials.s create mode 100755 asm/international_string_util.s create mode 100755 asm/item_icon.s create mode 100755 asm/item_menu.s create mode 100755 asm/item_menu_icons.s create mode 100755 asm/learn_move.s create mode 100755 asm/list_menu.s create mode 100755 asm/mail_data.s create mode 100755 asm/map_name_popup.s rename asm/{rom_8151534.s => math_util.s} (100%) create mode 100755 asm/menu.s create mode 100755 asm/menu_indicators.s create mode 100755 asm/new_menu_helpers.s create mode 100755 asm/party_menu.s create mode 100755 asm/pokeball.s create mode 100755 asm/pokemon_icon.s rename asm/{rom_80C6FA0.s => pokemon_storage_system.s} (75%) mode change 100644 => 100755 create mode 100755 asm/pokemon_summary_screen.s rename asm/{rom_81BE66C.s => pokenav.s} (54%) mode change 100644 => 100755 create mode 100755 asm/rayquaza_scene.s rename asm/{rom_81700F8.s => reset_save_heap.s} (100%) delete mode 100644 asm/rom_80AEFFC.s delete mode 100644 asm/rom_813C5BC.s delete mode 100644 asm/rom_818E9AC.s create mode 100755 asm/save_location.s create mode 100755 asm/script_movement.s create mode 100755 asm/smokescreen.s create mode 100755 asm/trainer_rematch.s rename asm/{rom_81BAD84.s => unk_81BAD84.s} (100%) create mode 100755 asm/unk_sprite_file.s create mode 100755 asm/unk_text_util.s create mode 100755 asm/unk_text_util_2.s create mode 100755 asm/unk_transition.s create mode 100755 asm/unk_transition_2.s create mode 100755 asm/use_pokeblock.s create mode 100755 asm/walda_phrase.s diff --git a/asm/rom_8034C54.s b/asm/battle_1.s similarity index 100% rename from asm/rom_8034C54.s rename to asm/battle_1.s diff --git a/asm/battle_anim_80D51AC.s b/asm/battle_anim_80D51AC.s new file mode 100755 index 000000000..c2ea27485 --- /dev/null +++ b/asm/battle_anim_80D51AC.s @@ -0,0 +1,2446 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_80D51AC +sub_80D51AC: @ 80D51AC + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =gBattleAnimArgs + ldrb r0, [r4] + bl GetAnimBankSpriteId + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + bne _080D51D0 + adds r0, r5, 0 + bl move_anim_task_del + b _080D520C + .pool +_080D51D0: + ldr r1, =gSprites + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r4, 0x2] + strh r1, [r0, 0x24] + ldrh r1, [r4, 0x4] + strh r1, [r0, 0x26] + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + strh r2, [r0, 0x8] + ldrh r1, [r4, 0x6] + strh r1, [r0, 0xA] + ldrh r1, [r4, 0x8] + strh r1, [r0, 0xC] + ldrh r1, [r4, 0x8] + strh r1, [r0, 0xE] + ldrh r1, [r4, 0x2] + strh r1, [r0, 0x10] + ldrh r1, [r4, 0x4] + strh r1, [r0, 0x12] + ldr r1, =sub_80D5220 + str r1, [r0] + adds r0, r5, 0 + bl _call_via_r1 +_080D520C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D51AC + + thumb_func_start sub_80D5220 +sub_80D5220: @ 80D5220 + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r3, r0, r1 + ldrh r0, [r3, 0xE] + movs r2, 0xE + ldrsh r5, [r3, r2] + adds r7, r1, 0 + cmp r5, 0 + bne _080D52C6 + ldr r2, =gSprites + movs r6, 0x8 + ldrsh r1, [r3, r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + movs r6, 0x24 + ldrsh r0, [r1, r6] + adds r6, r2, 0 + cmp r0, 0 + bne _080D5264 + ldrh r0, [r3, 0x10] + strh r0, [r1, 0x24] + b _080D5266 + .pool +_080D5264: + strh r5, [r1, 0x24] +_080D5266: + lsls r2, r4, 2 + adds r0, r2, r4 + lsls r0, 3 + adds r3, r0, r7 + movs r0, 0x8 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r6 + movs r5, 0x26 + ldrsh r0, [r1, r5] + cmp r0, 0 + bne _080D5286 + ldrh r0, [r3, 0x12] + b _080D5288 +_080D5286: + movs r0, 0 +_080D5288: + strh r0, [r1, 0x26] + adds r0, r2, r4 + lsls r0, 3 + adds r2, r0, r7 + ldrh r0, [r2, 0xC] + strh r0, [r2, 0xE] + ldrh r0, [r2, 0xA] + subs r0, 0x1 + strh r0, [r2, 0xA] + lsls r0, 16 + asrs r3, r0, 16 + cmp r3, 0 + bne _080D52CA + movs r0, 0x8 + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r3, [r0, 0x24] + movs r5, 0x8 + ldrsh r1, [r2, r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r3, [r0, 0x26] + adds r0, r4, 0 + bl move_anim_task_del + b _080D52CA +_080D52C6: + subs r0, 0x1 + strh r0, [r3, 0xE] +_080D52CA: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80D5220 + + thumb_func_start sub_80D52D0 +sub_80D52D0: @ 80D52D0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r6, 0 + ldr r2, =gBattleAnimArgs + ldrh r0, [r2] + movs r3, 0 + ldrsh r1, [r2, r3] + cmp r1, 0x3 + bgt _080D52FC + lsls r0, 24 + lsrs r0, 24 + bl GetAnimBankSpriteId + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0xFF + bne _080D5352 + b _080D5356 + .pool +_080D52FC: + cmp r1, 0x8 + beq _080D5348 + movs r1, 0 + ldrsh r0, [r2, r1] + cmp r0, 0x5 + beq _080D531C + cmp r0, 0x5 + bgt _080D5312 + cmp r0, 0x4 + beq _080D5318 + b _080D5324 +_080D5312: + cmp r0, 0x6 + beq _080D5320 + b _080D5324 +_080D5318: + movs r0, 0 + b _080D5326 +_080D531C: + movs r0, 0x2 + b _080D5326 +_080D5320: + movs r0, 0x1 + b _080D5326 +_080D5324: + movs r0, 0x3 +_080D5326: + bl GetBankByPlayerAI + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + bne _080D533C + movs r6, 0x1 +_080D533C: + ldr r0, =gBankSpriteIds + adds r0, r4, r0 + b _080D5350 + .pool +_080D5348: + ldr r1, =gBankSpriteIds + ldr r0, =gAnimationBankAttacker + ldrb r0, [r0] + adds r0, r1 +_080D5350: + ldrb r3, [r0] +_080D5352: + cmp r6, 0 + beq _080D5368 +_080D5356: + adds r0, r5, 0 + bl move_anim_task_del + b _080D53A6 + .pool +_080D5368: + ldr r1, =gSprites + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 2 + adds r0, r1 + ldr r2, =gBattleAnimArgs + ldrh r1, [r2, 0x2] + strh r1, [r0, 0x24] + ldrh r1, [r2, 0x4] + strh r1, [r0, 0x26] + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + strh r3, [r0, 0x8] + ldrh r1, [r2, 0x6] + strh r1, [r0, 0xA] + ldrh r1, [r2, 0x8] + strh r1, [r0, 0xC] + ldrh r1, [r2, 0x8] + strh r1, [r0, 0xE] + ldrh r1, [r2, 0x2] + strh r1, [r0, 0x10] + ldrh r1, [r2, 0x4] + strh r1, [r0, 0x12] + ldr r1, =sub_80D53BC + str r1, [r0] + adds r0, r5, 0 + bl _call_via_r1 +_080D53A6: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D52D0 + + thumb_func_start sub_80D53BC +sub_80D53BC: @ 80D53BC + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r3, r0, r1 + ldrh r2, [r3, 0xE] + movs r4, 0xE + ldrsh r0, [r3, r4] + mov r12, r1 + cmp r0, 0 + bne _080D5474 + ldr r2, =gSprites + movs r7, 0x8 + ldrsh r1, [r3, r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, r0, r2 + movs r0, 0x24 + ldrsh r1, [r4, r0] + ldrh r5, [r3, 0x10] + movs r7, 0x10 + ldrsh r0, [r3, r7] + adds r7, r2, 0 + cmp r1, r0 + bne _080D5408 + negs r0, r5 + strh r0, [r4, 0x24] + b _080D540A + .pool +_080D5408: + strh r5, [r4, 0x24] +_080D540A: + lsls r3, r6, 2 + adds r1, r3, r6 + lsls r1, 3 + add r1, r12 + movs r0, 0x8 + ldrsh r2, [r1, r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r4, r0, r7 + movs r0, 0x26 + ldrsh r2, [r4, r0] + mov r8, r2 + ldrh r5, [r1, 0x12] + movs r2, 0x12 + ldrsh r0, [r1, r2] + cmp r8, r0 + bne _080D5434 + negs r0, r5 + strh r0, [r4, 0x26] + b _080D5436 +_080D5434: + strh r5, [r4, 0x26] +_080D5436: + adds r0, r3, r6 + lsls r0, 3 + mov r4, r12 + adds r3, r0, r4 + ldrh r0, [r3, 0xC] + strh r0, [r3, 0xE] + ldrh r0, [r3, 0xA] + subs r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r2, r0, 16 + cmp r2, 0 + bne _080D5478 + movs r0, 0x8 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x24] + movs r4, 0x8 + ldrsh r1, [r3, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + adds r0, r6, 0 + bl move_anim_task_del + b _080D5478 +_080D5474: + subs r0, r2, 0x1 + strh r0, [r3, 0xE] +_080D5478: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80D53BC + + thumb_func_start sub_80D5484 +sub_80D5484: @ 80D5484 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =gBattleAnimArgs + ldrb r0, [r4] + bl GetAnimBankSpriteId + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0xFF + bne _080D54A8 + adds r0, r5, 0 + bl move_anim_task_del + b _080D54F6 + .pool +_080D54A8: + ldr r0, =gSprites + lsls r1, r3, 4 + adds r1, r3 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r4, 0x2] + ldrh r2, [r1, 0x24] + adds r0, r2 + movs r2, 0 + strh r0, [r1, 0x24] + ldrh r0, [r4, 0x4] + ldrh r6, [r1, 0x26] + adds r0, r6 + strh r0, [r1, 0x26] + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + strh r3, [r1, 0x8] + strh r2, [r1, 0xA] + ldrh r0, [r4, 0x6] + strh r0, [r1, 0xC] + strh r2, [r1, 0xE] + ldrh r0, [r4, 0x8] + strh r0, [r1, 0x10] + movs r2, 0x2 + ldrsh r0, [r4, r2] + lsls r0, 1 + strh r0, [r1, 0x12] + movs r6, 0x4 + ldrsh r0, [r4, r6] + lsls r0, 1 + strh r0, [r1, 0x14] + ldr r2, =sub_80D5508 + str r2, [r1] + adds r0, r5, 0 + bl _call_via_r2 +_080D54F6: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D5484 + + thumb_func_start sub_80D5508 +sub_80D5508: @ 80D5508 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r2, [r4, 0xE] + movs r3, 0xE + ldrsh r0, [r4, r3] + adds r6, r1, 0 + cmp r0, 0 + beq _080D5526 + b _080D5638 +_080D5526: + ldrh r1, [r4, 0xA] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080D5568 + ldr r2, =gSprites + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r4, 0x12] + ldrh r3, [r0, 0x24] + adds r1, r3 + strh r1, [r0, 0x24] + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r4, 0x14] + ldrh r3, [r0, 0x26] + adds r1, r3 + strh r1, [r0, 0x26] + adds r3, r2, 0 + b _080D5592 + .pool +_080D5568: + ldr r3, =gSprites + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x24] + ldrh r2, [r4, 0x12] + subs r1, r2 + strh r1, [r0, 0x24] + movs r2, 0x8 + ldrsh r1, [r4, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x26] + ldrh r2, [r4, 0x14] + subs r1, r2 + strh r1, [r0, 0x26] +_080D5592: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r6 + ldrh r0, [r4, 0x10] + strh r0, [r4, 0xE] + ldrh r0, [r4, 0xA] + adds r2, r0, 0x1 + strh r2, [r4, 0xA] + lsls r0, r2, 16 + asrs r0, 16 + movs r6, 0xC + ldrsh r1, [r4, r6] + cmp r0, r1 + blt _080D563C + movs r0, 0x1 + ands r2, r0 + cmp r2, 0 + beq _080D55F8 + movs r1, 0x8 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + movs r2, 0x12 + ldrsh r0, [r4, r2] + lsrs r2, r0, 31 + adds r0, r2 + asrs r0, 1 + ldrh r6, [r1, 0x24] + adds r0, r6 + strh r0, [r1, 0x24] + movs r1, 0x8 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + movs r2, 0x14 + ldrsh r0, [r4, r2] + lsrs r2, r0, 31 + adds r0, r2 + asrs r0, 1 + ldrh r3, [r1, 0x26] + adds r0, r3 + strh r0, [r1, 0x26] + b _080D5630 + .pool +_080D55F8: + movs r6, 0x8 + ldrsh r0, [r4, r6] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r3 + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsrs r0, r1, 31 + adds r1, r0 + asrs r1, 1 + ldrh r0, [r2, 0x24] + subs r0, r1 + strh r0, [r2, 0x24] + movs r1, 0x8 + ldrsh r0, [r4, r1] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r3 + movs r3, 0x14 + ldrsh r1, [r4, r3] + lsrs r0, r1, 31 + adds r1, r0 + asrs r1, 1 + ldrh r0, [r2, 0x26] + subs r0, r1 + strh r0, [r2, 0x26] +_080D5630: + adds r0, r5, 0 + bl move_anim_task_del + b _080D563C +_080D5638: + subs r0, r2, 0x1 + strh r0, [r4, 0xE] +_080D563C: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80D5508 + + thumb_func_start sub_80D5644 +sub_80D5644: @ 80D5644 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =gBattleAnimArgs + ldrb r0, [r5] + bl GetAnimBankSpriteId + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gSprites + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r2, [r5, 0x2] + strh r2, [r1, 0x24] + ldr r2, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r2 + strh r0, [r1, 0x8] + ldrh r0, [r5, 0x2] + strh r0, [r1, 0xA] + ldrh r0, [r5, 0x4] + strh r0, [r1, 0xC] + ldrh r0, [r5, 0x6] + strh r0, [r1, 0xE] + ldrh r0, [r5, 0x8] + strh r0, [r1, 0x10] + ldr r2, =sub_80D56A4 + str r2, [r1] + adds r0, r4, 0 + bl _call_via_r2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D5644 + + thumb_func_start sub_80D56A4 +sub_80D56A4: @ 80D56A4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r2, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r3, r0, r2 + ldrb r5, [r3, 0x8] + ldrh r4, [r3, 0xA] + ldrh r1, [r3, 0x18] + adds r0, r1, 0x1 + strh r0, [r3, 0x18] + movs r7, 0xC + ldrsh r0, [r3, r7] + lsls r1, 16 + asrs r1, 16 + mov r12, r2 + ldr r7, =gSprites + cmp r0, r1 + bne _080D56F6 + movs r0, 0 + strh r0, [r3, 0x18] + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r1, r0, r7 + ldrh r3, [r1, 0x24] + movs r0, 0x24 + ldrsh r2, [r1, r0] + lsls r0, r4, 16 + asrs r0, 16 + cmp r2, r0 + bne _080D56EE + negs r0, r2 + lsls r0, 16 + lsrs r4, r0, 16 +_080D56EE: + lsls r0, r4, 16 + asrs r0, 16 + adds r0, r3 + strh r0, [r1, 0x24] +_080D56F6: + lsls r2, r6, 2 + adds r2, r6 + lsls r2, 3 + add r2, r12 + strh r4, [r2, 0xA] + ldrh r1, [r2, 0xE] + ldrh r0, [r2, 0x1A] + adds r1, r0 + strh r1, [r2, 0x1A] + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r0, r7 + lsls r1, 16 + asrs r1, 24 + strh r1, [r0, 0x26] + ldrh r0, [r2, 0x10] + subs r0, 0x1 + strh r0, [r2, 0x10] + lsls r0, 16 + cmp r0, 0 + bne _080D5728 + adds r0, r6, 0 + bl move_anim_task_del +_080D5728: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D56A4 + + thumb_func_start sub_80D5738 +sub_80D5738: @ 80D5738 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + movs r6, 0x1 + ldr r4, =gBattleAnimArgs + ldrb r0, [r4] + bl GetAnimBankSpriteId + lsls r0, 24 + lsrs r7, r0, 24 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x5 + ble _080D575C + movs r0, 0x5 + strh r0, [r4, 0x8] +_080D575C: + movs r1, 0 + movs r2, 0x8 + ldrsh r0, [r4, r2] + adds r3, r4, 0 + ldr r2, =gTasks + mov r12, r2 + lsls r4, r5, 2 + ldr r2, =sub_80D57B8 + mov r8, r2 + cmp r1, r0 + bge _080D5782 + adds r2, r0, 0 +_080D5774: + lsls r0, r6, 25 + lsrs r6, r0, 24 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, r2 + blt _080D5774 +_080D5782: + adds r0, r4, r5 + lsls r0, 3 + add r0, r12 + strh r7, [r0, 0x8] + ldrh r1, [r3, 0x2] + strh r1, [r0, 0xA] + ldrh r1, [r3, 0x4] + strh r1, [r0, 0xC] + ldrh r1, [r3, 0x6] + strh r1, [r0, 0xE] + strh r6, [r0, 0x10] + mov r1, r8 + str r1, [r0] + adds r0, r5, 0 + bl _call_via_r8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D5738 + + thumb_func_start sub_80D57B8 +sub_80D57B8: @ 80D57B8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r5, r0, r1 + ldrb r4, [r5, 0x8] + movs r1, 0x12 + ldrsh r0, [r5, r1] + movs r2, 0xA + ldrsh r1, [r5, r2] + bl Sin + ldr r2, =gSprites + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r4, r1, r2 + strh r0, [r4, 0x24] + movs r1, 0x12 + ldrsh r0, [r5, r1] + movs r2, 0xC + ldrsh r1, [r5, r2] + bl Cos + negs r0, r0 + strh r0, [r4, 0x26] + ldrh r1, [r5, 0xC] + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r5, 0x10] + ldrh r1, [r5, 0x12] + adds r0, r1 + movs r1, 0xFF + ands r0, r1 + strh r0, [r5, 0x12] + cmp r0, 0 + bne _080D5810 + ldrh r0, [r5, 0xE] + subs r0, 0x1 + strh r0, [r5, 0xE] +_080D5810: + movs r2, 0xE + ldrsh r0, [r5, r2] + cmp r0, 0 + bne _080D5822 + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + adds r0, r6, 0 + bl move_anim_task_del +_080D5822: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D57B8 + + thumb_func_start sub_80D5830 +sub_80D5830: @ 80D5830 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gAnimationBankAttacker + ldrb r0, [r0] + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + beq _080D584C + ldr r1, =gBattleAnimArgs + ldrh r0, [r1, 0x2] + negs r0, r0 + strh r0, [r1, 0x2] +_080D584C: + adds r0, r4, 0 + bl sub_80D5738 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D5830 + + thumb_func_start sub_80D5860 +sub_80D5860: @ 80D5860 + push {r4,lr} + adds r4, r0, 0 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =gAnimationBankAttacker + ldrb r0, [r0] + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + beq _080D5890 + ldr r1, =gBattleAnimArgs + ldrh r0, [r1, 0x2] + negs r0, r0 + b _080D5894 + .pool +_080D5890: + ldr r1, =gBattleAnimArgs + ldrh r0, [r1, 0x2] +_080D5894: + strh r0, [r4, 0x30] + ldrh r2, [r1] + movs r0, 0 + strh r2, [r4, 0x2E] + strh r0, [r4, 0x32] + ldr r1, =gBankSpriteIds + ldr r0, =gAnimationBankAttacker + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + strh r0, [r4, 0x34] + strh r2, [r4, 0x36] + ldr r1, =sub_80D58D4 + adds r0, r4, 0 + bl StoreSpriteCallbackInData6 + ldr r0, =sub_80A6630 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D5860 + + thumb_func_start sub_80D58D4 +sub_80D58D4: @ 80D58D4 + push {lr} + ldrh r1, [r0, 0x36] + strh r1, [r0, 0x2E] + ldrh r1, [r0, 0x30] + negs r1, r1 + strh r1, [r0, 0x30] + ldr r1, =sub_80A6630 + str r1, [r0, 0x1C] + ldr r1, =move_anim_8072740 + bl StoreSpriteCallbackInData6 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D58D4 + + thumb_func_start sub_80D58F8 +sub_80D58F8: @ 80D58F8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r5, =gBattleAnimArgs + ldrb r0, [r5, 0x4] + bl GetAnimBankSpriteId + lsls r0, 24 + lsrs r0, 24 + ldrh r2, [r5] + movs r1, 0 + strh r2, [r4, 0x2E] + strh r1, [r4, 0x30] + ldrh r1, [r5, 0x2] + strh r1, [r4, 0x32] + strh r0, [r4, 0x34] + strh r2, [r4, 0x36] + ldr r1, =sub_80D5944 + adds r0, r4, 0 + bl StoreSpriteCallbackInData6 + ldr r0, =sub_80A6630 + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D58F8 + + thumb_func_start sub_80D5944 +sub_80D5944: @ 80D5944 + push {lr} + ldrh r1, [r0, 0x36] + strh r1, [r0, 0x2E] + ldrh r1, [r0, 0x32] + negs r1, r1 + strh r1, [r0, 0x32] + ldr r1, =sub_80A6630 + str r1, [r0, 0x1C] + ldr r1, =move_anim_8072740 + bl StoreSpriteCallbackInData6 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D5944 + + thumb_func_start sub_80D5968 +sub_80D5968: @ 80D5968 + push {r4-r7,lr} + sub sp, 0x4 + adds r6, r0, 0 + ldr r0, =gBattleAnimArgs + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _080D598C + ldr r1, =gBankSpriteIds + ldr r0, =gAnimationBankAttacker + b _080D5990 + .pool +_080D598C: + ldr r1, =gBankSpriteIds + ldr r0, =gAnimationBankTarget +_080D5990: + ldrb r0, [r0] + adds r0, r1 + ldrb r7, [r0] + ldr r5, =gBattleAnimArgs + ldrh r0, [r5, 0x4] + movs r3, 0 + strh r0, [r6, 0x2E] + ldr r0, =gSprites + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + adds r4, r0 + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r6, 0x30] + ldrh r0, [r4, 0x20] + strh r0, [r6, 0x32] + ldrh r0, [r4, 0x26] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r6, 0x34] + ldrh r0, [r4, 0x22] + strh r0, [r6, 0x36] + adds r0, r6, 0 + str r3, [sp] + bl sub_80A6E14 + ldr r3, [sp] + strh r3, [r6, 0x34] + strh r3, [r6, 0x36] + ldrh r0, [r4, 0x24] + strh r0, [r6, 0x38] + ldrh r0, [r4, 0x26] + strh r0, [r6, 0x3A] + adds r2, r6, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + movs r1, 0x2 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + bne _080D5A00 + strh r3, [r6, 0x32] + b _080D5A06 + .pool +_080D5A00: + cmp r0, 0x2 + bne _080D5A06 + strh r3, [r6, 0x30] +_080D5A06: + ldr r0, =gBattleAnimArgs + ldrh r1, [r0, 0x2] + lsls r0, r7, 8 + orrs r0, r1 + strh r0, [r6, 0x3C] + ldr r0, =sub_80D5A24 + str r0, [r6, 0x1C] + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D5968 + + thumb_func_start sub_80D5A24 +sub_80D5A24: @ 80D5A24 + push {r4-r6,lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x3C] + lsls r1, r0, 24 + lsrs r4, r1, 24 + adds r5, r4, 0 + lsls r0, 16 + asrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =gSprites + adds r3, r1, r0 + ldrh r0, [r2, 0x2E] + movs r6, 0x2E + ldrsh r1, [r2, r6] + cmp r1, 0 + bne _080D5A64 + cmp r4, 0x1 + bhi _080D5A4E + strh r1, [r3, 0x24] +_080D5A4E: + cmp r5, 0x2 + beq _080D5A56 + cmp r5, 0 + bne _080D5A58 +_080D5A56: + strh r1, [r3, 0x26] +_080D5A58: + adds r0, r2, 0 + bl move_anim_8072740 + b _080D5A8E + .pool +_080D5A64: + subs r0, 0x1 + strh r0, [r2, 0x2E] + ldrh r1, [r2, 0x30] + ldrh r0, [r2, 0x34] + adds r1, r0 + strh r1, [r2, 0x34] + ldrh r0, [r2, 0x32] + ldrh r4, [r2, 0x36] + adds r0, r4 + strh r0, [r2, 0x36] + lsls r1, 16 + asrs r1, 24 + ldrh r6, [r2, 0x38] + adds r1, r6 + strh r1, [r3, 0x24] + ldrh r0, [r2, 0x36] + lsls r0, 16 + asrs r0, 24 + ldrh r2, [r2, 0x3A] + adds r0, r2 + strh r0, [r3, 0x26] +_080D5A8E: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80D5A24 + + thumb_func_start sub_80D5A94 +sub_80D5A94: @ 80D5A94 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r0, =gBattleAnimArgs + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _080D5AB0 + ldr r0, =gAnimationBankAttacker + b _080D5AB2 + .pool +_080D5AB0: + ldr r0, =gAnimationBankTarget +_080D5AB2: + ldrb r2, [r0] + ldr r0, =gBankSpriteIds + adds r0, r2, r0 + ldrb r6, [r0] + adds r0, r2, 0 + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + beq _080D5ADC + ldr r1, =gBattleAnimArgs + ldrh r0, [r1, 0x2] + negs r0, r0 + strh r0, [r1, 0x2] + movs r2, 0x6 + ldrsh r0, [r1, r2] + cmp r0, 0x1 + bne _080D5ADC + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] +_080D5ADC: + ldr r2, =gBattleAnimArgs + ldrh r0, [r2, 0x8] + movs r4, 0 + strh r0, [r5, 0x2E] + ldr r0, =gSprites + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x20] + strh r0, [r5, 0x30] + ldrh r0, [r2, 0x2] + ldrh r3, [r1, 0x20] + adds r0, r3 + strh r0, [r5, 0x32] + ldrh r0, [r1, 0x22] + strh r0, [r5, 0x34] + ldrh r0, [r2, 0x4] + ldrh r1, [r1, 0x22] + adds r0, r1 + strh r0, [r5, 0x36] + adds r0, r5, 0 + bl sub_80A6E14 + strh r4, [r5, 0x34] + strh r4, [r5, 0x36] + strh r6, [r5, 0x38] + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r1, =move_anim_8072740 + adds r0, r5, 0 + bl StoreSpriteCallbackInData6 + ldr r0, =sub_80A6680 + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D5A94 + + thumb_func_start sub_80D5B48 +sub_80D5B48: @ 80D5B48 + push {r4-r7,lr} + adds r6, r0, 0 + adds r2, r6, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =gBattleAnimArgs + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _080D5B70 + ldr r0, =gAnimationBankAttacker + b _080D5B72 + .pool +_080D5B70: + ldr r0, =gAnimationBankTarget +_080D5B72: + ldrb r1, [r0] + ldr r0, =gBankSpriteIds + adds r0, r1, r0 + ldrb r7, [r0] + adds r0, r1, 0 + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + beq _080D5B9C + ldr r1, =gBattleAnimArgs + ldrh r0, [r1, 0x2] + negs r0, r0 + strh r0, [r1, 0x2] + movs r2, 0x6 + ldrsh r0, [r1, r2] + cmp r0, 0x1 + bne _080D5B9C + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] +_080D5B9C: + ldr r5, =gBattleAnimArgs + ldrh r0, [r5, 0x8] + strh r0, [r6, 0x2E] + ldr r0, =gSprites + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + adds r4, r0 + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r6, 0x30] + ldrh r1, [r5, 0x2] + adds r0, r1 + strh r0, [r6, 0x32] + ldrh r0, [r4, 0x26] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r6, 0x34] + ldrh r1, [r5, 0x4] + adds r0, r1 + strh r0, [r6, 0x36] + adds r0, r6, 0 + bl sub_80A6E14 + ldrh r0, [r4, 0x24] + lsls r0, 8 + strh r0, [r6, 0x34] + ldrh r0, [r4, 0x26] + lsls r0, 8 + strh r0, [r6, 0x36] + strh r7, [r6, 0x38] + ldrh r0, [r5, 0xA] + strh r0, [r6, 0x3A] + lsls r0, 16 + cmp r0, 0 + bne _080D5C04 + ldr r1, =move_anim_8072740 + adds r0, r6, 0 + bl StoreSpriteCallbackInData6 + b _080D5C0C + .pool +_080D5C04: + ldr r1, =sub_80D5C20 + adds r0, r6, 0 + bl StoreSpriteCallbackInData6 +_080D5C0C: + ldr r0, =sub_80A6680 + str r0, [r6, 0x1C] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D5B48 + + thumb_func_start sub_80D5C20 +sub_80D5C20: @ 80D5C20 + push {r4,lr} + ldr r4, =gSprites + movs r1, 0x38 + ldrsh r2, [r0, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + movs r3, 0 + strh r3, [r1, 0x24] + movs r1, 0x38 + ldrsh r2, [r0, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + strh r3, [r1, 0x26] + bl move_anim_8072740 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D5C20 + + thumb_func_start sub_80D5C50 +sub_80D5C50: @ 80D5C50 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r5, =gBattleAnimArgs + movs r0, 0x6 + ldrsh r1, [r5, r0] + movs r0, 0x80 + lsls r0, 8 + bl __divsi3 + lsls r0, 16 + lsrs r7, r0, 16 + ldr r0, =gAnimationBankAttacker + ldrb r0, [r0] + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + beq _080D5C82 + ldrh r0, [r5, 0x2] + negs r0, r0 + strh r0, [r5, 0x2] + ldrh r0, [r5, 0xA] + negs r0, r0 + strh r0, [r5, 0xA] +_080D5C82: + ldrb r0, [r5] + bl GetAnimBankSpriteId + ldr r1, =gTasks + lsls r4, r6, 2 + adds r4, r6 + lsls r4, 3 + adds r4, r1 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x8] + movs r1, 0x2 + ldrsh r0, [r5, r1] + lsls r0, 8 + movs r2, 0x6 + ldrsh r1, [r5, r2] + bl __divsi3 + strh r0, [r4, 0xA] + ldrh r0, [r5, 0x4] + strh r0, [r4, 0xC] + ldrh r0, [r5, 0x6] + strh r0, [r4, 0xE] + ldrh r0, [r5, 0x8] + strh r0, [r4, 0x10] + movs r1, 0xA + ldrsh r0, [r5, r1] + lsls r0, 8 + movs r2, 0xC + ldrsh r1, [r5, r2] + bl __divsi3 + strh r0, [r4, 0x12] + ldrh r0, [r5, 0xC] + strh r0, [r4, 0x14] + strh r7, [r4, 0x16] + ldr r0, =sub_80D5CE4 + str r0, [r4] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D5C50 + + thumb_func_start sub_80D5CE4 +sub_80D5CE4: @ 80D5CE4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r5, r1, r2 + ldrb r1, [r5, 0x8] + ldrh r0, [r5, 0xA] + ldrh r2, [r5, 0x1E] + adds r0, r2 + strh r0, [r5, 0x1E] + ldr r2, =gSprites + lsls r4, r1, 4 + adds r4, r1 + lsls r4, 2 + adds r4, r2 + lsls r0, 16 + asrs r0, 24 + strh r0, [r4, 0x24] + ldrh r0, [r5, 0x1C] + lsrs r0, 8 + movs r2, 0xC + ldrsh r1, [r5, r2] + bl Sin + strh r0, [r4, 0x26] + ldrh r0, [r5, 0x16] + ldrh r1, [r5, 0x1C] + adds r0, r1 + strh r0, [r5, 0x1C] + ldrh r0, [r5, 0xE] + subs r0, 0x1 + strh r0, [r5, 0xE] + lsls r0, 16 + cmp r0, 0 + bne _080D5D34 + ldr r0, =sub_80D5D48 + str r0, [r5] +_080D5D34: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D5CE4 + + thumb_func_start sub_80D5D48 +sub_80D5D48: @ 80D5D48 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r1, [r4, 0x10] + movs r2, 0x10 + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _080D5D70 + subs r0, r1, 0x1 + strh r0, [r4, 0x10] + b _080D5DA4 + .pool +_080D5D70: + ldrb r0, [r4, 0x8] + ldrh r2, [r4, 0x12] + ldrh r1, [r4, 0x20] + adds r2, r1 + strh r2, [r4, 0x20] + ldr r3, =gSprites + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + lsls r2, 16 + asrs r2, 24 + ldrh r0, [r4, 0x1E] + lsls r0, 16 + asrs r0, 24 + adds r2, r0 + strh r2, [r1, 0x24] + ldrh r0, [r4, 0x14] + subs r0, 0x1 + strh r0, [r4, 0x14] + lsls r0, 16 + cmp r0, 0 + bne _080D5DA4 + adds r0, r5, 0 + bl move_anim_task_del +_080D5DA4: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D5D48 + + thumb_func_start sub_80D5DB0 +sub_80D5DB0: @ 80D5DB0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =gBattleAnimArgs + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0x2 + beq _080D5DDE + cmp r0, 0x2 + bgt _080D5DD8 + cmp r0, 0 + blt _080D5E10 + ldrb r0, [r1] + bl GetAnimBankSpriteId + lsls r0, 24 + lsrs r2, r0, 24 + b _080D5E18 + .pool +_080D5DD8: + cmp r0, 0x3 + beq _080D5DE8 + b _080D5E10 +_080D5DDE: + ldr r5, =gAnimationBankAttacker + b _080D5DEA + .pool +_080D5DE8: + ldr r5, =gAnimationBankTarget +_080D5DEA: + ldrb r0, [r5] + movs r4, 0x2 + eors r0, r4 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080D5E10 + ldr r1, =gBankSpriteIds + ldrb r0, [r5] + eors r0, r4 + adds r0, r1 + ldrb r2, [r0] + b _080D5E18 + .pool +_080D5E10: + adds r0, r6, 0 + bl move_anim_task_del + b _080D5E58 +_080D5E18: + ldr r1, =gTasks + lsls r4, r6, 2 + adds r0, r4, r6 + lsls r0, 3 + adds r5, r0, r1 + strh r2, [r5, 0x8] + ldr r0, =gAnimationBankTarget + ldrb r0, [r0] + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + beq _080D5E44 + ldr r0, =gBattleAnimArgs + ldrh r0, [r0, 0x2] + b _080D5E4A + .pool +_080D5E44: + ldr r0, =gBattleAnimArgs + ldrh r0, [r0, 0x2] + negs r0, r0 +_080D5E4A: + strh r0, [r5, 0xA] + ldr r0, =gTasks + adds r1, r4, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80D5E6C + str r0, [r1] +_080D5E58: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D5DB0 + + thumb_func_start sub_80D5E6C +sub_80D5E6C: @ 80D5E6C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrb r2, [r1, 0x8] + ldr r3, =gSprites + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r1, 0xA] + ldrh r2, [r0, 0x24] + adds r1, r2 + strh r1, [r0, 0x24] + movs r2, 0x24 + ldrsh r1, [r0, r2] + movs r2, 0x20 + ldrsh r0, [r0, r2] + adds r1, r0 + adds r1, 0x20 + movs r0, 0x98 + lsls r0, 1 + cmp r1, r0 + bls _080D5EAA + adds r0, r4, 0 + bl move_anim_task_del +_080D5EAA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D5E6C + + thumb_func_start sub_80D5EB8 +sub_80D5EB8: @ 80D5EB8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r6, =gAnimationBankAttacker + ldrb r0, [r6] + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + beq _080D5ED4 + ldr r1, =gBattleAnimArgs + ldrh r0, [r1, 0x2] + negs r0, r0 + strh r0, [r1, 0x2] +_080D5ED4: + ldr r4, =gBattleAnimArgs + ldrb r0, [r4, 0x8] + bl GetAnimBankSpriteId + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r3, r5, 2 + adds r1, r3, r5 + lsls r1, 3 + adds r2, r1, r2 + ldrh r1, [r4] + strh r1, [r2, 0x8] + ldrh r1, [r4, 0x2] + strh r1, [r2, 0xA] + ldrh r1, [r4, 0x4] + strh r1, [r2, 0xC] + ldrh r1, [r4, 0x6] + strh r1, [r2, 0xE] + strh r0, [r2, 0x10] + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080D5F14 + ldrb r0, [r6] + b _080D5F18 + .pool +_080D5F14: + ldr r0, =gAnimationBankTarget + ldrb r0, [r0] +_080D5F18: + strh r0, [r2, 0x12] + ldr r1, =gTasks + adds r0, r3, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0, 0x20] + ldr r1, =sub_80D5F3C + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D5EB8 + + thumb_func_start sub_80D5F3C +sub_80D5F3C: @ 80D5F3C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r1 + ldrb r7, [r4, 0x10] + ldrh r0, [r4, 0xC] + ldrh r1, [r4, 0x1C] + adds r0, r1 + lsls r1, r0, 16 + strh r0, [r4, 0x1C] + lsrs r1, 24 + mov r8, r1 + mov r0, r8 + movs r2, 0xA + ldrsh r1, [r4, r2] + bl Sin + lsls r0, 16 + lsrs r5, r0, 16 + mov r9, r5 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080D5F94 + ldr r0, =gSprites + lsls r2, r7, 4 + adds r1, r2, r7 + lsls r1, 2 + adds r1, r0 + strh r5, [r1, 0x24] + mov r9, r0 + adds r4, r2, 0 + b _080D5FDA + .pool +_080D5F94: + ldrb r0, [r4, 0x12] + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + bne _080D5FBC + ldr r1, =gSprites + lsls r2, r7, 4 + adds r0, r2, r7 + lsls r0, 2 + adds r3, r0, r1 + lsls r0, r5, 16 + asrs r0, 16 + mov r9, r1 + adds r4, r2, 0 + cmp r0, 0 + bge _080D5FD8 + b _080D5FD6 + .pool +_080D5FBC: + ldr r1, =gSprites + lsls r2, r7, 4 + adds r0, r2, r7 + lsls r0, 2 + adds r3, r0, r1 + mov r4, r9 + lsls r0, r4, 16 + asrs r0, 16 + mov r9, r1 + adds r4, r2, 0 + cmp r0, 0 + bge _080D5FD6 + negs r0, r0 +_080D5FD6: + negs r0, r0 +_080D5FD8: + strh r0, [r3, 0x26] +_080D5FDA: + mov r5, r8 + cmp r5, 0x7F + bls _080D5FFC + ldr r1, =gTasks + lsls r2, r6, 2 + adds r0, r2, r6 + lsls r0, 3 + adds r3, r0, r1 + movs r5, 0x1E + ldrsh r0, [r3, r5] + adds r5, r1, 0 + cmp r0, 0 + bne _080D5FFC + movs r1, 0x20 + ldrsh r0, [r3, r1] + cmp r0, 0x1 + beq _080D601E +_080D5FFC: + mov r2, r8 + cmp r2, 0x7E + bhi _080D6050 + ldr r1, =gTasks + lsls r2, r6, 2 + adds r0, r2, r6 + lsls r0, 3 + adds r3, r0, r1 + movs r5, 0x1E + ldrsh r0, [r3, r5] + adds r5, r1, 0 + cmp r0, 0x1 + bne _080D6050 + movs r1, 0x20 + ldrsh r0, [r3, r1] + cmp r0, 0 + bne _080D6050 +_080D601E: + adds r1, r2, r6 + lsls r1, 3 + adds r1, r5 + ldrh r0, [r1, 0x1E] + movs r2, 0x1 + eors r0, r2 + strh r0, [r1, 0x1E] + ldrh r0, [r1, 0x20] + eors r0, r2 + strh r0, [r1, 0x20] + ldrh r0, [r1, 0xE] + subs r0, 0x1 + strh r0, [r1, 0xE] + lsls r0, 16 + asrs r3, r0, 16 + cmp r3, 0 + bne _080D6050 + adds r0, r4, r7 + lsls r0, 2 + add r0, r9 + strh r3, [r0, 0x24] + strh r3, [r0, 0x26] + adds r0, r6, 0 + bl move_anim_task_del +_080D6050: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D5F3C + + thumb_func_start sub_80D6064 +sub_80D6064: @ 80D6064 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r6, =gBattleAnimArgs + ldrb r0, [r6, 0x6] + bl GetAnimBankSpriteId + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldrb r1, [r6, 0x8] + adds r0, r5, 0 + bl sub_80A7270 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r6] + strh r1, [r0, 0x8] + ldrh r1, [r6, 0x2] + strh r1, [r0, 0xA] + ldrh r1, [r6, 0x4] + strh r1, [r0, 0xC] + ldrh r1, [r6, 0x4] + strh r1, [r0, 0xE] + strh r5, [r0, 0x10] + movs r1, 0x80 + lsls r1, 1 + strh r1, [r0, 0x1C] + strh r1, [r0, 0x1E] + ldr r1, =sub_80D60BC + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D6064 + + thumb_func_start sub_80D60BC +sub_80D60BC: @ 80D60BC + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x8] + ldrh r1, [r4, 0x1C] + adds r0, r1 + strh r0, [r4, 0x1C] + ldrh r0, [r4, 0xA] + ldrh r3, [r4, 0x1E] + adds r0, r3 + strh r0, [r4, 0x1E] + ldrb r0, [r4, 0x10] + adds r6, r0, 0 + movs r0, 0x1C + ldrsh r1, [r4, r0] + movs r3, 0x1E + ldrsh r2, [r4, r3] + adds r0, r6, 0 + movs r3, 0 + bl obj_id_set_rotscale + ldrh r0, [r4, 0xC] + subs r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0 + bne _080D612C + ldrh r2, [r4, 0xE] + movs r3, 0xE + ldrsh r0, [r4, r3] + cmp r0, 0 + ble _080D6120 + ldrh r0, [r4, 0x8] + negs r0, r0 + strh r0, [r4, 0x8] + ldrh r0, [r4, 0xA] + negs r0, r0 + strh r0, [r4, 0xA] + strh r2, [r4, 0xC] + strh r1, [r4, 0xE] + b _080D612C + .pool +_080D6120: + adds r0, r6, 0 + bl sub_80A7344 + adds r0, r5, 0 + bl move_anim_task_del +_080D612C: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80D60BC + + thumb_func_start sub_80D6134 +sub_80D6134: @ 80D6134 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, =gBattleAnimArgs + ldrb r0, [r4, 0x4] + bl GetAnimBankSpriteId + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r1, 0 + bl sub_80A7270 + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r2, r0, r1 + movs r1, 0 + strh r1, [r2, 0xA] + ldrh r0, [r4] + strh r0, [r2, 0xC] + movs r3, 0x6 + ldrsh r0, [r4, r3] + cmp r0, 0x1 + beq _080D6178 + strh r1, [r2, 0xE] + b _080D6184 + .pool +_080D6178: + ldrh r0, [r4] + ldrh r1, [r4, 0x2] + adds r3, r0, 0 + muls r3, r1 + adds r0, r3, 0 + strh r0, [r2, 0xE] +_080D6184: + ldr r1, =gTasks + lsls r4, r7, 2 + adds r0, r4, r7 + lsls r0, 3 + adds r5, r0, r1 + ldr r6, =gBattleAnimArgs + ldrh r0, [r6, 0x2] + strh r0, [r5, 0x10] + mov r0, r8 + strh r0, [r5, 0x12] + ldrh r0, [r6, 0x6] + strh r0, [r5, 0x14] + bl IsContest + lsls r0, 24 + mov r8, r4 + cmp r0, 0 + beq _080D61B8 + movs r0, 0x1 + strh r0, [r5, 0x16] + b _080D61DC + .pool +_080D61B8: + movs r1, 0x4 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _080D61C8 + ldr r0, =gAnimationBankAttacker + b _080D61CA + .pool +_080D61C8: + ldr r0, =gAnimationBankTarget +_080D61CA: + ldrb r0, [r0] + bl GetBankSide + movs r1, 0 + lsls r0, 24 + cmp r0, 0 + bne _080D61DA + movs r1, 0x1 +_080D61DA: + strh r1, [r5, 0x16] +_080D61DC: + ldr r0, =gTasks + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r4, r1, r0 + movs r3, 0x16 + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _080D6208 + bl IsContest + lsls r0, 24 + cmp r0, 0 + bne _080D6208 + movs r1, 0xE + ldrsh r0, [r4, r1] + negs r0, r0 + strh r0, [r4, 0xE] + movs r2, 0x10 + ldrsh r0, [r4, r2] + negs r0, r0 + strh r0, [r4, 0x10] +_080D6208: + ldr r0, =gTasks + mov r3, r8 + adds r1, r3, r7 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80D6308 + str r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D6134 + + thumb_func_start sub_80D622C +sub_80D622C: @ 80D622C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =gBattleAnimArgs + ldrb r0, [r4, 0x4] + bl GetAnimBankSpriteId + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r1, 0 + bl sub_80A7270 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0xA] + ldrh r1, [r4] + strh r1, [r0, 0xC] + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080D6274 + ldr r0, =gAnimationBankAttacker + b _080D6276 + .pool +_080D6274: + ldr r0, =gAnimationBankTarget +_080D6276: + ldrb r0, [r0] + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + beq _080D6288 + ldrh r0, [r4, 0x2] + negs r0, r0 + strh r0, [r4, 0x2] +_080D6288: + ldr r0, =gBattleAnimArgs + movs r2, 0x6 + ldrsh r1, [r0, r2] + adds r6, r0, 0 + cmp r1, 0x1 + beq _080D62B0 + ldr r2, =gTasks + lsls r3, r5, 2 + adds r0, r3, r5 + lsls r0, 3 + adds r0, r2 + movs r1, 0 + strh r1, [r0, 0xE] + b _080D62CA + .pool +_080D62B0: + ldr r3, =gTasks + lsls r4, r5, 2 + adds r0, r4, r5 + lsls r0, 3 + adds r0, r3 + ldrh r2, [r6] + ldrh r1, [r6, 0x2] + adds r7, r2, 0 + muls r7, r1 + adds r1, r7, 0 + strh r1, [r0, 0xE] + adds r2, r3, 0 + adds r3, r4, 0 +_080D62CA: + adds r1, r3, r5 + lsls r1, 3 + adds r1, r2 + ldrh r0, [r6, 0x2] + strh r0, [r1, 0x10] + mov r0, r8 + strh r0, [r1, 0x12] + ldrh r0, [r6, 0x6] + strh r0, [r1, 0x14] + movs r0, 0x1 + strh r0, [r1, 0x16] + movs r2, 0xE + ldrsh r0, [r1, r2] + negs r0, r0 + strh r0, [r1, 0xE] + movs r7, 0x10 + ldrsh r0, [r1, r7] + negs r0, r0 + strh r0, [r1, 0x10] + ldr r0, =sub_80D6308 + str r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D622C + + thumb_func_start sub_80D6308 +sub_80D6308: @ 80D6308 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x10] + ldrh r1, [r4, 0xE] + adds r0, r1 + strh r0, [r4, 0xE] + ldrb r0, [r4, 0x12] + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0xE] + adds r1, r2, 0 + bl obj_id_set_rotscale + movs r2, 0x16 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _080D633C + ldrb r0, [r4, 0x12] + bl sub_80A73A0 +_080D633C: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + movs r2, 0xC + ldrsh r1, [r4, r2] + cmp r0, r1 + blt _080D6382 + movs r1, 0x14 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080D6364 + cmp r0, 0x1 + ble _080D636A + cmp r0, 0x2 + beq _080D6372 + b _080D636A + .pool +_080D6364: + ldrb r0, [r4, 0x12] + bl sub_80A7344 +_080D636A: + adds r0, r5, 0 + bl move_anim_task_del + b _080D6382 +_080D6372: + movs r0, 0 + strh r0, [r4, 0xA] + movs r2, 0x10 + ldrsh r0, [r4, r2] + negs r0, r0 + strh r0, [r4, 0x10] + movs r0, 0x1 + strh r0, [r4, 0x14] +_080D6382: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80D6308 + + thumb_func_start sub_80D6388 +sub_80D6388: @ 80D6388 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =gBattleAnimArgs + movs r2, 0 + ldrsh r1, [r0, r2] + mov r8, r0 + cmp r1, 0 + bne _080D63C0 + ldr r4, =gTasks + lsls r5, r7, 2 + adds r0, r5, r7 + lsls r0, 3 + adds r6, r0, r4 + ldr r0, =gMovePowerMoveAnim + ldrh r0, [r0] + movs r1, 0xC + bl __udivsi3 + b _080D63D4 + .pool +_080D63C0: + ldr r4, =gTasks + lsls r5, r7, 2 + adds r0, r5, r7 + lsls r0, 3 + adds r6, r0, r4 + ldr r0, =gMoveDmgMoveAnim + ldr r0, [r0] + movs r1, 0xC + bl __divsi3 +_080D63D4: + strh r0, [r6, 0x26] + lsls r0, 16 + adds r1, r4, 0 + cmp r0, 0 + bgt _080D63E2 + movs r0, 0x1 + strh r0, [r6, 0x26] +_080D63E2: + movs r2, 0x26 + ldrsh r0, [r6, r2] + cmp r0, 0x10 + ble _080D63EE + movs r0, 0x10 + strh r0, [r6, 0x26] +_080D63EE: + adds r4, r5, r7 + lsls r4, 3 + adds r4, r1 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsrs r0, r1, 31 + adds r1, r0 + asrs r1, 1 + movs r5, 0 + strh r1, [r4, 0x24] + ldrh r2, [r4, 0x26] + movs r0, 0x1 + ands r0, r2 + adds r1, r0 + strh r1, [r4, 0x22] + strh r5, [r4, 0x20] + mov r1, r8 + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x1C] + ldrh r0, [r1, 0x8] + strh r0, [r4, 0x1E] + movs r0, 0x1 + bl GetAnimBankSpriteId + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x16] + ldr r2, =gSprites + movs r0, 0x16 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x24] + strh r0, [r4, 0x18] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x26] + strh r0, [r4, 0x1A] + strh r5, [r4, 0x8] + mov r1, r8 + ldrh r0, [r1, 0x2] + strh r0, [r4, 0xA] + ldrh r0, [r1, 0x4] + strh r0, [r4, 0xC] + ldr r0, =sub_80D646C + str r0, [r4] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D6388 + + thumb_func_start sub_80D646C +sub_80D646C: @ 80D646C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + adds r3, r0, r1 + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] + lsls r0, 16 + asrs r0, 16 + movs r2, 0xA + ldrsh r1, [r3, r2] + cmp r0, r1 + ble _080D654A + movs r0, 0 + strh r0, [r3, 0x8] + ldrh r0, [r3, 0x20] + adds r1, r0, 0x1 + movs r0, 0x1 + ands r1, r0 + strh r1, [r3, 0x20] + movs r2, 0x1C + ldrsh r0, [r3, r2] + cmp r0, 0 + beq _080D64DE + cmp r1, 0 + beq _080D64C8 + ldr r2, =gSprites + movs r0, 0x16 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r3, 0x22] + ldrh r2, [r3, 0x18] + adds r1, r2 + b _080D64DC + .pool +_080D64C8: + ldr r2, =gSprites + movs r0, 0x16 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r3, 0x18] + ldrh r2, [r3, 0x24] + subs r1, r2 +_080D64DC: + strh r1, [r0, 0x24] +_080D64DE: + movs r1, 0x1E + ldrsh r0, [r3, r1] + cmp r0, 0 + beq _080D6518 + movs r2, 0x20 + ldrsh r4, [r3, r2] + cmp r4, 0 + beq _080D6508 + ldr r2, =gSprites + movs r0, 0x16 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r3, 0x26] + strh r1, [r0, 0x26] + b _080D6518 + .pool +_080D6508: + ldr r2, =gSprites + movs r0, 0x16 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r4, [r0, 0x26] +_080D6518: + ldrh r0, [r3, 0xC] + subs r0, 0x1 + strh r0, [r3, 0xC] + lsls r0, 16 + asrs r4, r0, 16 + cmp r4, 0 + bne _080D654A + ldr r2, =gSprites + movs r0, 0x16 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r4, [r0, 0x24] + movs r0, 0x16 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r4, [r0, 0x26] + adds r0, r5, 0 + bl move_anim_task_del +_080D654A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D646C + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_815A0D4.s b/asm/battle_anim_815A0D4.s old mode 100644 new mode 100755 similarity index 86% rename from asm/rom_815A0D4.s rename to asm/battle_anim_815A0D4.s index 373c5d074..46b09081d --- a/asm/rom_815A0D4.s +++ b/asm/battle_anim_815A0D4.s @@ -12485,1974 +12485,4 @@ _08160618: .pool thumb_func_end sub_816058C - thumb_func_start sub_8160624 -sub_8160624: @ 8160624 - push {lr} - bl LoadOam - bl ProcessSpriteCopyRequests - bl TransferPlttBuffer - pop {r0} - bx r0 - thumb_func_end sub_8160624 - - thumb_func_start sub_8160638 -sub_8160638: @ 8160638 - push {lr} - sub sp, 0x4 - bl ScriptContext2_Enable - ldr r0, =sub_8160664 - movs r1, 0xA - bl CreateTask - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8160638 - - thumb_func_start sub_8160664 -sub_8160664: @ 8160664 - 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 _08160688 - ldr r0, =sub_81606A0 - bl SetMainCallback2 - ldr r1, =gUnknown_03005DAC - ldr r0, =sub_80AF168 - str r0, [r1] - adds r0, r4, 0 - bl DestroyTask -_08160688: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8160664 - - thumb_func_start sub_81606A0 -sub_81606A0: @ 81606A0 - push {r4-r6,lr} - bl ResetSpriteData - bl FreeAllSpritePalettes - bl ResetTasks - bl clear_scheduled_bg_copies_to_vram - ldr r6, =gUnknown_0203BC34 - movs r0, 0x8C - lsls r0, 1 - bl AllocZeroed - str r0, [r6] - ldr r1, =gSpecialVar_0x8004 - ldrh r1, [r1] - adds r0, 0x44 - movs r5, 0 - strb r1, [r0] - ldr r0, =sub_8160624 - bl SetVBlankCallback - bl sub_81607EC - movs r0, 0 - bl sub_81D2824 - ldr r4, =gUnknown_0203BC38 - movs r0, 0 - strh r5, [r4] - strh r5, [r4, 0x2] - strb r0, [r4, 0x4] - bl sub_8161280 - ldr r0, =gUnknown_085CEBB0 - bl LoadSpriteSheet - ldr r0, =gUnknown_085CEBB8 - bl LoadSpritePalette - bl sub_81610B8 - ldr r0, =gUnknown_03006310 - ldrh r1, [r4] - ldrh r2, [r4, 0x2] - bl ListMenuInit - ldr r1, [r6] - movs r2, 0x89 - lsls r2, 1 - adds r1, r2 - strb r0, [r1] - movs r0, 0 - movs r1, 0 - movs r2, 0x2 - bl FillPalette - ldr r0, =sub_816082C - bl SetMainCallback2 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81606A0 - - thumb_func_start sub_8160740 -sub_8160740: @ 8160740 - push {r4,r5,lr} - bl ResetSpriteData - bl FreeAllSpritePalettes - bl ResetTasks - bl clear_scheduled_bg_copies_to_vram - ldr r5, =gUnknown_0203BC34 - movs r0, 0x8C - lsls r0, 1 - bl AllocZeroed - str r0, [r5] - movs r1, 0x1C - strb r1, [r0] - ldr r0, [r5] - ldr r1, =gSpecialVar_0x8004 - ldrh r1, [r1] - adds r0, 0x44 - strb r1, [r0] - ldr r0, [r5] - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - adds r0, 0x45 - strb r1, [r0] - ldr r0, =sub_8160624 - bl SetVBlankCallback - bl sub_81607EC - ldr r4, =gUnknown_0203BC38 - ldrb r0, [r4, 0x4] - bl sub_81D2824 - bl sub_8161280 - ldr r0, =gUnknown_085CEBB0 - bl LoadSpriteSheet - ldr r0, =gUnknown_085CEBB8 - bl LoadSpritePalette - bl sub_81610B8 - ldr r0, =gUnknown_03006310 - ldrh r1, [r4] - ldrh r2, [r4, 0x2] - bl ListMenuInit - ldr r1, [r5] - movs r2, 0x89 - lsls r2, 1 - adds r1, r2 - strb r0, [r1] - movs r0, 0 - movs r1, 0 - movs r2, 0x2 - bl FillPalette - ldr r0, =sub_816082C - bl SetMainCallback2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8160740 - - thumb_func_start sub_81607EC -sub_81607EC: @ 81607EC - push {lr} - bl sub_8121DA0 - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_085CEC28 - movs r0, 0 - movs r2, 0x2 - bl InitBgsFromTemplates - bl sub_8121E10 - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - pop {r0} - bx r0 - .pool - thumb_func_end sub_81607EC - - thumb_func_start sub_816082C -sub_816082C: @ 816082C - push {lr} - bl sub_8160868 - bl RunTasks - bl AnimateSprites - bl BuildOamBuffer - bl do_scheduled_bg_tilemap_copies_to_vram - bl UpdatePaletteFade - pop {r0} - bx r0 - thumb_func_end sub_816082C - - thumb_func_start sub_816084C -sub_816084C: @ 816084C - push {r4,lr} - adds r1, r0, 0 - ldr r4, =gStringVar4 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - bl sub_81D2BF4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816084C - - thumb_func_start sub_8160868 -sub_8160868: @ 8160868 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - ldr r1, =gUnknown_0203BC34 - ldr r0, [r1] - ldrb r0, [r0] - adds r7, r1, 0 - cmp r0, 0x21 - bls _0816087E - b _08160E8A -_0816087E: - lsls r0, 2 - ldr r1, =_08160890 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08160890: - .4byte _08160918 - .4byte _08160932 - .4byte _0816094C - .4byte _08160954 - .4byte _0816095C - .4byte _08160964 - .4byte _08160980 - .4byte _08160E8A - .4byte _08160988 - .4byte _081609A8 - .4byte _08160E8A - .4byte _08160E8A - .4byte _08160A44 - .4byte _08160A64 - .4byte _08160CB8 - .4byte _08160CD8 - .4byte _08160AB8 - .4byte _08160AD0 - .4byte _08160AEC - .4byte _08160C1C - .4byte _08160C48 - .4byte _08160C98 - .4byte _08160CA6 - .4byte _08160E8A - .4byte _08160B2C - .4byte _08160B60 - .4byte _08160B80 - .4byte _08160BDC - .4byte _08160CFC - .4byte _08160D48 - .4byte _08160E0C - .4byte _08160E38 - .4byte _08160E58 - .4byte _08160E70 -_08160918: - ldr r1, [r7] - ldrb r0, [r1] - adds r0, 0x1 - movs r4, 0 - strb r0, [r1] - movs r0, 0 - bl render_previous_quest_text - movs r0, 0x1 - negs r0, r0 - str r4, [sp] - movs r1, 0 - b _08160CAE -_08160932: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08160940 - b _08160E8A -_08160940: - ldr r1, [r7] - movs r0, 0x4 - b _08160E88 - .pool -_0816094C: - ldr r1, [r7] - ldrb r0, [r1] - adds r0, 0x1 - b _08160E88 -_08160954: - movs r0, 0 - bl render_previous_quest_text - b _0816096A -_0816095C: - movs r0, 0 - bl sub_8160F50 - b _08160E8A -_08160964: - movs r0, 0 - bl sub_8161074 -_0816096A: - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - bl sub_81611AC - b _08160E8A - .pool -_08160980: - movs r0, 0x1 - bl sub_8160F50 - b _08160E8A -_08160988: - bl sub_81D2C3C - lsls r0, 16 - cmp r0, 0 - beq _08160994 - b _08160E8A -_08160994: - bl sub_81D2C50 - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - b _08160E88 - .pool -_081609A8: - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - bne _08160A0A - ldr r5, =gUnknown_0203BC34 - ldr r0, [r5] - adds r0, 0x44 - ldrb r1, [r0] - movs r0, 0x64 - adds r4, r1, 0 - muls r4, r0 - ldr r0, =gPlayerParty - adds r4, r0 - bl sub_8161054 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl GiveMoveToMon - lsls r0, 16 - ldr r1, =0xffff0000 - cmp r0, r1 - beq _08160A04 - ldr r0, =gUnknown_085EF8E4 - bl sub_816084C - ldr r1, =gSpecialVar_0x8004 - movs r0, 0x1 - strh r0, [r1] - ldr r1, [r5] - movs r0, 0x1F - b _08160E88 - .pool -_08160A04: - ldr r1, [r5] - movs r0, 0x10 - b _08160E88 -_08160A0A: - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _08160A18 - cmp r1, 0x1 - beq _08160A18 - b _08160E8A -_08160A18: - ldr r0, =gUnknown_0203BC38 - ldrb r0, [r0, 0x4] - cmp r0, 0 - bne _08160A30 - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - movs r0, 0x3 - b _08160E88 - .pool -_08160A30: - cmp r0, 0x1 - beq _08160A36 - b _08160E8A -_08160A36: - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - movs r0, 0x5 - b _08160E88 - .pool -_08160A44: - bl sub_81D2C3C - lsls r0, 16 - cmp r0, 0 - beq _08160A50 - b _08160E8A -_08160A50: - bl sub_81D2C50 - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - b _08160E88 - .pool -_08160A64: - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - bne _08160A7C - ldr r0, =gSpecialVar_0x8004 - strh r1, [r0] - b _08160E82 - .pool -_08160A7C: - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _08160A8A - cmp r1, 0x1 - beq _08160A8A - b _08160E8A -_08160A8A: - ldr r0, =gUnknown_0203BC38 - ldrb r0, [r0, 0x4] - cmp r0, 0 - bne _08160AA4 - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - movs r0, 0x3 - b _08160E88 - .pool -_08160AA4: - cmp r0, 0x1 - beq _08160AAA - b _08160E8A -_08160AAA: - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - movs r0, 0x5 - b _08160E88 - .pool -_08160AB8: - ldr r0, =gUnknown_085EF8F3 - bl sub_816084C - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - b _08160E88 - .pool -_08160AD0: - bl sub_81D2C3C - lsls r0, 16 - cmp r0, 0 - beq _08160ADC - b _08160E8A -_08160ADC: - bl sub_81D2C50 - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - movs r0, 0x12 - b _08160E88 - .pool -_08160AEC: - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - bne _08160B10 - ldr r0, =gUnknown_085EFA10 - bl sub_816084C - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - movs r0, 0x13 - b _08160E88 - .pool -_08160B10: - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _08160B1E - cmp r1, 0x1 - beq _08160B1E - b _08160E8A -_08160B1E: - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - movs r0, 0x18 - b _08160E88 - .pool -_08160B2C: - ldr r4, =gStringVar2 - bl sub_8161054 - movs r1, 0xD - muls r1, r0 - ldr r0, =gMoveNames - adds r1, r0 - adds r0, r4, 0 - bl StringCopy - ldr r0, =gUnknown_085EF960 - bl sub_816084C - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - b _08160E88 - .pool -_08160B60: - bl sub_81D2C3C - lsls r0, 16 - cmp r0, 0 - beq _08160B6C - b _08160E8A -_08160B6C: - bl sub_81D2C50 - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - b _08160E88 - .pool -_08160B80: - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - bne _08160B98 - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - movs r0, 0x1B - b _08160E88 - .pool -_08160B98: - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _08160BA6 - cmp r1, 0x1 - beq _08160BA6 - b _08160E8A -_08160BA6: - ldr r0, =gUnknown_0203BC38 - ldrb r0, [r0, 0x4] - cmp r0, 0 - bne _08160BC4 - ldr r2, =gUnknown_0203BC34 - ldr r1, [r2] - movs r0, 0x3 - strb r0, [r1] - adds r7, r2, 0 - b _08160BD0 - .pool -_08160BC4: - ldr r7, =gUnknown_0203BC34 - cmp r0, 0x1 - bne _08160BD0 - ldr r1, [r7] - movs r0, 0x5 - strb r0, [r1] -_08160BD0: - ldr r1, [r7] - movs r0, 0x10 - b _08160E88 - .pool -_08160BDC: - bl sub_81D2C3C - lsls r0, 16 - cmp r0, 0 - beq _08160BE8 - b _08160E8A -_08160BE8: - movs r0, 0x3 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, =gUnknown_0203BC38 - ldrb r0, [r0, 0x4] - cmp r0, 0 - bne _08160C08 - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - movs r0, 0x3 - b _08160E88 - .pool -_08160C08: - cmp r0, 0x1 - beq _08160C0E - b _08160E8A -_08160C0E: - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - movs r0, 0x5 - b _08160E88 - .pool -_08160C1C: - bl sub_81D2C3C - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0 - beq _08160C2A - b _08160E8A -_08160C2A: - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - movs r0, 0x14 - strb r0, [r1] - subs r0, 0x15 - str r2, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - b _08160E8A - .pool -_08160C48: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08160C56 - b _08160E8A -_08160C56: - bl sub_8161054 - lsls r0, 16 - lsrs r0, 16 - ldr r4, =gPlayerParty - ldr r1, =gUnknown_0203BC34 - ldr r1, [r1] - adds r1, 0x44 - ldrb r1, [r1] - ldr r2, =gPlayerPartyCount - ldrb r2, [r2] - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - ldr r3, =sub_8160740 - str r0, [sp] - adds r0, r4, 0 - bl sub_81BFA38 - bl sub_8160EA0 - b _08160E8A - .pool -_08160C98: - bl sub_81D2C3C - lsls r0, 16 - cmp r0, 0 - beq _08160CA4 - b _08160E8A -_08160CA4: - b _08160E82 -_08160CA6: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] -_08160CAE: - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - b _08160E8A -_08160CB8: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - b _08160E88 - .pool -_08160CD8: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08160CE6 - b _08160E8A -_08160CE6: - bl sub_8160EA0 - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - b _08160E8A - .pool -_08160CFC: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, =gUnknown_0203BC38 - ldrb r0, [r0, 0x4] - cmp r0, 0 - bne _08160D30 - movs r0, 0x1 - bl render_previous_quest_text - b _08160D3A - .pool -_08160D30: - cmp r0, 0x1 - bne _08160D3A - movs r0, 0x1 - bl sub_8161074 -_08160D3A: - bl sub_8161234 - movs r0, 0x3 - movs r1, 0x2 - bl CopyWindowToVram - b _08160E8A -_08160D48: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08160D56 - b _08160E8A -_08160D56: - ldr r1, [r7] - adds r2, r1, 0 - adds r2, 0x45 - ldrb r0, [r2] - cmp r0, 0x4 - bne _08160D6C - movs r0, 0x18 - b _08160E88 - .pool -_08160D6C: - adds r0, r1, 0 - adds r0, 0x44 - ldrb r0, [r0] - movs r4, 0x64 - muls r0, r4 - ldr r5, =gPlayerParty - adds r0, r5 - ldrb r1, [r2] - adds r1, 0xD - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - ldr r2, =gStringVar3 - movs r1, 0xD - mov r8, r1 - mov r1, r8 - muls r1, r0 - ldr r6, =gMoveNames - adds r1, r6 - adds r0, r2, 0 - bl StringCopy - ldr r1, [r7] - adds r0, r1, 0 - adds r0, 0x44 - ldrb r0, [r0] - muls r0, r4 - adds r0, r5 - adds r1, 0x45 - ldrb r1, [r1] - bl RemoveMonPPBonus - ldr r0, [r7] - adds r0, 0x44 - ldrb r0, [r0] - muls r4, r0 - adds r4, r5 - bl sub_8161054 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - ldr r0, [r7] - adds r0, 0x45 - ldrb r2, [r0] - adds r0, r4, 0 - bl SetMonMoveSlot - ldr r4, =gStringVar2 - bl sub_8161054 - mov r1, r8 - muls r1, r0 - adds r1, r6 - adds r0, r4, 0 - bl StringCopy - ldr r0, =gUnknown_085EF979 - bl sub_816084C - ldr r1, [r7] - movs r0, 0x1E - strb r0, [r1] - ldr r1, =gSpecialVar_0x8004 - movs r0, 0x1 - strh r0, [r1] - b _08160E8A - .pool -_08160E0C: - bl sub_81D2C3C - lsls r0, 16 - cmp r0, 0 - bne _08160E8A - ldr r0, =gUnknown_085EF9A6 - bl sub_816084C - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - movs r0, 0x1F - strb r0, [r1] - ldr r0, =0x0000016f - bl PlayFanfare - b _08160E8A - .pool -_08160E38: - bl sub_81D2C3C - lsls r0, 16 - cmp r0, 0 - bne _08160E8A - ldr r0, =0x0000016f - bl PlayFanfare - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - movs r0, 0x20 - b _08160E88 - .pool -_08160E58: - bl IsFanfareTaskInactive - lsls r0, 24 - cmp r0, 0 - beq _08160E8A - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - movs r0, 0x21 - b _08160E88 - .pool -_08160E70: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08160E8A - movs r0, 0x5 - bl PlaySE -_08160E82: - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - movs r0, 0xE -_08160E88: - strb r0, [r1] -_08160E8A: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8160868 - - thumb_func_start sub_8160EA0 -sub_8160EA0: @ 8160EA0 - push {r4,lr} - bl sub_8161234 - ldr r4, =gUnknown_0203BC34 - ldr r0, [r4] - movs r1, 0x89 - lsls r1, 1 - adds r0, r1 - ldrb r0, [r0] - ldr r1, =gUnknown_0203BC38 - adds r2, r1, 0x2 - bl sub_81AE6C8 - bl FreeAllWindowBuffers - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] - bl ResetSpriteData - bl FreeAllSpritePalettes - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8160EA0 - - thumb_func_start render_previous_quest_text -render_previous_quest_text: @ 8160EE0 - push {r4-r6,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r5, r0, 24 - movs r2, 0 - ldr r6, =gSprites - ldr r4, =gUnknown_0203BC34 - movs r3, 0x4 -_08160EF0: - ldr r0, [r4] - adds r0, 0x1 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r3 - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0xF - ble _08160EF0 - cmp r5, 0 - bne _08160F38 - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EF8C2 - adds r0, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x3 - movs r1, 0x11 - bl FillWindowPixelBuffer - movs r0, 0x1 - str r0, [sp] - str r5, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0 - bl PrintTextOnWindow -_08160F38: - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end render_previous_quest_text - - thumb_func_start sub_8160F50 -sub_8160F50: @ 8160F50 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r6, =gUnknown_0203BC34 - ldr r0, [r6] - movs r4, 0x89 - lsls r4, 1 - adds r0, r4 - ldrb r0, [r0] - bl ListMenuHandleInput - adds r5, r0, 0 - ldr r0, [r6] - adds r0, r4 - ldrb r0, [r0] - ldr r4, =gUnknown_0203BC38 - adds r2, r4, 0x2 - adds r1, r4, 0 - bl get_coro_args_x18_x1A - movs r0, 0x2 - negs r0, r0 - cmp r5, r0 - beq _08160FE4 - adds r0, 0x1 - cmp r5, r0 - bne _08161010 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x30 - ands r0, r1 - cmp r0, 0 - bne _08160F9C - bl GetLRKeysState - lsls r0, 24 - cmp r0, 0 - beq _0816103E -_08160F9C: - movs r0, 0x5 - bl PlaySE - cmp r7, 0 - bne _08160FC4 - movs r0, 0x1 - bl PutWindowTilemap - ldr r0, [r6] - movs r1, 0x5 - strb r1, [r0] - movs r0, 0x1 - strb r0, [r4, 0x4] - b _08160FD4 - .pool -_08160FC4: - movs r0, 0 - bl PutWindowTilemap - ldr r0, [r6] - movs r2, 0 - movs r1, 0x3 - strb r1, [r0] - strb r2, [r4, 0x4] -_08160FD4: - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - bl sub_8161054 - bl sub_816137C - b _0816103E -_08160FE4: - movs r0, 0x5 - bl PlaySE - bl sub_8161234 - ldr r1, [r6] - movs r0, 0xC - strb r0, [r1] - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EF9E6 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - bl sub_81D2BF4 - b _0816103E - .pool -_08161010: - movs r0, 0x5 - bl PlaySE - bl sub_8161234 - ldr r1, [r6] - movs r0, 0x8 - strb r0, [r1] - ldr r0, =gStringVar2 - movs r1, 0xD - muls r1, r5 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EF8DA - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - bl sub_81D2BF4 -_0816103E: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8160F50 - - thumb_func_start sub_8161054 -sub_8161054: @ 8161054 - ldr r0, =gUnknown_0203BC34 - ldr r2, [r0] - ldr r1, =gUnknown_0203BC38 - ldrh r0, [r1, 0x2] - ldrh r1, [r1] - adds r0, r1 - lsls r0, 3 - adds r2, 0x4C - adds r2, r0 - ldr r0, [r2] - bx lr - .pool - thumb_func_end sub_8161054 - - thumb_func_start sub_8161074 -sub_8161074: @ 8161074 - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _081610A6 - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EF8C2 - adds r0, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x3 - movs r1, 0x11 - bl FillWindowPixelBuffer - movs r0, 0x1 - str r0, [sp] - str r5, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0 - bl PrintTextOnWindow -_081610A6: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8161074 - - thumb_func_start sub_81610B8 -sub_81610B8: @ 81610B8 - push {r4-r7,lr} - ldr r2, =gUnknown_0203BC34 - ldr r0, [r2] - movs r1, 0x8A - lsls r1, 1 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldr r0, [r2] - ldr r2, =0x00000113 - adds r1, r0, r2 - movs r0, 0x1 - negs r0, r0 - strb r0, [r1] - bl sub_81611AC - movs r4, 0 - ldr r5, =gUnknown_085CEC10 -_081610DC: - adds r2, r4, 0 - cmp r4, 0 - bge _081610E4 - adds r2, r4, 0x3 -_081610E4: - asrs r2, 2 - lsls r1, r2, 2 - subs r1, r4, r1 - lsls r1, 19 - movs r0, 0xD0 - lsls r0, 15 - adds r1, r0 - asrs r1, 16 - lsls r2, 19 - movs r0, 0x90 - lsls r0, 14 - adds r2, r0 - asrs r2, 16 - adds r0, r5, 0 - movs r3, 0 - bl CreateSprite - ldr r2, =gUnknown_0203BC34 - ldr r1, [r2] - adds r1, 0x1 - adds r1, r4 - strb r0, [r1] - adds r4, 0x1 - cmp r4, 0x7 - ble _081610DC - movs r4, 0 - ldr r7, =gUnknown_085CEC10 - adds r6, r2, 0 -_0816111C: - adds r2, r4, 0 - cmp r4, 0 - bge _08161124 - adds r2, r4, 0x3 -_08161124: - asrs r2, 2 - lsls r1, r2, 2 - subs r1, r4, r1 - lsls r1, 19 - movs r0, 0xD0 - lsls r0, 15 - adds r1, r0 - asrs r1, 16 - lsls r2, 19 - movs r0, 0xD0 - lsls r0, 14 - adds r2, r0 - asrs r2, 16 - adds r0, r7, 0 - movs r3, 0 - bl CreateSprite - ldr r1, [r6] - adds r2, r4, 0 - adds r2, 0x8 - adds r1, 0x1 - adds r1, r2 - strb r0, [r1] - ldr r0, [r6] - adds r0, 0x1 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r5, =gSprites - adds r0, r5 - movs r1, 0x2 - bl StartSpriteAnim - adds r4, 0x1 - cmp r4, 0x7 - ble _0816111C - movs r4, 0 - ldr r3, =gUnknown_0203BC34 - movs r2, 0x4 -_08161176: - ldr r0, [r3] - adds r0, 0x1 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - adds r4, 0x1 - cmp r4, 0xF - ble _08161176 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81610B8 - - thumb_func_start sub_81611AC -sub_81611AC: @ 81611AC - push {r4-r6,lr} - ldr r4, =gUnknown_0203BC34 - ldr r1, [r4] - movs r2, 0x8A - lsls r2, 1 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0xFF - bne _081611D4 - ldr r0, =gUnknown_085CEBC0 - movs r3, 0x8B - lsls r3, 1 - adds r1, r3 - bl AddScrollIndicatorArrowPair - ldr r1, [r4] - movs r5, 0x8A - lsls r5, 1 - adds r1, r5 - strb r0, [r1] -_081611D4: - ldr r0, [r4] - ldr r6, =0x00000113 - adds r0, r6 - ldrb r0, [r0] - cmp r0, 0xFF - bne _08161210 - ldr r0, =gUnknown_0203CE8C - adds r2, r0, 0 - ldr r1, =gUnknown_085CEBD0 - ldm r1!, {r3,r5,r6} - stm r2!, {r3,r5,r6} - ldr r1, [r1] - str r1, [r2] - ldr r2, [r4] - movs r3, 0x88 - lsls r3, 1 - adds r1, r2, r3 - ldrb r1, [r1] - ldr r5, =0x00000111 - adds r2, r5 - ldrb r2, [r2] - subs r1, r2 - strh r1, [r0, 0x8] - ldr r1, =gUnknown_0203BC38 - bl AddScrollIndicatorArrowPair - ldr r1, [r4] - ldr r6, =0x00000113 - adds r1, r6 - strb r0, [r1] -_08161210: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81611AC - - thumb_func_start sub_8161234 -sub_8161234: @ 8161234 - push {r4,lr} - ldr r4, =gUnknown_0203BC34 - ldr r0, [r4] - movs r2, 0x8A - lsls r2, 1 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0xFF - beq _08161256 - bl RemoveScrollIndicatorArrowPair - ldr r0, [r4] - movs r1, 0x8A - lsls r1, 1 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] -_08161256: - ldr r0, [r4] - ldr r2, =0x00000113 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0xFF - beq _08161270 - bl RemoveScrollIndicatorArrowPair - ldr r0, [r4] - ldr r2, =0x00000113 - adds r1, r0, r2 - movs r0, 0xFF - strb r0, [r1] -_08161270: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8161234 - - thumb_func_start sub_8161280 -sub_8161280: @ 8161280 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0xC - ldr r4, =gUnknown_0203BC34 - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x44 - ldrb r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r2, =gPlayerParty - adds r0, r2 - adds r1, 0x12 - bl GetMoveRelearnerMoves - ldr r1, [r4] - movs r6, 0x88 - lsls r6, 1 - adds r1, r6 - strb r0, [r1] - movs r5, 0 - ldr r0, [r4] - adds r0, r6 - ldrb r0, [r0] - cmp r5, r0 - bge _081612F6 - mov r8, r4 - movs r0, 0xD - mov r12, r0 - ldr r2, =gMoveNames - mov r9, r2 -_081612C2: - mov r7, r8 - ldr r4, [r7] - lsls r3, r5, 3 - adds r2, r4, 0 - adds r2, 0x48 - adds r2, r3 - lsls r0, r5, 1 - adds r1, r4, 0 - adds r1, 0x12 - adds r1, r0 - ldrh r0, [r1] - mov r7, r12 - muls r7, r0 - adds r0, r7, 0 - add r0, r9 - str r0, [r2] - adds r0, r4, 0 - adds r0, 0x4C - adds r0, r3 - ldrh r1, [r1] - str r1, [r0] - adds r5, 0x1 - adds r0, r4, r6 - ldrb r0, [r0] - cmp r5, r0 - blt _081612C2 -_081612F6: - ldr r4, =gUnknown_0203BC34 - ldr r0, [r4] - adds r0, 0x44 - ldrb r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl GetMonData - ldr r0, =gStringVar1 - mov r1, sp - bl StringCopy10 - ldr r2, [r4] - movs r5, 0x88 - lsls r5, 1 - adds r3, r2, r5 - ldrb r0, [r3] - lsls r0, 3 - adds r1, r2, 0 - adds r1, 0x48 - adds r1, r0 - ldr r0, =gText_Cancel - str r0, [r1] - ldrb r0, [r3] - lsls r0, 3 - adds r2, 0x4C - adds r2, r0 - movs r0, 0x2 - negs r0, r0 - str r0, [r2] - ldrb r0, [r3] - adds r0, 0x1 - strb r0, [r3] - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x48 - adds r1, r5 - ldrb r1, [r1] - bl sub_81D28C8 - ldr r1, [r4] - ldr r2, =0x00000111 - adds r1, r2 - strb r0, [r1] - add sp, 0xC - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8161280 - - thumb_func_start sub_816137C -sub_816137C: @ 816137C - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r0, 0 - ldr r0, =gUnknown_0203BC38 - ldrb r0, [r0, 0x4] - cmp r0, 0 - beq _08161394 - movs r0, 0x2 - negs r0, r0 - cmp r4, r0 - bne _081613CC -_08161394: - movs r5, 0 - ldr r4, =gSprites - ldr r3, =gUnknown_0203BC34 - movs r2, 0x4 -_0816139C: - ldr r0, [r3] - adds r0, 0x1 - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0xF - bls _0816139C - b _081614FE - .pool -_081613CC: - ldr r1, =gContestEffects - ldr r0, =gContestMoves - lsls r4, 3 - adds r0, r4, r0 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x1] - movs r1, 0xA - bl __udivsi3 - lsls r0, 24 - lsrs r6, r0, 24 - mov r8, r4 - cmp r6, 0xFF - bne _081613EE - movs r6, 0 -_081613EE: - movs r5, 0 - ldr r7, =gUnknown_0203BC34 - ldr r4, =gSprites -_081613F4: - cmp r5, r6 - bcs _08161420 - ldr r0, [r7] - adds r0, 0x1 - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x1 - bl StartSpriteAnim - b _08161436 - .pool -_08161420: - ldr r0, [r7] - adds r0, 0x1 - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0 - bl StartSpriteAnim -_08161436: - ldr r0, [r7] - adds r0, 0x1 - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - movs r3, 0x5 - negs r3, r3 - adds r2, r3, 0 - ands r1, r2 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x7 - bls _081613F4 - ldr r1, =gContestEffects - ldr r0, =gContestMoves - add r0, r8 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x2] - movs r1, 0xA - bl __udivsi3 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0xFF - bne _0816147C - movs r6, 0 -_0816147C: - movs r5, 0 - ldr r0, =gUnknown_0203BC34 - mov r8, r0 - ldr r7, =gSprites -_08161484: - cmp r5, r6 - bcs _081614B8 - mov r1, r8 - ldr r0, [r1] - adds r4, r5, 0 - adds r4, 0x8 - adds r0, 0x1 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - movs r1, 0x3 - bl StartSpriteAnim - b _081614D4 - .pool -_081614B8: - mov r3, r8 - ldr r0, [r3] - adds r4, r5, 0 - adds r4, 0x8 - adds r0, 0x1 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - movs r1, 0x2 - bl StartSpriteAnim -_081614D4: - mov r1, r8 - ldr r0, [r1] - adds r0, 0x1 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - adds r0, 0x3E - ldrb r1, [r0] - movs r3, 0x5 - negs r3, r3 - adds r2, r3, 0 - ands r1, r2 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x7 - bls _08161484 -_081614FE: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_816137C - - 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. diff --git a/asm/rom_818CFC8.s b/asm/battle_dome_cards.s similarity index 100% rename from asm/rom_818CFC8.s rename to asm/battle_dome_cards.s diff --git a/asm/battle_frontier_1.s b/asm/battle_frontier_1.s new file mode 100755 index 000000000..135918627 --- /dev/null +++ b/asm/battle_frontier_1.s @@ -0,0 +1,16014 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_818E9AC +sub_818E9AC: @ 818E9AC + push {lr} + ldr r1, =gUnknown_0860D090 + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E9AC + + thumb_func_start sub_818E9CC +sub_818E9CC: @ 818E9CC + push {r4-r7,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r7, r0, 16 + ldr r0, [r4] + ldr r2, =0x00000ca8 + adds r0, r2 + movs r6, 0 + strb r6, [r0] + ldr r1, [r4] + adds r2, 0xA + adds r0, r1, r2 + strh r6, [r0] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r4] + ldr r2, =0x00000ca9 + adds r1, r2 + ldrb r2, [r1] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r4, [r4] + ldr r0, =0x00000cdc + adds r3, r4, r0 + ldr r2, =gUnknown_0860D0EC + lsls r1, r5, 2 + lsls r0, r7, 3 + adds r1, r0 + adds r1, r2 + ldr r0, [r3] + ldr r1, [r1] + ands r0, r1 + cmp r0, 0 + bne _0818EA3E + lsls r0, r5, 1 + lsls r1, r7, 2 + adds r0, r1 + ldr r2, =0x00000d0c + adds r1, r4, r2 + adds r1, r0 + strh r6, [r1] +_0818EA3E: + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0x4 + ldrsb r1, [r0, r1] + movs r2, 0x5 + ldrsb r2, [r0, r2] + movs r3, 0x1 + negs r3, r3 + movs r0, 0 + bl saved_warp2_set + ldr r0, =gTrainerBattleOpponent_A + strh r6, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E9CC + + thumb_func_start sub_818EA84 +sub_818EA84: @ 818EA84 + push {r4-r6,lr} + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x9 + bls _0818EAA8 + b _0818ED10 +_0818EAA8: + lsls r0, 2 + ldr r1, =_0818EAC8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0818EAC8: + .4byte _0818EAF0 + .4byte _0818EB14 + .4byte _0818EB48 + .4byte _0818EB64 + .4byte _0818EB80 + .4byte _0818EB98 + .4byte _0818EBB4 + .4byte _0818EC40 + .4byte _0818ECD0 + .4byte _0818ECF4 +_0818EAF0: + ldr r3, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r5, 1 + lsls r2, r6, 2 + adds r1, r2 + ldr r2, =0x00000d0c + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r3] + b _0818ED10 + .pool +_0818EB14: + ldr r4, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r3, =0x00000cdc + adds r2, r3 + ldr r3, =gUnknown_0860D0EC + lsls r0, r5, 2 + lsls r1, r6, 3 + adds r0, r1 + adds r0, r3 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + strh r0, [r4] + b _0818ED10 + .pool +_0818EB48: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000d08 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 31 + b _0818ECBE + .pool +_0818EB64: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r3, =0x00000d08 + adds r0, r3 + ldrb r0, [r0] + lsls r0, 30 + b _0818ECBE + .pool +_0818EB80: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000d08 + adds r0, r2 + b _0818ECBA + .pool +_0818EB98: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r3, =0x00000d08 + adds r0, r3 + ldrb r0, [r0] + lsls r0, 28 + b _0818ECBE + .pool +_0818EBB4: + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bne _0818EC04 + cmp r5, 0 + beq _0818EBE8 + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000d08 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 26 + b _0818ECBE + .pool +_0818EBE8: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r3, =0x00000d08 + adds r0, r3 + ldrb r0, [r0] + lsls r0, 27 + b _0818ECBE + .pool +_0818EC04: + cmp r5, 0 + beq _0818EC24 + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000d08 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 30 + b _0818ECBE + .pool +_0818EC24: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r3, =0x00000d08 + adds r0, r3 + ldrb r0, [r0] + lsls r0, 31 + b _0818ECBE + .pool +_0818EC40: + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bne _0818EC90 + cmp r5, 0 + beq _0818EC74 + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000d08 + adds r0, r2 + ldrb r0, [r0] + lsrs r0, 7 + strh r0, [r1] + b _0818ED10 + .pool +_0818EC74: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r3, =0x00000d08 + adds r0, r3 + ldrb r0, [r0] + lsls r0, 25 + b _0818ECBE + .pool +_0818EC90: + cmp r5, 0 + beq _0818ECB0 + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000d08 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 28 + b _0818ECBE + .pool +_0818ECB0: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r3, =0x00000d08 + adds r0, r3 +_0818ECBA: + ldrb r0, [r0] + lsls r0, 29 +_0818ECBE: + lsrs r0, 31 + strh r0, [r1] + b _0818ED10 + .pool +_0818ECD0: + bl sub_81B8558 + ldr r2, =gUnknown_0203CEF8 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + movs r1, 0xCB + lsls r1, 4 + adds r0, r1 + ldrh r1, [r0] + strb r1, [r2] + ldrh r0, [r0] + lsrs r0, 8 + strb r0, [r2, 0x1] + b _0818ED10 + .pool +_0818ECF4: + ldr r2, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r3, =0x00000d0a + adds r0, r1, r3 + ldrb r0, [r0] + lsls r0, 1 + adds r3, 0x1 + adds r1, r3 + ldr r3, =0x0000fffd + adds r0, r3 + ldrb r1, [r1] + adds r0, r1 + strh r0, [r2] +_0818ED10: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818EA84 + + thumb_func_start sub_818ED28 +sub_818ED28: @ 818ED28 + push {r4,r5,lr} + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r4, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x8 + bls _0818ED4C + b _0818F01E +_0818ED4C: + lsls r0, 2 + ldr r1, =_0818ED6C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0818ED6C: + .4byte _0818ED90 + .4byte _0818EDB4 + .4byte _0818EE10 + .4byte _0818EE34 + .4byte _0818EE5C + .4byte _0818EE78 + .4byte _0818EEA0 + .4byte _0818EF50 + .4byte _0818F008 +_0818ED90: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + lsls r0, r4, 1 + lsls r1, r5, 2 + adds r0, r1 + ldr r1, =0x00000d0c + adds r2, r1 + adds r2, r0 + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + strh r0, [r2] + b _0818F01E + .pool +_0818EDB4: + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + cmp r0, 0 + beq _0818EDE8 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r0, =0x00000cdc + adds r2, r0 + ldr r3, =gUnknown_0860D0EC + lsls r1, r4, 2 + lsls r0, r5, 3 + adds r1, r0 + adds r1, r3 + ldr r0, [r2] + ldr r1, [r1] + orrs r0, r1 + str r0, [r2] + b _0818F01E + .pool +_0818EDE8: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r1, =0x00000cdc + adds r2, r1 + ldr r3, =gUnknown_0860D0FC + lsls r1, r4, 2 + lsls r0, r5, 3 + adds r1, r0 + adds r1, r3 + ldr r0, [r2] + ldr r1, [r1] + ands r0, r1 + str r0, [r2] + b _0818F01E + .pool +_0818EE10: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r1, =0x00000d08 + adds r2, r1 + movs r1, 0x1 + ands r1, r0 + ldrb r3, [r2] + movs r0, 0x2 + negs r0, r0 + b _0818EF74 + .pool +_0818EE34: + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r2, =0x00000d08 + adds r3, r2 + movs r1, 0x1 + ands r1, r0 + lsls r1, 1 + ldrb r2, [r3] + movs r0, 0x3 + negs r0, r0 + b _0818EFF4 + .pool +_0818EE5C: + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r1, =0x00000d08 + adds r3, r1 + b _0818EFE8 + .pool +_0818EE78: + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r2, =0x00000d08 + adds r3, r2 + movs r1, 0x1 + ands r1, r0 + lsls r1, 3 + ldrb r2, [r3] + movs r0, 0x9 + negs r0, r0 + b _0818EFF4 + .pool +_0818EEA0: + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x1 + bne _0818EF00 + cmp r4, 0 + beq _0818EEDC + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r2, =0x00000d08 + adds r3, r2 + ands r1, r0 + lsls r1, 5 + ldrb r2, [r3] + movs r0, 0x21 + negs r0, r0 + b _0818EFF4 + .pool +_0818EEDC: + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r2, =0x00000d08 + adds r3, r2 + ands r1, r0 + lsls r1, 4 + ldrb r2, [r3] + movs r0, 0x11 + negs r0, r0 + b _0818EFF4 + .pool +_0818EF00: + cmp r4, 0 + beq _0818EF2C + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r1, =0x00000d08 + adds r3, r1 + movs r1, 0x1 + ands r1, r0 + lsls r1, 1 + ldrb r2, [r3] + movs r0, 0x3 + negs r0, r0 + b _0818EFF4 + .pool +_0818EF2C: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r1, =0x00000d08 + adds r2, r1 + movs r1, 0x1 + ands r1, r0 + ldrb r3, [r2] + movs r0, 0x2 + negs r0, r0 + b _0818EF74 + .pool +_0818EF50: + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x1 + bne _0818EFB0 + cmp r4, 0 + beq _0818EF8C + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r1, [r0] + ldr r0, =0x00000d08 + adds r2, r0 + lsls r1, 7 + ldrb r3, [r2] + movs r0, 0x7F +_0818EF74: + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + b _0818F01E + .pool +_0818EF8C: + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r2, =0x00000d08 + adds r3, r2 + ands r1, r0 + lsls r1, 6 + ldrb r2, [r3] + movs r0, 0x41 + negs r0, r0 + b _0818EFF4 + .pool +_0818EFB0: + cmp r4, 0 + beq _0818EFDC + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r1, =0x00000d08 + adds r3, r1 + movs r1, 0x1 + ands r1, r0 + lsls r1, 3 + ldrb r2, [r3] + movs r0, 0x9 + negs r0, r0 + b _0818EFF4 + .pool +_0818EFDC: + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r2, =0x00000d08 + adds r3, r2 +_0818EFE8: + movs r1, 0x1 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r3] + movs r0, 0x5 + negs r0, r0 +_0818EFF4: + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + b _0818F01E + .pool +_0818F008: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r0, =gUnknown_0203CEF8 + ldrb r1, [r0] + ldrb r0, [r0, 0x1] + lsls r0, 8 + orrs r1, r0 + movs r0, 0xCB + lsls r0, 4 + adds r2, r0 + strh r1, [r2] +_0818F01E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818ED28 + + thumb_func_start sub_818F02C +sub_818F02C: @ 818F02C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x3C + movs r0, 0 + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r0, [sp, 0x10] + movs r0, 0x20 + bl AllocZeroed + str r0, [sp, 0x18] + movs r0, 0x18 + bl AllocZeroed + str r0, [sp, 0x1C] + ldr r4, =gSaveBlock2Ptr + ldr r1, [r4] + ldr r2, =0x00000ca9 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + adds r0, 0x1 + ldr r3, =0x00000d0a + adds r1, r3 + strb r0, [r1] + ldr r0, =0x000040ce + bl VarGet + ldr r1, [r4] + adds r0, 0x1 + ldr r5, =0x00000d0b + adds r1, r5 + strb r0, [r1] + ldr r2, [r4] + ldr r7, =0x00000d24 + adds r3, r2, r7 + ldrh r0, [r3] + ldr r5, =0x000003ff + adds r1, r5, 0 + orrs r0, r1 + strh r0, [r3] + ldr r3, =0x00000d25 + adds r2, r3 + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r1, [r4] + adds r1, r3 + ldrb r2, [r1] + movs r0, 0x19 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r4] + adds r1, r3 + ldrb r2, [r1] + movs r0, 0x1F + ands r0, r2 + strb r0, [r1] + movs r7, 0 + mov r10, r7 + mov r8, r4 + ldr r0, =gBattleScripting + 0x14 + mov r9, r0 + movs r4, 0 +_0818F0BA: + mov r1, r8 + ldr r0, [r1] + ldr r2, =0x00000caa + adds r0, r2 + adds r0, r4 + ldrh r0, [r0] + movs r3, 0x64 + muls r0, r3 + add r0, r9 + movs r1, 0xB + movs r2, 0 + bl GetMonData + mov r5, r8 + ldr r1, [r5] + ldr r7, =0x00000d64 + adds r1, r7 + adds r1, r4 + strh r0, [r1] + movs r5, 0 + mov r0, r10 + lsls r7, r0, 4 + adds r6, r7, 0 +_0818F0E8: + mov r1, r8 + ldr r0, [r1] + ldr r2, =0x00000caa + adds r0, r2 + adds r0, r4 + ldrh r0, [r0] + movs r3, 0x64 + muls r0, r3 + add r0, r9 + adds r1, r5, 0 + adds r1, 0xD + movs r2, 0 + bl GetMonData + mov r2, r8 + ldr r1, [r2] + ldr r3, =0x00000efc + adds r1, r3 + adds r1, r6 + strh r0, [r1] + adds r6, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _0818F0E8 + movs r5, 0 + ldr r6, =gSaveBlock2Ptr +_0818F11C: + ldr r0, [r6] + ldr r1, =0x00000caa + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + movs r2, 0x64 + muls r0, r2 + add r0, r9 + adds r1, r5, 0 + adds r1, 0x1A + movs r2, 0 + bl GetMonData + ldr r1, [r6] + adds r2, r5, r7 + ldr r3, =0x00000f04 + adds r1, r3 + adds r1, r2 + strb r0, [r1] + adds r5, 0x1 + cmp r5, 0x5 + ble _0818F11C + mov r5, r8 + ldr r0, [r5] + ldr r1, =0x00000caa + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + movs r2, 0x64 + muls r0, r2 + add r0, r9 + bl GetNature + ldr r1, [r5] + adds r1, r7 + ldr r3, =0x00000f0a + adds r1, r3 + strb r0, [r1] + adds r4, 0x2 + movs r5, 0x1 + add r10, r5 + mov r7, r10 + cmp r7, 0x2 + ble _0818F0BA + mov r10, r5 + movs r0, 0x4 + str r0, [sp, 0x34] + movs r1, 0x6 + str r1, [sp, 0x38] +_0818F17E: + mov r2, r10 + cmp r2, 0x5 + ble _0818F22C +_0818F184: + bl sub_81A39C4 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_8162548 + lsls r0, 16 + lsrs r4, r0, 16 + movs r5, 0x1 + cmp r5, r10 + bge _0818F1CA + ldr r3, =gSaveBlock2Ptr + ldr r0, [r3] + ldr r7, =0x00000d28 + adds r0, r7 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + adds r2, r3, 0 + cmp r0, r4 + beq _0818F1CA + ldr r3, =0x00000d24 +_0818F1B2: + adds r5, 0x1 + cmp r5, r10 + bge _0818F1CA + ldr r0, [r2] + lsls r1, r5, 2 + adds r0, r1 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r4 + bne _0818F1B2 +_0818F1CA: + cmp r5, r10 + bne _0818F184 + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r1, [sp, 0x34] + adds r3, r1 + ldr r2, =0x00000d24 + adds r3, r2 + ldr r5, =0x000003ff + adds r0, r5, 0 + adds r2, r4, 0 + ands r2, r0 + ldrh r0, [r3] + ldr r7, =0xfffffc00 + adds r1, r7, 0 + b _0818F292 + .pool +_0818F22C: + bl sub_81A39C4 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_8162548 + lsls r0, 16 + lsrs r4, r0, 16 + movs r5, 0x1 + cmp r5, r10 + bge _0818F274 + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r2, =0x00000d28 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + adds r2, r1, 0 + cmp r0, r4 + beq _0818F274 + ldr r3, =0x00000d24 +_0818F25C: + adds r5, 0x1 + cmp r5, r10 + bge _0818F274 + ldr r0, [r2] + lsls r1, r5, 2 + adds r0, r1 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r4 + bne _0818F25C +_0818F274: + cmp r5, r10 + bne _0818F22C + ldr r5, =gSaveBlock2Ptr + ldr r3, [r5] + ldr r7, [sp, 0x34] + adds r3, r7 + ldr r0, =0x00000d24 + adds r3, r0 + ldr r1, =0x000003ff + adds r0, r1, 0 + adds r2, r4, 0 + ands r2, r0 + ldrh r0, [r3] + ldr r5, =0xfffffc00 + adds r1, r5, 0 +_0818F292: + ands r0, r1 + orrs r0, r2 + strh r0, [r3] + movs r5, 0 + lsls r4, 16 + str r4, [sp, 0x2C] + ldr r7, [sp, 0x38] + str r7, [sp, 0x20] +_0818F2A2: + lsls r0, r5, 1 + mov r9, r0 + adds r1, r5, 0x1 + str r1, [sp, 0x24] + lsls r2, r5, 2 + str r2, [sp, 0x28] +_0818F2AE: + ldr r3, [sp, 0x2C] + lsrs r0, r3, 16 + bl sub_8163524 + lsls r0, 16 + lsrs r6, r0, 16 + movs r7, 0 + cmp r7, r5 + bge _0818F300 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, [sp, 0x8] + mov r8, r1 + ldr r2, [sp, 0xC] + mov r12, r2 + ldr r3, =0x00000d64 + adds r0, r3 + ldr r1, [sp, 0x20] + adds r4, r1, r0 +_0818F2D4: + ldrh r3, [r4] + cmp r3, r6 + beq _0818F300 + ldr r2, =gUnknown_0203BC8C + ldr r1, [r2] + lsls r0, r6, 4 + adds r2, r0, r1 + ldrh r0, [r2] + cmp r8, r0 + beq _0818F300 + cmp r12, r0 + beq _0818F300 + lsls r0, r3, 4 + adds r0, r1 + ldrb r0, [r0, 0xA] + ldrb r2, [r2, 0xA] + cmp r0, r2 + beq _0818F300 + adds r4, 0x2 + adds r7, 0x1 + cmp r7, r5 + blt _0818F2D4 +_0818F300: + cmp r7, r5 + bne _0818F2AE + ldr r3, =gSaveBlock2Ptr + ldr r0, [r3] + ldr r1, [sp, 0x38] + add r1, r9 + ldr r5, =0x00000d64 + adds r0, r5 + adds r0, r1 + strh r6, [r0] + ldr r2, [sp, 0x28] + add r2, sp + adds r2, 0x8 + ldr r0, =gUnknown_0203BC8C + ldr r1, [r0] + lsls r0, r6, 4 + adds r0, r1 + ldrh r0, [r0] + str r0, [r2] + ldr r5, [sp, 0x24] + cmp r5, 0x2 + ble _0818F2A2 + ldr r2, [r3] + ldr r7, [sp, 0x34] + adds r2, r7 + ldr r0, =0x00000d25 + adds r2, r0 + ldrb r0, [r2] + movs r3, 0x5 + negs r3, r3 + adds r1, r3, 0 + ands r0, r1 + strb r0, [r2] + ldr r5, =gSaveBlock2Ptr + ldr r2, [r5] + adds r2, r7 + ldr r7, =0x00000d25 + adds r2, r7 + ldrb r0, [r2] + subs r3, 0x14 + adds r1, r3, 0 + ands r0, r1 + strb r0, [r2] + ldr r1, [r5] + ldr r5, [sp, 0x34] + adds r1, r5 + adds r1, r7 + ldrb r2, [r1] + movs r0, 0x1F + ands r0, r2 + strb r0, [r1] + adds r5, 0x4 + str r5, [sp, 0x34] + ldr r7, [sp, 0x38] + adds r7, 0x6 + str r7, [sp, 0x38] + movs r0, 0x1 + add r10, r0 + mov r1, r10 + cmp r1, 0xF + bgt _0818F37C + b _0818F17E +_0818F37C: + movs r7, 0 + ldr r2, [sp, 0x18] + strh r7, [r2] + movs r3, 0 + mov r10, r3 + ldr r6, =gBitTable + ldr r5, =gBaseStats +_0818F38A: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + mov r2, r10 + lsls r1, r2, 1 + ldr r3, =0x00000caa + adds r0, r3 + adds r0, r1 + ldrh r0, [r0] + subs r4, r0, 0x1 + movs r0, 0x64 + muls r4, r0 + ldr r0, =gPlayerParty + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x3B + movs r2, 0 + bl GetMonData + ldr r2, [sp, 0x18] + ldrh r1, [r2] + adds r1, r0 + strh r1, [r2] + adds r0, r4, 0 + movs r1, 0x3C + movs r2, 0 + bl GetMonData + ldr r3, [sp, 0x18] + ldrh r1, [r3] + adds r1, r0 + strh r1, [r3] + adds r0, r4, 0 + movs r1, 0x3E + movs r2, 0 + bl GetMonData + ldr r2, [sp, 0x18] + ldrh r1, [r2] + adds r1, r0 + strh r1, [r2] + adds r0, r4, 0 + movs r1, 0x3F + movs r2, 0 + bl GetMonData + ldr r3, [sp, 0x18] + ldrh r1, [r3] + adds r1, r0 + strh r1, [r3] + adds r0, r4, 0 + movs r1, 0x3D + movs r2, 0 + bl GetMonData + ldr r2, [sp, 0x18] + ldrh r1, [r2] + adds r1, r0 + strh r1, [r2] + adds r0, r4, 0 + movs r1, 0x3A + movs r2, 0 + bl GetMonData + ldr r3, [sp, 0x18] + ldrh r1, [r3] + adds r1, r0 + strh r1, [r3] + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl GetMonData + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r0, [r1, 0x6] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + orrs r7, r0 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl GetMonData + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r0, [r1, 0x7] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + orrs r7, r0 + movs r0, 0x1 + add r10, r0 + mov r1, r10 + cmp r1, 0x2 + ble _0818F38A + movs r4, 0 + movs r1, 0x1 + movs r5, 0x1F +_0818F458: + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _0818F462 + adds r4, 0x1 +_0818F462: + asrs r7, 1 + subs r5, 0x1 + cmp r5, 0 + bge _0818F458 + bl sub_8165C40 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x14] + adds r2, r0, 0 + adds r0, r4, 0 + muls r0, r2 + movs r1, 0x14 + bl __divsi3 + ldr r3, [sp, 0x18] + ldrh r1, [r3] + adds r1, r0 + strh r1, [r3] + movs r5, 0x1 + mov r10, r5 + adds r6, r3, 0 + adds r6, 0x2 + movs r7, 0x2 + str r7, [sp, 0x30] +_0818F494: + movs r7, 0 + strh r7, [r6] + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + mov r2, r10 + lsls r1, r2, 2 + adds r0, r1 + ldr r3, =0x00000d24 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + bl sub_8190168 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r5, 0 + ldr r0, [sp, 0x30] + mov r9, r0 +_0818F4BC: + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + mov r4, r9 + add r4, r10 + adds r4, r5 + lsls r4, 1 + ldr r2, =0x00000d64 + adds r0, r2 + adds r0, r4 + ldrh r1, [r0] + ldr r3, =gUnknown_0203BC8C + ldr r0, [r3] + lsls r1, 4 + adds r1, r0 + ldrh r0, [r1] + ldrb r3, [r1, 0xB] + ldrb r1, [r1, 0xC] + str r1, [sp] + ldr r1, [sp, 0x1C] + str r1, [sp, 0x4] + ldr r1, [sp, 0x14] + mov r2, r8 + bl sub_818F720 + ldr r2, [sp, 0x1C] + ldr r1, [r2, 0x4] + ldrh r0, [r6] + adds r0, r1 + ldr r1, [r2, 0x8] + adds r0, r1 + ldr r1, [r2, 0x10] + adds r0, r1 + ldr r1, [r2, 0x14] + adds r0, r1 + ldr r1, [r2, 0xC] + adds r0, r1 + ldr r1, [r2] + adds r0, r1 + strh r0, [r6] + ldr r3, =gSaveBlock2Ptr + ldr r0, [r3] + ldr r1, =0x00000d64 + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + ldr r2, =gUnknown_0203BC8C + ldr r1, [r2] + lsls r0, 4 + adds r0, r1 + ldrh r0, [r0] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r3, =gBaseStats + adds r1, r3 + ldrb r0, [r1, 0x6] + lsls r0, 2 + ldr r2, =gBitTable + adds r0, r2 + ldr r0, [r0] + orrs r7, r0 + ldrb r0, [r1, 0x7] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + orrs r7, r0 + adds r5, 0x1 + cmp r5, 0x2 + ble _0818F4BC + movs r4, 0 + movs r1, 0x1 + movs r5, 0x1F +_0818F54C: + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _0818F556 + adds r4, 0x1 +_0818F556: + asrs r7, 1 + subs r5, 0x1 + cmp r5, 0 + bge _0818F54C + ldr r3, [sp, 0x14] + adds r0, r4, 0 + muls r0, r3 + movs r1, 0x14 + bl __divsi3 + ldrh r1, [r6] + adds r1, r0 + strh r1, [r6] + adds r6, 0x2 + ldr r5, [sp, 0x30] + adds r5, 0x2 + str r5, [sp, 0x30] + movs r7, 0x1 + add r10, r7 + mov r0, r10 + cmp r0, 0xF + ble _0818F494 + movs r1, 0 + mov r10, r1 + ldr r2, =0x000003ff + mov r8, r2 +_0818F58A: + mov r5, r10 + adds r5, 0x1 + adds r7, r5, 0 + cmp r5, 0xF + bgt _0818F626 + mov r3, r10 + lsls r0, r3, 1 + ldr r1, [sp, 0x18] + adds r6, r0, r1 + lsls r0, r5, 1 + adds r4, r0, r1 +_0818F5A0: + ldrh r1, [r6] + ldrh r0, [r4] + cmp r1, r0 + bcc _0818F5C2 + cmp r1, r0 + bne _0818F61E + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + lsls r0, r5, 2 + adds r0, r1, r0 + ldr r2, =0x00000d24 + adds r0, r2 + ldrh r0, [r0] + lsls r2, r0, 22 + lsrs r0, r2, 22 + cmp r0, r8 + bne _0818F602 +_0818F5C2: + mov r0, r10 + adds r1, r5, 0 + ldr r2, [sp, 0x18] + bl sub_818F904 + b _0818F600 + .pool +_0818F600: + b _0818F61E +_0818F602: + mov r3, r10 + lsls r0, r3, 2 + adds r0, r1, r0 + ldr r1, =0x00000d24 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 22 + cmp r0, r2 + bls _0818F61E + mov r0, r10 + adds r1, r5, 0 + ldr r2, [sp, 0x18] + bl sub_818F904 +_0818F61E: + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0xF + ble _0818F5A0 +_0818F626: + mov r10, r7 + mov r2, r10 + cmp r2, 0xE + ble _0818F58A + bl sub_81A3610 + lsls r0, 24 + cmp r0, 0 + beq _0818F6EE + movs r3, 0 + mov r10, r3 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r4, =0x00000d24 + adds r1, r4 + ldrh r1, [r1] + lsls r1, 22 + lsrs r1, 22 + ldr r3, =0x000003ff + adds r2, r0, 0 + ldr r6, =gUnknown_0860D3F1 + cmp r1, r3 + beq _0818F674 + adds r5, r2, 0 +_0818F656: + movs r7, 0x1 + add r10, r7 + mov r0, r10 + cmp r0, 0xF + bgt _0818F674 + ldr r0, [r5] + mov r7, r10 + lsls r1, r7, 2 + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r3 + bne _0818F656 +_0818F674: + mov r1, r10 + lsls r0, r1, 1 + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0 + beq _0818F6AC + movs r5, 0 + ldr r2, [r2] + ldr r3, =0x00000d24 + adds r2, r3 + ldrh r1, [r2] + ldr r0, =0xfffffc00 + ands r0, r1 + ldr r7, =0x000003fe + adds r1, r7, 0 + b _0818F6BE + .pool +_0818F6AC: + movs r5, 0x1 + ldr r2, [r2] + ldr r0, =0x00000d28 + adds r2, r0 + ldrh r1, [r2] + ldr r0, =0xfffffc00 + ands r0, r1 + ldr r3, =0x000003fe + adds r1, r3, 0 +_0818F6BE: + orrs r0, r1 + strh r0, [r2] + movs r7, 0 + mov r10, r7 + lsls r0, r5, 1 + adds r0, r5 + lsls r4, r0, 1 +_0818F6CC: + mov r1, r10 + lsls r0, r1, 24 + lsrs r0, 24 + bl sub_81A4FF0 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + ldr r2, =0x00000d64 + adds r1, r2 + adds r1, r4 + strh r0, [r1] + adds r4, 0x2 + movs r3, 0x1 + add r10, r3 + mov r5, r10 + cmp r5, 0x2 + ble _0818F6CC +_0818F6EE: + ldr r0, [sp, 0x18] + bl Free + ldr r0, [sp, 0x1C] + bl Free + add sp, 0x3C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818F02C + + thumb_func_start sub_818F720 +sub_818F720: @ 818F720 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + adds r7, r1, 0 + mov r9, r2 + ldr r1, [sp, 0x3C] + ldr r2, [sp, 0x40] + mov r8, r2 + lsls r0, 16 + lsrs r6, r0, 16 + lsls r3, 24 + lsrs r5, r3, 24 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x18] + movs r1, 0 + adds r4, r5, 0 + movs r3, 0x1 + movs r2, 0x5 +_0818F74C: + adds r0, r4, 0 + ands r0, r3 + cmp r0, 0 + beq _0818F756 + adds r1, 0x1 +_0818F756: + lsrs r4, 1 + subs r2, 0x1 + cmp r2, 0 + bge _0818F74C + movs r0, 0xFF + lsls r0, 1 + bl __divsi3 + lsls r0, 16 + lsrs r3, r0, 16 + lsls r0, r6, 3 + mov r10, r0 + movs r1, 0 + mov r12, r1 + mov r1, sp + movs r2, 0x5 +_0818F776: + mov r0, r12 + str r0, [r1] + adds r0, r5, 0 + ands r0, r4 + cmp r0, 0 + beq _0818F784 + str r3, [r1] +_0818F784: + lsls r0, r4, 25 + lsrs r4, r0, 24 + adds r1, 0x4 + subs r2, 0x1 + cmp r2, 0 + bge _0818F776 + ldr r0, =0x0000012f + cmp r6, r0 + bne _0818F7A0 + movs r0, 0x1 + b _0818F7CA + .pool +_0818F7A0: + mov r2, r10 + subs r0, r2, r6 + lsls r0, 2 + ldr r1, =gBaseStats + adds r0, r1 + ldrb r0, [r0] + lsls r0, 1 + mov r2, r9 + adds r1, r0, r2 + ldr r0, [sp] + cmp r0, 0 + bge _0818F7BA + adds r0, 0x3 +_0818F7BA: + asrs r0, 2 + adds r0, r1, r0 + muls r0, r7 + movs r1, 0x64 + bl __divsi3 + adds r0, r7 + adds r0, 0xA +_0818F7CA: + mov r1, r8 + str r0, [r1] + mov r2, r10 + subs r0, r2, r6 + lsls r0, 2 + ldr r1, =gBaseStats + adds r4, r0, r1 + ldrb r0, [r4, 0x1] + lsls r0, 1 + mov r2, r9 + adds r1, r0, r2 + ldr r0, [sp, 0x4] + cmp r0, 0 + bge _0818F7E8 + adds r0, 0x3 +_0818F7E8: + asrs r0, 2 + adds r0, r1, r0 + muls r0, r7 + movs r1, 0x64 + bl __divsi3 + adds r1, r0, 0 + adds r1, 0x5 + mov r0, r8 + str r1, [r0, 0x4] + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x18] + movs r2, 0x1 + bl nature_stat_mod + lsls r0, 24 + lsrs r0, 24 + mov r1, r8 + str r0, [r1, 0x4] + ldrb r0, [r4, 0x2] + lsls r0, 1 + mov r2, r9 + adds r1, r0, r2 + ldr r0, [sp, 0x8] + cmp r0, 0 + bge _0818F820 + adds r0, 0x3 +_0818F820: + asrs r0, 2 + adds r0, r1, r0 + muls r0, r7 + movs r1, 0x64 + bl __divsi3 + adds r1, r0, 0 + adds r1, 0x5 + mov r0, r8 + str r1, [r0, 0x8] + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x18] + movs r2, 0x2 + bl nature_stat_mod + lsls r0, 24 + lsrs r0, 24 + mov r1, r8 + str r0, [r1, 0x8] + ldrb r0, [r4, 0x3] + lsls r0, 1 + mov r2, r9 + adds r1, r0, r2 + ldr r0, [sp, 0xC] + cmp r0, 0 + bge _0818F858 + adds r0, 0x3 +_0818F858: + asrs r0, 2 + adds r0, r1, r0 + muls r0, r7 + movs r1, 0x64 + bl __divsi3 + adds r1, r0, 0 + adds r1, 0x5 + mov r0, r8 + str r1, [r0, 0xC] + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x18] + movs r2, 0x3 + bl nature_stat_mod + lsls r0, 24 + lsrs r0, 24 + mov r1, r8 + str r0, [r1, 0xC] + ldrb r0, [r4, 0x4] + lsls r0, 1 + mov r2, r9 + adds r1, r0, r2 + ldr r0, [sp, 0x10] + cmp r0, 0 + bge _0818F890 + adds r0, 0x3 +_0818F890: + asrs r0, 2 + adds r0, r1, r0 + muls r0, r7 + movs r1, 0x64 + bl __divsi3 + adds r1, r0, 0 + adds r1, 0x5 + mov r0, r8 + str r1, [r0, 0x10] + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x18] + movs r2, 0x4 + bl nature_stat_mod + lsls r0, 24 + lsrs r0, 24 + mov r1, r8 + str r0, [r1, 0x10] + ldrb r0, [r4, 0x5] + lsls r0, 1 + mov r1, r9 + adds r2, r0, r1 + ldr r0, [sp, 0x14] + cmp r0, 0 + bge _0818F8C8 + adds r0, 0x3 +_0818F8C8: + asrs r0, 2 + adds r0, r2, r0 + muls r0, r7 + movs r1, 0x64 + bl __divsi3 + adds r1, r0, 0 + adds r1, 0x5 + mov r2, r8 + str r1, [r2, 0x14] + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x18] + movs r2, 0x5 + bl nature_stat_mod + lsls r0, 24 + lsrs r0, 24 + mov r1, r8 + str r0, [r1, 0x14] + 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_818F720 + + thumb_func_start sub_818F904 +sub_818F904: @ 818F904 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r3, r0, 1 + mov r12, r3 + adds r4, r3, r2 + ldrh r5, [r4] + lsls r7, r1, 1 + mov r9, r7 + add r2, r9 + ldrh r3, [r2] + strh r3, [r4] + strh r5, [r2] + ldr r2, =gSaveBlock2Ptr + ldr r5, [r2] + lsls r6, r0, 2 + adds r6, r5, r6 + ldr r3, =0x00000d24 + adds r6, r3 + ldrh r7, [r6] + mov r10, r7 + mov r2, r10 + lsls r2, 22 + mov r8, r2 + lsls r2, r1, 2 + adds r5, r2 + adds r5, r3 + ldrh r4, [r5] + lsls r4, 22 + lsrs r4, 22 + ldr r3, =0xfffffc00 + adds r2, r3, 0 + mov r7, r10 + ands r2, r7 + orrs r2, r4 + strh r2, [r6] + mov r2, r8 + lsrs r2, 22 + mov r8, r2 + ldrh r2, [r5] + ands r3, r2 + mov r7, r8 + orrs r3, r7 + strh r3, [r5] + ldr r2, =gSaveBlock2Ptr + mov r8, r2 + add r12, r0 + add r9, r1 + mov r3, r9 + lsls r4, r3, 1 + mov r7, r12 + lsls r3, r7, 1 + ldr r7, =0x00000d64 + movs r6, 0x2 +_0818F974: + mov r1, r8 + ldr r0, [r1] + adds r0, r7 + adds r2, r0, r3 + ldrh r5, [r2] + adds r0, r4 + ldrh r1, [r0] + strh r1, [r2] + strh r5, [r0] + adds r4, 0x2 + adds r3, 0x2 + subs r6, 0x1 + cmp r6, 0 + bge _0818F974 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818F904 + + thumb_func_start sub_818F9B0 +sub_818F9B0: @ 818F9B0 + push {lr} + ldr r0, =gStringVar1 + ldr r2, =gUnknown_085CCD20 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + ldr r3, =0x00000cb2 + adds r1, r3 + ldrh r1, [r1] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl StringCopy + pop {r0} + bx r0 + .pool + thumb_func_end sub_818F9B0 + + thumb_func_start sub_818F9E0 +sub_818F9E0: @ 818F9E0 + push {lr} + ldr r0, =gStringVar1 + ldr r2, =gUnknown_085CCD20 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + ldr r3, =0x00000cb2 + adds r1, r3 + ldrh r1, [r1] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl StringCopy + ldr r0, =gStringVar2 + ldr r1, =gTrainerBattleOpponent_A + ldrh r1, [r1] + bl sub_8195898 + pop {r0} + bx r0 + .pool + thumb_func_end sub_818F9E0 + + thumb_func_start sub_818FA20 +sub_818FA20: @ 818FA20 + push {r4,r5,lr} + ldr r1, =gUnknown_0203CD70 + movs r0, 0 + str r0, [r1] + ldr r4, =gPlayerParty + adds r0, r4, 0 + movs r1, 0x3A + movs r2, 0 + bl GetMonData + ldr r5, =gUnknown_0203CD74 + str r0, [r5] + adds r4, 0x64 + adds r0, r4, 0 + movs r1, 0x3A + movs r2, 0 + bl GetMonData + ldr r1, [r5] + adds r1, r0 + str r1, [r5] + bl CalculatePlayerPartyCount + ldr r0, =gTrainerBattleOpponent_A + ldrh r0, [r0] + bl sub_8195358 + lsls r0, 16 + lsrs r0, 16 + bl sub_818FBDC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818FA20 + + thumb_func_start sub_818FA74 +sub_818FA74: @ 818FA74 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x30 + adds r5, r2, 0 + str r3, [sp, 0x14] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x10] + lsls r1, 16 + lsrs r1, 16 + str r1, [sp, 0x28] + lsls r5, 24 + lsrs r5, 24 + add r0, sp, 0xC + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + ldr r0, [sp, 0x28] + bl sub_8190168 + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + str r6, [sp, 0x2C] + bl sub_8165C40 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x64 + ldr r4, [sp, 0x10] + adds r3, r4, 0 + muls r3, r0 + str r3, [sp, 0x18] + ldr r6, =gEnemyParty + adds r0, r3, r6 + ldr r7, =gSaveBlock2Ptr + ldr r4, [r7] + lsls r5, 1 + ldr r3, [sp, 0x28] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 1 + adds r1, r5, r1 + ldr r6, =0x00000d64 + adds r4, r6 + adds r4, r1 + ldrh r3, [r4] + ldr r7, =gUnknown_0203BC8C + ldr r7, [r7] + mov r8, r7 + lsls r3, 4 + add r3, r8 + ldrh r1, [r3] + ldrb r3, [r3, 0xC] + ldr r6, [sp, 0x2C] + str r6, [sp] + ldrh r4, [r4] + lsls r4, 4 + add r4, r8 + ldrb r4, [r4, 0xB] + str r4, [sp, 0x4] + ldr r7, [sp, 0x14] + str r7, [sp, 0x8] + bl sub_8068634 + add r0, sp, 0xC + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + movs r6, 0 + ldr r2, [sp, 0x18] + str r2, [sp, 0x1C] + mov r10, r5 + ldr r3, =0x00000d64 + mov r9, r3 + ldr r3, =gUnknown_0203BC8C + mov r4, r10 + str r4, [sp, 0x20] +_0818FB18: + ldr r7, =gSaveBlock2Ptr + ldr r1, [r7] + ldr r2, [sp, 0x28] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 1 + mov r8, r0 + mov r5, r10 + add r5, r8 + add r1, r9 + adds r1, r5 + ldrh r0, [r1] + ldr r1, [r3] + lsls r0, 4 + adds r0, r1 + lsls r4, r6, 1 + adds r0, 0x2 + adds r0, r4 + ldrh r1, [r0] + lsls r2, r6, 24 + lsrs r2, 24 + mov r12, r2 + ldr r7, [sp, 0x1C] + ldr r2, =gEnemyParty + adds r0, r7, r2 + mov r2, r12 + str r3, [sp, 0x24] + bl SetMonMoveSlot + ldr r7, =gSaveBlock2Ptr + ldr r0, [r7] + add r0, r9 + adds r0, r5 + ldrh r0, [r0] + ldr r3, [sp, 0x24] + ldr r1, [r3] + lsls r0, 4 + adds r0, r1 + adds r0, 0x2 + adds r0, r4 + ldrh r0, [r0] + cmp r0, 0xDA + bne _0818FB74 + movs r1, 0 + add r0, sp, 0xC + strb r1, [r0] +_0818FB74: + adds r6, 0x1 + cmp r6, 0x3 + ble _0818FB18 + movs r0, 0x64 + ldr r1, [sp, 0x10] + adds r4, r1, 0 + muls r4, r0 + ldr r0, =gEnemyParty + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x20 + add r2, sp, 0xC + bl SetMonData + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, [sp, 0x20] + add r1, r8 + ldr r2, =0x00000d64 + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + ldr r1, =gUnknown_0203BC8C + ldr r1, [r1] + lsls r0, 4 + adds r0, r1 + ldrb r2, [r0, 0xA] + lsls r2, 1 + ldr r0, =gBattleFrontierHeldItems + adds r2, r0 + adds r0, r4, 0 + movs r1, 0xC + bl SetMonData + add sp, 0x30 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818FA74 + + thumb_func_start sub_818FBDC +sub_818FBDC: @ 818FBDC + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + movs r6, 0 + bl ZeroEnemyPartyMons + mov r0, r8 + bl sub_818FC78 + adds r5, r0, 0 + bl Random + adds r4, r0, 0 + bl Random + lsls r4, 16 + lsrs r7, r4, 16 + lsls r0, 16 + orrs r7, r0 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x5 + bls _0818FC46 + movs r4, 0 +_0818FC20: + movs r0, 0x1 + ands r0, r5 + cmp r0, 0 + beq _0818FC3C + lsls r2, r4, 24 + lsrs r2, 24 + adds r0, r6, 0 + mov r1, r8 + adds r3, r7, 0 + bl sub_818FA74 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0818FC3C: + asrs r5, 1 + adds r4, 0x1 + cmp r4, 0x2 + ble _0818FC20 + b _0818FC6C +_0818FC46: + movs r4, 0x2 +_0818FC48: + movs r0, 0x4 + ands r0, r5 + cmp r0, 0 + beq _0818FC64 + lsls r2, r4, 24 + lsrs r2, 24 + adds r0, r6, 0 + mov r1, r8 + adds r3, r7, 0 + bl sub_818FA74 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0818FC64: + lsls r5, 1 + subs r4, 0x1 + cmp r4, 0 + bge _0818FC48 +_0818FC6C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_818FBDC + + thumb_func_start sub_818FC78 +sub_818FC78: @ 818FC78 + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + bl Random + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0818FCA2 + adds r0, r4, 0 + movs r1, 0 + bl sub_818FCBC + cmp r0, 0 + bne _0818FCB6 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_818FDB8 + b _0818FCB6 +_0818FCA2: + adds r0, r5, 0 + movs r1, 0 + bl sub_818FDB8 + cmp r0, 0 + bne _0818FCB6 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_818FCBC +_0818FCB6: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_818FC78 + + thumb_func_start sub_818FCBC +sub_818FCBC: @ 818FCBC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0xC] + movs r0, 0 + mov r9, r0 + mov r1, r8 + lsls r1, 2 + str r1, [sp, 0x18] +_0818FCDE: + mov r2, r9 + lsls r0, r2, 2 + mov r2, sp + adds r1, r2, r0 + movs r0, 0 + str r0, [r1] + movs r7, 0 + mov r0, r9 + adds r0, 0x1 + str r0, [sp, 0x14] + adds r5, r1, 0 + mov r1, r9 + lsls r1, 1 + str r1, [sp, 0x10] +_0818FCFA: + movs r6, 0 + adds r2, r7, 0x1 + mov r10, r2 +_0818FD00: + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r2, [sp, 0x18] + adds r0, r1, r2 + ldr r2, =0x00000d24 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + ldr r2, =0x000003fe + cmp r0, r2 + bne _0818FD3C + mov r1, r9 + lsls r0, r1, 24 + lsls r1, r7, 24 + lsrs r0, 24 + lsrs r1, 24 + bl sub_81A5060 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + b _0818FD60 + .pool +_0818FD3C: + mov r2, r8 + lsls r0, r2, 1 + add r0, r8 + lsls r0, 1 + ldr r2, [sp, 0x10] + adds r0, r2, r0 + ldr r2, =0x00000d64 + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + ldr r1, =gUnknown_0203BC8C + ldr r1, [r1] + lsls r0, 4 + adds r0, r1 + lsls r1, r7, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r4, [r0] +_0818FD60: + movs r0, 0x64 + muls r0, r6 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl GetMonData + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + bl sub_818FFC0 + ldr r1, [r5] + adds r1, r0 + str r1, [r5] + adds r6, 0x1 + cmp r6, 0x2 + ble _0818FD00 + mov r7, r10 + cmp r7, 0x3 + ble _0818FCFA + ldr r0, [sp, 0x14] + mov r9, r0 + cmp r0, 0x2 + ble _0818FCDE + mov r0, sp + ldr r1, [sp, 0xC] + bl sub_818FEB4 + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_818FCBC + + thumb_func_start sub_818FDB8 +sub_818FDB8: @ 818FDB8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0xC] + movs r0, 0 + mov r9, r0 + mov r1, r8 + lsls r1, 2 + str r1, [sp, 0x18] +_0818FDDA: + mov r2, r9 + lsls r0, r2, 2 + mov r2, sp + adds r1, r2, r0 + movs r0, 0 + str r0, [r1] + movs r7, 0 + mov r0, r9 + adds r0, 0x1 + str r0, [sp, 0x14] + adds r5, r1, 0 + mov r1, r9 + lsls r1, 1 + str r1, [sp, 0x10] +_0818FDF6: + movs r6, 0 + adds r2, r7, 0x1 + mov r10, r2 +_0818FDFC: + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r2, [sp, 0x18] + adds r0, r1, r2 + ldr r2, =0x00000d24 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + ldr r2, =0x000003fe + cmp r0, r2 + bne _0818FE38 + mov r1, r9 + lsls r0, r1, 24 + lsls r1, r7, 24 + lsrs r0, 24 + lsrs r1, 24 + bl sub_81A5060 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + b _0818FE5C + .pool +_0818FE38: + mov r2, r8 + lsls r0, r2, 1 + add r0, r8 + lsls r0, 1 + ldr r2, [sp, 0x10] + adds r0, r2, r0 + ldr r2, =0x00000d64 + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + ldr r1, =gUnknown_0203BC8C + ldr r1, [r1] + lsls r0, 4 + adds r0, r1 + lsls r1, r7, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r4, [r0] +_0818FE5C: + movs r0, 0x64 + muls r0, r6 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl GetMonData + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0x1 + bl sub_818FFC0 + ldr r1, [r5] + adds r1, r0 + str r1, [r5] + adds r6, 0x1 + cmp r6, 0x2 + ble _0818FDFC + mov r7, r10 + cmp r7, 0x3 + ble _0818FDF6 + ldr r0, [sp, 0x14] + mov r9, r0 + cmp r0, 0x2 + ble _0818FDDA + mov r0, sp + ldr r1, [sp, 0xC] + bl sub_818FEB4 + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_818FDB8 + + thumb_func_start sub_818FEB4 +sub_818FEB4: @ 818FEB4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + mov r10, r0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0 + str r0, [sp, 0xC] + movs r3, 0x2 + add r0, sp, 0x8 +_0818FECE: + str r3, [r0] + subs r0, 0x4 + subs r3, 0x1 + cmp r3, 0 + bge _0818FECE + mov r3, r10 + ldr r2, [r3] + ldr r0, [r3, 0x4] + cmp r2, r0 + bne _0818FF20 + ldr r0, [r3, 0x8] + cmp r2, r0 + bne _0818FF20 + cmp r1, 0 + beq _0818FFAA + movs r3, 0 + ldr r4, =gBitTable +_0818FEF0: + str r3, [sp, 0x14] + bl Random + movs r1, 0x3 + ands r1, r0 + ldr r3, [sp, 0x14] + cmp r1, 0x3 + beq _0818FF16 + lsls r0, r1, 2 + adds r0, r4 + ldr r1, [r0] + ldr r0, [sp, 0xC] + ands r0, r1 + cmp r0, 0 + bne _0818FF16 + ldr r0, [sp, 0xC] + orrs r0, r1 + str r0, [sp, 0xC] + adds r3, 0x1 +_0818FF16: + cmp r3, 0x2 + bne _0818FEF0 + b _0818FFAA + .pool +_0818FF20: + movs r3, 0 + mov r9, sp + mov r8, r10 +_0818FF26: + adds r2, r3, 0x1 + cmp r2, 0x2 + bgt _0818FF84 + mov r6, r8 + mov r7, r9 + lsls r0, r2, 2 + mov r1, sp + adds r5, r0, r1 + mov r1, r10 + adds r4, r0, r1 +_0818FF3A: + ldr r0, [r6] + ldr r1, [r4] + cmp r0, r1 + bge _0818FF4E + str r1, [r6] + str r0, [r4] + ldr r1, [r7] + ldr r0, [r5] + str r0, [r7] + str r1, [r5] +_0818FF4E: + ldr r1, [r6] + ldr r0, [r4] + cmp r1, r0 + bne _0818FF7A + str r2, [sp, 0x10] + str r3, [sp, 0x14] + bl Random + movs r1, 0x1 + ands r1, r0 + ldr r2, [sp, 0x10] + ldr r3, [sp, 0x14] + cmp r1, 0 + beq _0818FF7A + ldr r1, [r6] + ldr r0, [r4] + str r0, [r6] + str r1, [r4] + ldr r1, [r7] + ldr r0, [r5] + str r0, [r7] + str r1, [r5] +_0818FF7A: + adds r5, 0x4 + adds r4, 0x4 + adds r2, 0x1 + cmp r2, 0x2 + ble _0818FF3A +_0818FF84: + movs r4, 0x4 + add r9, r4 + add r8, r4 + adds r3, 0x1 + cmp r3, 0x1 + ble _0818FF26 + ldr r2, =gBitTable + mov r1, sp + movs r3, 0x1 +_0818FF96: + ldm r1!, {r0} + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ldr r4, [sp, 0xC] + orrs r4, r0 + str r4, [sp, 0xC] + subs r3, 0x1 + cmp r3, 0 + bge _0818FF96 +_0818FFAA: + ldr r0, [sp, 0xC] + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_818FEB4 + + thumb_func_start sub_818FFC0 +sub_818FFC0: @ 818FFC0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r3, r0, 0 + adds r4, r1, 0 + str r2, [sp] + movs r6, 0 + movs r2, 0x14 + cmp r3, 0 + beq _0818FFF0 + ldr r0, =0x0000ffff + cmp r3, r0 + beq _0818FFF0 + ldr r0, =gBattleMoves + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 2 + adds r3, r1, r0 + ldrb r0, [r3, 0x1] + cmp r0, 0 + bne _0818FFFC +_0818FFF0: + movs r0, 0 + b _08190156 + .pool +_0818FFFC: + ldr r1, =gBaseStats + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x6] + mov r10, r1 + ldrb r1, [r0, 0x7] + mov r9, r1 + ldrb r0, [r0, 0x16] + mov r8, r0 + ldrb r3, [r3, 0x2] + str r3, [sp, 0x4] + cmp r0, 0x1A + bne _0819002C + cmp r3, 0x4 + bne _0819002C + ldr r0, [sp] + cmp r0, 0x1 + bne _081900AA + movs r2, 0x8 + b _081900A4 + .pool +_0819002C: + ldr r0, =gUnknown_0831ACE8 + adds r1, r6, r0 + ldrb r0, [r1] + ldr r7, =gUnknown_0831ACE8 + cmp r0, 0xFF + beq _081900A4 + adds r4, r1, 0 +_0819003A: + ldrb r0, [r4] + cmp r0, 0xFE + beq _08190096 + ldrb r0, [r4] + ldr r1, [sp, 0x4] + cmp r0, r1 + bne _08190096 + ldrb r0, [r4, 0x1] + adds r5, r6, 0x1 + cmp r0, r10 + bne _0819006C + adds r1, r6, 0x2 + mov r0, r8 + cmp r0, 0x19 + bne _0819005E + ldrb r0, [r4, 0x2] + cmp r0, 0x28 + bne _0819006C +_0819005E: + adds r0, r1, r7 + ldrb r0, [r0] + muls r0, r2 + movs r1, 0xA + bl __divsi3 + adds r2, r0, 0 +_0819006C: + adds r0, r5, r7 + ldrb r0, [r0] + cmp r0, r9 + bne _08190096 + cmp r10, r9 + beq _08190096 + adds r1, r6, 0x2 + mov r0, r8 + cmp r0, 0x19 + bne _08190088 + adds r0, r1, r7 + ldrb r0, [r0] + cmp r0, 0x28 + bne _08190096 +_08190088: + adds r0, r1, r7 + ldrb r0, [r0] + muls r0, r2 + movs r1, 0xA + bl __divsi3 + adds r2, r0, 0 +_08190096: + adds r4, 0x3 + adds r6, 0x3 + ldr r1, =gUnknown_0831ACE8 + adds r0, r6, r1 + ldrb r0, [r0] + cmp r0, 0xFF + bne _0819003A +_081900A4: + ldr r0, [sp] + cmp r0, 0x1 + beq _081900E0 +_081900AA: + ldr r1, [sp] + cmp r1, 0x1 + bgt _081900BC + cmp r1, 0 + beq _081900C4 + b _08190154 + .pool +_081900BC: + ldr r0, [sp] + cmp r0, 0x2 + beq _08190114 + b _08190154 +_081900C4: + cmp r2, 0xA + beq _08190146 + cmp r2, 0xA + ble _08190146 + cmp r2, 0x28 + beq _0819014A + cmp r2, 0x28 + bgt _081900DA + cmp r2, 0x14 + beq _08190104 + b _08190146 +_081900DA: + cmp r2, 0x50 + bne _08190146 + b _08190100 +_081900E0: + cmp r2, 0xA + beq _08190104 + cmp r2, 0xA + bgt _081900F2 + cmp r2, 0 + beq _08190100 + cmp r2, 0x5 + beq _0819014A + b _08190146 +_081900F2: + cmp r2, 0x28 + beq _08190108 + cmp r2, 0x28 + ble _08190146 + cmp r2, 0x50 + beq _0819010E + b _08190146 +_08190100: + movs r2, 0x8 + b _08190154 +_08190104: + movs r2, 0x2 + b _08190154 +_08190108: + movs r2, 0x2 + negs r2, r2 + b _08190154 +_0819010E: + movs r2, 0x4 + negs r2, r2 + b _08190154 +_08190114: + cmp r2, 0xA + beq _08190146 + cmp r2, 0xA + bgt _08190126 + cmp r2, 0 + beq _0819013A + cmp r2, 0x5 + beq _08190140 + b _08190146 +_08190126: + cmp r2, 0x28 + beq _0819014E + cmp r2, 0x28 + bgt _08190134 + cmp r2, 0x14 + beq _0819014A + b _08190146 +_08190134: + cmp r2, 0x50 + beq _08190152 + b _08190146 +_0819013A: + movs r2, 0x10 + negs r2, r2 + b _08190154 +_08190140: + movs r2, 0x8 + negs r2, r2 + b _08190154 +_08190146: + movs r2, 0 + b _08190154 +_0819014A: + movs r2, 0x4 + b _08190154 +_0819014E: + movs r2, 0xC + b _08190154 +_08190152: + movs r2, 0x14 +_08190154: + adds r0, r2, 0 +_08190156: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_818FFC0 + + thumb_func_start sub_8190168 +sub_8190168: @ 8190168 + push {lr} + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + cmp r0, 0x63 + bls _0819019A + movs r1, 0x6 + cmp r0, 0x77 + bls _0819019A + movs r1, 0x9 + cmp r0, 0x8B + bls _0819019A + movs r1, 0xC + cmp r0, 0x9F + bls _0819019A + movs r1, 0xF + cmp r0, 0xB3 + bls _0819019A + movs r1, 0x12 + cmp r0, 0xC7 + bls _0819019A + movs r1, 0x1F + cmp r0, 0xDB + bhi _0819019A + movs r1, 0x15 +_0819019A: + adds r0, r1, 0 + pop {r1} + bx r1 + thumb_func_end sub_8190168 + + thumb_func_start sub_81901A0 +sub_81901A0: @ 81901A0 + push {r4-r7,lr} + adds r3, r0, 0 + adds r2, r1, 0 + movs r5, 0 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r4, =0x00000d24 + adds r1, r4 + ldrh r1, [r1] + lsls r1, 22 + lsrs r1, 22 + mov r12, r0 + ldr r6, =gUnknown_0860D10C + cmp r1, r2 + beq _081901D8 + mov r7, r12 +_081901C0: + adds r5, 0x1 + cmp r5, 0xF + bgt _081901D8 + ldr r0, [r7] + lsls r1, r5, 2 + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r2 + bne _081901C0 +_081901D8: + cmp r3, 0 + beq _0819026C + cmp r3, 0x3 + bne _081901FC + lsls r0, r5, 2 + adds r1, r0, 0x3 + adds r1, r6 + ldrb r1, [r1] + adds r4, r1, 0 + adds r4, 0x8 + b _08190206 + .pool +_081901FC: + lsls r0, r5, 2 + adds r1, r3, r0 + adds r1, r6 + ldrb r1, [r1] + adds r4, r1, 0x4 +_08190206: + adds r0, r3, r0 + adds r0, r6 + ldrb r2, [r0] + cmp r2, r4 + bge _08190256 + ldr r1, =gUnknown_0860D14C + adds r0, r2, r1 + ldrb r3, [r0] + adds r6, r1, 0 + cmp r3, r5 + beq _08190234 + mov r1, r12 + ldr r0, [r1] + lsls r1, r3, 2 + adds r0, r1 + ldr r3, =0x00000d25 + adds r0, r3 + b _0819024E + .pool +_08190234: + adds r2, 0x1 + cmp r2, r4 + bge _08190256 + adds r0, r2, r6 + ldrb r1, [r0] + cmp r1, r5 + beq _08190234 + mov r3, r12 + ldr r0, [r3] + lsls r1, 2 + adds r0, r1 + ldr r1, =0x00000d25 + adds r0, r1 +_0819024E: + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _08190234 +_08190256: + cmp r2, r4 + beq _08190286 + ldr r0, =gUnknown_0860D14C + adds r0, r2, r0 + ldrb r0, [r0] + b _08190292 + .pool +_0819026C: + mov r3, r12 + ldr r1, [r3] + lsls r0, r5, 2 + adds r0, r6 + ldrb r2, [r0] + lsls r0, r2, 2 + adds r1, r0 + ldr r0, =0x00000d25 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 29 + cmp r0, 0 + bge _08190290 +_08190286: + movs r0, 0xFF + b _08190292 + .pool +_08190290: + adds r0, r2, 0 +_08190292: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81901A0 + + thumb_func_start sub_8190298 +sub_8190298: @ 8190298 + push {lr} + bl sub_81902AC + ldr r1, =gTrainerBattleOpponent_A + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8190298 + + thumb_func_start sub_81902AC +sub_81902AC: @ 81902AC + push {r4,lr} + ldr r0, =gSaveBlock2Ptr + ldr r4, [r0] + ldr r1, =0x00000cb2 + adds r0, r4, r1 + ldrh r0, [r0] + ldr r1, =0x000003ff + bl sub_81901A0 + lsls r0, 2 + adds r4, r0 + ldr r0, =0x00000d24 + adds r4, r0 + ldrh r0, [r4] + lsls r0, 22 + lsrs r0, 22 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81902AC + + thumb_func_start sub_81902E4 +sub_81902E4: @ 81902E4 + push {lr} + ldr r0, =gTrainerBattleOpponent_A + ldrh r0, [r0] + movs r1, 0 + bl sub_8162614 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81902E4 + + thumb_func_start sub_81902F8 +sub_81902F8: @ 81902F8 + push {r4,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl VarSet + ldr r1, [r4] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl sub_81A4C30 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81902F8 + + thumb_func_start sub_819033C +sub_819033C: @ 819033C + push {r4,r5,lr} + ldr r5, =gSaveBlock2Ptr + ldr r0, [r5] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r4, [r0] + lsls r4, 30 + lsrs r4, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 24 + ldr r1, [r5] + lsls r4, 1 + lsrs r0, 22 + adds r4, r0 + ldr r3, =0x00000d0c + adds r1, r3 + adds r1, r4 + ldrh r0, [r1] + ldr r2, =0x000003e6 + cmp r0, r2 + bhi _0819036E + adds r0, 0x1 + strh r0, [r1] +_0819036E: + ldr r0, [r5] + ldr r1, =0x00000d1c + adds r0, r1 + adds r1, r0, r4 + ldrh r0, [r1] + cmp r0, r2 + bhi _08190380 + adds r0, 0x1 + strh r0, [r1] +_08190380: + ldr r0, [r5] + adds r1, r0, r3 + adds r1, r4 + ldr r2, =0x00000d14 + adds r0, r2 + adds r0, r4 + ldrh r1, [r1] + ldrh r2, [r0] + cmp r1, r2 + bls _08190396 + strh r1, [r0] +_08190396: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819033C + + thumb_func_start sub_81903B8 +sub_81903B8: @ 81903B8 + push {r4,r5,lr} + ldr r0, =sub_8190400 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gTasks + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + movs r5, 0 + strh r5, [r4, 0x8] + bl sub_81902AC + lsls r0, 16 + lsrs r0, 16 + bl sub_8195358 + strh r0, [r4, 0xA] + strh r5, [r4, 0xC] + strh r5, [r4, 0xE] + ldr r0, =sub_8194B54 + bl SetMainCallback2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81903B8 + + thumb_func_start sub_8190400 +sub_8190400: @ 8190400 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r1, =gTasks + lsls r0, 2 + add r0, r10 + lsls r0, 3 + adds r6, r0, r1 + movs r0, 0xA + ldrsh r5, [r6, r0] + movs r2, 0xC + ldrsh r1, [r6, r2] + mov r9, r1 + movs r0, 0xE + ldrsh r7, [r6, r0] + movs r1, 0x8 + ldrsh r4, [r6, r1] + cmp r4, 0x1 + beq _08190508 + cmp r4, 0x1 + bgt _08190440 + cmp r4, 0 + beq _0819044E + b _08190772 + .pool +_08190440: + cmp r4, 0x2 + bne _08190446 + b _08190570 +_08190446: + cmp r4, 0x3 + bne _0819044C + b _08190634 +_0819044C: + b _08190772 +_0819044E: + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + bl SetVBlankCallback + movs r0, 0x1 + bl EnableInterrupts + str r4, [sp, 0x4] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, =0x05006000 + add r0, sp, 0x4 + bl CpuSet + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_0860CE84 + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + ldr r0, =gUnknown_0860CEB4 + bl InitWindows + bl DeactivateAllTextPrinters + ldr r0, =gUnknown_02022E14 + strh r4, [r0] + ldr r0, =gUnknown_02022E16 + strh r4, [r0] + ldr r0, =gUnknown_02022E18 + strh r4, [r0] + ldr r0, =gUnknown_02022E1A + strh r4, [r0] + ldr r0, =gUnknown_02022E20 + strh r4, [r0] + ldr r0, =gUnknown_02022E22 + strh r4, [r0] + mov r2, r9 + cmp r2, 0x2 + bne _081904DC + ldr r0, =gUnknown_02022E1C + strh r4, [r0] + ldr r0, =gUnknown_02022E1E + strh r4, [r0] + b _081904E6 + .pool +_081904DC: + ldr r0, =gUnknown_02022E1C + strh r4, [r0] + ldr r1, =gUnknown_02022E1E + movs r0, 0xA0 + strh r0, [r1] +_081904E6: + 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] + b _08190772 + .pool +_08190508: + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + movs r0, 0x4C + movs r1, 0 + bl SetGpuReg + movs r0, 0x40 + movs r1, 0 + bl SetGpuReg + movs r0, 0x44 + movs r1, 0 + bl SetGpuReg + movs r0, 0x42 + movs r1, 0 + bl SetGpuReg + movs r0, 0x46 + movs r1, 0 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0 + bl SetGpuReg + movs r0, 0x4A + movs r1, 0x3F + bl SetGpuReg + bl ResetPaletteFade + bl ResetSpriteData + bl FreeAllSpritePalettes + ldr r1, =gReservedSpritePaletteCount + movs r0, 0x4 + strb r0, [r1] + b _08190602 + .pool +_08190570: + ldr r1, =gUnknown_08D83D50 + movs r5, 0x80 + lsls r5, 6 + movs r7, 0 + str r7, [sp] + movs r0, 0x2 + adds r2, r5, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, =gUnknown_08D84970 + movs r4, 0x1 + str r4, [sp] + movs r0, 0x2 + adds r2, r5, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, =gUnknown_08D84F00 + movs r2, 0x80 + lsls r2, 4 + str r4, [sp] + movs r0, 0x3 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r0, =gUnknown_0860CF50 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_08D85358 + movs r4, 0x80 + lsls r4, 2 + movs r1, 0 + adds r2, r4, 0 + bl LoadCompressedPalette + ldr r0, =gUnknown_08D85444 + movs r1, 0x80 + lsls r1, 1 + adds r2, r4, 0 + bl LoadCompressedPalette + ldr r0, =gUnknown_08D85600 + movs r1, 0xF0 + movs r2, 0x20 + bl LoadCompressedPalette + mov r0, r9 + cmp r0, 0x2 + bne _081905DE + ldr r0, =gUnknown_08D854C8 + movs r1, 0x50 + movs r2, 0x20 + bl LoadCompressedPalette +_081905DE: + str r7, [sp, 0x8] + add r0, sp, 0x8 + ldr r1, =gPlttBufferFaded + ldr r2, =0x05000100 + bl CpuSet + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg +_08190602: + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + b _08190772 + .pool +_08190634: + ldr r0, =sub_8194B70 + bl SetVBlankCallback + ldr r4, =gUnknown_0203CD78 + movs r0, 0x14 + bl AllocZeroed + str r0, [r4] + movs r6, 0 + lsls r5, 24 + movs r2, 0xFF +_0819064A: + ldr r1, [r4] + adds r1, r6 + ldrb r0, [r1] + orrs r0, r2 + strb r0, [r1] + adds r6, 0x1 + cmp r6, 0xF + ble _0819064A + bl sub_80D2F04 + ldr r0, =sub_8190CD4 + movs r1, 0 + bl CreateTask + 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, 0 + strh r1, [r0, 0x8] + strh r1, [r0, 0xC] + mov r1, r9 + strh r1, [r0, 0xE] + strh r7, [r0, 0x10] + mov r2, r9 + cmp r2, 0x2 + bne _081906A8 + lsrs r1, r5, 24 + movs r0, 0 + bl sub_819314C + ldr r0, =gUnknown_0203CD78 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x10] + b _081906B0 + .pool +_081906A8: + lsrs r1, r5, 24 + movs r0, 0 + bl sub_81924E0 +_081906B0: + movs r1, 0xFA + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + mov r0, r9 + cmp r0, 0 + beq _0819076C + ldr r5, =gUnknown_0860D068 + adds r0, r5, 0 + movs r1, 0x78 + movs r2, 0x4 + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r7, r0, 24 + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + ldr r1, =gSprites + mov r8, r1 + add r4, r8 + adds r0, r4, 0 + movs r1, 0 + bl StartSpriteAnim + strh r6, [r4, 0x2E] + adds r0, r5, 0 + movs r1, 0x78 + movs r2, 0x9C + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r7, r0, 24 + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + add r4, r8 + adds r0, r4, 0 + movs r1, 0x1 + bl StartSpriteAnim + strh r6, [r4, 0x2E] + ldr r5, =gUnknown_0860D050 + adds r0, r5, 0 + movs r1, 0x6 + movs r2, 0x50 + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + mov r2, r8 + adds r4, r0, r2 + adds r0, r4, 0 + movs r1, 0 + bl StartSpriteAnim + strh r6, [r4, 0x2E] + movs r0, 0 + strh r0, [r4, 0x30] + mov r1, r9 + cmp r1, 0x1 + bne _08190746 + adds r0, r4, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_08190746: + adds r0, r5, 0 + movs r1, 0xEA + movs r2, 0x50 + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r7, r0, 24 + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + add r4, r8 + adds r0, r4, 0 + movs r1, 0x1 + bl StartSpriteAnim + strh r6, [r4, 0x2E] + movs r0, 0x1 + strh r0, [r4, 0x30] +_0819076C: + mov r0, r10 + bl DestroyTask +_08190772: + 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_8190400 + + thumb_func_start sub_8190790 +sub_8190790: @ 8190790 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x22] + adds r1, r0, 0x4 + strh r1, [r2, 0x22] + movs r3, 0x2E + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _081907D4 + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + blt _081907BC + adds r3, r2, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r3] +_081907BC: + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x28 + bne _081907F0 + ldr r0, =SpriteCallbackDummy + str r0, [r2, 0x1C] + b _081907F0 + .pool +_081907D4: + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xBF + ble _081907F0 + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + movs r3, 0x32 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldrh r0, [r2, 0x34] + bl sub_818D8F0 +_081907F0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8190790 + + thumb_func_start sub_81907F8 +sub_81907F8: @ 81907F8 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x22] + subs r1, r0, 0x4 + strh r1, [r2, 0x22] + movs r3, 0x2E + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _08190838 + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xC0 + bgt _08190820 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r3] +_08190820: + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x28 + bne _08190858 + ldr r0, =SpriteCallbackDummy + str r0, [r2, 0x1C] + b _08190858 + .pool +_08190838: + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + bgt _08190858 + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + movs r3, 0x32 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldrh r0, [r2, 0x34] + bl sub_818D8F0 +_08190858: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81907F8 + + thumb_func_start sub_8190860 +sub_8190860: @ 8190860 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x20] + adds r1, r0, 0x4 + strh r1, [r2, 0x20] + movs r3, 0x2E + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _081908A4 + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + blt _0819088C + adds r3, r2, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r3] +_0819088C: + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x40 + bne _081908C0 + ldr r0, =SpriteCallbackDummy + str r0, [r2, 0x1C] + b _081908C0 + .pool +_081908A4: + lsls r1, 16 + ldr r0, =0x010f0000 + cmp r1, r0 + ble _081908C0 + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + movs r3, 0x32 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldrh r0, [r2, 0x34] + bl sub_818D8F0 +_081908C0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8190860 + + thumb_func_start sub_81908CC +sub_81908CC: @ 81908CC + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x20] + subs r1, r0, 0x4 + strh r1, [r2, 0x20] + movs r3, 0x2E + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _08190910 + lsls r1, 16 + movs r0, 0x88 + lsls r0, 17 + cmp r1, r0 + bgt _081908F6 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r3] +_081908F6: + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x40 + bne _08190930 + ldr r0, =SpriteCallbackDummy + str r0, [r2, 0x1C] + b _08190930 + .pool +_08190910: + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + bgt _08190930 + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + movs r3, 0x32 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldrh r0, [r2, 0x34] + bl sub_818D8F0 +_08190930: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81908CC + + thumb_func_start sub_8190938 +sub_8190938: @ 8190938 + push {lr} + adds r1, r0, 0 + movs r2, 0x34 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _0819094A + adds r0, r1, 0 + bl sub_80D30DC +_0819094A: + pop {r0} + bx r0 + thumb_func_end sub_8190938 + + thumb_func_start sub_8190950 +sub_8190950: @ 8190950 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08190962 + adds r0, r4, 0 + bl sub_80D30DC +_08190962: + ldrh r0, [r4, 0x22] + adds r1, r0, 0x4 + strh r1, [r4, 0x22] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _081909A4 + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + blt _0819098A + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_0819098A: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x28 + bne _081909C0 + ldr r0, =sub_8190938 + str r0, [r4, 0x1C] + b _081909C0 + .pool +_081909A4: + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xAF + ble _081909C0 + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + movs r2, 0x32 + ldrsh r1, [r4, r2] + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + adds r0, r4, 0 + bl sub_80D2EF8 +_081909C0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8190950 + + thumb_func_start sub_81909CC +sub_81909CC: @ 81909CC + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081909DE + adds r0, r4, 0 + bl sub_80D30DC +_081909DE: + ldrh r0, [r4, 0x22] + subs r1, r0, 0x4 + strh r1, [r4, 0x22] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08190A1C + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xB0 + bgt _08190A02 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_08190A02: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x28 + bne _08190A3C + ldr r0, =sub_8190938 + str r0, [r4, 0x1C] + b _08190A3C + .pool +_08190A1C: + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + bgt _08190A3C + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + movs r2, 0x32 + ldrsh r1, [r4, r2] + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + adds r0, r4, 0 + bl sub_80D2EF8 +_08190A3C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81909CC + + thumb_func_start sub_8190A48 +sub_8190A48: @ 8190A48 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08190A5A + adds r0, r4, 0 + bl sub_80D30DC +_08190A5A: + ldrh r0, [r4, 0x20] + adds r1, r0, 0x4 + strh r1, [r4, 0x20] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08190A9C + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + blt _08190A82 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_08190A82: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x40 + bne _08190AB8 + ldr r0, =sub_8190938 + str r0, [r4, 0x1C] + b _08190AB8 + .pool +_08190A9C: + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _08190AB8 + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + movs r2, 0x32 + ldrsh r1, [r4, r2] + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + adds r0, r4, 0 + bl sub_80D2EF8 +_08190AB8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8190A48 + + thumb_func_start sub_8190AC4 +sub_8190AC4: @ 8190AC4 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08190AD6 + adds r0, r4, 0 + bl sub_80D30DC +_08190AD6: + ldrh r0, [r4, 0x20] + subs r1, r0, 0x4 + strh r1, [r4, 0x20] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08190B14 + lsls r1, 16 + movs r0, 0x80 + lsls r0, 17 + cmp r1, r0 + bgt _08190AFC + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_08190AFC: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x40 + bne _08190B34 + ldr r0, =sub_8190938 + str r0, [r4, 0x1C] + b _08190B34 + .pool +_08190B14: + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + bgt _08190B34 + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + movs r2, 0x32 + ldrsh r1, [r4, r2] + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + adds r0, r4, 0 + bl sub_80D2EF8 +_08190B34: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8190AC4 + + thumb_func_start sub_8190B40 +sub_8190B40: @ 8190B40 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r3, r0, 0 + movs r0, 0x2E + ldrsh r6, [r3, r0] + ldr r2, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r2 + movs r7, 0x10 + ldrsh r1, [r4, r7] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0xA + ldrsh r0, [r0, r1] + ldr r1, =gUnknown_0860D080 + adds r0, r1 + ldrb r0, [r0] + mov r10, r0 + ldr r1, =gSaveBlock2Ptr + ldr r5, [r1] + ldr r7, =0x00000cb2 + adds r0, r5, r7 + ldrh r0, [r0] + mov r12, r0 + movs r7, 0xE + ldrsh r0, [r4, r7] + mov r9, r2 + mov r8, r1 + cmp r0, 0x1 + bne _08190C0C + movs r1, 0x30 + ldrsh r0, [r3, r1] + cmp r0, 0 + beq _08190BFC + mov r2, r10 + lsls r0, r2, 2 + adds r1, r5, r0 + ldr r7, =0x00000d25 + adds r1, r7 + ldrb r2, [r1] + lsls r1, r2, 29 + adds r4, r0, 0 + cmp r1, 0 + bge _08190BB6 + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r1, [r0, 0x10] + subs r1, 0x1 + lsls r0, r2, 27 + lsrs r0, 30 + cmp r1, r0 + blt _08190C32 +_08190BB6: + mov r1, r8 + ldr r0, [r1] + adds r0, r4 + ldr r2, =0x00000d25 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _08190BD4 + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + subs r0, 0x1 + cmp r0, r12 + blt _08190C32 +_08190BD4: + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + add r0, r9 + movs r7, 0x8 + ldrsh r0, [r0, r7] + b _08190C4C + .pool +_08190BFC: + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0 + bne _08190C32 + b _08190C48 + .pool +_08190C0C: + movs r2, 0x30 + ldrsh r0, [r3, r2] + cmp r0, 0 + beq _08190C28 + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0x1 + bls _08190C32 + movs r7, 0x8 + ldrsh r0, [r4, r7] + b _08190C4C + .pool +_08190C28: + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0 + beq _08190C48 +_08190C32: + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + b _08190C5C + .pool +_08190C48: + movs r1, 0x8 + ldrsh r0, [r4, r1] +_08190C4C: + cmp r0, 0x2 + bne _08190C5C + adds r0, r3, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_08190C5C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8190B40 + + thumb_func_start sub_8190C6C +sub_8190C6C: @ 8190C6C + push {lr} + adds r3, r0, 0 + movs r0, 0x2E + ldrsh r1, [r3, r0] + ldr r2, =gTasks + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r1, r0, r2 + movs r2, 0xE + ldrsh r0, [r1, r2] + cmp r0, 0x1 + bne _08190C9C + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0 + bne _08190CA6 + b _08190CC0 + .pool +_08190C9C: + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0x1 + beq _08190CC0 +_08190CA6: + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0x2 + bne _08190CCE + adds r0, r3, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + b _08190CCE + .pool +_08190CC0: + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_08190CCE: + pop {r0} + bx r0 + thumb_func_end sub_8190C6C + + thumb_func_start sub_8190CD4 +sub_8190CD4: @ 8190CD4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r1, =gTasks + lsls r0, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r3, 0xE + ldrsh r2, [r0, r3] + mov r9, r2 + movs r4, 0x10 + ldrsh r7, [r0, r4] + movs r5, 0x8 + ldrsh r0, [r0, r5] + cmp r0, 0x8 + bls _08190D06 + bl _08192202 +_08190D06: + lsls r0, 2 + ldr r1, =_08190D18 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08190D18: + .4byte _08190D3C + .4byte _08190D7C + .4byte _08190DA8 + .4byte _08190E48 + .4byte _08191FF8 + .4byte _08192038 + .4byte _08192078 + .4byte _081920BC + .4byte _08192106 +_08190D3C: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _08190D50 + bl _08192202 +_08190D50: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade + ldr r1, =gTasks + mov r6, r8 + lsls r0, r6, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0, 0x8] + bl _08192202 + .pool +_08190D7C: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08190D8C + bl _08192202 +_08190D8C: + mov r1, r8 + lsls r0, r1, 2 + add r0, r8 + lsls r0, 3 + ldr r2, =gTasks + adds r0, r2 + movs r1, 0x2 + strh r1, [r0, 0x8] + bl _08192202 + .pool +_08190DA8: + mov r0, r8 + bl sub_819221C + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x8 + bgt _08190DBE + cmp r6, 0x1 + bge _08190DF0 + bl _08192202 +_08190DBE: + cmp r6, 0x9 + beq _08190DC6 + bl _08192202 +_08190DC6: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + ldr r1, =gTasks + mov r3, r8 + lsls r0, r3, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0x8 + strh r1, [r0, 0x8] + bl _08192202 + .pool +_08190DF0: + ldr r1, =gTasks + mov r4, r8 + lsls r2, r4, 2 + adds r0, r2, r4 + lsls r0, 3 + adds r0, r1 + strh r6, [r0, 0x12] + movs r5, 0xC + ldrsh r0, [r0, r5] + movs r1, 0 + mov r9, r2 + cmp r0, 0 + beq _08190E0C + movs r1, 0x9 +_08190E0C: + adds r6, r1, 0 + adds r0, r6, 0 + adds r0, 0x9 + cmp r6, r0 + bge _08190E32 + adds r5, r0, 0 +_08190E18: + lsls r4, r6, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0x2 + bl CopyWindowToVram + adds r0, r4, 0 + movs r1, 0 + bl FillWindowPixelBuffer + adds r6, 0x1 + cmp r6, r5 + blt _08190E18 +_08190E32: + ldr r0, =gTasks + mov r1, r9 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0x3 + strh r0, [r1, 0x8] + bl _08192202 + .pool +_08190E48: + mov r6, r8 + lsls r1, r6, 2 + adds r0, r1, r6 + lsls r0, 3 + ldr r2, =gTasks + adds r0, r2 + movs r3, 0x12 + ldrsh r6, [r0, r3] + subs r0, r6, 0x1 + mov r9, r1 + cmp r0, 0x7 + bls _08190E64 + bl _08192202 +_08190E64: + lsls r0, 2 + ldr r1, =_08190E78 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08190E78: + .4byte _08190E98 + .4byte _08191234 + .4byte _081915CC + .4byte _08191B08 + .4byte _08190E98 + .4byte _08191234 + .4byte _0819187C + .4byte _08191D68 +_08190E98: + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r4, =gTasks + adds r0, r4 + movs r5, 0xC + ldrsh r2, [r0, r5] + cmp r2, 0 + beq _08190ED4 + ldr r0, =gUnknown_02022E14 + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E16 + strh r1, [r0] + ldr r0, =gUnknown_02022E18 + strh r1, [r0] + ldr r1, =gUnknown_02022E1A + movs r0, 0xA0 + strh r0, [r1] + b _08190EE6 + .pool +_08190ED4: + ldr r0, =gUnknown_02022E14 + strh r2, [r0] + ldr r1, =gUnknown_02022E16 + movs r0, 0xA0 + strh r0, [r1] + ldr r0, =gUnknown_02022E18 + strh r2, [r0] + ldr r0, =gUnknown_02022E1A + strh r2, [r0] +_08190EE6: + cmp r6, 0x1 + bne _08190F9C + ldr r5, =gUnknown_0203CD78 + ldr r0, [r5] + ldrb r1, [r0, 0x10] + cmp r1, 0 + bne _08190F50 + ldr r0, =gUnknown_02022E1C + strh r1, [r0] + ldr r1, =gUnknown_02022E1E + movs r6, 0xA0 + lsls r6, 1 + adds r0, r6, 0 + strh r0, [r1] + ldr r3, =gUnknown_0860D080 + ldr r2, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r2 + movs r4, 0xA + ldrsh r1, [r0, r4] + adds r1, r3 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r2 + ldrb r2, [r0, 0xC] + movs r0, 0x10 + orrs r0, r2 + ldrb r1, [r1] + bl sub_81924E0 + b _08191084 + .pool +_08190F50: + ldr r1, =gUnknown_02022E1C + movs r6, 0x80 + lsls r6, 1 + adds r0, r6, 0 + strh r0, [r1] + ldr r0, =gUnknown_02022E1E + movs r4, 0 + strh r4, [r0] + ldr r3, =gUnknown_0860D080 + ldr r2, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r2 + movs r6, 0xA + ldrsh r1, [r0, r6] + adds r1, r3 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r2 + ldrb r2, [r0, 0xC] + movs r0, 0x10 + orrs r0, r2 + ldrb r1, [r1] + bl sub_81924E0 + ldr r0, [r5] + strb r4, [r0, 0x10] + b _08191084 + .pool +_08190F9C: + ldr r6, =gUnknown_0203CD78 + ldr r1, [r6] + ldrb r5, [r1, 0x10] + cmp r5, 0 + bne _08190FF8 + ldr r4, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r4 + movs r2, 0xA + ldrsh r0, [r0, r2] + adds r2, r0, 0 + subs r2, 0x10 + lsls r0, r2, 24 + lsrs r0, 24 + adds r1, 0x11 + bl sub_8192F08 + ldr r0, =gUnknown_02022E1C + strh r5, [r0] + ldr r1, =gUnknown_02022E1E + movs r3, 0xA0 + lsls r3, 1 + adds r0, r3, 0 + strh r0, [r1] + ldr r2, [r6] + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r4 + ldrb r1, [r0, 0xC] + movs r0, 0x10 + orrs r0, r1 + ldrb r1, [r2, 0x11] + bl sub_81924E0 + b _08191084 + .pool +_08190FF8: + cmp r5, 0x2 + bne _0819104C + ldr r4, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r4 + movs r5, 0xA + ldrsh r0, [r0, r5] + adds r2, r0, 0 + subs r2, 0x10 + lsls r0, r2, 24 + lsrs r0, 24 + adds r1, 0x11 + bl sub_8192F08 + ldr r1, =gUnknown_02022E1C + movs r0, 0 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + movs r2, 0xA0 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r1] + ldr r2, [r6] + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r4 + ldrb r1, [r0, 0xC] + movs r0, 0x10 + orrs r0, r1 + ldrb r1, [r2, 0x12] + bl sub_81924E0 + b _08191084 + .pool +_0819104C: + ldr r1, =gUnknown_02022E1C + movs r3, 0x80 + lsls r3, 1 + adds r0, r3, 0 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + movs r0, 0xA0 + strh r0, [r1] + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + movs r4, 0xA + ldrsh r0, [r0, r4] + adds r2, r0, 0 + subs r2, 0x10 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0xC] + movs r0, 0x10 + orrs r0, r1 + lsls r1, r2, 24 + lsrs r1, 24 + bl sub_819314C +_08191084: + movs r6, 0 + ldr r5, =gUnknown_0203CD78 + mov r10, r5 + ldr r3, =gSprites + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r1, =gTasks + adds r5, r0, r1 + mov r12, r6 + adds r4, r3, 0 + adds r4, 0x1C + movs r7, 0x1 +_0819109E: + cmp r6, 0x1 + bgt _0819110C + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191150 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_8190790 + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _08191150 + .pool +_0819110C: + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191150 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_8190950 + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_08191150: + adds r6, 0x1 + cmp r6, 0x7 + ble _0819109E + movs r6, 0x8 + ldr r2, =gUnknown_0203CD78 + mov r12, r2 + ldr r3, =gSprites + ldr r1, =gTasks + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r5, r0, r1 + movs r4, 0 + adds r7, r3, 0 + adds r7, 0x1C +_0819116E: + cmp r6, 0x9 + bgt _081911D4 + mov r1, r12 + ldr r0, [r1] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191214 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_8190790 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _08191214 + .pool +_081911D4: + mov r2, r12 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191214 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_8190950 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_08191214: + adds r6, 0x1 + cmp r6, 0xF + ble _0819116E + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r3, =gTasks + adds r0, r3 + movs r2, 0 + movs r1, 0x4 + bl _08191FE8 + .pool +_08191234: + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r4, =gTasks + adds r0, r4 + movs r5, 0xC + ldrsh r2, [r0, r5] + cmp r2, 0 + beq _08191278 + ldr r0, =gUnknown_02022E14 + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E16 + strh r1, [r0] + ldr r0, =gUnknown_02022E18 + strh r1, [r0] + ldr r1, =gUnknown_02022E1A + ldr r2, =0x0000ff60 + adds r0, r2, 0 + strh r0, [r1] + b _0819128C + .pool +_08191278: + ldr r0, =gUnknown_02022E14 + strh r2, [r0] + ldr r1, =gUnknown_02022E16 + ldr r3, =0x0000ff60 + adds r0, r3, 0 + strh r0, [r1] + ldr r0, =gUnknown_02022E18 + strh r2, [r0] + ldr r0, =gUnknown_02022E1A + strh r2, [r0] +_0819128C: + cmp r6, 0x2 + bne _0819133C + ldr r5, =gUnknown_0203CD78 + ldr r0, [r5] + ldrb r1, [r0, 0x10] + cmp r1, 0 + bne _081912F4 + ldr r0, =gUnknown_02022E1C + strh r1, [r0] + ldr r1, =gUnknown_02022E1E + movs r0, 0xA0 + strh r0, [r1] + ldr r3, =gUnknown_0860D080 + ldr r2, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r2 + movs r4, 0xA + ldrsh r1, [r0, r4] + adds r1, r3 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r2 + ldrb r2, [r0, 0xC] + movs r0, 0x4 + orrs r0, r2 + ldrb r1, [r1] + bl sub_81924E0 + b _0819141C + .pool +_081912F4: + ldr r0, =gUnknown_02022E1C + movs r4, 0 + strh r4, [r0] + ldr r0, =gUnknown_02022E1E + strh r4, [r0] + ldr r3, =gUnknown_0860D080 + ldr r2, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r2 + movs r6, 0xA + ldrsh r1, [r0, r6] + adds r1, r3 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r2 + ldrb r2, [r0, 0xC] + movs r0, 0x4 + orrs r0, r2 + ldrb r1, [r1] + bl sub_81924E0 + ldr r0, [r5] + strb r4, [r0, 0x10] + b _0819141C + .pool +_0819133C: + ldr r6, =gUnknown_0203CD78 + ldr r1, [r6] + ldrb r5, [r1, 0x10] + cmp r5, 0 + bne _08191394 + ldr r4, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r4 + movs r2, 0xA + ldrsh r0, [r0, r2] + adds r2, r0, 0 + subs r2, 0x10 + lsls r0, r2, 24 + lsrs r0, 24 + adds r1, 0x11 + bl sub_8192F08 + ldr r0, =gUnknown_02022E1C + strh r5, [r0] + ldr r1, =gUnknown_02022E1E + movs r0, 0xA0 + strh r0, [r1] + ldr r2, [r6] + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r4 + ldrb r1, [r0, 0xC] + movs r0, 0x4 + orrs r0, r1 + ldrb r1, [r2, 0x11] + bl sub_81924E0 + b _0819141C + .pool +_08191394: + cmp r5, 0x2 + bne _081913E4 + ldr r4, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r4 + movs r3, 0xA + ldrsh r0, [r0, r3] + adds r2, r0, 0 + subs r2, 0x10 + lsls r0, r2, 24 + lsrs r0, 24 + adds r1, 0x11 + bl sub_8192F08 + ldr r1, =gUnknown_02022E1C + movs r0, 0 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + movs r0, 0xA0 + strh r0, [r1] + ldr r2, [r6] + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r4 + ldrb r1, [r0, 0xC] + movs r0, 0x4 + orrs r0, r1 + ldrb r1, [r2, 0x12] + bl sub_81924E0 + b _0819141C + .pool +_081913E4: + ldr r1, =gUnknown_02022E1C + movs r4, 0x80 + lsls r4, 1 + adds r0, r4, 0 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + movs r0, 0 + strh r0, [r1] + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + movs r5, 0xA + ldrsh r0, [r0, r5] + adds r2, r0, 0 + subs r2, 0x10 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0xC] + movs r0, 0x4 + orrs r0, r1 + lsls r1, r2, 24 + lsrs r1, 24 + bl sub_819314C +_0819141C: + movs r6, 0 + ldr r0, =gUnknown_0203CD78 + mov r10, r0 + ldr r3, =gSprites + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r1, =gTasks + adds r5, r0, r1 + mov r12, r6 + adds r4, r3, 0 + adds r4, 0x1C + movs r7, 0x1 +_08191436: + cmp r6, 0x1 + bgt _081914A4 + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _081914E8 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_81907F8 + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _081914E8 + .pool +_081914A4: + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _081914E8 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_81909CC + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_081914E8: + adds r6, 0x1 + cmp r6, 0x7 + ble _08191436 + movs r6, 0x8 + ldr r2, =gUnknown_0203CD78 + mov r12, r2 + ldr r3, =gSprites + ldr r1, =gTasks + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r5, r0, r1 + movs r4, 0 + adds r7, r3, 0 + adds r7, 0x1C +_08191506: + cmp r6, 0x9 + bgt _0819156C + mov r1, r12 + ldr r0, [r1] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _081915AC + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_81907F8 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _081915AC + .pool +_0819156C: + mov r2, r12 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _081915AC + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_81909CC + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_081915AC: + adds r6, 0x1 + cmp r6, 0xF + ble _08191506 + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r3, =gTasks + adds r0, r3 + movs r2, 0 + movs r1, 0x5 + bl _08191FE8 + .pool +_081915CC: + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r4, =gTasks + adds r0, r4 + movs r5, 0xC + ldrsh r2, [r0, r5] + cmp r2, 0 + beq _0819160C + ldr r0, =gUnknown_02022E14 + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E16 + strh r1, [r0] + ldr r2, =gUnknown_02022E18 + movs r6, 0x80 + lsls r6, 1 + adds r0, r6, 0 + strh r0, [r2] + ldr r0, =gUnknown_02022E1A + strh r1, [r0] + b _08191622 + .pool +_0819160C: + ldr r1, =gUnknown_02022E14 + movs r3, 0x80 + lsls r3, 1 + adds r0, r3, 0 + strh r0, [r1] + ldr r0, =gUnknown_02022E16 + strh r2, [r0] + ldr r0, =gUnknown_02022E18 + strh r2, [r0] + ldr r0, =gUnknown_02022E1A + strh r2, [r0] +_08191622: + ldr r0, =gUnknown_0203CD78 + ldr r4, [r0] + ldrb r0, [r4, 0x10] + cmp r0, 0 + bne _08191688 + ldr r1, =gUnknown_02022E1C + movs r4, 0x80 + lsls r4, 1 + adds r0, r4, 0 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + movs r0, 0xA0 + strh r0, [r1] + ldr r3, =gUnknown_0860D080 + ldr r2, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r2 + movs r5, 0xA + ldrsh r1, [r0, r5] + adds r1, r3 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r2 + ldrb r2, [r0, 0xC] + movs r0, 0x8 + orrs r0, r2 + ldrb r1, [r1] + bl sub_81924E0 + b _081916C6 + .pool +_08191688: + ldr r1, =gUnknown_02022E1C + movs r6, 0x80 + lsls r6, 1 + adds r0, r6, 0 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + movs r0, 0 + strh r0, [r1] + ldr r3, =gUnknown_0860D15C + ldr r2, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r2 + movs r5, 0xA + ldrsh r1, [r0, r5] + lsls r1, 2 + subs r1, 0x1 + ldrb r4, [r4, 0x10] + adds r1, r4 + adds r1, r3 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r2 + ldrb r2, [r0, 0xC] + movs r0, 0x8 + orrs r0, r2 + ldrb r1, [r1] + bl sub_819314C +_081916C6: + movs r6, 0 + ldr r0, =gUnknown_0203CD78 + mov r10, r0 + ldr r3, =gSprites + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r1, =gTasks + adds r5, r0, r1 + mov r12, r6 + adds r4, r3, 0 + adds r4, 0x1C + movs r7, 0x1 +_081916E0: + cmp r6, 0x1 + bgt _08191754 + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191798 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_8190860 + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _08191798 + .pool +_08191754: + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191798 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_8190A48 + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_08191798: + adds r6, 0x1 + cmp r6, 0x7 + ble _081916E0 + movs r6, 0x8 + ldr r2, =gUnknown_0203CD78 + mov r12, r2 + ldr r3, =gSprites + ldr r1, =gTasks + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r5, r0, r1 + movs r4, 0 + adds r7, r3, 0 + adds r7, 0x1C +_081917B6: + cmp r6, 0x9 + bgt _0819181C + mov r1, r12 + ldr r0, [r1] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _0819185C + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_8190860 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _0819185C + .pool +_0819181C: + mov r2, r12 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _0819185C + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_8190A48 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_0819185C: + adds r6, 0x1 + cmp r6, 0xF + ble _081917B6 + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r3, =gTasks + adds r0, r3 + movs r2, 0 + movs r1, 0x6 + b _08191FE8 + .pool +_0819187C: + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r4, =gTasks + adds r0, r4 + movs r5, 0xC + ldrsh r2, [r0, r5] + cmp r2, 0 + beq _081918BC + ldr r0, =gUnknown_02022E14 + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E16 + strh r1, [r0] + ldr r2, =gUnknown_02022E18 + movs r6, 0x80 + lsls r6, 1 + adds r0, r6, 0 + strh r0, [r2] + ldr r0, =gUnknown_02022E1A + strh r1, [r0] + b _081918D2 + .pool +_081918BC: + ldr r1, =gUnknown_02022E14 + movs r3, 0x80 + lsls r3, 1 + adds r0, r3, 0 + strh r0, [r1] + ldr r0, =gUnknown_02022E16 + strh r2, [r0] + ldr r0, =gUnknown_02022E18 + strh r2, [r0] + ldr r0, =gUnknown_02022E1A + strh r2, [r0] +_081918D2: + ldr r0, =gUnknown_0203CD78 + ldr r2, [r0] + ldrb r0, [r2, 0x10] + cmp r0, 0 + bne _08191924 + ldr r1, =gUnknown_02022E1C + movs r4, 0x80 + lsls r4, 1 + adds r0, r4, 0 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + movs r0, 0xA0 + strh r0, [r1] + ldr r1, =gTasks + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0xC] + movs r0, 0x8 + orrs r0, r1 + ldrb r1, [r2, 0x11] + bl sub_81924E0 + b _08191958 + .pool +_08191924: + ldr r1, =gUnknown_02022E1C + movs r0, 0 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + movs r0, 0xA0 + strh r0, [r1] + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + movs r5, 0xA + ldrsh r0, [r0, r5] + adds r2, r0, 0 + subs r2, 0x10 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0xC] + movs r0, 0x8 + orrs r0, r1 + lsls r1, r2, 24 + lsrs r1, 24 + bl sub_819314C +_08191958: + movs r6, 0 + ldr r0, =gUnknown_0203CD78 + mov r10, r0 + ldr r3, =gSprites + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r1, =gTasks + adds r5, r0, r1 + mov r12, r6 + adds r4, r3, 0 + adds r4, 0x1C + movs r7, 0x1 +_08191972: + cmp r6, 0x1 + bgt _081919E0 + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191A24 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_8190860 + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _08191A24 + .pool +_081919E0: + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191A24 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_8190A48 + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_08191A24: + adds r6, 0x1 + cmp r6, 0x7 + ble _08191972 + movs r6, 0x8 + ldr r2, =gUnknown_0203CD78 + mov r12, r2 + ldr r3, =gSprites + ldr r1, =gTasks + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r5, r0, r1 + movs r4, 0 + adds r7, r3, 0 + adds r7, 0x1C +_08191A42: + cmp r6, 0x9 + bgt _08191AA8 + mov r1, r12 + ldr r0, [r1] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191AE8 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_8190860 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _08191AE8 + .pool +_08191AA8: + mov r2, r12 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191AE8 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_8190A48 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_08191AE8: + adds r6, 0x1 + cmp r6, 0xF + ble _08191A42 + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r3, =gTasks + adds r0, r3 + movs r2, 0 + movs r1, 0x6 + b _08191FE8 + .pool +_08191B08: + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r4, =gTasks + adds r0, r4 + movs r5, 0xC + ldrsh r2, [r0, r5] + cmp r2, 0 + beq _08191B48 + ldr r0, =gUnknown_02022E14 + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E16 + strh r1, [r0] + ldr r2, =gUnknown_02022E18 + movs r6, 0xFF + lsls r6, 8 + adds r0, r6, 0 + strh r0, [r2] + ldr r0, =gUnknown_02022E1A + strh r1, [r0] + b _08191B5E + .pool +_08191B48: + ldr r1, =gUnknown_02022E14 + movs r3, 0xFF + lsls r3, 8 + adds r0, r3, 0 + strh r0, [r1] + ldr r0, =gUnknown_02022E16 + strh r2, [r0] + ldr r0, =gUnknown_02022E18 + strh r2, [r0] + ldr r0, =gUnknown_02022E1A + strh r2, [r0] +_08191B5E: + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0x1 + bne _08191B94 + ldr r1, =gUnknown_02022E1C + movs r0, 0 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + movs r0, 0xA0 + strh r0, [r1] + b _08191B9E + .pool +_08191B94: + ldr r0, =gUnknown_02022E1C + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E1E + strh r1, [r0] +_08191B9E: + ldr r4, =gUnknown_0860D15C + ldr r5, =gUnknown_0203CD78 + ldr r3, [r5] + ldr r2, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r2 + movs r6, 0xA + ldrsh r1, [r0, r6] + lsls r1, 2 + subs r1, 0x1 + ldrb r3, [r3, 0x10] + adds r1, r3 + adds r1, r4 + mov r4, r9 + add r4, r8 + lsls r4, 3 + adds r4, r2 + ldrb r2, [r4, 0xC] + movs r0, 0x2 + orrs r0, r2 + ldrb r1, [r1] + bl sub_819314C + movs r6, 0 + ldr r7, =gSprites + mov r12, r6 + mov r10, r5 + adds r5, r7, 0 + adds r5, 0x1C +_08191BDC: + cmp r6, 0x1 + bgt _08191C50 + mov r1, r10 + ldr r0, [r1] + adds r3, r0, r6 + ldrb r0, [r3] + cmp r0, 0xFF + beq _08191C96 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =sub_81908CC + str r1, [r0] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r4, 0xC] + movs r2, 0x1 + eors r1, r2 + strh r1, [r0, 0x2E] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + mov r2, r12 + strh r2, [r0, 0x30] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r6, [r0, 0x32] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r1, [r0, 0x34] + b _08191C96 + .pool +_08191C50: + mov r3, r10 + ldr r0, [r3] + adds r3, r0, r6 + ldrb r0, [r3] + cmp r0, 0xFF + beq _08191C96 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =sub_8190AC4 + str r1, [r0] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r4, 0xC] + movs r2, 0x1 + eors r1, r2 + strh r1, [r0, 0x2E] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r6, [r0, 0x32] +_08191C96: + adds r6, 0x1 + cmp r6, 0x7 + ble _08191BDC + movs r6, 0x8 + ldr r2, =gUnknown_0203CD78 + mov r12, r2 + ldr r3, =gSprites + ldr r1, =gTasks + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r5, r0, r1 + movs r4, 0 + adds r7, r3, 0 + adds r7, 0x1C +_08191CB4: + cmp r6, 0x9 + bgt _08191D1C + mov r1, r12 + ldr r0, [r1] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191D5C + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_81908CC + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _08191D5C + .pool +_08191D1C: + mov r2, r12 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191D5C + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_8190AC4 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_08191D5C: + adds r6, 0x1 + cmp r6, 0xF + ble _08191CB4 + b _08191FDA + .pool +_08191D68: + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r4, =gTasks + adds r0, r4 + movs r5, 0xC + ldrsh r2, [r0, r5] + cmp r2, 0 + beq _08191DA8 + ldr r0, =gUnknown_02022E14 + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E16 + strh r1, [r0] + ldr r2, =gUnknown_02022E18 + movs r6, 0xFF + lsls r6, 8 + adds r0, r6, 0 + strh r0, [r2] + ldr r0, =gUnknown_02022E1A + strh r1, [r0] + b _08191DBE + .pool +_08191DA8: + ldr r1, =gUnknown_02022E14 + movs r3, 0xFF + lsls r3, 8 + adds r0, r3, 0 + strh r0, [r1] + ldr r0, =gUnknown_02022E16 + strh r2, [r0] + ldr r0, =gUnknown_02022E18 + strh r2, [r0] + ldr r0, =gUnknown_02022E1A + strh r2, [r0] +_08191DBE: + ldr r0, =gUnknown_0203CD78 + ldr r2, [r0] + ldrb r0, [r2, 0x10] + cmp r0, 0x2 + bne _08191E10 + ldr r1, =gUnknown_02022E1C + movs r4, 0x80 + lsls r4, 1 + adds r0, r4, 0 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + movs r0, 0xA0 + strh r0, [r1] + ldr r1, =gTasks + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0xC] + movs r0, 0x2 + orrs r0, r1 + ldrb r1, [r2, 0x12] + bl sub_81924E0 + b _08191E44 + .pool +_08191E10: + ldr r1, =gUnknown_02022E1C + movs r0, 0 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + movs r0, 0xA0 + strh r0, [r1] + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + movs r5, 0xA + ldrsh r0, [r0, r5] + adds r2, r0, 0 + subs r2, 0x10 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0xC] + movs r0, 0x2 + orrs r0, r1 + lsls r1, r2, 24 + lsrs r1, 24 + bl sub_819314C +_08191E44: + movs r6, 0 + ldr r0, =gUnknown_0203CD78 + mov r10, r0 + ldr r3, =gSprites + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r1, =gTasks + adds r5, r0, r1 + mov r12, r6 + adds r4, r3, 0 + adds r4, 0x1C + movs r7, 0x1 +_08191E5E: + cmp r6, 0x1 + bgt _08191ECC + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191F10 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_81908CC + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _08191F10 + .pool +_08191ECC: + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191F10 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_8190AC4 + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_08191F10: + adds r6, 0x1 + cmp r6, 0x7 + ble _08191E5E + movs r6, 0x8 + ldr r2, =gUnknown_0203CD78 + mov r12, r2 + ldr r3, =gSprites + ldr r1, =gTasks + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r5, r0, r1 + movs r4, 0 + adds r7, r3, 0 + adds r7, 0x1C +_08191F2E: + cmp r6, 0x9 + bgt _08191F94 + mov r1, r12 + ldr r0, [r1] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191FD4 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_81908CC + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _08191FD4 + .pool +_08191F94: + mov r2, r12 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191FD4 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_8190AC4 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_08191FD4: + adds r6, 0x1 + cmp r6, 0xF + ble _08191F2E +_08191FDA: + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r3, =gTasks + adds r0, r3 + movs r2, 0 + movs r1, 0x7 +_08191FE8: + strh r1, [r0, 0x8] + strh r2, [r0, 0x12] + b _08192202 + .pool +_08191FF8: + mov r4, r8 + lsls r0, r4, 2 + add r0, r8 + lsls r0, 3 + ldr r5, =gTasks + adds r1, r0, r5 + ldrh r0, [r1, 0x12] + adds r0, 0x1 + strh r0, [r1, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x29 + beq _08192100 + ldr r1, =gUnknown_02022E16 + ldrh r0, [r1] + subs r0, 0x4 + strh r0, [r1] + ldr r1, =gUnknown_02022E1A + ldrh r0, [r1] + subs r0, 0x4 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + b _081920A4 + .pool +_08192038: + mov r6, r8 + lsls r0, r6, 2 + add r0, r8 + lsls r0, 3 + ldr r2, =gTasks + adds r1, r0, r2 + ldrh r0, [r1, 0x12] + adds r0, 0x1 + strh r0, [r1, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x29 + beq _08192100 + ldr r1, =gUnknown_02022E16 + ldrh r0, [r1] + adds r0, 0x4 + strh r0, [r1] + ldr r1, =gUnknown_02022E1A + ldrh r0, [r1] + adds r0, 0x4 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + b _081920E8 + .pool +_08192078: + mov r3, r8 + lsls r0, r3, 2 + add r0, r8 + lsls r0, 3 + ldr r4, =gTasks + adds r1, r0, r4 + ldrh r0, [r1, 0x12] + adds r0, 0x1 + strh r0, [r1, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x41 + beq _08192100 + ldr r1, =gUnknown_02022E14 + ldrh r0, [r1] + subs r0, 0x4 + strh r0, [r1] + ldr r1, =gUnknown_02022E18 + ldrh r0, [r1] + subs r0, 0x4 + strh r0, [r1] + ldr r1, =gUnknown_02022E1C +_081920A4: + ldrh r0, [r1] + subs r0, 0x4 + strh r0, [r1] + b _08192202 + .pool +_081920BC: + mov r5, r8 + lsls r0, r5, 2 + add r0, r8 + lsls r0, 3 + ldr r6, =gTasks + adds r1, r0, r6 + ldrh r0, [r1, 0x12] + adds r0, 0x1 + strh r0, [r1, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x41 + beq _08192100 + ldr r1, =gUnknown_02022E14 + ldrh r0, [r1] + adds r0, 0x4 + strh r0, [r1] + ldr r1, =gUnknown_02022E18 + ldrh r0, [r1] + adds r0, 0x4 + strh r0, [r1] + ldr r1, =gUnknown_02022E1C +_081920E8: + ldrh r0, [r1] + adds r0, 0x4 + strh r0, [r1] + b _08192202 + .pool +_08192100: + movs r0, 0x2 + strh r0, [r1, 0x8] + b _08192202 +_08192106: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08192202 + movs r6, 0 + ldr r4, =gUnknown_0203CD78 +_08192116: + cmp r6, 0x1 + bgt _08192134 + ldr r0, [r4] + adds r1, r0, r6 + ldrb r0, [r1] + cmp r0, 0xFF + beq _0819214E + bl sub_818D8F0 + b _0819214E + .pool +_08192134: + ldr r0, [r4] + adds r1, r0, r6 + ldrb r0, [r1] + cmp r0, 0xFF + beq _0819214E + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + bl sub_80D2EF8 +_0819214E: + adds r6, 0x1 + cmp r6, 0x7 + ble _08192116 + movs r6, 0x8 + ldr r4, =gUnknown_0203CD78 +_08192158: + cmp r6, 0x9 + bgt _08192174 + ldr r0, [r4] + adds r1, r0, r6 + ldrb r0, [r1] + cmp r0, 0xFF + beq _0819218E + bl sub_818D8F0 + b _0819218E + .pool +_08192174: + ldr r0, [r4] + adds r1, r0, r6 + ldrb r0, [r1] + cmp r0, 0xFF + beq _0819218E + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + bl sub_80D2EF8 +_0819218E: + adds r6, 0x1 + cmp r6, 0xF + ble _08192158 + bl sub_80D2F9C + ldr r4, =gUnknown_0203CD78 + ldr r0, [r4] + bl Free + movs r5, 0 + str r5, [r4] + bl FreeAllWindowBuffers + mov r0, r9 + cmp r0, 0 + bne _081921C4 + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl SetMainCallback2 + b _081921FC + .pool +_081921C4: + ldr r0, =sub_8194220 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r6, r0, 24 + ldr r2, =gTasks + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r2 + strh r5, [r1, 0x8] + strh r5, [r1, 0xA] + movs r0, 0x3 + strh r0, [r1, 0xC] + mov r3, r8 + lsls r0, r3, 2 + add r0, r8 + lsls r0, 3 + adds r0, r2 + ldrh r0, [r0, 0x10] + strh r0, [r1, 0xE] + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r2 + ldrh r0, [r0, 0x14] + strh r0, [r1, 0x10] +_081921FC: + mov r0, r8 + bl DestroyTask +_08192202: + 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_8190CD4 + + thumb_func_start sub_819221C +sub_819221C: @ 819221C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r7, 0 + ldr r2, =gTasks + lsls r0, 2 + add r0, r9 + lsls r0, 3 + adds r0, r2 + mov r12, r0 + movs r1, 0x10 + ldrsh r6, [r0, r1] + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r2 + movs r3, 0xA + ldrsh r5, [r0, r3] + ldr r0, =gUnknown_0860D080 + adds r0, r5, r0 + ldrb r0, [r0] + mov r10, r0 + ldr r3, =gSaveBlock2Ptr + ldr r0, [r3] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r0, [r0] + mov r8, r0 + ldr r1, =gMain + ldrh r4, [r1, 0x2E] + movs r0, 0x3 + ands r0, r4 + adds r2, r1, 0 + cmp r0, 0 + beq _0819226E + movs r7, 0x9 +_0819226E: + mov r3, r12 + movs r1, 0xE + ldrsh r0, [r3, r1] + cmp r0, 0 + bne _0819227A + b _081924CC +_0819227A: + cmp r0, 0x1 + beq _08192280 + b _081923B0 +_08192280: + movs r0, 0x40 + ands r0, r4 + cmp r0, 0 + beq _081922BA + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0 + bne _081922BA + cmp r5, 0 + bne _081922B4 + movs r5, 0xF + b _081922B6 + .pool +_081922B4: + subs r5, 0x1 +_081922B6: + movs r7, 0x1 + b _08192360 +_081922BA: + ldrh r1, [r2, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081922E2 + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0 + bne _081922E2 + cmp r5, 0xF + bne _081922DC + movs r5, 0 + b _081922DE + .pool +_081922DC: + adds r5, 0x1 +_081922DE: + movs r7, 0x2 + b _08192360 +_081922E2: + ldrh r1, [r2, 0x2E] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08192304 + ldr r0, =gUnknown_0203CD78 + ldr r1, [r0] + ldrb r0, [r1, 0x10] + cmp r0, 0 + beq _08192304 + subs r0, 0x1 + strb r0, [r1, 0x10] + movs r7, 0x3 + b _08192360 + .pool +_08192304: + ldrh r1, [r2, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08192360 + ldr r2, =gSaveBlock2Ptr + ldr r0, [r2] + mov r3, r10 + lsls r1, r3, 2 + adds r0, r1 + ldr r2, =0x00000d25 + adds r0, r2 + ldrb r3, [r0] + lsls r0, r3, 29 + mov r12, r1 + cmp r0, 0 + bge _0819233C + ldr r0, =gUnknown_0203CD78 + ldr r2, [r0] + ldrb r4, [r2, 0x10] + subs r1, r4, 0x1 + lsls r0, r3, 27 + lsrs r0, 30 + cmp r1, r0 + bge _0819233C + adds r0, r4, 0x1 + strb r0, [r2, 0x10] + movs r7, 0x4 +_0819233C: + ldr r3, =gSaveBlock2Ptr + ldr r0, [r3] + add r0, r12 + ldr r1, =0x00000d25 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _08192360 + ldr r0, =gUnknown_0203CD78 + ldr r3, [r0] + ldrb r1, [r3, 0x10] + subs r0, r1, 0x1 + cmp r0, r8 + bge _08192360 + adds r0, r1, 0x1 + strb r0, [r3, 0x10] + movs r7, 0x4 +_08192360: + cmp r7, 0x9 + beq _08192366 + b _081924A0 +_08192366: + ldr r0, =gUnknown_0203CD78 + ldr r3, [r0] + ldrb r0, [r3, 0x10] + cmp r0, 0 + beq _081923A0 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + ldr r2, =gTasks + adds r1, r2 + ldr r2, =gUnknown_0860D1A0 + lsrs r0, r5, 31 + adds r0, r5, r0 + asrs r0, 1 + lsls r0, 2 + subs r0, 0x1 + ldrb r3, [r3, 0x10] + adds r0, r3 + b _08192482 + .pool +_081923A0: + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r3, =gTasks + adds r0, r3 + b _0819249E + .pool +_081923B0: + movs r0, 0x40 + ands r0, r4 + cmp r0, 0 + beq _081923DE + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0x1 + bne _081923DE + cmp r5, 0x10 + bne _081923D8 + ldr r0, =gUnknown_0860D19C + add r0, r8 + ldrb r5, [r0] + b _081923DA + .pool +_081923D8: + subs r5, 0x1 +_081923DA: + movs r7, 0x5 + b _08192446 +_081923DE: + ldrh r1, [r2, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0819240E + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0x1 + bne _0819240E + ldr r0, =gUnknown_0860D19C + add r0, r8 + ldrb r0, [r0] + cmp r5, r0 + bne _08192408 + movs r5, 0x10 + b _0819240A + .pool +_08192408: + adds r5, 0x1 +_0819240A: + movs r7, 0x6 + b _08192446 +_0819240E: + ldrh r1, [r2, 0x2E] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0819242C + ldr r0, =gUnknown_0203CD78 + ldr r1, [r0] + ldrb r0, [r1, 0x10] + cmp r0, 0 + beq _0819242C + movs r7, 0x7 + subs r0, 0x1 + b _08192444 + .pool +_0819242C: + ldrh r1, [r2, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08192446 + ldr r0, =gUnknown_0203CD78 + ldr r1, [r0] + ldrb r0, [r1, 0x10] + cmp r0, 0x1 + bhi _08192446 + movs r7, 0x8 + adds r0, 0x1 +_08192444: + strb r0, [r1, 0x10] +_08192446: + cmp r7, 0x9 + bne _081924A0 + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r1, [r0, 0x10] + cmp r1, 0 + bne _08192470 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + ldr r2, =gTasks + adds r1, r2 + ldr r2, =gUnknown_0860D1C0 + ldrb r0, [r0, 0x11] + b _08192482 + .pool +_08192470: + cmp r1, 0x2 + bne _08192494 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + ldr r3, =gTasks + adds r1, r3 + ldr r2, =gUnknown_0860D1C0 + ldrb r0, [r0, 0x12] +_08192482: + adds r0, r2 + ldrb r0, [r0] + strh r0, [r1, 0xA] + b _081924A0 + .pool +_08192494: + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =gTasks + adds r0, r1 +_0819249E: + strh r5, [r0, 0xA] +_081924A0: + cmp r7, 0 + beq _081924CC + cmp r7, 0x9 + beq _081924CC + movs r0, 0x5 + bl PlaySE + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0xA] + mov r2, r9 + lsls r0, r2, 2 + add r0, r9 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0xC] + movs r2, 0x1 + eors r1, r2 + strh r1, [r0, 0xC] +_081924CC: + adds r0, r7, 0 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_819221C + + thumb_func_start sub_81924E0 +sub_81924E0: @ 81924E0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x58 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x1C] + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x20] + movs r5, 0 + movs r0, 0 + str r0, [sp, 0x28] + movs r1, 0 + str r1, [sp, 0x2C] + movs r2, 0 + str r2, [sp, 0x30] + movs r4, 0 + movs r0, 0x24 + bl AllocZeroed + mov r8, r0 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r3, [sp, 0x20] + lsls r0, r3, 2 + adds r0, r1, r0 + ldr r2, =0x00000d24 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + str r0, [sp, 0x24] + movs r0, 0x1 + ldr r3, [sp, 0x1C] + ands r0, r3 + cmp r0, 0 + beq _08192538 + movs r5, 0x8 + movs r4, 0x9 + str r4, [sp, 0x28] + movs r4, 0x2 +_08192538: + movs r0, 0x2 + ldr r2, [sp, 0x1C] + ands r0, r2 + cmp r0, 0 + beq _08192548 + movs r3, 0x80 + lsls r3, 1 + str r3, [sp, 0x2C] +_08192548: + movs r0, 0x4 + ldr r2, [sp, 0x1C] + ands r0, r2 + cmp r0, 0 + beq _08192556 + movs r3, 0xA0 + str r3, [sp, 0x30] +_08192556: + movs r0, 0x8 + ldr r2, [sp, 0x1C] + ands r0, r2 + cmp r0, 0 + beq _08192564 + ldr r3, =0xffffff00 + str r3, [sp, 0x2C] +_08192564: + movs r0, 0x10 + ldr r2, [sp, 0x1C] + ands r0, r2 + cmp r0, 0 + beq _08192574 + movs r3, 0xA0 + negs r3, r3 + str r3, [sp, 0x30] +_08192574: + ldr r0, =0x000003ff + ldr r2, [sp, 0x24] + cmp r2, r0 + bne _08192598 + ldrb r0, [r1, 0x8] + bl sub_806F000 + lsls r0, 16 + lsrs r0, 16 + b _081925B6 + .pool +_08192598: + ldr r0, =0x000003fe + ldr r3, [sp, 0x24] + cmp r3, r0 + bne _081925AC + bl sub_8195910 + b _081925B2 + .pool +_081925AC: + ldr r0, [sp, 0x24] + bl sub_8162AA0 +_081925B2: + lsls r0, 24 + lsrs r0, 24 +_081925B6: + ldr r2, [sp, 0x2C] + adds r2, 0x30 + ldr r3, [sp, 0x30] + adds r3, 0x40 + adds r1, r4, 0 + adds r1, 0xC + str r1, [sp] + ldr r1, =0x0000ffff + str r1, [sp, 0x4] + movs r1, 0x1 + bl sub_818D8AC + ldr r1, =gUnknown_0203CD78 + ldr r1, [r1] + adds r1, r5 + strb r0, [r1] + movs r0, 0x1E + ldr r4, [sp, 0x1C] + ands r0, r4 + cmp r0, 0 + beq _081925FC + ldr r2, =gSprites + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_081925FC: + movs r7, 0 + ldr r0, [sp, 0x20] + lsls r0, 1 + str r0, [sp, 0x3C] + adds r1, r5, 0x2 + ldr r2, [sp, 0x28] + lsls r2, 24 + str r2, [sp, 0x44] + ldr r3, [sp, 0x28] + adds r3, 0x4 + str r3, [sp, 0x40] + ldr r4, [sp, 0x20] + adds r0, r4 + ldr r6, =gUnknown_0203CD78 + ldr r2, =gSprites + mov r10, r2 + adds r4, r1, 0 + lsls r5, r0, 1 + movs r3, 0 + mov r9, r3 +_08192624: + ldr r0, =0x000003ff + ldr r1, [sp, 0x24] + cmp r1, r0 + bne _08192660 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000d64 + adds r0, r2 + adds r0, r5 + ldrh r0, [r0] + ldr r1, =gUnknown_0860D340 + adds r1, r7, r1 + ldrb r2, [r1] + ldr r3, [sp, 0x2C] + orrs r2, r3 + b _081926B0 + .pool +_08192660: + ldr r0, =0x000003fe + ldr r3, [sp, 0x24] + cmp r3, r0 + bne _08192690 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000d64 + adds r0, r1 + adds r0, r5 + ldrh r0, [r0] + ldr r1, =gUnknown_0860D340 + adds r1, r7, r1 + ldrb r2, [r1] + ldr r3, [sp, 0x2C] + orrs r2, r3 + b _081926B0 + .pool +_08192690: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r3, =0x00000d64 + adds r0, r3 + adds r0, r5 + ldrh r1, [r0] + ldr r0, =gUnknown_0203BC8C + ldr r0, [r0] + lsls r1, 4 + adds r1, r0 + ldrh r0, [r1] + ldr r1, =gUnknown_0860D340 + adds r1, r7, r1 + ldrb r2, [r1] + ldr r1, [sp, 0x2C] + orrs r2, r1 +_081926B0: + ldr r1, =gUnknown_0860D343 + adds r1, r7, r1 + ldrb r3, [r1] + ldr r1, [sp, 0x30] + adds r3, r1 + mov r1, r9 + str r1, [sp] + str r1, [sp, 0x4] + movs r1, 0x1 + str r1, [sp, 0x8] + ldr r1, =sub_8190938 + bl sub_80D2CC4 + ldr r1, [r6] + adds r1, r4 + strb r0, [r1] + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r10 + ldrb r1, [r0, 0x5] + movs r2, 0xD + negs r2, r2 + ands r1, r2 + strb r1, [r0, 0x5] + movs r0, 0x1E + ldr r3, [sp, 0x1C] + ands r0, r3 + cmp r0, 0 + beq _0819270A + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r10 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_0819270A: + adds r4, 0x1 + adds r5, 0x2 + adds r7, 0x1 + cmp r7, 0x2 + ble _08192624 + add r0, sp, 0xC + movs r2, 0 + movs r3, 0x2 + strb r3, [r0, 0x5] + strb r2, [r0, 0x6] + strb r2, [r0, 0x7] + adds r1, r0, 0 + adds r0, r2, 0 + strb r0, [r1, 0x8] + adds r0, r1, 0 + ldrb r0, [r0, 0x7] + strb r0, [r1, 0x9] + adds r0, r1, 0 + strb r3, [r0, 0xA] + strb r2, [r0, 0xB] + adds r3, r0, 0 + ldrb r2, [r3, 0xC] + movs r1, 0x10 + negs r1, r1 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3, 0xC] + adds r2, r3, 0 + movs r0, 0xE0 + strb r0, [r2, 0xC] + ldrb r0, [r2, 0xD] + ands r1, r0 + strb r1, [r2, 0xD] + adds r1, r2, 0 + movs r0, 0xD0 + strb r0, [r1, 0xD] + movs r7, 0 + ldr r0, =0x000003ff + ldr r4, [sp, 0x24] + cmp r4, r0 + bne _08192784 + ldr r0, =gTrainerClassToNameIndex + adds r0, 0x3C + ldrb r5, [r0] + b _081927A2 + .pool +_08192784: + ldr r0, =0x000003fe + ldr r1, [sp, 0x24] + cmp r1, r0 + bne _08192798 + bl sub_8195924 + b _0819279E + .pool +_08192798: + ldr r0, [sp, 0x24] + bl GetFrontierOpponentClass +_0819279E: + lsls r0, 24 + lsrs r5, r0, 24 +_081927A2: + ldr r2, =gTrainerClassNames + movs r0, 0xD + adds r1, r5, 0 + muls r1, r0 + adds r0, r7, r1 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0xFF + beq _081927CA + ldr r3, =gStringVar1 + adds r0, r1, r2 + adds r2, r7, r0 +_081927BA: + adds r0, r7, r3 + ldrb r1, [r2] + strb r1, [r0] + adds r2, 0x1 + adds r7, 0x1 + ldrb r0, [r2] + cmp r0, 0xFF + bne _081927BA +_081927CA: + ldr r5, =gStringVar1 + adds r1, r7, r5 + movs r0, 0 + strb r0, [r1] + adds r0, r7, 0x1 + adds r0, r5 + movs r1, 0xFF + strb r1, [r0] + ldr r0, =0x000003ff + ldr r2, [sp, 0x24] + cmp r2, r0 + bne _08192800 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + adds r0, r5, 0 + bl StringAppend + b _08192836 + .pool +_08192800: + ldr r0, =0x000003fe + ldr r3, [sp, 0x24] + cmp r3, r0 + bne _08192824 + ldr r4, =gStringVar2 + adds r0, r4, 0 + bl sub_8195938 + adds r0, r5, 0 + adds r1, r4, 0 + bl StringAppend + b _08192836 + .pool +_08192824: + ldr r4, =gStringVar2 + ldr r1, [sp, 0x24] + adds r0, r4, 0 + bl sub_8195898 + adds r0, r5, 0 + adds r1, r4, 0 + bl StringAppend +_08192836: + add r0, sp, 0xC + ldrb r0, [r0, 0x5] + ldr r4, =gStringVar1 + add r1, sp, 0xC + ldrb r3, [r1, 0xA] + adds r1, r4, 0 + movs r2, 0xD0 + bl GetStringCenterAlignXOffsetWithLetterSpacing + add r1, sp, 0xC + movs r5, 0 + strb r0, [r1, 0x8] + str r4, [sp, 0xC] + adds r0, r1, 0 + add r4, sp, 0x28 + ldrb r4, [r4] + strb r4, [r0, 0x4] + ldr r0, [sp, 0x44] + lsrs r4, r0, 24 + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram + add r0, sp, 0xC + movs r1, 0 + movs r2, 0 + bl AddTextPrinter + add r0, sp, 0xC + strb r5, [r0, 0xA] + movs r7, 0 + adds r6, r0, 0 + ldr r1, [sp, 0x3C] + ldr r2, [sp, 0x20] + adds r0, r1, r2 + lsls r0, 1 + mov r9, r0 + movs r3, 0xB + mov r10, r3 +_0819288A: + ldr r0, =gUnknown_0860D346 + adds r0, r7, r0 + ldrb r0, [r0] + strb r0, [r6, 0x9] + ldr r0, =0x000003ff + ldr r4, [sp, 0x24] + cmp r4, r0 + bne _081928C0 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + lsls r0, r7, 1 + add r0, r9 + ldr r2, =0x00000d64 + adds r1, r2 + b _081928FA + .pool +_081928C0: + ldr r0, =0x000003fe + ldr r4, [sp, 0x24] + cmp r4, r0 + bne _081928E4 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + lsls r0, r7, 1 + add r0, r9 + ldr r2, =0x00000d64 + adds r1, r2 + b _081928FA + .pool +_081928E4: + ldr r4, =gSaveBlock2Ptr + ldr r1, [r4] + lsls r0, r7, 1 + add r0, r9 + ldr r2, =0x00000d64 + adds r1, r2 + adds r1, r0 + ldrh r1, [r1] + ldr r0, =gUnknown_0203BC8C + ldr r0, [r0] + lsls r1, 4 +_081928FA: + adds r1, r0 + ldrh r0, [r1] + mov r3, r10 + muls r3, r0 + adds r0, r3, 0 + ldr r1, =gSpeciesNames + adds r0, r1 + str r0, [sp, 0xC] + adds r0, r7, 0x1 + ldr r4, [sp, 0x28] + adds r0, r4 + movs r1, 0 + strb r0, [r6, 0x4] + cmp r7, 0x1 + bne _08192930 + movs r0, 0x7 + strb r0, [r6, 0x8] + b _08192932 + .pool +_08192930: + strb r1, [r6, 0x8] +_08192932: + adds r5, r7, 0x1 + ldr r0, [sp, 0x28] + adds r4, r5, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram + add r0, sp, 0xC + movs r1, 0 + movs r2, 0 + bl AddTextPrinter + adds r7, r5, 0 + cmp r7, 0x2 + ble _0819288A + ldr r4, [sp, 0x40] + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram + ldr r0, =0x000003fe + ldr r1, [sp, 0x24] + cmp r1, r0 + bne _08192980 + ldr r0, =gUnknown_0860D1D0 + ldr r0, [r0, 0x40] + b _0819298A + .pool +_08192980: + ldr r0, =gUnknown_0860D1D0 + ldr r2, [sp, 0x20] + lsls r1, r2, 2 + adds r1, r0 + ldr r0, [r1] +_0819298A: + str r0, [sp, 0xC] + add r1, sp, 0xC + movs r2, 0 + movs r0, 0x1 + strb r0, [r1, 0x5] + adds r0, r1, 0 + add r3, sp, 0x40 + ldrb r3, [r3] + strb r3, [r0, 0x4] + strb r2, [r0, 0x8] + movs r1, 0x4 + strb r1, [r0, 0x7] + strb r1, [r0, 0x9] + movs r1, 0 + bl AddTextPrinter + movs r7, 0 + ldr r3, =gUnknown_0860B358 +_081929AE: + movs r5, 0 + adds r4, r7, 0x1 + str r4, [sp, 0x38] + lsls r0, r7, 1 + str r0, [sp, 0x34] + lsls r2, r7, 4 +_081929BA: + movs r6, 0 + lsls r1, r5, 1 + mov r10, r1 + mov r4, r8 + mov r9, r2 +_081929C4: + ldr r0, =0x000003fe + ldr r1, [sp, 0x24] + cmp r1, r0 + bne _08192A00 + lsls r0, r7, 24 + lsls r1, r5, 24 + lsrs r0, 24 + lsrs r1, 24 + str r2, [sp, 0x48] + str r3, [sp, 0x4C] + bl sub_81A5060 + lsls r0, 16 + lsrs r0, 12 + adds r0, r6, r0 + ldr r3, [sp, 0x4C] + adds r0, r3 + ldrh r1, [r4] + ldrb r0, [r0] + adds r1, r0 + strh r1, [r4] + ldr r2, [sp, 0x48] + b _08192A58 + .pool +_08192A00: + ldr r0, =0x000003ff + ldr r1, [sp, 0x24] + cmp r1, r0 + bne _08192A20 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000efc + adds r0, r1 + add r0, r9 + b _08192A48 + .pool +_08192A20: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + mov r12, r0 + ldr r0, [sp, 0x3C] + ldr r1, [sp, 0x20] + adds r0, r1 + str r0, [sp, 0x50] + lsls r0, 1 + ldr r1, [sp, 0x34] + adds r0, r1, r0 + ldr r1, =0x00000d64 + add r1, r12 + adds r1, r0 + ldrh r0, [r1] + ldr r1, =gUnknown_0203BC8C + ldr r1, [r1] + lsls r0, 4 + adds r0, r1 + adds r0, 0x2 + add r0, r10 +_08192A48: + ldrh r0, [r0] + lsls r0, 4 + adds r0, r6, r0 + adds r0, r3 + ldrh r1, [r4] + ldrb r0, [r0] + adds r1, r0 + strh r1, [r4] +_08192A58: + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0xF + ble _081929C4 + adds r2, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _081929BA + ldr r7, [sp, 0x38] + cmp r7, 0x2 + ble _081929AE + movs r7, 0 + ldr r2, =gUnknown_0860D214 + mov r9, r2 + ldr r3, =gUnknown_0860C988 + mov r10, r3 +_08192A78: + movs r4, 0 + movs r6, 0 + movs r5, 0 + mov r3, r8 + lsls r0, r7, 4 + mov r1, r10 + adds r2, r0, r1 +_08192A86: + ldrb r0, [r2] + cmp r0, 0 + beq _08192A9E + adds r4, 0x1 + movs r1, 0 + ldrsh r0, [r3, r1] + cmp r0, 0 + beq _08192A9E + ldrb r1, [r2] + cmp r0, r1 + blt _08192A9E + adds r6, 0x1 +_08192A9E: + adds r3, 0x2 + adds r2, 0x1 + adds r5, 0x1 + cmp r5, 0xF + ble _08192A86 + cmp r4, r6 + beq _08192AB2 + adds r7, 0x1 + cmp r7, 0x1E + bls _08192A78 +_08192AB2: + lsls r0, r7, 2 + add r0, r9 + ldr r0, [r0] + str r0, [sp, 0xC] + add r0, sp, 0xC + movs r1, 0x14 + strb r1, [r0, 0x7] + strb r1, [r0, 0x9] + movs r1, 0 + movs r2, 0 + bl AddTextPrinter + movs r1, 0 + mov r0, r8 + adds r0, 0x22 +_08192AD0: + strh r1, [r0] + subs r0, 0x2 + cmp r0, r8 + bge _08192AD0 + ldr r2, [sp, 0x24] + ldr r3, =0xfffffc02 + adds r0, r2, r3 + cmp r0, 0x1 + bls _08192AE4 + b _08192C24 +_08192AE4: + movs r7, 0 + movs r4, 0 + mov r9, r4 +_08192AEA: + movs r5, 0 + mov r4, r8 + mov r6, r9 +_08192AF0: + ldr r0, =0x000003fe + ldr r1, [sp, 0x24] + cmp r1, r0 + bne _08192B24 + lsls r1, r5, 24 + lsrs r1, 24 + lsrs r0, r6, 24 + bl sub_81A50F0 + lsls r0, 24 + lsrs r0, 24 + b _08192B34 + .pool +_08192B24: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r7, 4 + adds r1, r5, r1 + ldr r2, =0x00000f04 + adds r0, r2 + adds r0, r1 + ldrb r0, [r0] +_08192B34: + strh r0, [r4] + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x5 + ble _08192AF0 + mov r3, r8 + ldrh r0, [r3] + ldrh r4, [r3, 0xC] + adds r0, r4 + strh r0, [r3, 0xC] + movs r5, 0 + mov r4, r8 +_08192B4C: + ldr r0, =0x000003fe + ldr r1, [sp, 0x24] + cmp r1, r0 + bne _08192B70 + mov r2, r9 + lsrs r0, r2, 24 + bl sub_81A50B0 + lsls r0, 24 + lsrs r2, r0, 24 + b _08192B7E + .pool +_08192B70: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r7, 4 + adds r0, r1 + ldr r3, =0x00000f0a + adds r0, r3 + ldrb r2, [r0] +_08192B7E: + ldr r1, =gNatureStatTable + lsls r0, r2, 2 + adds r0, r2 + adds r0, r5, r0 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + ble _08192BB4 + movs r0, 0x2 + ldrsh r1, [r4, r0] + movs r0, 0x6E + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + ldrh r1, [r4, 0xE] + adds r1, r0 + strh r1, [r4, 0xE] + b _08192BDC + .pool +_08192BB4: + cmp r0, 0 + bge _08192BD4 + movs r2, 0x2 + ldrsh r1, [r4, r2] + movs r0, 0x5A + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + ldrh r1, [r4, 0xE] + adds r1, r0 + strh r1, [r4, 0xE] + ldrh r0, [r4, 0x1A] + adds r0, 0x1 + strh r0, [r4, 0x1A] + b _08192BDC +_08192BD4: + ldrh r0, [r4, 0x2] + ldrh r3, [r4, 0xE] + adds r0, r3 + strh r0, [r4, 0xE] +_08192BDC: + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x4 + ble _08192B4C + movs r4, 0x80 + lsls r4, 17 + add r9, r4 + adds r7, 0x1 + cmp r7, 0x2 + bgt _08192BF2 + b _08192AEA +_08192BF2: + movs r5, 0 + mov r1, r8 + movs r7, 0x5 +_08192BF8: + movs r2, 0xC + ldrsh r0, [r1, r2] + adds r5, r0 + adds r1, 0x2 + subs r7, 0x1 + cmp r7, 0 + bge _08192BF8 + movs r6, 0x64 + mov r4, r8 + movs r7, 0x5 +_08192C0C: + movs r3, 0xC + ldrsh r0, [r4, r3] + muls r0, r6 + adds r1, r5, 0 + bl __divsi3 + strh r0, [r4] + adds r4, 0x2 + subs r7, 0x1 + cmp r7, 0 + bge _08192C0C + b _08192D70 +_08192C24: + ldr r4, =gUnknown_0203BC8C + mov r10, r4 + ldr r1, [sp, 0x3C] + ldr r2, [sp, 0x20] + adds r0, r1, r2 + lsls r0, 1 + mov r9, r0 + movs r7, 0x2 +_08192C34: + ldr r3, =gSaveBlock2Ptr + ldr r0, [r3] + ldr r4, =0x00000d64 + adds r0, r4 + add r0, r9 + ldrh r0, [r0] + mov r2, r10 + ldr r1, [r2] + lsls r0, 4 + adds r0, r1 + ldrb r2, [r0, 0xB] + movs r6, 0 + movs r4, 0 + movs r3, 0x1 + mov r1, r8 + movs r5, 0x5 +_08192C54: + strh r4, [r1] + adds r0, r2, 0 + ands r0, r3 + cmp r0, 0 + beq _08192C60 + adds r6, 0x1 +_08192C60: + asrs r2, 1 + adds r1, 0x2 + subs r5, 0x1 + cmp r5, 0 + bge _08192C54 + movs r0, 0xFF + lsls r0, 1 + adds r1, r6, 0 + bl __divsi3 + adds r6, r0, 0 + ldr r3, =gSaveBlock2Ptr + ldr r0, [r3] + ldr r4, =0x00000d64 + adds r0, r4 + add r0, r9 + ldrh r0, [r0] + mov r2, r10 + ldr r1, [r2] + lsls r0, 4 + adds r0, r1 + ldrb r2, [r0, 0xB] + movs r3, 0x1 + mov r1, r8 + movs r5, 0x5 +_08192C92: + adds r0, r2, 0 + ands r0, r3 + cmp r0, 0 + beq _08192C9C + strh r6, [r1] +_08192C9C: + asrs r2, 1 + adds r1, 0x2 + subs r5, 0x1 + cmp r5, 0 + bge _08192C92 + mov r3, r8 + ldrh r0, [r3] + ldrh r4, [r3, 0xC] + adds r0, r4 + strh r0, [r3, 0xC] + movs r5, 0 + mov r4, r8 +_08192CB4: + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r2, =0x00000d64 + adds r0, r2 + add r0, r9 + ldrh r0, [r0] + mov r3, r10 + ldr r1, [r3] + lsls r0, 4 + adds r0, r1 + ldrb r2, [r0, 0xC] + lsls r0, r2, 2 + adds r0, r2 + adds r0, r5, r0 + ldr r1, =gNatureStatTable + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + ble _08192D04 + movs r2, 0x2 + ldrsh r1, [r4, r2] + movs r0, 0x6E + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + ldrh r1, [r4, 0xE] + adds r1, r0 + strh r1, [r4, 0xE] + b _08192D2C + .pool +_08192D04: + cmp r0, 0 + bge _08192D24 + movs r3, 0x2 + ldrsh r1, [r4, r3] + movs r0, 0x5A + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + ldrh r1, [r4, 0xE] + adds r1, r0 + strh r1, [r4, 0xE] + ldrh r0, [r4, 0x1A] + adds r0, 0x1 + strh r0, [r4, 0x1A] + b _08192D2C +_08192D24: + ldrh r0, [r4, 0x2] + ldrh r1, [r4, 0xE] + adds r0, r1 + strh r0, [r4, 0xE] +_08192D2C: + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x4 + ble _08192CB4 + movs r2, 0x2 + add r9, r2 + subs r7, 0x1 + cmp r7, 0 + blt _08192D40 + b _08192C34 +_08192D40: + movs r5, 0 + mov r1, r8 + movs r7, 0x5 +_08192D46: + movs r3, 0xC + ldrsh r0, [r1, r3] + adds r5, r0 + adds r1, 0x2 + subs r7, 0x1 + cmp r7, 0 + bge _08192D46 + movs r6, 0x64 + mov r4, r8 + movs r7, 0x5 +_08192D5A: + movs r1, 0xC + ldrsh r0, [r4, r1] + muls r0, r6 + adds r1, r5, 0 + bl __divsi3 + strh r0, [r4] + adds r4, 0x2 + subs r7, 0x1 + cmp r7, 0 + bge _08192D5A +_08192D70: + movs r7, 0 + movs r5, 0 + movs r6, 0 + mov r4, r8 + mov r10, r8 + mov r9, r8 +_08192D7C: + movs r2, 0 + ldrsh r1, [r4, r2] + cmp r1, 0x1D + ble _08192DDE + cmp r7, 0x2 + bne _08192DD4 + mov r3, r8 + movs r0, 0xC + ldrsh r3, [r3, r0] + mov r12, r3 + cmp r12, r1 + bge _08192DC6 + mov r2, r8 + ldrh r2, [r2, 0xE] + add r3, sp, 0x54 + strh r2, [r3] + mov r2, r8 + movs r3, 0xE + ldrsh r0, [r2, r3] + cmp r0, r1 + bge _08192DBA + cmp r12, r0 + bge _08192DB4 + add r0, sp, 0x54 + ldrh r0, [r0] + strh r0, [r2, 0xC] + strh r6, [r2, 0xE] + b _08192DDE +_08192DB4: + mov r1, r8 + strh r6, [r1, 0xE] + b _08192DDE +_08192DBA: + add r2, sp, 0x54 + ldrh r3, [r2] + mov r2, r8 + strh r3, [r2, 0xC] + strh r6, [r2, 0xE] + b _08192DDE +_08192DC6: + mov r3, r8 + movs r2, 0xE + ldrsh r0, [r3, r2] + cmp r0, r1 + bge _08192DDE + strh r6, [r3, 0xE] + b _08192DDE +_08192DD4: + mov r3, r9 + strh r6, [r3, 0xC] + movs r0, 0x2 + add r9, r0 + adds r7, 0x1 +_08192DDE: + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08192E64 + cmp r5, 0x2 + bne _08192E5A + movs r2, 0x18 + ldrsh r0, [r4, r2] + cmp r0, 0x1 + bgt _08192E18 + cmp r0, 0x1 + bne _08192E64 + mov r3, r8 + movs r1, 0x10 + ldrsh r0, [r3, r1] + lsls r0, 1 + add r0, r8 + movs r2, 0x18 + ldrsh r0, [r0, r2] + cmp r0, 0 + bne _08192E22 + movs r1, 0x12 + ldrsh r0, [r3, r1] + lsls r0, 1 + add r0, r8 + movs r2, 0x18 + ldrsh r0, [r0, r2] + cmp r0, 0 + bne _08192E22 +_08192E18: + mov r3, r8 + ldrh r0, [r3, 0x12] + strh r0, [r3, 0x10] + strh r6, [r3, 0x12] + b _08192E64 +_08192E22: + movs r1, 0x18 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _08192E64 + mov r2, r8 + movs r3, 0x10 + ldrsh r0, [r2, r3] + lsls r0, 1 + add r0, r8 + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08192E44 + ldrh r0, [r2, 0x12] + strh r0, [r2, 0x10] + strh r6, [r2, 0x12] + b _08192E64 +_08192E44: + mov r2, r8 + movs r3, 0x12 + ldrsh r0, [r2, r3] + lsls r0, 1 + add r0, r8 + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08192E64 + strh r6, [r2, 0x12] + b _08192E64 +_08192E5A: + mov r2, r10 + strh r6, [r2, 0x10] + movs r3, 0x2 + add r10, r3 + adds r5, 0x1 +_08192E64: + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x5 + ble _08192D7C + cmp r7, 0x2 + bne _08192E8C + ldr r0, =gUnknown_0860D349 + mov r4, r8 + movs r1, 0xC + ldrsh r2, [r4, r1] + adds r0, r2, r0 + movs r3, 0xE + ldrsh r1, [r4, r3] + subs r1, 0x1 + subs r1, r2 + ldrb r0, [r0] + adds r7, r1, r0 + b _08192ED2 + .pool +_08192E8C: + cmp r7, 0x1 + bne _08192E9C + mov r4, r8 + movs r1, 0xC + ldrsh r0, [r4, r1] + adds r7, r0, 0 + adds r7, 0xF + b _08192ED2 +_08192E9C: + cmp r5, 0x2 + bne _08192EC0 + ldr r0, =gUnknown_0860D349 + mov r3, r8 + movs r4, 0x10 + ldrsh r2, [r3, r4] + adds r0, r2, r0 + movs r4, 0x12 + ldrsh r1, [r3, r4] + subs r1, 0x1 + subs r1, r2 + ldrb r0, [r0] + adds r1, r0 + adds r7, r1, 0 + adds r7, 0x15 + b _08192ED2 + .pool +_08192EC0: + cmp r5, 0x1 + bne _08192ED0 + mov r1, r8 + movs r2, 0x10 + ldrsh r0, [r1, r2] + adds r7, r0, 0 + adds r7, 0x24 + b _08192ED2 +_08192ED0: + movs r7, 0x2A +_08192ED2: + lsls r0, r7, 2 + ldr r3, =gUnknown_0860D294 + adds r0, r3 + ldr r0, [r0] + str r0, [sp, 0xC] + add r0, sp, 0xC + movs r1, 0x24 + strb r1, [r0, 0x7] + strb r1, [r0, 0x9] + movs r1, 0 + movs r2, 0 + bl AddTextPrinter + mov r0, r8 + bl Free + add sp, 0x58 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81924E0 + + thumb_func_start sub_8192F08 +sub_8192F08: @ 8192F08 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + str r1, [sp] + lsls r0, 24 + lsrs r7, r0, 24 + movs r0, 0 + str r0, [sp, 0x4] + mov r8, r0 + ldr r2, =gUnknown_0860D3C4 + lsls r0, r7, 1 + adds r0, r7 + adds r1, r0, r2 + ldrb r6, [r1] + adds r1, r2, 0x1 + adds r0, r1 + ldrb r0, [r0] + adds r0, r6, r0 + adds r3, r2, 0 + cmp r6, r0 + bge _08192FD4 + ldr r5, =gSaveBlock2Ptr + ldr r1, =0x000003ff + mov r10, r1 + ldr r2, =0x000003fe + mov r9, r2 +_08192F42: + ldr r0, =gUnknown_0860D3B4 + adds r0, r6, r0 + ldrb r4, [r0] + ldr r0, [r5] + lsls r1, r4, 2 + adds r0, r1 + ldr r2, =0x00000d25 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _08192FBE + ldr r0, [sp] + add r0, r8 + strb r4, [r0] + ldr r2, [r5] + adds r0, r2, r1 + ldr r1, =0x00000d24 + adds r0, r1 + ldrh r0, [r0] + lsls r1, r0, 22 + lsrs r0, r1, 22 + cmp r0, r10 + bne _08192F9C + ldr r0, =gStringVar1 + adds r1, r2, 0 + bl StringCopy + b _08192FB8 + .pool +_08192F9C: + lsrs r0, r1, 22 + cmp r0, r9 + bne _08192FB0 + ldr r0, =gStringVar1 + bl sub_8195938 + b _08192FB8 + .pool +_08192FB0: + lsrs r1, 22 + ldr r0, =gStringVar1 + bl sub_8195898 +_08192FB8: + movs r2, 0x1 + add r8, r2 + ldr r3, =gUnknown_0860D3C4 +_08192FBE: + adds r6, 0x1 + lsls r1, r7, 1 + adds r1, r7 + adds r0, r1, r3 + ldrb r2, [r0] + adds r0, r3, 0x1 + adds r1, r0 + ldrb r0, [r1] + adds r2, r0 + cmp r6, r2 + blt _08192F42 +_08192FD4: + mov r5, r8 + cmp r5, 0x2 + bne _08192FE8 + movs r0, 0 + b _0819313C + .pool +_08192FE8: + mov r12, r3 + lsls r3, r7, 1 + adds r0, r3, r7 + mov r2, r12 + adds r1, r0, r2 + ldrb r6, [r1] + mov r1, r12 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + adds r0, r6, r0 + str r3, [sp, 0x8] + cmp r6, r0 + blt _08193006 + b _08193126 +_08193006: + ldr r5, =gSaveBlock2Ptr + mov r10, r5 + ldr r0, =0x00000d25 + mov r9, r0 +_0819300E: + ldr r0, =gUnknown_0860D3B4 + adds r0, r6, r0 + ldrb r4, [r0] + mov r1, r10 + ldr r0, [r1] + lsls r2, r4, 2 + str r2, [sp, 0xC] + adds r0, r2 + add r0, r9 + ldrb r2, [r0] + lsls r0, r2, 29 + cmp r0, 0 + bge _08193100 + lsls r2, 27 + adds r1, r3, r7 + mov r0, r12 + adds r0, 0x2 + adds r1, r0 + lsrs r2, 30 + ldrb r1, [r1] + cmp r2, r1 + bcc _08193100 + ldr r0, [sp] + add r0, r8 + strb r4, [r0] + movs r5, 0x1 + add r8, r5 + mov r0, r10 + ldr r3, [r0] + ldr r5, [sp, 0xC] + adds r2, r3, r5 + adds r0, r2, 0 + add r0, r9 + ldrb r5, [r0] + mov r12, r5 + mov r0, r12 + lsls r0, 27 + lsrs r0, 30 + cmp r0, r1 + bne _081930BC + lsls r4, 1 + movs r1, 0xEC + lsls r1, 4 + adds r0, r3, r1 + adds r0, r4 + ldrh r1, [r0] + movs r0, 0xD + muls r1, r0 + ldr r0, =gMoveNames + adds r1, r0 + ldr r0, =gStringVar2 + bl StringCopy + mov r2, r10 + ldr r1, [r2] + ldr r5, [sp, 0xC] + adds r0, r1, r5 + add r0, r9 + ldrb r0, [r0] + lsls r2, r0, 24 + lsrs r0, r2, 29 + lsls r0, 1 + str r0, [sp, 0x4] + movs r0, 0xEC + lsls r0, 4 + adds r1, r0 + adds r1, r4 + ldrh r0, [r1] + cmp r0, 0 + bne _08193100 + lsrs r0, r2, 29 + cmp r0, 0 + bne _08193100 + movs r1, 0x4 + str r1, [sp, 0x4] + b _08193100 + .pool +_081930BC: + ldr r5, =0x00000d24 + adds r0, r2, r5 + ldrh r0, [r0] + lsls r1, r0, 22 + ldr r0, =0xffc00000 + cmp r1, r0 + bne _081930E0 + ldr r0, =gStringVar1 + adds r1, r3, 0 + bl StringCopy + b _08193100 + .pool +_081930E0: + ldr r0, =0xff800000 + cmp r1, r0 + bne _081930F8 + ldr r0, =gStringVar1 + bl sub_8195938 + b _08193100 + .pool +_081930F8: + lsrs r1, 22 + ldr r0, =gStringVar1 + bl sub_8195898 +_08193100: + mov r0, r8 + cmp r0, 0x2 + beq _08193126 + adds r6, 0x1 + ldr r1, =gUnknown_0860D3C4 + mov r12, r1 + ldr r3, [sp, 0x8] + adds r1, r3, r7 + mov r2, r12 + adds r0, r1, r2 + ldrb r2, [r0] + mov r0, r12 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + adds r2, r0 + cmp r6, r2 + bge _08193126 + b _0819300E +_08193126: + cmp r7, 0xE + beq _08193138 + ldr r0, [sp, 0x4] + adds r0, 0x1 + b _0819313C + .pool +_08193138: + ldr r0, [sp, 0x4] + adds r0, 0x2 +_0819313C: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8192F08 + + thumb_func_start sub_819314C +sub_819314C: @ 819314C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x80 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x34] + lsls r1, 24 + lsrs r6, r1, 24 + movs r0, 0 + str r0, [sp, 0x3C] + movs r7, 0 + movs r1, 0 + str r1, [sp, 0x40] + movs r2, 0 + str r2, [sp, 0x44] + mov r9, r2 + movs r0, 0x1 + ldr r3, [sp, 0x34] + ands r0, r3 + cmp r0, 0 + beq _08193186 + movs r7, 0x8 + str r7, [sp, 0x3C] + movs r7, 0x9 + movs r0, 0x2 + mov r9, r0 +_08193186: + movs r0, 0x2 + ldr r1, [sp, 0x34] + ands r0, r1 + cmp r0, 0 + beq _08193196 + movs r2, 0x80 + lsls r2, 1 + str r2, [sp, 0x40] +_08193196: + movs r0, 0x4 + ldr r3, [sp, 0x34] + ands r0, r3 + cmp r0, 0 + beq _081931A4 + movs r0, 0xA0 + str r0, [sp, 0x44] +_081931A4: + movs r0, 0x8 + ldr r1, [sp, 0x34] + ands r0, r1 + cmp r0, 0 + beq _081931B2 + ldr r2, =0xffffff00 + str r2, [sp, 0x40] +_081931B2: + movs r0, 0x10 + ldr r3, [sp, 0x34] + ands r0, r3 + cmp r0, 0 + beq _081931C2 + movs r0, 0xA0 + negs r0, r0 + str r0, [sp, 0x44] +_081931C2: + ldr r4, =gUnknown_0203CD78 + ldr r1, [r4] + adds r1, 0x11 + adds r0, r6, 0 + bl sub_8192F08 + str r0, [sp, 0x38] + movs r5, 0 + mov r1, sp + adds r1, 0x1C + str r1, [sp, 0x48] + mov r2, sp + adds r2, 0x24 + str r2, [sp, 0x4C] + lsls r1, r6, 1 + mov r3, sp + adds r3, 0x2C + str r3, [sp, 0x50] + ldr r0, [sp, 0x40] + adds r0, 0x30 + mov r8, r0 + ldr r2, [sp, 0x44] + adds r2, 0x58 + str r2, [sp, 0x78] + movs r3, 0xC + add r3, r9 + mov r10, r3 + ldr r0, [sp, 0x40] + adds r0, 0xC0 + str r0, [sp, 0x7C] + mov r2, r9 + adds r2, 0xD + str r2, [sp, 0x74] + ldr r3, [sp, 0x3C] + adds r3, 0x1 + mov r9, r3 + ldr r0, [sp, 0x3C] + adds r0, 0x2 + str r0, [sp, 0x54] + ldr r2, [sp, 0x3C] + adds r2, 0x5 + str r2, [sp, 0x5C] + adds r3, r7, 0 + adds r3, 0x8 + str r3, [sp, 0x6C] + adds r0, r7, 0x6 + str r0, [sp, 0x64] + adds r2, r7, 0x7 + str r2, [sp, 0x68] + lsls r3, r6, 2 + str r3, [sp, 0x58] + adds r0, r7, 0x5 + str r0, [sp, 0x60] + ldr r0, [r4] + adds r0, 0x11 + mov r12, r0 + ldr r0, =gSaveBlock2Ptr + ldr r4, [r0] + ldr r0, =gUnknown_0860D3C6 + movs r3, 0 + adds r1, r6 + adds r1, r0 + ldrb r6, [r1] +_08193240: + ldr r1, [sp, 0x48] + adds r2, r3, r1 + mov r7, r12 + adds r0, r7, r5 + ldrb r0, [r0] + str r0, [r2] + ldr r7, [sp, 0x4C] + adds r1, r3, r7 + lsls r0, 2 + adds r0, r4, r0 + ldr r7, =0x00000d24 + adds r0, r7 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + str r0, [r1] + ldr r0, [r2] + lsls r0, 2 + adds r0, r4, r0 + ldr r1, =0x00000d25 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 27 + lsrs r0, 30 + cmp r0, r6 + bhi _0819329C + lsls r0, r1, 29 + cmp r0, 0 + bge _0819329C + ldr r2, [sp, 0x50] + adds r1, r3, r2 + movs r0, 0x1 + b _081932A2 + .pool +_0819329C: + ldr r7, [sp, 0x50] + adds r1, r3, r7 + movs r0, 0 +_081932A2: + str r0, [r1] + adds r3, 0x4 + adds r5, 0x1 + cmp r5, 0x1 + ble _08193240 + ldr r1, [sp, 0x24] + ldr r0, =0x000003ff + cmp r1, r0 + bne _081932D4 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldrb r0, [r0, 0x8] + bl sub_806F000 + lsls r0, 16 + lsrs r0, 16 + mov r2, r8 + ldr r3, [sp, 0x78] + mov r1, r10 + str r1, [sp] + b _081932F8 + .pool +_081932D4: + ldr r0, =0x000003fe + cmp r1, r0 + bne _081932E4 + bl sub_8195910 + b _081932EC + .pool +_081932E4: + lsls r0, r1, 16 + lsrs r0, 16 + bl sub_8162AA0 +_081932EC: + lsls r0, 24 + lsrs r0, 24 + mov r2, r8 + ldr r3, [sp, 0x78] + mov r7, r10 + str r7, [sp] +_081932F8: + ldr r1, =0x0000ffff + str r1, [sp, 0x4] + movs r1, 0x1 + bl sub_818D8AC + ldr r1, =gUnknown_0203CD78 + ldr r1, [r1] + ldr r2, [sp, 0x3C] + adds r1, r2 + strb r0, [r1] + movs r0, 0x1E + ldr r3, [sp, 0x34] + ands r0, r3 + cmp r0, 0 + beq _08193334 + ldr r2, =gSprites + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldr r7, [sp, 0x3C] + adds r0, r7 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_08193334: + ldr r0, [sp, 0x2C] + cmp r0, 0 + beq _0819335A + ldr r2, =gSprites + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldr r1, [sp, 0x3C] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r2, [r0, 0x5] + movs r1, 0xF + ands r1, r2 + movs r2, 0x30 + orrs r1, r2 + strb r1, [r0, 0x5] +_0819335A: + ldr r2, [sp, 0x4C] + ldr r1, [r2, 0x4] + ldr r0, =0x000003ff + cmp r1, r0 + bne _08193388 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldrb r0, [r0, 0x8] + bl sub_806F000 + lsls r0, 16 + lsrs r0, 16 + b _081933B0 + .pool +_08193388: + ldr r0, =0x000003fe + cmp r1, r0 + bne _081933A4 + bl sub_8195910 + lsls r0, 24 + lsrs r0, 24 + ldr r2, [sp, 0x7C] + ldr r3, [sp, 0x78] + ldr r1, [sp, 0x74] + str r1, [sp] + b _081933B8 + .pool +_081933A4: + lsls r0, r1, 16 + lsrs r0, 16 + bl sub_8162AA0 + lsls r0, 24 + lsrs r0, 24 +_081933B0: + ldr r2, [sp, 0x7C] + ldr r3, [sp, 0x78] + ldr r7, [sp, 0x74] + str r7, [sp] +_081933B8: + ldr r1, =0x0000ffff + str r1, [sp, 0x4] + movs r1, 0x1 + bl sub_818D8AC + ldr r1, =gUnknown_0203CD78 + ldr r1, [r1] + add r1, r9 + strb r0, [r1] + movs r0, 0x1E + ldr r1, [sp, 0x34] + ands r0, r1 + cmp r0, 0 + beq _081933F0 + ldr r2, =gSprites + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + add r0, r9 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_081933F0: + ldr r2, [sp, 0x50] + ldr r0, [r2, 0x4] + cmp r0, 0 + beq _08193416 + ldr r2, =gSprites + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + add r0, r9 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r2, [r0, 0x5] + movs r1, 0xF + ands r1, r2 + movs r2, 0x30 + orrs r1, r2 + strb r1, [r0, 0x5] +_08193416: + movs r5, 0 + ldr r3, [sp, 0x38] + lsls r3, 2 + str r3, [sp, 0x70] + mov r8, r5 + ldr r6, =gUnknown_0203CD78 + ldr r7, =gSprites + ldr r4, [sp, 0x54] + mov r9, r5 + movs r0, 0x1 + mov r10, r0 +_0819342C: + ldr r1, [sp, 0x24] + ldr r0, =0x000003ff + cmp r1, r0 + bne _08193464 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r1, [sp, 0x1C] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + add r0, r9 + ldr r1, =0x00000d64 + adds r2, r1 + adds r2, r0 + ldrh r0, [r2] + b _081934B0 + .pool +_08193464: + ldr r0, =0x000003fe + cmp r1, r0 + bne _08193490 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r1, [sp, 0x1C] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + add r0, r9 + ldr r1, =0x00000d64 + adds r2, r1 + adds r2, r0 + ldrh r0, [r2] + b _081934B0 + .pool +_08193490: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r1, [sp, 0x1C] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + add r0, r9 + ldr r1, =0x00000d64 + adds r2, r1 + adds r2, r0 + ldrh r1, [r2] + ldr r0, =gUnknown_0203BC8C + ldr r0, [r0] + lsls r1, 4 + adds r1, r0 + ldrh r0, [r1] +_081934B0: + ldr r1, =gUnknown_0860D3A8 + adds r1, r5, r1 + ldrb r2, [r1] + ldr r3, [sp, 0x40] + orrs r2, r3 + ldr r1, =gUnknown_0860D3AB + adds r1, r5, r1 + ldrb r3, [r1] + ldr r1, [sp, 0x44] + adds r3, r1 + mov r1, r8 + str r1, [sp] + str r1, [sp, 0x4] + mov r1, r10 + str r1, [sp, 0x8] + ldr r1, =sub_8190938 + bl sub_80D2CC4 + ldr r1, [r6] + adds r1, r4 + strb r0, [r1] + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrb r1, [r0, 0x5] + movs r3, 0xD + negs r3, r3 + adds r2, r3, 0 + ands r1, r2 + strb r1, [r0, 0x5] + movs r0, 0x1E + ldr r1, [sp, 0x34] + ands r0, r1 + cmp r0, 0 + beq _08193516 + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_08193516: + ldr r0, [sp, 0x2C] + cmp r0, 0 + beq _08193548 + ldr r0, [r6] + adds r0, r4 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + movs r2, 0x30 + orrs r0, r2 + strb r0, [r1, 0x5] + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + mov r2, r10 + strh r2, [r0, 0x34] +_08193548: + adds r4, 0x1 + movs r3, 0x2 + add r9, r3 + adds r5, 0x1 + cmp r5, 0x2 + bgt _08193556 + b _0819342C +_08193556: + movs r5, 0 + ldr r6, =gUnknown_0203CD78 + ldr r7, =gSprites + mov r8, r7 + ldr r4, [sp, 0x5C] + mov r9, r5 + movs r7, 0 +_08193564: + ldr r0, [sp, 0x4C] + ldr r1, [r0, 0x4] + ldr r0, =0x000003ff + cmp r1, r0 + bne _081935AC + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r3, [sp, 0x48] + ldr r1, [r3, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + add r0, r9 + ldr r1, =0x00000d64 + adds r2, r1 + adds r2, r0 + ldrh r0, [r2] + b _081935FA + .pool +_081935AC: + ldr r0, =0x000003fe + cmp r1, r0 + bne _081935D8 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r0, [sp, 0x48] + ldr r1, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + add r0, r9 + ldr r1, =0x00000d64 + adds r2, r1 + adds r2, r0 + ldrh r0, [r2] + b _081935FA + .pool +_081935D8: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r0, [sp, 0x48] + ldr r1, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + add r0, r9 + ldr r1, =0x00000d64 + adds r2, r1 + adds r2, r0 + ldrh r1, [r2] + ldr r0, =gUnknown_0203BC8C + ldr r0, [r0] + lsls r1, 4 + adds r1, r0 + ldrh r0, [r1] +_081935FA: + ldr r1, =gUnknown_0860D3AE + adds r1, r5, r1 + ldrb r2, [r1] + ldr r3, [sp, 0x40] + orrs r2, r3 + ldr r1, =gUnknown_0860D3B1 + adds r1, r5, r1 + ldrb r3, [r1] + ldr r1, [sp, 0x44] + adds r3, r1 + str r7, [sp] + str r7, [sp, 0x4] + movs r1, 0x1 + str r1, [sp, 0x8] + ldr r1, =sub_8190938 + bl sub_80D2CC4 + ldr r1, [r6] + adds r1, r4 + strb r0, [r1] + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + ldrb r1, [r0, 0x5] + movs r3, 0xD + negs r3, r3 + adds r2, r3, 0 + ands r1, r2 + strb r1, [r0, 0x5] + movs r0, 0x1E + ldr r1, [sp, 0x34] + ands r0, r1 + cmp r0, 0 + beq _0819365E + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_0819365E: + ldr r2, [sp, 0x50] + ldr r0, [r2, 0x4] + cmp r0, 0 + beq _08193692 + ldr r0, [r6] + adds r0, r4 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r8 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + movs r2, 0x30 + orrs r0, r2 + strb r0, [r1, 0x5] + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + movs r1, 0x1 + strh r1, [r0, 0x34] +_08193692: + adds r4, 0x1 + movs r3, 0x2 + add r9, r3 + adds r5, 0x1 + cmp r5, 0x2 + bgt _081936A0 + b _08193564 +_081936A0: + add r0, sp, 0xC + movs r5, 0 + strb r5, [r0, 0x6] + adds r1, r0, 0 + movs r0, 0x2 + strb r0, [r1, 0x7] + adds r0, r1, 0 + ldrb r0, [r0, 0x6] + strb r0, [r1, 0x8] + adds r0, r1, 0 + ldrb r0, [r0, 0x7] + strb r0, [r1, 0x9] + adds r0, r1, 0 + strb r5, [r0, 0xA] + strb r5, [r0, 0xB] + adds r3, r0, 0 + ldrb r2, [r3, 0xC] + movs r1, 0x10 + negs r1, r1 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3, 0xC] + adds r2, r3, 0 + movs r0, 0xE0 + strb r0, [r2, 0xC] + ldrb r0, [r2, 0xD] + ands r1, r0 + strb r1, [r2, 0xD] + adds r1, r2, 0 + movs r0, 0xD0 + strb r0, [r1, 0xD] + ldr r4, =gStringVar4 + ldr r0, =gUnknown_0860D38C + ldr r7, [sp, 0x70] + adds r0, r7, r0 + ldr r1, [r0] + adds r0, r4, 0 + bl StringExpandPlaceholders + str r4, [sp, 0xC] + add r0, sp, 0xC + add r1, sp, 0x6C + ldrb r1, [r1] + strb r1, [r0, 0x4] + adds r1, r0, 0 + movs r0, 0x1 + strb r0, [r1, 0x5] + ldr r4, [sp, 0x6C] + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram + add r0, sp, 0xC + strb r5, [r0, 0x8] + adds r1, r0, 0 + strb r5, [r0, 0x7] + strb r5, [r1, 0x9] + movs r1, 0 + movs r2, 0 + bl AddTextPrinter + ldr r1, [sp, 0x24] + ldr r0, =0x000003ff + cmp r1, r0 + bne _0819375C + ldr r0, =gStringVar1 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + bl StringCopy + b _0819377E + .pool +_0819375C: + ldr r0, =0x000003fe + cmp r1, r0 + bne _08193774 + ldr r0, =gStringVar1 + bl sub_8195938 + b _0819377E + .pool +_08193774: + ldr r0, =gStringVar1 + lsls r1, 16 + lsrs r1, 16 + bl sub_8195898 +_0819377E: + add r0, sp, 0xC + movs r4, 0x2 + strb r4, [r0, 0x5] + strb r4, [r0, 0xA] + ldr r5, =gStringVar1 + str r5, [sp, 0xC] + add r2, sp, 0x64 + ldrb r2, [r2] + strb r2, [r0, 0x4] + ldrb r0, [r0, 0x5] + ldr r1, [sp, 0xC] + add r2, sp, 0xC + ldrb r3, [r2, 0xA] + movs r2, 0x40 + bl GetStringCenterAlignXOffsetWithLetterSpacing + add r1, sp, 0xC + strb r0, [r1, 0x8] + adds r0, r1, 0 + strb r4, [r0, 0x7] + strb r4, [r1, 0x9] + ldr r4, [sp, 0x64] + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram + add r0, sp, 0xC + movs r1, 0 + movs r2, 0 + bl AddTextPrinter + ldr r3, [sp, 0x4C] + ldr r1, [r3, 0x4] + ldr r0, =0x000003ff + cmp r1, r0 + bne _081937E4 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + adds r0, r5, 0 + bl StringCopy + b _08193802 + .pool +_081937E4: + ldr r0, =0x000003fe + cmp r1, r0 + bne _081937F8 + adds r0, r5, 0 + bl sub_8195938 + b _08193802 + .pool +_081937F8: + lsls r1, 16 + lsrs r1, 16 + adds r0, r5, 0 + bl sub_8195898 +_08193802: + ldr r0, =gStringVar1 + str r0, [sp, 0xC] + add r0, sp, 0xC + movs r6, 0 + add r7, sp, 0x68 + ldrb r7, [r7] + strb r7, [r0, 0x4] + ldrb r0, [r0, 0x5] + ldr r1, [sp, 0xC] + add r2, sp, 0xC + ldrb r3, [r2, 0xA] + movs r2, 0x40 + bl GetStringCenterAlignXOffsetWithLetterSpacing + add r1, sp, 0xC + strb r0, [r1, 0x8] + adds r0, r1, 0 + movs r5, 0x2 + strb r5, [r0, 0x7] + strb r5, [r1, 0x9] + ldr r4, [sp, 0x68] + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram + add r0, sp, 0xC + movs r1, 0 + movs r2, 0 + bl AddTextPrinter + add r0, sp, 0xC + strb r6, [r0, 0xA] + ldr r0, =gUnknown_0860D350 + ldr r1, [sp, 0x58] + adds r0, r1, r0 + ldr r0, [r0] + str r0, [sp, 0xC] + add r0, sp, 0xC + add r2, sp, 0x60 + ldrb r2, [r2] + strb r2, [r0, 0x4] + ldrb r0, [r0, 0x5] + ldr r1, [sp, 0xC] + add r2, sp, 0xC + ldrb r3, [r2, 0xA] + movs r2, 0xA0 + bl GetStringCenterAlignXOffsetWithLetterSpacing + add r1, sp, 0xC + strb r0, [r1, 0x8] + adds r0, r1, 0 + strb r5, [r0, 0x7] + strb r5, [r1, 0x9] + ldr r4, [sp, 0x60] + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram + add r0, sp, 0xC + movs r1, 0 + movs r2, 0 + bl AddTextPrinter + add sp, 0x80 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819314C + + thumb_func_start sub_81938A4 +sub_81938A4: @ 81938A4 + push {lr} + ldr r0, =sub_8194220 + movs r1, 0 + 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 r2, 0 + strh r2, [r1, 0x8] + strh r2, [r1, 0xA] + movs r0, 0x2 + strh r0, [r1, 0xC] + strh r2, [r1, 0x10] + ldr r0, =sub_8194B54 + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81938A4 + + thumb_func_start sub_81938E0 +sub_81938E0: @ 81938E0 + push {r4,lr} + bl sub_8194D48 + ldr r4, =gSaveBlock2Ptr + ldr r2, [r4] + ldr r1, =0x00000d0a + adds r0, r2, r1 + ldrb r1, [r0] + subs r1, 0x1 + ldr r0, =0x00000ca9 + adds r2, r0 + movs r0, 0x3 + ands r1, r0 + ldrb r3, [r2] + movs r0, 0x4 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldr r0, [r4] + ldr r1, =0x00000cb2 + adds r0, r1 + movs r4, 0 + movs r1, 0x3 + strh r1, [r0] + ldr r0, =sub_8194220 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + strh r4, [r1, 0xA] + movs r0, 0x2 + strh r0, [r1, 0xC] + movs r0, 0x1 + strh r0, [r1, 0x10] + ldr r0, =sub_8194B54 + bl SetMainCallback2 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81938E0 + + thumb_func_start sub_819395C +sub_819395C: @ 819395C + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r2, 0xA + ldrsh r7, [r0, r2] + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r2, r1, 0 + cmp r0, 0x7 + bls _0819397E + b _08193BC2 +_0819397E: + lsls r0, 2 + ldr r1, =_08193990 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08193990: + .4byte _081939B0 + .4byte _08193A00 + .4byte _08193A20 + .4byte _08193AA8 + .4byte _08193BC2 + .4byte _08193B20 + .4byte _08193BC2 + .4byte _08193B84 +_081939B0: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _081939C2 + b _08193BC2 +_081939C2: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0, 0x8] + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + movs r1, 0x1 + bl StartSpriteAnim + b _08193BC2 + .pool +_08193A00: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08193A0E + b _08193BC2 +_08193A0E: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r2 + movs r1, 0x2 + strh r1, [r0, 0x8] + b _08193BC2 + .pool +_08193A20: + adds r0, r5, 0 + bl sub_8193BDC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08193A30 + b _08193BC2 +_08193A30: + cmp r0, 0x1 + ble _08193A3C + cmp r0, 0x2 + beq _08193A60 + cmp r0, 0x3 + beq _08193A84 +_08193A3C: + 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, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x7 + strh r1, [r0, 0x8] + b _08193BC2 + .pool +_08193A60: + 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, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x3 + strh r1, [r0, 0x8] + b _08193BC2 + .pool +_08193A84: + 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, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x5 + strh r1, [r0, 0x8] + b _08193BC2 + .pool +_08193AA8: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + beq _08193ABA + b _08193BC2 +_08193ABA: + bl FreeAllWindowBuffers + bl remove_some_task + ldr r4, =gUnknown_0203CD7C + ldr r0, [r4] + bl Free + str r6, [r4] + ldr r0, =sub_8190400 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, =gTasks + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 3 + adds r1, r2 + movs r3, 0 + strh r6, [r1, 0x8] + ldr r0, =gUnknown_0860D080 + adds r0, r7, r0 + ldrb r0, [r0] + strh r0, [r1, 0xA] + movs r0, 0x1 + strh r0, [r1, 0xC] + strh r5, [r1, 0xE] + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r2 + movs r1, 0x4 + strh r1, [r0, 0x8] + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + strb r3, [r0, 0x10] + b _08193BC2 + .pool +_08193B20: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _08193BC2 + bl FreeAllWindowBuffers + bl remove_some_task + ldr r4, =gUnknown_0203CD7C + ldr r0, [r4] + bl Free + str r6, [r4] + ldr r0, =sub_8190400 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, =gTasks + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + adds r0, r2 + strh r6, [r0, 0x8] + adds r1, r7, 0 + subs r1, 0x10 + strh r1, [r0, 0xA] + movs r1, 0x2 + strh r1, [r0, 0xC] + strh r5, [r0, 0xE] + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r2 + movs r1, 0x6 + strh r1, [r0, 0x8] + b _08193BC2 + .pool +_08193B84: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _08193BC2 + bl FreeAllWindowBuffers + bl remove_some_task + ldr r4, =gUnknown_0203CD7C + ldr r0, [r4] + bl Free + str r6, [r4] + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl SetMainCallback2 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldrb r0, [r0, 0x16] + bl DestroyTask + adds r0, r5, 0 + bl DestroyTask +_08193BC2: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819395C + + thumb_func_start sub_8193BDC +sub_8193BDC: @ 8193BDC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r7, r0, 24 + movs r0, 0x1 + mov r9, r0 + movs r1, 0x4 + mov r8, r1 + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + movs r1, 0xA + ldrsh r5, [r0, r1] + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r6, [r0] + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + adds r2, r1, 0 + adds r3, r0, 0 + cmp r2, 0x2 + beq _08193C20 + mov r0, r9 + ands r0, r1 + cmp r0, 0 + beq _08193C58 + cmp r5, 0x1F + bne _08193C3C +_08193C20: + movs r0, 0x5 + bl PlaySE + movs r0, 0 + mov r9, r0 + b _08193CDE + .pool +_08193C3C: + cmp r5, 0xF + bgt _08193C4C + movs r0, 0x5 + bl PlaySE + movs r1, 0x2 + mov r9, r1 + b _08193CDE +_08193C4C: + movs r0, 0x5 + bl PlaySE + movs r0, 0x3 + mov r9, r0 + b _08193CDE +_08193C58: + cmp r2, 0x40 + bne _08193C78 + ldr r0, =gUnknown_0860CBF1 + lsls r1, r5, 2 + adds r1, r5 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0xFF + beq _08193C78 + movs r1, 0 + mov r8, r1 + b _08193CDE + .pool +_08193C78: + ldrh r0, [r3, 0x2E] + cmp r0, 0x80 + bne _08193C9C + ldr r0, =gUnknown_0860CBF1 + lsls r1, r5, 2 + adds r1, r5 + adds r1, r6 + lsls r1, 2 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0xFF + beq _08193C9C + movs r0, 0x1 + b _08193CDC + .pool +_08193C9C: + ldrh r0, [r3, 0x2E] + cmp r0, 0x20 + bne _08193CC0 + ldr r0, =gUnknown_0860CBF1 + lsls r1, r5, 2 + adds r1, r5 + adds r1, r6 + lsls r1, 2 + adds r0, 0x2 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0xFF + beq _08193CC0 + movs r1, 0x2 + mov r8, r1 + b _08193CDE + .pool +_08193CC0: + ldrh r0, [r3, 0x2E] + cmp r0, 0x10 + bne _08193CDE + ldr r0, =gUnknown_0860CBF1 + lsls r1, r5, 2 + adds r1, r5 + adds r1, r6 + lsls r1, 2 + adds r0, 0x3 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0xFF + beq _08193CDE + movs r0, 0x3 +_08193CDC: + mov r8, r0 +_08193CDE: + mov r1, r8 + cmp r1, 0x4 + beq _08193D26 + movs r0, 0x5 + bl PlaySE + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + ldr r4, =gSprites + adds r0, r4 + movs r1, 0 + bl StartSpriteAnim + ldr r2, =gUnknown_0860CBF1 + lsls r1, r6, 2 + add r1, r8 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 2 + adds r1, r0 + adds r1, r2 + ldrb r5, [r1] + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + bl StartSpriteAnim + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0xA] +_08193D26: + mov r0, r9 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8193BDC + + thumb_func_start sub_8193D40 +sub_8193D40: @ 8193D40 + push {lr} + ldr r0, =sub_8194220 + movs r1, 0 + 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 r2, 0 + strh r2, [r1, 0x8] + movs r0, 0x1 + strh r0, [r1, 0xA] + movs r0, 0x2 + strh r0, [r1, 0xC] + strh r2, [r1, 0x10] + ldr r0, =sub_8194B54 + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8193D40 + + thumb_func_start sub_8193D7C +sub_8193D7C: @ 8193D7C + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r7, =gSpecialVar_0x8005 + ldrh r0, [r7] + cmp r0, 0x1 + bne _08193E10 + ldr r5, =gTrainerBattleOpponent_A + ldrh r0, [r5] + bl sub_8195358 + ldr r4, =gSaveBlock2Ptr + ldr r2, [r4] + lsls r0, 2 + adds r2, r0 + ldr r6, =0x00000d25 + adds r2, r6 + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldrh r0, [r5] + bl sub_8195358 + ldr r1, [r4] + lsls r0, 2 + adds r0, r1, r0 + ldr r2, =0x00000cb2 + mov r8, r2 + add r1, r8 + adds r0, r6 + movs r3, 0x3 + ldrb r2, [r1] + ands r2, r3 + lsls r2, 3 + ldrb r3, [r0] + movs r1, 0x19 + negs r1, r1 + ands r1, r3 + orrs r1, r2 + strb r1, [r0] + ldrh r0, [r5] + bl sub_8195358 + ldr r2, [r4] + lsls r0, 1 + movs r3, 0xEC + lsls r3, 4 + adds r1, r2, r3 + adds r1, r0 + ldr r0, =gBattleResults + ldrh r0, [r0, 0x22] + strh r0, [r1] + add r2, r8 + ldrh r0, [r2] + cmp r0, 0x2 + bhi _08193EAE + lsls r0, 24 + lsrs r0, 24 + bl sub_8195438 + b _08193EAE + .pool +_08193E10: + ldr r5, =0x000003ff + adds r0, r5, 0 + bl sub_8195358 + ldr r4, =gSaveBlock2Ptr + ldr r2, [r4] + lsls r0, 2 + adds r2, r0 + ldr r6, =0x00000d25 + adds r2, r6 + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + adds r0, r5, 0 + bl sub_8195358 + ldr r1, [r4] + lsls r0, 2 + adds r0, r1, r0 + ldr r2, =0x00000cb2 + adds r1, r2 + adds r0, r6 + movs r3, 0x3 + ldrb r2, [r1] + ands r2, r3 + lsls r2, 3 + ldrb r3, [r0] + movs r1, 0x19 + negs r1, r1 + ands r1, r3 + orrs r1, r2 + strb r1, [r0] + adds r0, r5, 0 + bl sub_8195358 + ldr r1, [r4] + lsls r0, 1 + movs r3, 0xEC + lsls r3, 4 + adds r1, r3 + adds r1, r0 + ldr r0, =gBattleResults + ldrh r0, [r0, 0x24] + strh r0, [r1] + ldr r0, =gBattleOutcome + ldrb r0, [r0] + cmp r0, 0x9 + beq _08193E78 + ldrh r0, [r7] + cmp r0, 0x9 + bne _08193E92 +_08193E78: + adds r0, r5, 0 + bl sub_8195358 + ldr r2, [r4] + lsls r0, 2 + adds r2, r0 + adds r2, r6 + ldrb r1, [r2] + movs r0, 0x1F + ands r0, r1 + movs r1, 0x20 + orrs r0, r1 + strb r0, [r2] +_08193E92: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r4, [r0] + cmp r4, 0x3 + bgt _08193EAE +_08193EA0: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8195438 + adds r4, 0x1 + cmp r4, 0x3 + ble _08193EA0 +_08193EAE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8193D7C + + thumb_func_start sub_8193ED0 +sub_8193ED0: @ 8193ED0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x84 + str r0, [sp, 0x48] + str r1, [sp, 0x4C] + lsls r4, r2, 24 + lsrs r4, 24 + movs r0, 0 + str r0, [sp, 0x54] + movs r1, 0 + str r1, [sp, 0x58] + bl sub_8165C40 + movs r2, 0 + str r2, [sp, 0x50] + add r3, sp, 0x30 + mov r10, r3 + ldr r5, [sp, 0x4C] + lsls r5, 1 + str r5, [sp, 0x70] + subs r4, 0x1 + str r4, [sp, 0x78] +_08193F02: + movs r0, 0 + mov r9, r0 + ldr r1, [sp, 0x50] + lsls r1, 2 + str r1, [sp, 0x74] + ldr r2, [sp, 0x48] + lsls r2, 2 + str r2, [sp, 0x6C] + ldr r3, [sp, 0x50] + adds r3, 0x1 + str r3, [sp, 0x60] +_08193F18: + ldr r4, [sp, 0x74] + add r4, r9 + lsls r0, r4, 2 + mov r5, sp + adds r1, r5, r0 + movs r0, 0 + str r0, [r1] + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r1, [sp, 0x6C] + adds r0, r3, r1 + ldr r2, =0x00000d24 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 22 + ldr r1, =0xff800000 + cmp r0, r1 + bne _08193F60 + ldr r3, [sp, 0x50] + lsls r0, r3, 24 + mov r5, r9 + lsls r1, r5, 24 + lsrs r1, 24 + lsrs r0, 24 + bl sub_81A5060 + lsls r1, r4, 1 + add r1, r10 + strh r0, [r1] + b _08193F8C + .pool +_08193F60: + lsls r2, r4, 1 + add r2, r10 + ldr r1, [sp, 0x48] + lsls r0, r1, 1 + adds r0, r1 + ldr r4, [sp, 0x50] + adds r0, r4 + lsls r0, 1 + ldr r5, =0x00000d64 + adds r1, r3, r5 + adds r1, r0 + ldrh r0, [r1] + ldr r1, =gUnknown_0203BC8C + ldr r1, [r1] + lsls r0, 4 + adds r0, r1 + mov r3, r9 + lsls r1, r3, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] +_08193F8C: + ldr r0, =gBattleMoves + ldr r1, [sp, 0x74] + add r1, r9 + lsls r1, 1 + add r1, r10 + ldrh r2, [r1] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r6, [r1, 0x1] + cmp r6, 0 + bne _08193FB8 + movs r6, 0x28 + b _08193FD0 + .pool +_08193FB8: + cmp r6, 0x1 + bne _08193FC0 + movs r6, 0x3C + b _08193FD0 +_08193FC0: + adds r1, r2, 0 + cmp r1, 0x78 + beq _08193FCA + cmp r1, 0x99 + bne _08193FD0 +_08193FCA: + lsrs r0, r6, 31 + adds r0, r6, r0 + asrs r6, r0, 1 +_08193FD0: + movs r1, 0 + mov r4, r9 + adds r4, 0x1 + str r4, [sp, 0x64] + ldr r5, [sp, 0x70] + ldr r2, [sp, 0x4C] + adds r0, r5, r2 + lsls r0, 1 + str r0, [sp, 0x5C] +_08193FE2: + lsls r7, r1, 1 + adds r1, 0x1 + str r1, [sp, 0x68] + ldr r3, [sp, 0x5C] + adds r3, r7 + mov r8, r3 +_08193FEE: + bl Random + adds r4, r0, 0 + bl Random + lsls r4, 16 + lsrs r5, r4, 16 + lsls r0, 16 + orrs r5, r0 + ldr r2, =gSaveBlock2Ptr + ldr r0, [r2] + ldr r4, =0x00000d64 + adds r0, r4 + add r0, r8 + ldrh r4, [r0] + ldr r3, =gUnknown_0203BC8C + ldr r0, [r3] + lsls r4, 4 + adds r4, r0 + adds r0, r5, 0 + str r2, [sp, 0x7C] + str r3, [sp, 0x80] + bl GetNatureFromPersonality + ldrb r1, [r4, 0xC] + lsls r0, 24 + lsrs r0, 24 + ldr r2, [sp, 0x7C] + ldr r3, [sp, 0x80] + cmp r1, r0 + bne _08193FEE + ldr r0, [r2] + ldr r2, [sp, 0x5C] + adds r1, r7, r2 + ldr r4, =0x00000d64 + adds r0, r4 + adds r0, r1 + ldrh r0, [r0] + ldr r1, [r3] + lsls r0, 4 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x1 + ands r5, r0 + cmp r5, 0 + beq _08194068 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r5, =gBaseStats + adds r0, r5 + ldrb r2, [r0, 0x17] + b _08194074 + .pool +_08194068: + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r2, =gBaseStats + adds r0, r2 + ldrb r2, [r0, 0x16] +_08194074: + ldr r4, [sp, 0x74] + add r4, r9 + lsls r0, r4, 1 + add r0, r10 + ldrh r0, [r0] + bl ai_rate_move + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x6 + ands r0, r5 + cmp r0, 0x6 + bne _0819409C + lsls r0, r4, 2 + mov r3, sp + adds r1, r3, r0 + b _081940D8 + .pool +_0819409C: + movs r0, 0x29 + ands r0, r5 + cmp r0, 0 + bne _081940DE + movs r0, 0x2 + ands r0, r5 + cmp r0, 0 + beq _081940B6 + lsls r0, r4, 2 + mov r5, sp + adds r2, r5, r0 + lsls r1, r6, 1 + b _081940CA +_081940B6: + movs r0, 0x4 + ands r5, r0 + cmp r5, 0 + beq _081940D2 + lsls r0, r4, 2 + mov r1, sp + adds r2, r1, r0 + lsrs r1, r6, 31 + adds r1, r6, r1 + asrs r1, 1 +_081940CA: + ldr r0, [r2] + adds r0, r1 + str r0, [r2] + b _081940DE +_081940D2: + lsls r0, r4, 2 + mov r2, sp + adds r1, r2, r0 +_081940D8: + ldr r0, [r1] + adds r0, r6 + str r0, [r1] +_081940DE: + ldr r1, [sp, 0x68] + cmp r1, 0x2 + bgt _081940E6 + b _08193FE2 +_081940E6: + ldr r2, [sp, 0x74] + add r2, r9 + lsls r0, r2, 2 + add r0, sp + ldr r1, [r0] + ldr r3, [sp, 0x54] + cmp r3, r1 + bge _08194104 + lsls r0, r2, 16 + lsrs r0, 16 + str r0, [sp, 0x58] + lsls r0, r1, 16 + lsrs r0, 16 + str r0, [sp, 0x54] + b _08194122 +_08194104: + ldr r4, [sp, 0x54] + cmp r4, r1 + bne _08194122 + ldr r5, [sp, 0x58] + lsls r0, r5, 1 + add r0, r10 + lsls r1, r2, 1 + add r1, r10 + ldrh r0, [r0] + ldrh r1, [r1] + cmp r0, r1 + bcs _08194122 + lsls r0, r2, 16 + lsrs r0, 16 + str r0, [sp, 0x58] +_08194122: + ldr r0, [sp, 0x64] + mov r9, r0 + cmp r0, 0x3 + bgt _0819412C + b _08193F18 +_0819412C: + ldr r1, [sp, 0x60] + str r1, [sp, 0x50] + cmp r1, 0x2 + bgt _08194136 + b _08193F02 +_08194136: + ldr r2, [sp, 0x58] + mov r9, r2 + b _08194182 +_0819413C: + movs r3, 0 + mov r9, r3 + movs r1, 0 + mov r4, r10 + mov r3, r10 + mov r2, sp +_08194148: + ldr r0, [r2] + ldr r5, [sp, 0x54] + cmp r5, r0 + bge _0819415A + mov r9, r1 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x54] + b _08194170 +_0819415A: + ldr r5, [sp, 0x54] + cmp r5, r0 + bne _08194170 + mov r5, r9 + lsls r0, r5, 1 + adds r0, r4, r0 + ldrh r0, [r0] + ldrh r5, [r3] + cmp r0, r5 + bcs _08194170 + mov r9, r1 +_08194170: + adds r3, 0x2 + adds r2, 0x4 + adds r1, 0x1 + cmp r1, 0xB + ble _08194148 + ldr r0, [sp, 0x50] + ldr r1, [sp, 0x78] + cmp r0, r1 + beq _081941F4 +_08194182: + movs r2, 0 + str r2, [sp, 0x50] + mov r3, r9 + lsls r7, r3, 2 + ldr r4, [sp, 0x78] + cmp r2, r4 + bge _081941CA + lsls r0, r3, 1 + mov r5, r10 + adds r6, r5, r0 + ldr r0, [sp, 0x48] + lsls r5, r0, 24 +_0819419A: + ldr r0, =gSaveBlock2Ptr + ldr r4, [r0] + ldr r2, [sp, 0x50] + lsls r1, r2, 24 + lsrs r1, 24 + lsrs r0, r5, 24 + bl sub_81953E8 + lsls r0, 24 + lsrs r0, 23 + movs r3, 0xEC + lsls r3, 4 + adds r4, r3 + adds r4, r0 + ldrh r0, [r4] + ldrh r4, [r6] + cmp r0, r4 + beq _081941CA + ldr r0, [sp, 0x50] + adds r0, 0x1 + str r0, [sp, 0x50] + ldr r1, [sp, 0x78] + cmp r0, r1 + blt _0819419A +_081941CA: + ldr r2, [sp, 0x50] + ldr r3, [sp, 0x78] + cmp r2, r3 + beq _081941F4 + mov r4, sp + adds r1, r4, r7 + movs r0, 0 + str r0, [r1] + movs r5, 0 + str r5, [sp, 0x54] + mov r9, r5 + mov r2, sp + movs r1, 0xB +_081941E4: + ldm r2!, {r0} + add r9, r0 + subs r1, 0x1 + cmp r1, 0 + bge _081941E4 + mov r0, r9 + cmp r0, 0 + bne _0819413C +_081941F4: + mov r1, r9 + lsls r0, r1, 2 + add r0, sp + ldr r0, [r0] + cmp r0, 0 + bne _08194204 + ldr r2, [sp, 0x58] + mov r9, r2 +_08194204: + mov r3, r9 + lsls r0, r3, 1 + add r0, r10 + ldrh r0, [r0] + add sp, 0x84 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8193ED0 + + thumb_func_start sub_8194220 +sub_8194220: @ 8194220 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r1, =gTasks + lsls r0, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r2, 0xA + ldrsh r1, [r0, r2] + mov r10, r1 + movs r3, 0xC + ldrsh r4, [r0, r3] + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r0, 0x5 + bls _08194250 + b _081948C2 +_08194250: + lsls r0, 2 + ldr r1, =_08194264 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08194264: + .4byte _0819427C + .4byte _0819431C + .4byte _0819438C + .4byte _0819447C + .4byte _081944FC + .4byte _081947C8 +_0819427C: + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + bl SetVBlankCallback + movs r0, 0x3 + bl EnableInterrupts + movs r4, 0 + str r4, [sp, 0x14] + add r0, sp, 0x14 + movs r1, 0xC0 + lsls r1, 19 + ldr r2, =0x05006000 + bl CpuSet + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_0860CE74 + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + ldr r0, =gUnknown_0860CE94 + bl InitWindows + bl DeactivateAllTextPrinters + ldr r0, =gUnknown_02022E14 + strh r4, [r0] + ldr r0, =gUnknown_02022E16 + strh r4, [r0] + ldr r0, =gUnknown_02022E18 + strh r4, [r0] + ldr r0, =gUnknown_02022E1A + strh r4, [r0] + 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 r1, 0xB0 + lsls r1, 4 + movs r0, 0x3 + movs r2, 0 + bl ChangeBgY + ldr r1, =gTasks + mov r2, r8 + lsls r0, r2, 2 + b _0819443C + .pool +_0819431C: + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + movs r0, 0x4C + movs r1, 0 + bl SetGpuReg + ldr r1, =0x00005860 + movs r0, 0x40 + bl SetGpuReg + movs r0, 0x44 + movs r1, 0x9F + bl SetGpuReg + ldr r1, =0x00009098 + movs r0, 0x42 + bl SetGpuReg + movs r0, 0x46 + movs r1, 0x9F + bl SetGpuReg + movs r0, 0x48 + movs r1, 0 + bl SetGpuReg + movs r0, 0x4A + movs r1, 0x3F + bl SetGpuReg + bl ResetPaletteFade + bl ResetSpriteData + bl FreeAllSpritePalettes + ldr r1, =gTasks + mov r3, r8 + lsls r0, r3, 2 + b _0819443C + .pool +_0819438C: + ldr r4, =gUnknown_0203CD7C + movs r0, 0x80 + lsls r0, 4 + bl AllocZeroed + adds r1, r0, 0 + str r1, [r4] + ldr r0, =gUnknown_08D83900 + bl LZDecompressWram + ldr r1, [r4] + movs r0, 0x1 + bl SetBgTilemapBuffer + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + ldr r1, =gUnknown_08D82F10 + movs r5, 0x80 + lsls r5, 6 + movs r6, 0 + str r6, [sp] + movs r0, 0x1 + adds r2, r5, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, =gUnknown_08D834FC + str r6, [sp] + movs r0, 0x2 + adds r2, r5, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, =gUnknown_08D83B2C + movs r4, 0x1 + str r4, [sp] + movs r0, 0x2 + adds r2, r5, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, =gUnknown_08D83C3C + str r4, [sp] + movs r0, 0x3 + adds r2, r5, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r0, =gUnknown_08D85358 + movs r4, 0x80 + lsls r4, 2 + movs r1, 0 + adds r2, r4, 0 + bl LoadCompressedPalette + ldr r0, =gUnknown_08D85444 + movs r1, 0x80 + lsls r1, 1 + adds r2, r4, 0 + bl LoadCompressedPalette + ldr r0, =gUnknown_08D85600 + movs r1, 0xF0 + movs r2, 0x20 + bl LoadCompressedPalette + str r6, [sp, 0x18] + add r0, sp, 0x18 + ldr r1, =gPlttBufferFaded + ldr r2, =0x05000100 + bl CpuSet + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + ldr r1, =gTasks + mov r4, r8 + lsls r0, r4, 2 +_0819443C: + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + b _081948C2 + .pool +_0819447C: + ldr r0, =gUnknown_0860CF50 + bl LoadCompressedObjectPic + mov r0, r8 + lsls r0, 2 + str r0, [sp, 0x1C] + mov r1, r10 + cmp r1, 0 + bne _081944E8 + movs r5, 0 + ldr r4, =gUnknown_0860D411 +_08194492: + ldrb r1, [r4] + ldrb r2, [r4, 0x1] + ldr r0, =gUnknown_0860CFA8 + movs r3, 0 + bl CreateSprite + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x1E + bls _08194492 + ldr r0, =gTasks + ldr r1, [sp, 0x1C] + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r2, 0x10 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _081944DC + ldr r0, =gUnknown_0860D008 + movs r1, 0xDA + movs r2, 0xC + movs r3, 0 + bl CreateSprite + b _081944E8 + .pool +_081944DC: + ldr r0, =gUnknown_0860CFD8 + movs r1, 0xDA + movs r2, 0xC + movs r3, 0 + bl CreateSprite +_081944E8: + ldr r1, =0x00007f40 + movs r0, 0 + bl SetGpuReg + b _081947A6 + .pool +_081944FC: + add r0, sp, 0x4 + movs r2, 0 + movs r1, 0x2 + strb r1, [r0, 0x5] + ldr r0, =gUnknown_085CCCEE + str r0, [sp, 0x4] + add r0, sp, 0x4 + strb r1, [r0, 0x4] + strb r2, [r0, 0x6] + strb r2, [r0, 0x7] + strb r1, [r0, 0xA] + strb r2, [r0, 0xB] + ldrb r0, [r0, 0x5] + ldr r1, [sp, 0x4] + add r2, sp, 0x4 + ldrb r3, [r2, 0xA] + movs r2, 0x70 + bl GetStringCenterAlignXOffsetWithLetterSpacing + add r1, sp, 0x4 + strb r0, [r1, 0x8] + movs r0, 0x1 + strb r0, [r1, 0x9] + adds r3, r1, 0 + ldrb r2, [r3, 0xC] + movs r1, 0x10 + negs r1, r1 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3, 0xC] + adds r2, r3, 0 + movs r0, 0xE0 + strb r0, [r2, 0xC] + ldrb r0, [r2, 0xD] + ands r1, r0 + strb r1, [r2, 0xD] + adds r1, r2, 0 + movs r0, 0xD0 + strb r0, [r1, 0xD] + adds r0, r1, 0 + movs r1, 0 + movs r2, 0 + bl AddTextPrinter + mov r3, r8 + lsls r3, 2 + str r3, [sp, 0x1C] + add r4, sp, 0x4 + movs r0, 0xF + mov r9, r0 + movs r1, 0 + str r1, [sp, 0x20] + movs r2, 0 + str r2, [sp, 0x24] + movs r7, 0 + movs r5, 0xF +_0819456C: + ldr r3, =gSaveBlock2Ptr + ldr r0, [r3] + adds r0, r7 + ldr r1, =0x00000d24 + adds r0, r1 + ldrh r1, [r0] + lsls r1, 22 + lsrs r1, 22 + ldr r0, =gDisplayedStringBattle + bl sub_8195898 + mov r2, r10 + cmp r2, 0x1 + bne _081945C4 + ldr r3, =gSaveBlock2Ptr + ldr r2, [r3] + adds r0, r2, r7 + ldr r1, =0x00000d25 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 29 + cmp r0, 0 + blt _081945DC + ldr r3, =0x00000cb2 + adds r0, r2, r3 + ldrh r1, [r0] + cmp r1, 0x1 + beq _08194634 + ldr r2, [sp, 0x24] + lsrs r0, r2, 24 + subs r1, 0x2 + b _081945EA + .pool +_081945C4: + mov r3, r10 + cmp r3, 0 + bne _08194634 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + adds r0, r2, r7 + ldr r1, =0x00000d25 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 29 + cmp r0, 0 + bge _081945FC +_081945DC: + lsls r1, 27 + lsrs r0, r1, 30 + cmp r0, 0 + beq _08194634 + subs r1, r0, 0x1 + ldr r2, [sp, 0x24] + lsrs r0, r2, 24 +_081945EA: + lsls r1, 24 + lsrs r1, 24 + bl sub_81948EC + b _08194634 + .pool +_081945FC: + ldr r3, =0x00000cb2 + adds r1, r2, r3 + ldrh r0, [r1] + cmp r0, 0 + beq _08194634 + ldr r0, [sp, 0x1C] + add r0, r8 + lsls r0, 3 + ldr r2, =gTasks + adds r0, r2 + movs r3, 0x10 + ldrsh r0, [r0, r3] + cmp r0, 0 + beq _08194624 + ldrh r1, [r1] + b _08194628 + .pool +_08194624: + ldrh r0, [r1] + subs r1, r0, 0x1 +_08194628: + ldr r2, [sp, 0x24] + lsrs r0, r2, 24 + lsls r1, 24 + lsrs r1, 24 + bl sub_81948EC +_08194634: + ldr r0, [sp, 0x1C] + add r0, r8 + lsls r0, 3 + ldr r3, =gTasks + adds r0, r3 + movs r1, 0x10 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08194660 + ldr r2, =gSaveBlock2Ptr + ldr r0, [r2] + ldr r3, =0x00000cb2 + adds r0, r3 + ldrh r3, [r0] + adds r6, r2, 0 + b _0819466E + .pool +_08194660: + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r2, =0x00000cb2 + adds r0, r2 + ldrh r0, [r0] + subs r3, r0, 0x1 + adds r6, r1, 0 +_0819466E: + mov r0, r10 + cmp r0, 0x1 + bne _0819468E + ldr r2, [r6] + adds r0, r2, r7 + ldr r1, =0x00000d25 + adds r0, r1 + ldrb r1, [r0] + lsls r1, 27 + lsrs r1, 30 + ldr r0, =0x00000cb2 + adds r2, r0 + ldrh r0, [r2] + subs r0, 0x1 + cmp r1, r0 + blt _081946A6 +_0819468E: + mov r1, r10 + cmp r1, 0 + bne _081946FA + ldr r0, [r6] + adds r0, r7 + ldr r2, =0x00000d25 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 27 + lsrs r0, 30 + cmp r0, r3 + bgt _081946FA +_081946A6: + ldr r0, [r6] + adds r1, r0, r7 + ldr r3, =0x00000d25 + adds r0, r1, r3 + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + bge _081946FA + ldr r2, =0x00000d24 + adds r0, r1, r2 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + ldr r3, =0x000003ff + cmp r0, r3 + bne _081946F0 + ldrb r1, [r4, 0xC] + mov r0, r9 + ands r0, r1 + movs r1, 0x30 + orrs r0, r1 + strb r0, [r4, 0xC] + ldrb r1, [r4, 0xD] + mov r0, r9 + ands r0, r1 + movs r1, 0x40 + b _08194740 + .pool +_081946F0: + ldrb r1, [r4, 0xC] + mov r0, r9 + ands r0, r1 + movs r1, 0xB0 + b _08194734 +_081946FA: + ldr r0, [r6] + adds r0, r7 + ldr r1, =0x00000d24 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + ldr r2, =0x000003ff + cmp r0, r2 + bne _0819472C + ldrb r1, [r4, 0xC] + mov r0, r9 + ands r0, r1 + movs r1, 0x30 + orrs r0, r1 + strb r0, [r4, 0xC] + ldrb r1, [r4, 0xD] + mov r0, r9 + ands r0, r1 + movs r1, 0x40 + b _08194740 + .pool +_0819472C: + ldrb r1, [r4, 0xC] + mov r0, r9 + ands r0, r1 + movs r1, 0xE0 +_08194734: + orrs r0, r1 + strb r0, [r4, 0xC] + ldrb r1, [r4, 0xD] + mov r0, r9 + ands r0, r1 + movs r1, 0xD0 +_08194740: + orrs r0, r1 + strb r0, [r4, 0xD] + ldr r0, =gUnknown_0860D3F1 + ldr r3, [sp, 0x20] + adds r0, r3, r0 + ldrb r0, [r0] + cmp r0, 0 + bne _08194768 + ldrb r0, [r4, 0x5] + ldrb r3, [r4, 0xA] + ldr r1, =gDisplayedStringBattle + movs r2, 0x3D + bl GetStringWidthDifference + b _0819476A + .pool +_08194768: + movs r0, 0x3 +_0819476A: + strb r0, [r4, 0x8] + ldr r0, =gDisplayedStringBattle + str r0, [sp, 0x4] + ldr r0, =gUnknown_0860D3F1 + ldr r1, [sp, 0x20] + adds r0, r1, r0 + ldrb r0, [r0] + strb r0, [r4, 0x4] + ldr r2, =gUnknown_0860D3F2 + adds r0, r1, r2 + ldrb r0, [r0] + strb r0, [r4, 0x9] + add r0, sp, 0x4 + movs r1, 0 + movs r2, 0 + bl AddTextPrinter + ldr r3, [sp, 0x20] + adds r3, 0x2 + str r3, [sp, 0x20] + ldr r0, [sp, 0x24] + movs r1, 0x80 + lsls r1, 17 + adds r0, r1 + str r0, [sp, 0x24] + adds r7, 0x4 + subs r5, 0x1 + cmp r5, 0 + blt _081947A6 + b _0819456C +_081947A6: + ldr r0, =gTasks + ldr r1, [sp, 0x1C] + add r1, r8 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _081948C2 + .pool +_081947C8: + movs r0, 0 + bl PutWindowTilemap + movs r0, 0x1 + bl PutWindowTilemap + movs r0, 0x2 + bl PutWindowTilemap + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + movs r0, 0x1 + movs r1, 0x3 + bl CopyWindowToVram + movs r0, 0x2 + movs r1, 0x3 + bl CopyWindowToVram + ldr r0, =sub_8194BEC + bl SetHBlankCallback + ldr r0, =sub_8194CE4 + bl SetVBlankCallback + cmp r4, 0x2 + bne _0819485C + mov r2, r10 + cmp r2, 0 + bne _08194844 + ldr r0, =sub_819395C + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r2 + mov r3, r10 + strh r3, [r1, 0x8] + strh r3, [r1, 0xA] + mov r4, r8 + lsls r0, r4, 2 + add r0, r8 + lsls r0, 3 + adds r0, r2 + ldrh r0, [r0, 0x10] + strh r0, [r1, 0x14] + b _08194878 + .pool +_08194844: + ldr r0, =sub_8194950 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =gTasks + b _0819486C + .pool +_0819485C: + ldr r1, =gTasks + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r3, 0xE + ldrsh r5, [r0, r3] +_0819486C: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x8] +_08194878: + bl dp12_8087EA4 + ldr r0, =gUnknown_02038C28 + ldr r2, =0x00001f0a + movs r4, 0xF0 + lsls r4, 3 + adds r1, r0, r4 + movs r5, 0x5A +_08194888: + strh r2, [r0] + strh r2, [r1] + adds r1, 0x2 + adds r0, 0x2 + subs r5, 0x1 + cmp r5, 0 + bge _08194888 + movs r5, 0x5B + ldr r3, =gUnknown_0860CF44 + ldr r0, =gUnknown_02038C28 + ldr r2, =0x00001f09 + ldr r4, =0x00000836 + adds r1, r0, r4 + adds r0, 0xB6 +_081948A4: + strh r2, [r0] + strh r2, [r1] + adds r1, 0x2 + adds r0, 0x2 + adds r5, 0x1 + cmp r5, 0x9F + ble _081948A4 + ldr r0, [r3] + ldr r1, [r3, 0x4] + ldr r2, [r3, 0x8] + bl sub_80BA038 + mov r0, r8 + bl DestroyTask +_081948C2: + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8194220 + + thumb_func_start sub_81948EC +sub_81948EC: @ 81948EC + push {r4-r7,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r4, =gUnknown_0860DD10 + lsls r2, r1, 2 + lsls r3, r0, 4 + adds r2, r3 + adds r2, r4 + ldr r3, [r2] + ldr r2, =gUnknown_0860DE10 + lsls r0, 2 + adds r1, r0 + adds r1, r2 + ldrb r0, [r1] + cmp r0, 0 + beq _08194938 + movs r7, 0x1 + adds r4, r3, 0 + adds r5, r4, 0x2 + adds r6, r0, 0 +_0819491A: + ldrb r2, [r4] + ldrb r3, [r4, 0x1] + str r7, [sp] + str r7, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + adds r1, r5, 0 + bl CopyToBgTilemapBufferRect_ChangePalette + adds r4, 0x4 + adds r5, 0x4 + subs r6, 0x1 + cmp r6, 0 + bne _0819491A +_08194938: + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81948EC + + thumb_func_start sub_8194950 +sub_8194950: @ 8194950 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r2, r1, 0 + cmp r0, 0x4 + bls _08194974 + b _08194B3C +_08194974: + lsls r0, 2 + ldr r1, =_08194988 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08194988: + .4byte _0819499C + .4byte _081949C0 + .4byte _08194AD4 + .4byte _08194AEE + .4byte _08194B24 +_0819499C: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0, 0x8] + b _08194B3C + .pool +_081949C0: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081949CE + b _08194B3C +_081949CE: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r2 + movs r2, 0 + movs r3, 0x2 + movs r1, 0x2 + strh r1, [r0, 0x8] + movs r1, 0x40 + strh r1, [r0, 0xE] + add r0, sp, 0x4 + strb r3, [r0, 0x5] + strb r2, [r0, 0x6] + strb r2, [r0, 0x7] + strb r3, [r0, 0xA] + strb r2, [r0, 0xB] + adds r3, r0, 0 + ldrb r2, [r3, 0xC] + subs r1, 0x50 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3, 0xC] + adds r2, r3, 0 + movs r0, 0xB0 + strb r0, [r2, 0xC] + ldrb r0, [r2, 0xD] + ands r1, r0 + strb r1, [r2, 0xD] + adds r1, r2, 0 + movs r0, 0xD0 + strb r0, [r1, 0xD] + movs r7, 0 + ldr r0, =gDisplayedStringBattle + mov r9, r0 + ldr r1, =gSaveBlock2Ptr + mov r8, r1 + adds r4, r2, 0 + ldr r6, =gUnknown_0860D3F1 + movs r5, 0 +_08194A1C: + mov r2, r8 + ldr r0, [r2] + adds r0, r5 + ldr r1, =0x00000d24 + adds r0, r1 + ldrh r1, [r0] + lsls r1, 22 + lsrs r1, 22 + mov r0, r9 + bl sub_8195898 + mov r0, r8 + ldr r2, [r0] + adds r0, r2, r5 + ldr r1, =0x00000d25 + adds r0, r1 + ldrb r3, [r0] + lsls r1, r3, 27 + lsrs r1, 30 + ldr r0, =0x00000cb2 + adds r2, r0 + ldrh r0, [r2] + subs r0, 0x1 + cmp r1, r0 + bne _08194A9E + lsls r0, r3, 29 + cmp r0, 0 + bge _08194A9E + ldrb r0, [r6] + cmp r0, 0 + bne _08194A84 + ldrb r0, [r4, 0x5] + ldrb r3, [r4, 0xA] + mov r1, r9 + movs r2, 0x3D + bl GetStringWidthDifference + b _08194A86 + .pool +_08194A84: + movs r0, 0x3 +_08194A86: + strb r0, [r4, 0x8] + mov r1, r9 + str r1, [sp, 0x4] + ldrb r0, [r6] + strb r0, [r4, 0x4] + ldrb r0, [r6, 0x1] + strb r0, [r4, 0x9] + add r0, sp, 0x4 + movs r1, 0 + movs r2, 0 + bl AddTextPrinter +_08194A9E: + mov r2, r8 + ldr r1, [r2] + adds r0, r1, r5 + ldr r2, =0x00000d25 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _08194AC4 + subs r2, 0x73 + adds r0, r1, r2 + ldrh r1, [r0] + subs r1, 0x1 + lsls r0, r7, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + bl sub_81948EC +_08194AC4: + adds r6, 0x2 + adds r5, 0x4 + adds r7, 0x1 + cmp r7, 0xF + ble _08194A1C + b _08194B3C + .pool +_08194AD4: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r2 + ldrh r0, [r1, 0xE] + subs r0, 0x1 + strh r0, [r1, 0xE] + lsls r0, 16 + cmp r0, 0 + bne _08194B3C + movs r0, 0x3 + strh r0, [r1, 0x8] + b _08194B3C +_08194AEE: + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _08194B3C + 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 + movs r1, 0x4 + strh r1, [r0, 0x8] + b _08194B3C + .pool +_08194B24: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08194B3C + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl SetMainCallback2 + adds r0, r4, 0 + bl DestroyTask +_08194B3C: + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8194950 + + thumb_func_start sub_8194B54 +sub_8194B54: @ 8194B54 + push {lr} + bl AnimateSprites + bl BuildOamBuffer + bl RunTextPrinters + bl UpdatePaletteFade + bl RunTasks + pop {r0} + bx r0 + thumb_func_end sub_8194B54 + + thumb_func_start sub_8194B70 +sub_8194B70: @ 8194B70 + push {lr} + movs r0, 0x3 + movs r1, 0x80 + movs r2, 0x1 + bl ChangeBgX + movs r0, 0x3 + movs r1, 0x80 + movs r2, 0x2 + bl ChangeBgY + ldr r0, =gUnknown_02022E14 + ldrh r1, [r0] + movs r0, 0x10 + bl SetGpuReg + ldr r0, =gUnknown_02022E16 + ldrh r1, [r0] + movs r0, 0x12 + bl SetGpuReg + ldr r0, =gUnknown_02022E18 + ldrh r1, [r0] + movs r0, 0x14 + bl SetGpuReg + ldr r0, =gUnknown_02022E1A + ldrh r1, [r0] + movs r0, 0x16 + bl SetGpuReg + ldr r0, =gUnknown_02022E1C + ldrh r1, [r0] + movs r0, 0x18 + bl SetGpuReg + ldr r0, =gUnknown_02022E1E + ldrh r1, [r0] + movs r0, 0x1A + bl SetGpuReg + bl LoadOam + bl ProcessSpriteCopyRequests + bl TransferPlttBuffer + pop {r0} + bx r0 + .pool + thumb_func_end sub_8194B70 + + thumb_func_start sub_8194BEC +sub_8194BEC: @ 8194BEC + push {lr} + ldr r0, =0x04000006 + ldrh r0, [r0] + adds r1, r0, 0 + cmp r0, 0x29 + bls _08194CC8 + cmp r0, 0x31 + bhi _08194C1C + ldr r1, =0x04000048 + ldr r2, =0x00003b3b + adds r0, r2, 0 + strh r0, [r1] + subs r1, 0x8 + ldr r0, =0x989b5558 + b _08194CD4 + .pool +_08194C1C: + cmp r0, 0x39 + bls _08194CC8 + cmp r0, 0x4A + bhi _08194C40 + ldr r1, =0x04000048 + ldr r2, =0x00003b3b + adds r0, r2, 0 + strh r0, [r1] + subs r1, 0x8 + ldr r0, =0x90985860 + b _08194CD4 + .pool +_08194C40: + cmp r0, 0x51 + bhi _08194C60 + ldr r1, =0x04000048 + ldr r2, =0x00003b3b + adds r0, r2, 0 + strh r0, [r1] + subs r1, 0x8 + ldr r0, =0x989b5558 + b _08194CD4 + .pool +_08194C60: + cmp r0, 0x5E + bls _08194CC8 + cmp r0, 0x66 + bhi _08194C84 + ldr r1, =0x04000048 + ldr r2, =0x00003737 + adds r0, r2, 0 + strh r0, [r1] + subs r1, 0x8 + ldr r0, =0x989b5558 + b _08194CD4 + .pool +_08194C84: + cmp r0, 0x76 + bhi _08194CA4 + ldr r1, =0x04000048 + ldr r2, =0x00003737 + adds r0, r2, 0 + strh r0, [r1] + subs r1, 0x8 + ldr r0, =0x90985860 + b _08194CD4 + .pool +_08194CA4: + cmp r0, 0x7E + bls _08194CC8 + cmp r1, 0x86 + bhi _08194CC8 + ldr r1, =0x04000048 + ldr r2, =0x00003737 + adds r0, r2, 0 + strh r0, [r1] + subs r1, 0x8 + ldr r0, =0x989b5558 + b _08194CD4 + .pool +_08194CC8: + ldr r1, =0x04000048 + ldr r2, =0x00003f3f + adds r0, r2, 0 + strh r0, [r1] + subs r1, 0x8 + movs r0, 0 +_08194CD4: + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8194BEC + + thumb_func_start sub_8194CE4 +sub_8194CE4: @ 8194CE4 + push {lr} + ldr r0, =gUnknown_02022E14 + ldrh r1, [r0] + movs r0, 0x10 + bl SetGpuReg + ldr r0, =gUnknown_02022E16 + ldrh r1, [r0] + movs r0, 0x12 + bl SetGpuReg + ldr r0, =gUnknown_02022E18 + ldrh r1, [r0] + movs r0, 0x14 + bl SetGpuReg + ldr r0, =gUnknown_02022E1A + ldrh r1, [r0] + movs r0, 0x16 + bl SetGpuReg + movs r0, 0x2 + movs r1, 0x80 + movs r2, 0x2 + bl ChangeBgY + movs r0, 0x3 + movs r1, 0x80 + movs r2, 0x1 + bl ChangeBgY + bl LoadOam + bl ProcessSpriteCopyRequests + bl TransferPlttBuffer + bl sub_80BA0A8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8194CE4 + + thumb_func_start sub_8194D48 +sub_8194D48: @ 8194D48 + ldr r1, =gUnknown_0203BC8C + ldr r0, =gBattleFrontierMons + str r0, [r1] + ldr r1, =gUnknown_0203BC88 + ldr r0, =gBattleFrontierTrainers + str r0, [r1] + bx lr + .pool + thumb_func_end sub_8194D48 + + thumb_func_start sub_8194D68 +sub_8194D68: @ 8194D68 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + movs r3, 0 +_08194D76: + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r0, =gUnknown_0203CEF8 + adds r0, r3, r0 + ldrb r0, [r0] + subs r0, 0x1 + lsls r0, 1 + ldr r2, =0x00000caa + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + subs r0, 0x1 + mov r10, r0 + movs r6, 0 + adds r0, r3, 0x1 + str r0, [sp] + movs r1, 0x64 + mov r0, r10 + muls r0, r1 + movs r2, 0x8E + lsls r2, 2 + adds r2, r0 + mov r9, r2 + adds r7, r3, 0 + muls r7, r1 +_08194DA8: + movs r5, 0 + adds r0, r6, 0x1 + mov r8, r0 + b _08194DBE + .pool +_08194DBC: + adds r5, 0x1 +_08194DBE: + cmp r5, 0x3 + bgt _08194DEA + ldr r1, =gSaveBlock1Ptr + ldr r0, [r1] + add r0, r9 + adds r1, r5, 0 + adds r1, 0xD + movs r2, 0 + str r3, [sp, 0x4] + bl GetMonData + adds r4, r0, 0 + adds r1, r6, 0 + adds r1, 0xD + ldr r2, =gPlayerParty + adds r0, r7, r2 + movs r2, 0 + bl GetMonData + ldr r3, [sp, 0x4] + cmp r4, r0 + bne _08194DBC +_08194DEA: + cmp r5, 0x4 + bne _08194E00 + lsls r2, r6, 24 + lsrs r2, 24 + ldr r1, =gPlayerParty + adds r0, r7, r1 + movs r1, 0xA6 + str r3, [sp, 0x4] + bl SetMonMoveSlot + ldr r3, [sp, 0x4] +_08194E00: + mov r6, r8 + cmp r6, 0x3 + ble _08194DA8 + ldr r2, =gSaveBlock1Ptr + ldr r0, [r2] + movs r2, 0x64 + mov r1, r10 + muls r1, r2 + adds r0, r1 + movs r1, 0x8E + lsls r1, 2 + adds r0, r1 + adds r1, r3, 0 + muls r1, r2 + ldr r2, =gPlayerParty + adds r1, r2 + movs r2, 0x64 + bl memcpy + ldr r3, [sp] + cmp r3, 0x1 + ble _08194D76 + 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_8194D68 + + thumb_func_start sub_8194E44 +sub_8194E44: @ 8194E44 + push {r4-r7,lr} + sub sp, 0x4 + movs r4, 0 + ldr r7, =gSaveBlock1Ptr + movs r6, 0x64 + movs r5, 0 +_08194E50: + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r0, =gUnknown_0203CEF8 + adds r0, r4, r0 + ldrb r0, [r0] + subs r0, 0x1 + lsls r0, 1 + ldr r2, =0x00000caa + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + subs r0, 0x1 + adds r1, r0, 0 + muls r1, r6 + movs r0, 0x8E + lsls r0, 2 + adds r1, r0 + ldr r0, [r7] + adds r0, r1 + movs r1, 0xC + movs r2, 0 + bl GetMonData + mov r1, sp + strh r0, [r1] + ldr r0, =gPlayerParty + adds r0, r5, r0 + movs r1, 0xC + mov r2, sp + bl SetMonData + adds r5, 0x64 + adds r4, 0x1 + cmp r4, 0x1 + ble _08194E50 + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8194E44 + + thumb_func_start sub_8194EB4 +sub_8194EB4: @ 8194EB4 + push {lr} + bl sub_80F94E8 + pop {r0} + bx r0 + thumb_func_end sub_8194EB4 + + thumb_func_start sub_8194EC0 +sub_8194EC0: @ 8194EC0 + push {r4,lr} + ldr r0, =gTrainerBattleOpponent_A + ldrh r0, [r0] + bl sub_8195358 + adds r4, r0, 0 + ldr r0, =0x000003ff + bl sub_8195358 + cmp r4, r0 + ble _08194EE8 + ldr r1, =gScriptResult + movs r0, 0x1 + b _08194EEC + .pool +_08194EE8: + ldr r1, =gScriptResult + movs r0, 0x2 +_08194EEC: + strh r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8194EC0 + + thumb_func_start sub_8194EF8 +sub_8194EF8: @ 8194EF8 + push {r4,lr} + bl sub_8194D48 + movs r2, 0 + ldr r3, =gSaveBlock2Ptr + ldr r0, [r3] + ldr r1, =0x00000d25 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + bge _08194F2A + adds r4, r3, 0 + adds r3, r1, 0 +_08194F14: + adds r2, 0x1 + cmp r2, 0xF + bgt _08194F2A + ldr r0, [r4] + lsls r1, r2, 2 + adds r0, r1 + adds r0, r3 + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _08194F14 +_08194F2A: + ldr r0, =gStringVar1 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + lsls r2, 2 + adds r1, r2 + ldr r2, =0x00000d24 + adds r1, r2 + ldrh r1, [r1] + lsls r1, 22 + lsrs r1, 22 + bl sub_8195898 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8194EF8 + + thumb_func_start sub_8194F58 +sub_8194F58: @ 8194F58 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x40 + movs r0, 0 + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r0, [sp, 0x10] + ldr r4, =gSaveBlock2Ptr + ldr r2, [r4] + ldr r5, =0x00000d0a + adds r0, r2, r5 + ldrb r1, [r0] + ldr r6, =0x00000d0b + adds r0, r2, r6 + ldrb r0, [r0] + cmn r1, r0 + beq _08194F8C + ldr r1, =0x00000ca8 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08194F8C + b _0819533E +_08194F8C: + movs r0, 0x20 + bl AllocZeroed + str r0, [sp, 0x18] + movs r0, 0x18 + bl AllocZeroed + str r0, [sp, 0x1C] + ldr r1, [r4] + ldr r2, =0x00000ca9 + adds r1, r2 + ldrb r2, [r1] + lsls r0, r2, 30 + lsrs r0, 30 + str r0, [sp, 0x14] + movs r0, 0x4 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r0, [r4] + movs r1, 0x1 + adds r0, r5 + strb r1, [r0] + ldr r0, [r4] + adds r0, r6 + strb r1, [r0] + movs r3, 0 + mov r10, r3 + movs r4, 0 + str r4, [sp, 0x38] + movs r5, 0 + str r5, [sp, 0x3C] +_08194FCC: + mov r0, r10 + cmp r0, 0x4 + bgt _08194FFC + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + lsrs r4, r0, 16 + b _08195030 + .pool +_08194FFC: + mov r1, r10 + cmp r1, 0xE + bgt _0819501A + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x14 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + adds r4, r0, 0 + adds r4, 0xA + b _08195030 +_0819501A: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + adds r4, r0, 0 + adds r4, 0x1E +_08195030: + movs r6, 0 + cmp r6, r10 + bge _08195064 + ldr r2, =gSaveBlock2Ptr + ldr r0, [r2] + ldr r3, =0x00000d24 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r4 + beq _08195064 + adds r3, r2, 0 + ldr r2, =0x00000d24 +_0819504C: + adds r6, 0x1 + cmp r6, r10 + bge _08195064 + ldr r0, [r3] + lsls r1, r6, 2 + adds r0, r1 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r4 + bne _0819504C +_08195064: + cmp r6, r10 + bne _08194FCC + ldr r5, =gSaveBlock2Ptr + ldr r3, [r5] + ldr r0, [sp, 0x38] + adds r3, r0 + ldr r1, =0x00000d24 + adds r3, r1 + ldr r2, =0x000003ff + adds r0, r2, 0 + adds r2, r4, 0 + ands r2, r0 + ldrh r0, [r3] + ldr r5, =0xfffffc00 + adds r1, r5, 0 + ands r0, r1 + orrs r0, r2 + strh r0, [r3] + movs r6, 0 + lsls r4, 16 + str r4, [sp, 0x30] + ldr r0, [sp, 0x3C] + str r0, [sp, 0x20] +_08195092: + adds r1, r6, 0x1 + str r1, [sp, 0x24] + lsls r2, r6, 2 + str r2, [sp, 0x2C] + lsls r3, r6, 1 + str r3, [sp, 0x28] +_0819509E: + ldr r4, [sp, 0x30] + lsrs r0, r4, 16 + bl sub_8163524 + lsls r0, 16 + lsrs r5, r0, 16 + movs r7, 0 + cmp r7, r6 + bge _081950F4 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =gUnknown_0203BC8C + mov r9, r1 + ldr r2, [sp, 0x8] + mov r8, r2 + ldr r3, [sp, 0xC] + mov r12, r3 + ldr r4, =0x00000d64 + adds r0, r4 + ldr r1, [sp, 0x20] + adds r4, r1, r0 +_081950C8: + ldrh r3, [r4] + cmp r3, r5 + beq _081950F4 + mov r2, r9 + ldr r1, [r2] + lsls r0, r5, 4 + adds r2, r0, r1 + ldrh r0, [r2] + cmp r8, r0 + beq _081950F4 + cmp r12, r0 + beq _081950F4 + lsls r0, r3, 4 + adds r0, r1 + ldrb r0, [r0, 0xA] + ldrb r2, [r2, 0xA] + cmp r0, r2 + beq _081950F4 + adds r4, 0x2 + adds r7, 0x1 + cmp r7, r6 + blt _081950C8 +_081950F4: + cmp r7, r6 + bne _0819509E + ldr r3, =gSaveBlock2Ptr + ldr r0, [r3] + ldr r4, [sp, 0x28] + ldr r2, [sp, 0x3C] + adds r1, r4, r2 + ldr r3, =0x00000d64 + adds r0, r3 + adds r0, r1 + strh r5, [r0] + ldr r2, [sp, 0x2C] + add r2, sp + adds r2, 0x8 + ldr r3, =gUnknown_0203BC8C + ldr r1, [r3] + lsls r0, r5, 4 + adds r0, r1 + ldrh r0, [r0] + str r0, [r2] + ldr r6, [sp, 0x24] + cmp r6, 0x2 + ble _08195092 + ldr r4, =gSaveBlock2Ptr + ldr r2, [r4] + ldr r5, [sp, 0x38] + adds r2, r5 + ldr r0, =0x00000d25 + adds r2, r0 + ldrb r0, [r2] + movs r4, 0x5 + negs r4, r4 + adds r1, r4, 0 + ands r0, r1 + strb r0, [r2] + ldr r5, =gSaveBlock2Ptr + ldr r2, [r5] + ldr r0, [sp, 0x38] + adds r2, r0 + ldr r1, =0x00000d25 + adds r2, r1 + ldrb r0, [r2] + subs r4, 0x14 + adds r1, r4, 0 + ands r0, r1 + strb r0, [r2] + ldr r1, [r5] + ldr r5, [sp, 0x38] + adds r1, r5 + ldr r0, =0x00000d25 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x1F + ands r0, r2 + strb r0, [r1] + adds r5, 0x4 + str r5, [sp, 0x38] + ldr r1, [sp, 0x3C] + adds r1, 0x6 + str r1, [sp, 0x3C] + movs r2, 0x1 + add r10, r2 + mov r4, r10 + cmp r4, 0xF + bgt _08195178 + b _08194FCC +_08195178: + movs r5, 0 + mov r10, r5 + ldr r5, [sp, 0x18] + movs r0, 0 + str r0, [sp, 0x34] +_08195182: + movs r7, 0 + strh r7, [r5] + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + mov r2, r10 + lsls r1, r2, 2 + adds r0, r1 + ldr r3, =0x00000d24 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + bl sub_8190168 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r6, 0 + ldr r4, [sp, 0x34] + mov r9, r4 +_081951AA: + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + mov r4, r9 + add r4, r10 + adds r4, r6 + lsls r4, 1 + ldr r2, =0x00000d64 + adds r0, r2 + adds r0, r4 + ldrh r1, [r0] + ldr r3, =gUnknown_0203BC8C + ldr r0, [r3] + lsls r1, 4 + adds r1, r0 + ldrh r0, [r1] + ldrb r3, [r1, 0xB] + ldrb r1, [r1, 0xC] + str r1, [sp] + ldr r1, [sp, 0x1C] + str r1, [sp, 0x4] + movs r1, 0x32 + mov r2, r8 + bl sub_818F720 + ldr r2, [sp, 0x1C] + ldr r1, [r2, 0x4] + ldrh r0, [r5] + adds r0, r1 + ldr r1, [r2, 0x8] + adds r0, r1 + ldr r1, [r2, 0x10] + adds r0, r1 + ldr r1, [r2, 0x14] + adds r0, r1 + ldr r1, [r2, 0xC] + adds r0, r1 + ldr r1, [r2] + adds r0, r1 + strh r0, [r5] + ldr r3, =gSaveBlock2Ptr + ldr r0, [r3] + ldr r1, =0x00000d64 + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + ldr r2, =gUnknown_0203BC8C + ldr r1, [r2] + lsls r0, 4 + adds r0, r1 + ldrh r0, [r0] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r3, =gBaseStats + adds r1, r3 + ldrb r0, [r1, 0x6] + lsls r0, 2 + ldr r4, =gBitTable + adds r0, r4 + ldr r0, [r0] + orrs r7, r0 + ldrb r0, [r1, 0x7] + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + orrs r7, r0 + adds r6, 0x1 + cmp r6, 0x2 + ble _081951AA + movs r4, 0 + movs r1, 0x1 + movs r6, 0x1F +_0819523A: + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _08195244 + adds r4, 0x1 +_08195244: + asrs r7, 1 + subs r6, 0x1 + cmp r6, 0 + bge _0819523A + movs r1, 0x32 + adds r0, r4, 0 + muls r0, r1 + movs r1, 0x14 + bl __divsi3 + ldrh r1, [r5] + adds r1, r0 + strh r1, [r5] + adds r5, 0x2 + ldr r2, [sp, 0x34] + adds r2, 0x2 + str r2, [sp, 0x34] + movs r3, 0x1 + add r10, r3 + mov r4, r10 + cmp r4, 0xF + ble _08195182 + movs r5, 0 + mov r10, r5 + ldr r7, [sp, 0x18] +_08195276: + mov r6, r10 + adds r6, 0x1 + cmp r6, 0xF + bgt _081952F8 + mov r8, r7 + ldr r5, =0x00000d24 + lsls r0, r6, 1 + ldr r1, [sp, 0x18] + adds r4, r0, r1 +_08195288: + mov r2, r8 + ldrh r1, [r2] + ldrh r0, [r4] + cmp r1, r0 + bcs _081952C4 + mov r0, r10 + adds r1, r6, 0 + ldr r2, [sp, 0x18] + bl sub_818F904 + b _081952F0 + .pool +_081952C4: + cmp r1, r0 + bne _081952F0 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + mov r3, r10 + lsls r0, r3, 2 + adds r0, r1, r0 + adds r0, r5 + ldrh r2, [r0] + lsls r2, 22 + lsls r0, r6, 2 + adds r1, r0 + adds r1, r5 + ldrh r0, [r1] + lsls r0, 22 + cmp r2, r0 + bls _081952F0 + mov r0, r10 + adds r1, r6, 0 + ldr r2, [sp, 0x18] + bl sub_818F904 +_081952F0: + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0xF + ble _08195288 +_081952F8: + adds r7, 0x2 + movs r4, 0x1 + add r10, r4 + mov r5, r10 + cmp r5, 0xE + ble _08195276 + ldr r0, [sp, 0x18] + bl Free + ldr r0, [sp, 0x1C] + bl Free + movs r0, 0 + mov r10, r0 +_08195314: + mov r1, r10 + lsls r0, r1, 24 + lsrs r0, 24 + bl sub_8195438 + movs r2, 0x1 + add r10, r2 + mov r3, r10 + cmp r3, 0x3 + ble _08195314 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r4, =0x00000ca9 + adds r1, r4 + ldrb r2, [r1] + movs r0, 0x4 + negs r0, r0 + ands r0, r2 + ldr r5, [sp, 0x14] + orrs r0, r5 + strb r0, [r1] +_0819533E: + add sp, 0x40 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8194F58 + + thumb_func_start sub_8195358 +sub_8195358: @ 8195358 + push {r4,r5,lr} + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000d24 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r3 + beq _0819538E + adds r5, r4, 0 + adds r4, r1, 0 +_08195376: + adds r2, 0x1 + cmp r2, 0xF + bgt _0819538E + ldr r0, [r5] + lsls r1, r2, 2 + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r3 + bne _08195376 +_0819538E: + adds r0, r2, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8195358 + + thumb_func_start sub_81953A0 +sub_81953A0: @ 81953A0 + push {r4,r5,lr} + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000d24 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r3 + beq _081953D6 + adds r5, r4, 0 + adds r4, r1, 0 +_081953BE: + adds r2, 0x1 + cmp r2, 0xF + bgt _081953D6 + ldr r0, [r5] + lsls r1, r2, 2 + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r3 + bne _081953BE +_081953D6: + adds r0, r2, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81953A0 + + thumb_func_start sub_81953E8 +sub_81953E8: @ 81953E8 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gUnknown_0860D1A0 + ldr r0, =gUnknown_0860D1C0 + adds r0, r4, r0 + ldrb r0, [r0] + lsrs r0, 1 + lsls r0, 2 + adds r1, r0 + adds r1, r2 + ldrb r0, [r1] + subs r0, 0x10 + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + bl sub_8192F08 + mov r0, sp + ldrb r0, [r0] + cmp r4, r0 + beq _0819542C + mov r0, sp + ldrb r0, [r0] + b _08195430 + .pool +_0819542C: + mov r0, sp + ldrb r0, [r0, 0x1] +_08195430: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81953E8 + + thumb_func_start sub_8195438 +sub_8195438: @ 8195438 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x40 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0xC] + movs r1, 0 + str r1, [sp, 0x10] + movs r5, 0 + movs r1, 0x3 + ldr r0, [sp] + ands r0, r1 + lsls r0, 3 + str r0, [sp, 0x14] +_0819545E: + ldr r2, =gSaveBlock2Ptr + ldr r0, [r2] + lsls r4, r5, 2 + adds r1, r0, r4 + ldr r3, =0x00000d25 + adds r0, r1, r3 + ldrb r0, [r0] + lsls r0, 29 + adds r2, r5, 0x1 + str r2, [sp, 0x24] + cmp r0, 0 + bge _08195478 + b _08195876 +_08195478: + subs r3, 0x1 + adds r0, r1, r3 + ldrh r0, [r0] + lsls r1, r0, 22 + ldr r0, =0xffc00000 + cmp r1, r0 + bne _08195488 + b _08195876 +_08195488: + str r5, [sp, 0x4] + lsrs r1, 22 + ldr r0, [sp] + bl sub_81901A0 + str r0, [sp, 0x8] + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + adds r0, r3, r4 + ldr r1, =0x00000d24 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 22 + ldr r1, =0xff800000 + cmp r0, r1 + bne _08195504 + ldr r2, [sp, 0x8] + cmp r2, 0xFF + beq _08195504 + lsls r2, 2 + adds r1, r3, r2 + ldr r3, =0x00000d25 + adds r1, r3 + ldrb r0, [r1] + movs r3, 0x4 + orrs r0, r3 + strb r0, [r1] + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + adds r1, r2 + ldr r2, =0x00000d25 + adds r1, r2 + ldrb r0, [r1] + subs r3, 0x1D + ands r0, r3 + ldr r2, [sp, 0x14] + orrs r0, r2 + strb r0, [r1] + adds r0, r5, 0 + ldr r1, [sp, 0x8] + ldr r2, [sp] + bl sub_8193ED0 + ldr r3, =gSaveBlock2Ptr + ldr r1, [r3] + ldr r5, [sp, 0x8] + lsls r2, r5, 1 + movs r3, 0xEC + lsls r3, 4 + adds r1, r3 + adds r1, r2 + b _08195874 + .pool +_08195504: + ldr r4, =gSaveBlock2Ptr + ldr r3, [r4] + ldr r0, [sp, 0x8] + lsls r2, r0, 2 + adds r0, r3, r2 + ldr r1, =0x00000d24 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 22 + ldr r1, =0xff800000 + str r2, [sp, 0x30] + cmp r0, r1 + bne _0819557C + ldr r2, [sp, 0x4] + cmp r2, 0xFF + beq _0819557C + lsls r2, 2 + adds r1, r3, r2 + ldr r3, =0x00000d25 + adds r1, r3 + ldrb r0, [r1] + movs r3, 0x4 + orrs r0, r3 + strb r0, [r1] + ldr r1, [r4] + adds r1, r2 + ldr r0, =0x00000d25 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x19 + negs r2, r2 + ands r0, r2 + ldr r3, [sp, 0x14] + orrs r0, r3 + strb r0, [r1] + ldr r0, [sp, 0x8] + ldr r1, [sp, 0x4] + ldr r2, [sp] + bl sub_8193ED0 + ldr r1, [r4] + ldr r3, [sp, 0x4] + lsls r2, r3, 1 + movs r3, 0xEC + lsls r3, 4 + adds r1, r3 + adds r1, r2 + strh r0, [r1] + adds r5, 0x1 + str r5, [sp, 0x24] + b _08195876 + .pool +_0819557C: + adds r5, 0x1 + str r5, [sp, 0x24] + ldr r5, [sp, 0x8] + cmp r5, 0xFF + bne _08195588 + b _08195876 +_08195588: + movs r0, 0 + mov r10, r0 + lsls r1, r5, 1 + str r1, [sp, 0x2C] + ldr r2, [sp, 0x4] + lsls r2, 1 + str r2, [sp, 0x28] + ldr r3, [sp, 0x4] + adds r0, r2, r3 + lsls r0, 1 + mov r9, r0 + adds r0, r1, r5 + lsls r0, 1 + str r0, [sp, 0x18] +_081955A4: + movs r5, 0 + mov r0, r9 + str r0, [sp, 0x38] +_081955AA: + movs r6, 0 + lsls r7, r5, 1 + ldr r4, [sp, 0x18] +_081955B0: + ldr r2, =gSaveBlock2Ptr + ldr r1, [r2] + ldr r3, =0x00000d64 + adds r1, r3 + ldr r2, [sp, 0x38] + adds r0, r1, r2 + ldrh r0, [r0] + ldr r3, =gUnknown_0203BC8C + mov r8, r3 + ldr r2, [r3] + lsls r0, 4 + adds r0, r2 + adds r0, 0x2 + adds r0, r7 + ldrh r0, [r0] + adds r1, r4 + ldrh r1, [r1] + lsls r1, 4 + adds r1, r2 + ldrh r1, [r1] + movs r2, 0x2 + bl sub_818FFC0 + ldr r1, [sp, 0xC] + adds r1, r0 + str r1, [sp, 0xC] + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x2 + ble _081955B0 + adds r5, 0x1 + cmp r5, 0x3 + ble _081955AA + ldr r2, =gSaveBlock2Ptr + ldr r0, [r2] + ldr r3, =0x00000d64 + adds r0, r3 + add r0, r9 + ldrh r0, [r0] + mov r5, r8 + ldr r1, [r5] + lsls r0, 4 + adds r0, r1 + ldrh r2, [r0] + ldr r0, =gBaseStats + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + ldrb r2, [r1, 0x1] + adds r0, r2 + ldrb r2, [r1, 0x2] + adds r0, r2 + ldrb r2, [r1, 0x3] + adds r0, r2 + ldrb r3, [r1, 0x4] + adds r0, r3 + ldrb r1, [r1, 0x5] + adds r0, r1 + movs r1, 0xA + bl __divsi3 + ldr r5, [sp, 0xC] + adds r5, r0 + str r5, [sp, 0xC] + movs r0, 0x2 + add r9, r0 + movs r1, 0x1 + add r10, r1 + mov r2, r10 + cmp r2, 0x2 + ble _081955A4 + bl Random + movs r1, 0x1F + ands r1, r0 + adds r5, r1 + ldr r3, [sp, 0x4] + adds r5, r3 + str r5, [sp, 0xC] + movs r5, 0 + mov r10, r5 + ldr r1, [sp, 0x2C] + ldr r2, [sp, 0x8] + adds r0, r1, r2 + lsls r0, 1 + str r0, [sp, 0x1C] + ldr r5, [sp, 0x28] + adds r0, r5, r3 + lsls r0, 1 + str r0, [sp, 0x20] +_08195668: + movs r5, 0 + mov r0, r10 + lsls r3, r0, 1 + movs r1, 0x1 + add r10, r1 + ldr r2, [sp, 0x1C] + adds r2, r3 + mov r8, r2 +_08195678: + movs r6, 0 + lsls r7, r5, 1 + adds r5, 0x1 + str r5, [sp, 0x3C] + ldr r4, [sp, 0x20] +_08195682: + ldr r5, =gSaveBlock2Ptr + ldr r1, [r5] + ldr r0, =0x00000d64 + adds r1, r0 + mov r2, r8 + adds r0, r1, r2 + ldrh r0, [r0] + ldr r5, =gUnknown_0203BC8C + mov r9, r5 + ldr r2, [r5] + lsls r0, 4 + adds r0, r2 + adds r0, 0x2 + adds r0, r7 + ldrh r0, [r0] + adds r1, r4 + ldrh r1, [r1] + lsls r1, 4 + adds r1, r2 + ldrh r1, [r1] + movs r2, 0x2 + str r3, [sp, 0x34] + bl sub_818FFC0 + ldr r1, [sp, 0x10] + adds r1, r0 + str r1, [sp, 0x10] + adds r4, 0x2 + adds r6, 0x1 + ldr r3, [sp, 0x34] + cmp r6, 0x2 + ble _08195682 + ldr r5, [sp, 0x3C] + cmp r5, 0x3 + ble _08195678 + ldr r2, =gSaveBlock2Ptr + ldr r0, [r2] + ldr r5, [sp, 0x1C] + adds r1, r3, r5 + ldr r2, =0x00000d64 + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + mov r3, r9 + ldr r1, [r3] + lsls r0, 4 + adds r0, r1 + ldrh r2, [r0] + ldr r0, =gBaseStats + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + ldrb r2, [r1, 0x1] + adds r0, r2 + ldrb r5, [r1, 0x2] + adds r0, r5 + ldrb r2, [r1, 0x3] + adds r0, r2 + ldrb r2, [r1, 0x4] + adds r0, r2 + ldrb r1, [r1, 0x5] + adds r0, r1 + movs r1, 0xA + bl __divsi3 + ldr r3, [sp, 0x10] + adds r3, r0 + str r3, [sp, 0x10] + mov r5, r10 + cmp r5, 0x2 + ble _08195668 + bl Random + movs r1, 0x1F + ands r1, r0 + ldr r0, [sp, 0x10] + adds r0, r1 + ldr r1, [sp, 0x8] + adds r0, r1 + str r0, [sp, 0x10] + ldr r2, [sp, 0xC] + cmp r2, r0 + ble _08195784 + ldr r3, =gSaveBlock2Ptr + ldr r1, [r3] + ldr r5, [sp, 0x30] + adds r1, r5 + ldr r0, =0x00000d25 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + ldr r1, [r3] + adds r1, r5 + ldr r3, =0x00000d25 + adds r1, r3 + ldrb r0, [r1] + movs r5, 0x19 + negs r5, r5 + ands r0, r5 + ldr r2, [sp, 0x14] + orrs r0, r2 + strb r0, [r1] + ldr r0, [sp, 0x4] + ldr r1, [sp, 0x8] + ldr r2, [sp] + bl sub_8193ED0 + ldr r3, =gSaveBlock2Ptr + ldr r1, [r3] + movs r5, 0xEC + lsls r5, 4 + adds r1, r5 + ldr r2, [sp, 0x2C] + adds r1, r2 + b _08195874 + .pool +_08195784: + ldr r3, [sp, 0xC] + ldr r5, [sp, 0x10] + cmp r3, r5 + bge _081957DC + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r3, [sp, 0x4] + lsls r2, r3, 2 + adds r1, r2 + ldr r5, =0x00000d25 + adds r1, r5 + ldrb r0, [r1] + movs r3, 0x4 + orrs r0, r3 + strb r0, [r1] + ldr r5, =gSaveBlock2Ptr + ldr r1, [r5] + adds r1, r2 + ldr r0, =0x00000d25 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x19 + negs r2, r2 + ands r0, r2 + ldr r3, [sp, 0x14] + orrs r0, r3 + strb r0, [r1] + ldr r0, [sp, 0x8] + ldr r1, [sp, 0x4] + ldr r2, [sp] + bl sub_8193ED0 + ldr r1, [r5] + movs r5, 0xEC + lsls r5, 4 + adds r1, r5 + ldr r2, [sp, 0x28] + adds r1, r2 + b _08195874 + .pool +_081957DC: + ldr r3, [sp, 0x4] + ldr r5, [sp, 0x8] + cmp r3, r5 + ble _08195830 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r2, [sp, 0x30] + adds r1, r2 + ldr r3, =0x00000d25 + adds r1, r3 + ldrb r0, [r1] + movs r5, 0x4 + orrs r0, r5 + strb r0, [r1] + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + adds r1, r2 + adds r1, r3 + ldrb r0, [r1] + movs r2, 0x19 + negs r2, r2 + ands r0, r2 + ldr r3, [sp, 0x14] + orrs r0, r3 + strb r0, [r1] + ldr r0, [sp, 0x4] + ldr r1, [sp, 0x8] + ldr r2, [sp] + bl sub_8193ED0 + ldr r5, =gSaveBlock2Ptr + ldr r1, [r5] + movs r2, 0xEC + lsls r2, 4 + adds r1, r2 + ldr r3, [sp, 0x2C] + b _08195872 + .pool +_08195830: + ldr r5, =gSaveBlock2Ptr + ldr r1, [r5] + ldr r0, [sp, 0x4] + lsls r2, r0, 2 + adds r1, r2 + ldr r3, =0x00000d25 + adds r1, r3 + ldrb r0, [r1] + movs r5, 0x4 + orrs r0, r5 + strb r0, [r1] + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + adds r1, r2 + adds r1, r3 + ldrb r0, [r1] + movs r2, 0x19 + negs r2, r2 + ands r0, r2 + ldr r3, [sp, 0x14] + orrs r0, r3 + strb r0, [r1] + ldr r0, [sp, 0x8] + ldr r1, [sp, 0x4] + ldr r2, [sp] + bl sub_8193ED0 + ldr r5, =gSaveBlock2Ptr + ldr r1, [r5] + movs r2, 0xEC + lsls r2, 4 + adds r1, r2 + ldr r3, [sp, 0x28] +_08195872: + adds r1, r3 +_08195874: + strh r0, [r1] +_08195876: + ldr r5, [sp, 0x24] + cmp r5, 0xF + bgt _0819587E + b _0819545E +_0819587E: + add sp, 0x40 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195438 + + thumb_func_start sub_8195898 +sub_8195898: @ 8195898 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r1, 16 + lsrs r5, r1, 16 + movs r4, 0 + bl sub_8165C40 + ldr r0, =0x000003fe + cmp r5, r0 + bne _081958B8 + adds r0, r6, 0 + bl sub_8195938 + b _08195902 + .pool +_081958B8: + ldr r0, =0x000003ff + cmp r5, r0 + bne _081958DC + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] +_081958C2: + adds r0, r6, r4 + adds r1, r2, r4 + ldrb r1, [r1] + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x6 + ble _081958C2 + b _081958FC + .pool +_081958DC: + ldr r0, =0x0000012b + cmp r5, r0 + bhi _081958FC + ldr r0, =gUnknown_0203BC88 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r5 + adds r0, r1 + adds r2, r0, 0x4 +_081958EE: + adds r0, r6, r4 + adds r1, r2, r4 + ldrb r1, [r1] + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x6 + ble _081958EE +_081958FC: + adds r1, r6, r4 + movs r0, 0xFF + strb r0, [r1] +_08195902: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195898 + + thumb_func_start sub_8195910 +sub_8195910: @ 8195910 + ldr r0, =gTrainers + ldr r1, =0x00007df3 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_8195910 + + thumb_func_start sub_8195924 +sub_8195924: @ 8195924 + ldr r0, =gTrainers + ldr r1, =0x00007df1 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_8195924 + + thumb_func_start sub_8195938 +sub_8195938: @ 8195938 + push {r4,lr} + adds r3, r0, 0 + movs r2, 0 + ldr r4, =gTrainers + TRAINER_TUCKER * 0x28 + 0x4 @ Tucker's name +_08195940: + adds r0, r3, r2 + adds r1, r2, r4 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x6 + ble _08195940 + adds r1, r3, r2 + movs r0, 0xFF + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195938 + + thumb_func_start sub_8195960 +sub_8195960: @ 8195960 + push {lr} + ldr r1, =gUnknown_0860DE50 + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195960 + + thumb_func_start sub_8195980 +sub_8195980: @ 8195980 + push {r4-r7,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r7, r0, 16 + ldr r0, [r4] + ldr r2, =0x00000ca8 + adds r0, r2 + movs r6, 0 + strb r6, [r0] + ldr r1, [r4] + adds r2, 0xA + adds r0, r1, r2 + strh r6, [r0] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r4] + ldr r2, =0x00000ca9 + adds r1, r2 + ldrb r2, [r1] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r4, [r4] + ldr r0, =0x00000cdc + adds r3, r4, r0 + ldr r2, =gUnknown_0860DE98 + lsls r1, r5, 2 + lsls r0, r7, 3 + adds r1, r0 + adds r1, r2 + ldr r0, [r3] + ldr r1, [r1] + ands r0, r1 + cmp r0, 0 + bne _081959F2 + lsls r0, r5, 1 + lsls r1, r7, 2 + adds r0, r1 + ldr r2, =0x00000dc8 + adds r1, r4, r2 + adds r1, r0 + strh r6, [r1] +_081959F2: + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0x4 + ldrsb r1, [r0, r1] + movs r2, 0x5 + ldrsb r2, [r0, r2] + movs r3, 0x1 + negs r3, r3 + movs r0, 0 + bl saved_warp2_set + ldr r0, =gTrainerBattleOpponent_A + strh r6, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195980 + + thumb_func_start sub_8195A38 +sub_8195A38: @ 8195A38 + push {r4-r7,lr} + ldr r5, =gSaveBlock2Ptr + ldr r0, [r5] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r7, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x1 + beq _08195A90 + cmp r0, 0x1 + bgt _08195A74 + cmp r0, 0 + beq _08195A7A + b _08195AD0 + .pool +_08195A74: + cmp r0, 0x2 + beq _08195AB0 + b _08195AD0 +_08195A7A: + ldr r0, =gScriptResult + ldr r1, [r5] + ldr r2, =0x00000dc6 + adds r1, r2 + ldrh r1, [r1] + strh r1, [r0] + b _08195AD0 + .pool +_08195A90: + ldr r3, =gScriptResult + ldr r0, [r5] + lsls r1, r7, 1 + lsls r2, r6, 2 + adds r1, r2 + ldr r2, =0x00000dc8 + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r3] + b _08195AD0 + .pool +_08195AB0: + ldr r4, =gScriptResult + ldr r2, [r5] + ldr r0, =0x00000cdc + adds r2, r0 + ldr r3, =gUnknown_0860DE98 + lsls r0, r7, 2 + lsls r1, r6, 3 + adds r0, r1 + adds r0, r3 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + strh r0, [r4] +_08195AD0: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195A38 + + thumb_func_start sub_8195AE4 +sub_8195AE4: @ 8195AE4 + push {r4-r6,lr} + ldr r6, =gSaveBlock2Ptr + ldr r0, [r6] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x1 + beq _08195B3C + cmp r0, 0x1 + bgt _08195B20 + cmp r0, 0 + beq _08195B26 + b _08195BA0 + .pool +_08195B20: + cmp r0, 0x2 + beq _08195B5C + b _08195BA0 +_08195B26: + ldr r0, [r6] + ldr r1, =gSpecialVar_0x8006 + ldrh r1, [r1] + ldr r2, =0x00000dc6 + adds r0, r2 + strh r1, [r0] + b _08195BA0 + .pool +_08195B3C: + ldr r2, [r6] + lsls r0, r5, 1 + lsls r1, r4, 2 + adds r0, r1 + ldr r1, =0x00000dc8 + adds r2, r1 + adds r2, r0 + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + strh r0, [r2] + b _08195BA0 + .pool +_08195B5C: + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + cmp r0, 0 + beq _08195B88 + ldr r2, [r6] + ldr r0, =0x00000cdc + adds r2, r0 + ldr r3, =gUnknown_0860DE98 + lsls r1, r5, 2 + lsls r0, r4, 3 + adds r1, r0 + adds r1, r3 + ldr r0, [r2] + ldr r1, [r1] + orrs r0, r1 + b _08195B9E + .pool +_08195B88: + ldr r2, [r6] + ldr r1, =0x00000cdc + adds r2, r1 + ldr r3, =gUnknown_0860DEA8 + lsls r1, r5, 2 + lsls r0, r4, 3 + adds r1, r0 + adds r1, r3 + ldr r0, [r2] + ldr r1, [r1] + ands r0, r1 +_08195B9E: + str r0, [r2] +_08195BA0: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195AE4 + + thumb_func_start sub_8195BB0 +sub_8195BB0: @ 8195BB0 + push {r4,lr} + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + ldr r1, =gSaveBlock2Ptr + ldr r2, [r1] + ldr r3, =0x00000ca9 + adds r1, r2, r3 + ldrb r1, [r1] + lsls r1, 30 + lsrs r1, 29 + lsrs r0, 14 + adds r1, r0 + ldr r0, =0x00000dc8 + adds r2, r0 + adds r2, r1 + ldrh r0, [r2] + cmp r0, 0x31 + bhi _08195C00 + ldr r4, =gScriptResult + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + strh r0, [r4] + b _08195C16 + .pool +_08195C00: + cmp r0, 0x62 + bhi _08195C10 + ldr r1, =gScriptResult + movs r0, 0x3 + b _08195C14 + .pool +_08195C10: + ldr r1, =gScriptResult + movs r0, 0x4 +_08195C14: + strh r0, [r1] +_08195C16: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195BB0 + + thumb_func_start sub_8195C20 +sub_8195C20: @ 8195C20 + push {r4,lr} + ldr r4, =gTrainerBattleOpponent_A + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xFF + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + lsls r1, r0, 2 + adds r1, r0 + lsrs r1, 6 + strh r1, [r4] + ldrh r0, [r4] + movs r1, 0 + bl sub_8162614 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195C20 + + thumb_func_start sub_8195C50 +sub_8195C50: @ 8195C50 + push {lr} + ldr r3, =gTrainerBattleOpponent_A + ldrh r1, [r3] + ldr r0, =0x0000012b + cmp r1, r0 + bhi _08195C6C + ldr r2, =gUnknown_0203BC88 + movs r0, 0x34 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0xC + bl ConvertBattleFrontierTrainerSpeechToString +_08195C6C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195C50 + + thumb_func_start sub_8195C7C +sub_8195C7C: @ 8195C7C + push {r4-r7,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r7, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 24 + ldr r4, [r4] + lsls r1, r7, 1 + lsrs r5, r0, 22 + adds r1, r5 + ldr r3, =0x00000dc8 + adds r6, r4, r3 + adds r3, r6, r1 + ldrh r2, [r3] + ldr r0, =0x0000270e + cmp r2, r0 + bhi _08195CCA + adds r2, 0x1 + strh r2, [r3] + movs r3, 0xDD + lsls r3, 4 + adds r0, r4, r3 + adds r1, r0, r1 + adds r0, r5, 0 + ldrh r3, [r1] + cmp r7, r3 + bls _08195CC0 + adds r0, 0x2 +_08195CC0: + adds r0, r6, r0 + ldrh r0, [r0] + cmp r0, 0 + beq _08195CCA + strh r2, [r1] +_08195CCA: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195C7C + + thumb_func_start sub_8195CE4 +sub_8195CE4: @ 8195CE4 + push {r4,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl VarSet + ldr r1, [r4] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl sub_81A4C30 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195CE4 + + thumb_func_start sub_8195D28 +sub_8195D28: @ 8195D28 + push {r4,r5,lr} + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + ldr r4, =gSaveBlock2Ptr + ldr r2, [r4] + ldr r3, =0x00000ca9 + adds r1, r2, r3 + ldrb r1, [r1] + lsls r1, 30 + lsrs r1, 29 + lsrs r0, 14 + adds r1, r0 + ldr r0, =0x00000dc8 + adds r2, r0 + adds r2, r1 + ldrh r0, [r2] + cmp r0, 0x29 + bls _08195D88 + bl Random + ldr r4, [r4] + ldr r5, =gUnknown_0860DE84 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x9 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 15 + adds r0, r5 + ldrh r0, [r0] + ldr r1, =0x00000dc6 + adds r4, r1 + b _08195DA6 + .pool +_08195D88: + bl Random + ldr r4, [r4] + ldr r5, =gUnknown_0860DE78 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x6 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 15 + adds r0, r5 + ldrh r0, [r0] + ldr r3, =0x00000dc6 + adds r4, r3 +_08195DA6: + strh r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195D28 + + thumb_func_start sub_8195DB8 +sub_8195DB8: @ 8195DB8 + push {r4,r5,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000dc6 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x1 + bl AddBagItem + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bne _08195E00 + ldr r0, [r4] + ldr r1, =0x00000dc6 + adds r0, r1 + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r0, [r4] + ldr r1, =0x00000dc6 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + ldr r0, =gScriptResult + strh r5, [r0] + b _08195E06 + .pool +_08195E00: + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] +_08195E06: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195DB8 + + thumb_func_start sub_8195E10 +sub_8195E10: @ 8195E10 + push {lr} + bl RtcCalcLocalTime + ldr r0, =gLocalTime + bl sub_8195E34 + ldr r1, =gUnknown_0203CD80 + adds r0, 0xA + str r0, [r1] + movs r0, 0 + strb r0, [r1, 0x6] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195E10 + + thumb_func_start sub_8195E34 +sub_8195E34: @ 8195E34 + adds r3, r0, 0 + movs r1, 0 + ldrsh r0, [r3, r1] + lsls r1, r0, 1 + adds r1, r0 + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 5 + movs r2, 0x2 + ldrsb r2, [r3, r2] + lsls r1, r2, 4 + subs r1, r2 + lsls r1, 2 + adds r0, r1 + movs r1, 0x3 + ldrsb r1, [r3, r1] + adds r0, r1 + bx lr + thumb_func_end sub_8195E34 + + thumb_func_start sub_8195E58 +sub_8195E58: @ 8195E58 + push {lr} + bl RtcCalcLocalTime + ldr r0, =gLocalTime + bl sub_8195E34 + adds r1, r0, 0 + ldr r2, =gUnknown_0203CD80 + ldr r0, [r2] + cmp r0, r1 + bhi _08195E74 + subs r0, r1, r0 + cmp r0, 0x9 + bls _08195E84 +_08195E74: + str r1, [r2] + movs r0, 0x1 + b _08195E86 + .pool +_08195E84: + movs r0, 0 +_08195E86: + pop {r1} + bx r1 + thumb_func_end sub_8195E58 + + thumb_func_start sub_8195E8C +sub_8195E8C: @ 8195E8C + push {r4,r5,lr} + movs r5, 0x1 + ldr r4, =gPlayerParty + adds r0, r4, 0 + movs r1, 0x6 + bl GetMonData + cmp r0, 0 + bne _08195EAE + adds r0, r4, 0 + bl GetMonAbility + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1F + bne _08195EAE + movs r5, 0x2 +_08195EAE: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + lsls r1, r5, 1 + adds r1, r5 + cmp r0, r1 + blt _08195ED0 + movs r0, 0 + b _08195ED2 + .pool +_08195ED0: + movs r0, 0x1 +_08195ED2: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8195E8C + + thumb_func_start sub_8195ED8 +sub_8195ED8: @ 8195ED8 + push {r4,lr} + ldr r4, =gMapHeader + ldrb r0, [r4, 0x17] + bl is_light_level_1_2_3_or_6 + lsls r0, 24 + cmp r0, 0 + beq _08195F30 + ldrb r0, [r4, 0x14] + cmp r0, 0x39 + beq _08195F30 + cmp r0, 0xE + bne _08195F0E + movs r0, 0xF9 + lsls r0, 2 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08195F0E + movs r0, 0xDC + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _08195F30 +_08195F0E: + ldr r0, =gMapHeader + ldrb r0, [r0, 0x14] + cmp r0, 0x38 + bne _08195F38 + movs r0, 0xCF + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08195F38 + movs r0, 0x8B + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _08195F38 +_08195F30: + movs r0, 0 + b _08195F3A + .pool +_08195F38: + movs r0, 0x1 +_08195F3A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8195ED8 + + thumb_func_start sub_8195F40 +sub_8195F40: @ 8195F40 + push {lr} + ldr r1, =gUnknown_0203CD80 + ldrb r0, [r1, 0x6] + adds r0, 0x1 + strb r0, [r1, 0x6] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x9 + bhi _08195F5C + movs r0, 0 + b _08195F62 + .pool +_08195F5C: + movs r0, 0 + strb r0, [r1, 0x6] + movs r0, 0x1 +_08195F62: + pop {r1} + bx r1 + thumb_func_end sub_8195F40 + + thumb_func_start sub_8195F68 +sub_8195F68: @ 8195F68 + push {r4,lr} + bl sub_8195FCC + adds r4, r0, 0 + cmp r4, 0 + beq _08195FB8 + bl Random + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl __umodsi3 + bl sub_8195FF8 + ldr r2, =gUnknown_0203CD80 + movs r1, 0 + strh r0, [r2, 0x4] + strb r1, [r2, 0x7] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x4E + beq _08195FB8 + ldrh r0, [r2, 0x4] + bl sub_8196844 + adds r4, r0, 0 + bl sub_819672C + ldr r1, =gMapHeader + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1, 0x14] + cmp r0, r1 + bne _08195FC4 + adds r0, r4, 0 + bl sub_8196710 + cmp r0, 0 + bne _08195FC4 +_08195FB8: + movs r0, 0 + b _08195FC6 + .pool +_08195FC4: + movs r0, 0x1 +_08195FC6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8195F68 + + thumb_func_start sub_8195FCC +sub_8195FCC: @ 8195FCC + push {r4,r5,lr} + movs r4, 0 + movs r5, 0 +_08195FD2: + movs r1, 0xAE + lsls r1, 1 + adds r0, r4, r1 + lsls r0, 16 + lsrs r0, 16 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _08195FE8 + adds r5, 0x1 +_08195FE8: + adds r4, 0x1 + cmp r4, 0x3F + bls _08195FD2 + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8195FCC + + thumb_func_start sub_8195FF8 +sub_8195FF8: @ 8195FF8 + push {r4-r6,lr} + adds r5, r0, 0 + movs r4, 0 + ldr r6, =gUnknown_085500A4 +_08196000: + movs r1, 0xAE + lsls r1, 1 + adds r0, r4, r1 + lsls r0, 16 + lsrs r0, 16 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _08196022 + cmp r5, 0 + bne _08196020 + ldrh r0, [r6] + b _0819602C + .pool +_08196020: + subs r5, 0x1 +_08196022: + adds r6, 0x10 + adds r4, 0x1 + cmp r4, 0x3F + bls _08196000 + movs r0, 0x4E +_0819602C: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8195FF8 + + thumb_func_start sub_8196034 +sub_8196034: @ 8196034 + push {lr} + ldr r0, =0x0000012f + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _08196078 + bl sub_8195F40 + cmp r0, 0 + beq _08196078 + bl sub_8195E58 + cmp r0, 0 + beq _08196078 + bl sub_8195E8C + cmp r0, 0 + beq _08196078 + bl sub_8195ED8 + cmp r0, 0 + beq _08196078 + bl sub_8195F68 + cmp r0, 0 + beq _08196078 + bl task_prev_quest + movs r0, 0x1 + b _0819607A + .pool +_08196078: + movs r0, 0 +_0819607A: + pop {r1} + bx r1 + thumb_func_end sub_8196034 + + thumb_func_start sub_8196080 +sub_8196080: @ 8196080 + push {lr} + ldr r1, =gUnknown_0203CD80 + movs r0, 0x1 + strb r0, [r1, 0x7] + bl task_prev_quest + pop {r0} + bx r0 + .pool + thumb_func_end sub_8196080 + + thumb_func_start sub_8196094 +sub_8196094: @ 8196094 + push {lr} + ldr r0, =sub_81960E0 + bl FuncIsActiveTask + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8196094 + + thumb_func_start task_prev_quest +task_prev_quest: @ 81960A8 + push {lr} + ldr r0, =gUnknown_0203CD80 + ldrb r0, [r0, 0x7] + cmp r0, 0 + bne _081960C2 + bl ScriptContext2_Enable + bl player_bitmagic + bl sub_808B864 + bl sub_808BCF4 +_081960C2: + ldr r0, =0x00000107 + bl PlaySE + ldr r0, =sub_81960E0 + movs r1, 0x1 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end task_prev_quest + + thumb_func_start sub_81960E0 +sub_81960E0: @ 81960E0 + 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 + ldr r1, =gUnknown_0860EF78 + movs r2, 0 + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r5, 0 + bl _call_via_r1 + cmp r0, 0 + beq _0819611E + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + movs r1, 0 + strh r1, [r4, 0x2] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x7 + bls _0819611E + adds r0, r5, 0 + bl DestroyTask +_0819611E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81960E0 + + thumb_func_start sub_819612C +sub_819612C: @ 819612C + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r5, r0, r1 + ldr r0, =gUnknown_0860EF98 + bl AddWindow + strh r0, [r5, 0x4] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xFF + bne _0819615C + adds r0, r4, 0 + b _081961E0 + .pool +_0819615C: + ldr r1, =gUnknown_0860EA6C + movs r2, 0x80 + lsls r2, 1 + movs r3, 0x9C + lsls r3, 2 + movs r0, 0 + bl LoadBgTiles + lsls r0, 16 + ldr r1, =0xffff0000 + cmp r0, r1 + bne _08196188 + ldrb r0, [r5, 0x4] + bl RemoveWindow + adds r0, r4, 0 + b _081961E0 + .pool +_08196188: + ldr r1, =gUnknown_0860EB8C + ldr r3, =0x00000279 + movs r0, 0 + str r0, [sp] + movs r2, 0 + bl decompress_and_copy_tile_data_to_vram + cmp r0, 0 + beq _081961D8 + ldrb r0, [r5, 0x4] + movs r1, 0x88 + bl FillWindowPixelBuffer + ldr r0, =gUnknown_0860EA4C + movs r1, 0xE0 + movs r2, 0x20 + bl LoadPalette + ldr r0, =gUnknown_0860EB6C + movs r1, 0xF0 + movs r2, 0x20 + bl LoadPalette + ldr r1, =0xffffe000 + movs r0, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x1 + b _081961E6 + .pool +_081961D8: + ldrb r0, [r5, 0x4] + bl RemoveWindow + adds r0, r6, 0 +_081961E0: + bl DestroyTask + movs r0, 0 +_081961E6: + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_819612C + + thumb_func_start sub_81961F0 +sub_81961F0: @ 81961F0 + push {r4,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r4, r1, r0 + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + bne _08196268 + ldrb r0, [r4, 0x4] + bl PutWindowTilemap + movs r1, 0x4 + ldrsh r0, [r4, r1] + movs r1, 0x9C + lsls r1, 2 + movs r2, 0xE + bl sub_819645C + ldr r1, =0x0000f279 + movs r0, 0x4 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + str r0, [sp, 0xC] + movs r0, 0 + movs r2, 0x1 + movs r3, 0xF + bl WriteSequenceToBgTilemapBuffer + ldr r0, =sub_8196694 + movs r1, 0xA + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0xA] + ldrb r0, [r4, 0x4] + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0 + bl CopyBgTilemapBufferToVram + movs r0, 0x1 + b _0819626A + .pool +_08196268: + movs r0, 0 +_0819626A: + add sp, 0x10 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81961F0 + + thumb_func_start sub_8196274 +sub_8196274: @ 8196274 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r4, r1, r0 + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + beq _08196298 + movs r0, 0 + b _081962A4 + .pool +_08196298: + movs r1, 0x4 + ldrsh r0, [r4, r1] + ldr r1, =gUnknown_0860EF70 + bl sub_81965D8 + movs r0, 0x1 +_081962A4: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8196274 + + thumb_func_start sub_81962B0 +sub_81962B0: @ 81962B0 + push {lr} + movs r1, 0xC0 + lsls r1, 3 + movs r0, 0 + movs r2, 0x1 + bl ChangeBgY + cmp r0, 0 + bge _081962C6 + movs r0, 0 + b _081962D2 +_081962C6: + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x1 +_081962D2: + pop {r1} + bx r1 + thumb_func_end sub_81962B0 + + thumb_func_start sub_81962D8 +sub_81962D8: @ 81962D8 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r4, r1, r0 + movs r1, 0x4 + ldrsh r0, [r4, r1] + bl sub_8196648 + cmp r0, 0 + bne _08196328 + ldrb r0, [r4, 0x4] + movs r1, 0x88 + bl FillWindowPixelBuffer + ldr r1, =gUnknown_0203CD80 + ldrb r0, [r1, 0x7] + cmp r0, 0 + bne _0819630C + ldrh r0, [r1, 0x4] + ldr r1, =gStringVar4 + bl sub_81967AC +_0819630C: + movs r1, 0x4 + ldrsh r0, [r4, r1] + ldr r1, =gStringVar4 + bl sub_81965D8 + movs r0, 0x1 + b _0819632A + .pool +_08196328: + movs r0, 0 +_0819632A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81962D8 + + thumb_func_start sub_8196330 +sub_8196330: @ 8196330 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r4, r1, r0 + movs r1, 0x4 + ldrsh r0, [r4, r1] + bl sub_8196648 + cmp r0, 0 + bne _08196388 + bl IsSEPlaying + lsls r0, 24 + cmp r0, 0 + bne _08196388 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _08196388 + ldrb r0, [r4, 0x4] + movs r1, 0x88 + bl FillWindowPixelBuffer + ldrb r0, [r4, 0x4] + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0x84 + lsls r0, 1 + bl PlaySE + movs r0, 0x1 + b _0819638A + .pool +_08196388: + movs r0, 0 +_0819638A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8196330 + + thumb_func_start sub_8196390 +sub_8196390: @ 8196390 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r4, r1, r0 + movs r1, 0xC0 + lsls r1, 3 + movs r0, 0 + movs r2, 0x2 + bl ChangeBgY + ldr r1, =0xffffe000 + cmp r0, r1 + ble _081963C0 + movs r0, 0 + b _081963E8 + .pool +_081963C0: + movs r0, 0x1E + str r0, [sp] + movs r0, 0x6 + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0xE + bl FillBgTilemapBufferRect_Palette0 + ldrb r0, [r4, 0xA] + bl DestroyTask + ldrb r0, [r4, 0x4] + bl RemoveWindow + movs r0, 0 + bl CopyBgTilemapBufferToVram + movs r0, 0x1 +_081963E8: + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8196390 + + thumb_func_start sub_81963F0 +sub_81963F0: @ 81963F0 + push {lr} + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _08196454 + bl IsSEPlaying + lsls r0, 24 + cmp r0, 0 + bne _08196454 + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + ldr r0, =gUnknown_0203CD80 + ldrb r0, [r0, 0x7] + cmp r0, 0 + bne _08196446 + bl sub_81973A4 + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + bl GetFieldObjectIdByLocalIdAndMap + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gMapObjects + adds r0, r1 + bl FieldObjectClearAnimIfSpecialAnimFinished + bl sub_80D338C + bl sub_809757C + bl ScriptContext2_Disable +_08196446: + movs r0, 0x1 + b _08196456 + .pool +_08196454: + movs r0, 0 +_08196456: + pop {r1} + bx r1 + thumb_func_end sub_81963F0 + + thumb_func_start sub_819645C +sub_819645C: @ 819645C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + adds r4, r0, 0 + adds r5, r1, 0 + adds r7, r2, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0 + bl GetWindowAttribute + mov r9, r0 + adds r0, r4, 0 + movs r1, 0x1 + bl GetWindowAttribute + str r0, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x2 + bl GetWindowAttribute + str r0, [sp, 0xC] + adds r0, r4, 0 + movs r1, 0x3 + bl GetWindowAttribute + adds r6, r0, 0 + adds r0, r4, 0 + movs r1, 0x4 + bl GetWindowAttribute + str r0, [sp, 0x10] + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r1, 0xA + bl GetBgAttribute + lsls r0, 16 + lsrs r0, 16 + adds r5, r0 + lsls r7, 12 + movs r1, 0xF0 + lsls r1, 8 + adds r0, r1, 0 + ands r7, r0 + adds r1, r7, 0 + orrs r1, r5 + lsls r1, 16 + lsrs r1, 16 + ldr r2, [sp, 0x8] + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + mov r10, r2 + ldr r4, [sp, 0xC] + subs r4, 0x1 + lsls r4, 24 + lsrs r4, 24 + movs r3, 0x1 + mov r8, r3 + str r3, [sp] + str r3, [sp, 0x4] + mov r0, r9 + adds r3, r4, 0 + bl FillBgTilemapBufferRect_Palette0 + adds r1, r5, 0x1 + orrs r1, r7 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x8] + lsls r2, r0, 24 + lsrs r2, 24 + str r2, [sp, 0x14] + lsls r0, r6, 24 + lsrs r0, 24 + str r0, [sp, 0x18] + str r0, [sp] + mov r2, r8 + str r2, [sp, 0x4] + mov r0, r9 + ldr r2, [sp, 0x14] + adds r3, r4, 0 + bl FillBgTilemapBufferRect_Palette0 + adds r1, r5, 0x2 + orrs r1, r7 + lsls r1, 16 + lsrs r1, 16 + ldr r3, [sp, 0x8] + adds r0, r3, r6 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x1C] + mov r0, r8 + str r0, [sp] + str r0, [sp, 0x4] + mov r0, r9 + ldr r2, [sp, 0x1C] + adds r3, r4, 0 + bl FillBgTilemapBufferRect_Palette0 + adds r1, r5, 0x3 + orrs r1, r7 + lsls r1, 16 + lsrs r1, 16 + ldr r2, [sp, 0xC] + lsls r6, r2, 24 + lsrs r6, 24 + mov r3, r8 + str r3, [sp] + ldr r0, [sp, 0x10] + lsls r4, r0, 24 + lsrs r4, 24 + str r4, [sp, 0x4] + mov r0, r9 + mov r2, r10 + adds r3, r6, 0 + bl FillBgTilemapBufferRect_Palette0 + adds r1, r5, 0x4 + orrs r1, r7 + lsls r1, 16 + lsrs r1, 16 + mov r2, r8 + str r2, [sp] + str r4, [sp, 0x4] + mov r0, r9 + ldr r2, [sp, 0x1C] + adds r3, r6, 0 + bl FillBgTilemapBufferRect_Palette0 + adds r1, r5, 0x5 + orrs r1, r7 + lsls r1, 16 + lsrs r1, 16 + ldr r3, [sp, 0xC] + ldr r2, [sp, 0x10] + adds r0, r3, r2 + lsls r0, 24 + lsrs r4, r0, 24 + mov r3, r8 + str r3, [sp] + str r3, [sp, 0x4] + mov r0, r9 + mov r2, r10 + adds r3, r4, 0 + bl FillBgTilemapBufferRect_Palette0 + adds r1, r5, 0x6 + orrs r1, r7 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x18] + str r0, [sp] + mov r2, r8 + str r2, [sp, 0x4] + mov r0, r9 + ldr r2, [sp, 0x14] + adds r3, r4, 0 + bl FillBgTilemapBufferRect_Palette0 + adds r5, 0x7 + orrs r5, r7 + lsls r5, 16 + lsrs r5, 16 + mov r3, r8 + str r3, [sp] + str r3, [sp, 0x4] + mov r0, r9 + adds r1, r5, 0 + ldr r2, [sp, 0x1C] + adds r3, r4, 0 + bl FillBgTilemapBufferRect_Palette0 + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819645C + + thumb_func_start sub_81965D8 +sub_81965D8: @ 81965D8 + push {lr} + sub sp, 0x10 + str r1, [sp] + mov r1, sp + movs r3, 0 + strb r0, [r1, 0x4] + mov r0, sp + movs r1, 0x1 + strb r1, [r0, 0x5] + movs r2, 0x20 + strb r2, [r0, 0x6] + strb r1, [r0, 0x7] + strb r2, [r0, 0x8] + strb r1, [r0, 0x9] + strb r3, [r0, 0xA] + strb r3, [r0, 0xB] + mov r3, sp + ldrb r2, [r3, 0xC] + subs r1, 0x11 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3, 0xC] + mov r2, sp + movs r3, 0xF + movs r0, 0xA0 + strb r0, [r2, 0xC] + ldrb r0, [r2, 0xD] + ands r1, r0 + movs r0, 0x8 + orrs r1, r0 + strb r1, [r2, 0xD] + ands r1, r3 + movs r0, 0xE0 + orrs r1, r0 + strb r1, [r2, 0xD] + ldr r2, =gTextFlags + ldrb r1, [r2] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + bl sav2_get_text_speed + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, sp + movs r2, 0 + bl AddTextPrinter + add sp, 0x10 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81965D8 + + thumb_func_start sub_8196648 +sub_8196648: @ 8196648 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gMain + ldrh r1, [r0, 0x2C] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0819666C + ldr r0, =gTextFlags + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] + b _08196678 + .pool +_0819666C: + ldr r2, =gTextFlags + ldrb r1, [r2] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_08196678: + bl RunTextPrinters + lsls r0, r4, 24 + lsrs r0, 24 + bl IsTextPrinterActive + lsls r0, 16 + lsrs r0, 16 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8196648 + + thumb_func_start sub_8196694 +sub_8196694: @ 8196694 + push {lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r2, r1, r0 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _081966FC + movs r1, 0 + strh r1, [r2] + ldrh r0, [r2, 0x2] + adds r0, 0x1 + strh r0, [r2, 0x2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _081966C8 + strh r1, [r2, 0x2] +_081966C8: + movs r0, 0x2 + ldrsh r1, [r2, r0] + lsls r1, 4 + ldr r0, =0x00000279 + adds r1, r0 + strh r1, [r2, 0x4] + ldr r2, =0xfffff000 + adds r0, r2, 0 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x4 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + str r0, [sp, 0xC] + movs r0, 0 + movs r2, 0x1 + movs r3, 0xF + bl WriteSequenceToBgTilemapBuffer + movs r0, 0 + bl CopyBgTilemapBufferToVram +_081966FC: + add sp, 0x10 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8196694 + + thumb_func_start sub_8196710 +sub_8196710: @ 8196710 + ldr r1, =gSaveBlock1Ptr + ldr r1, [r1] + ldr r2, =0x000009ca + adds r1, r2 + adds r1, r0 + ldrb r1, [r1] + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + bx lr + .pool + thumb_func_end sub_8196710 + + thumb_func_start sub_819672C +sub_819672C: @ 819672C + push {lr} + ldr r1, =gUnknown_085500A4 + lsls r0, 4 + adds r0, r1 + ldrh r2, [r0, 0xA] + ldrh r1, [r0, 0xC] + adds r0, r2, 0 + bl get_mapheader_by_bank_and_number + ldrb r0, [r0, 0x14] + pop {r1} + bx r1 + .pool + thumb_func_end sub_819672C + + thumb_func_start sub_8196748 +sub_8196748: @ 8196748 + push {r4-r6,lr} + movs r5, 0 + movs r6, 0 + ldr r4, =gUnknown_085500A4 +_08196750: + ldrh r0, [r4] + bl trainer_flag_check + lsls r0, 24 + cmp r0, 0 + beq _0819675E + adds r6, 0x1 +_0819675E: + adds r4, 0x10 + adds r5, 0x1 + cmp r5, 0x3F + bls _08196750 + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8196748 + + thumb_func_start sub_8196774 +sub_8196774: @ 8196774 + push {r4-r7,lr} + adds r7, r0, 0 + movs r4, 0 + movs r6, 0 + ldr r5, =gUnknown_085500A4 +_0819677E: + ldrh r0, [r5] + bl trainer_flag_check + lsls r0, 24 + cmp r0, 0 + beq _0819679A + cmp r6, r7 + bne _08196798 + adds r0, r4, 0 + b _081967A4 + .pool +_08196798: + adds r6, 0x1 +_0819679A: + adds r5, 0x10 + adds r4, 0x1 + cmp r4, 0x4D + bls _0819677E + movs r0, 0x4E +_081967A4: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8196774 + + thumb_func_start sub_81967AC +sub_81967AC: @ 81967AC + push {r4-r7,lr} + adds r6, r1, 0 + movs r7, 0 + bl sub_8196844 + adds r5, r0, 0 + ldr r0, =gUnknown_0203CD88 + strh r7, [r0] + adds r0, r5, 0 + bl sub_8196710 + cmp r0, 0 + beq _081967EC + adds r0, r5, 0 + bl sub_819672C + ldr r1, =gMapHeader + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1, 0x14] + cmp r0, r1 + bne _081967EC + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_8196864 + b _08196830 + .pool +_081967EC: + adds r0, r5, 0 + bl sub_8196D74 + cmp r0, 0 + beq _0819680A + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_8196890 + adds r4, r0, 0 + movs r7, 0x1 + adds r0, r5, 0 + bl sub_80B1E94 + b _08196832 +_0819680A: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + beq _08196828 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_81968BC + b _08196830 +_08196828: + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_8196910 +_08196830: + adds r4, r0, 0 +_08196832: + adds r0, r5, 0 + adds r1, r4, 0 + adds r2, r6, 0 + bl sub_81969E0 + adds r0, r7, 0 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81967AC + + thumb_func_start sub_8196844 +sub_8196844: @ 8196844 + push {lr} + adds r3, r0, 0 + movs r2, 0 + ldr r1, =gUnknown_0860DEB8 +_0819684C: + ldrh r0, [r1] + cmp r0, r3 + beq _0819685C + adds r1, 0x14 + adds r2, 0x1 + b _0819684C + .pool +_0819685C: + adds r0, r2, 0 + pop {r1} + bx r1 + thumb_func_end sub_8196844 + + thumb_func_start sub_8196864 +sub_8196864: @ 8196864 + ldr r2, =gUnknown_0860DEB8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r1, [r1, 0xE] + movs r2, 0xFF + lsrs r0, r1, 8 + subs r0, 0x1 + ands r1, r2 + subs r1, 0x1 + ldr r2, =gUnknown_0860EA2C + lsls r0, 2 + adds r0, r2 + lsls r1, 3 + ldr r0, [r0] + adds r0, r1 + bx lr + .pool + thumb_func_end sub_8196864 + + thumb_func_start sub_8196890 +sub_8196890: @ 8196890 + ldr r2, =gUnknown_0860DEB8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r1, [r1, 0x10] + movs r2, 0xFF + lsrs r0, r1, 8 + subs r0, 0x1 + ands r1, r2 + subs r1, 0x1 + ldr r2, =gUnknown_0860EA2C + lsls r0, 2 + adds r0, r2 + lsls r1, 3 + ldr r0, [r0] + adds r0, r1 + bx lr + .pool + thumb_func_end sub_8196890 + + thumb_func_start sub_81968BC +sub_81968BC: @ 81968BC + push {r4,lr} + adds r4, r0, 0 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + ldr r2, =gUnknown_0860DEB8 + lsrs r0, 15 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 2 + adds r0, r1 + adds r2, 0x4 + adds r0, r2 + ldrh r4, [r0] + cmp r4, 0 + bne _081968EC + movs r0, 0 + bl SpriteCallbackDummy +_081968EC: + movs r1, 0xFF + lsrs r0, r4, 8 + subs r0, 0x1 + ands r4, r1 + subs r1, r4, 0x1 + ldr r2, =gUnknown_0860EA20 + lsls r0, 2 + adds r0, r2 + lsls r1, 3 + ldr r0, [r0] + adds r0, r1 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81968BC + + thumb_func_start sub_8196910 +sub_8196910: @ 8196910 + push {r4-r7,lr} + sub sp, 0x4 + adds r6, r0, 0 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081969AC + movs r5, 0 + movs r4, 0 + lsls r7, r6, 2 +_0819692C: + lsls r0, r4, 16 + lsrs r0, 16 + mov r1, sp + bl sub_8196E04 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bls _08196940 + adds r5, 0x1 +_08196940: + adds r4, 0x1 + cmp r4, 0x6 + ble _0819692C + cmp r5, 0 + beq _081969AC + bl Random + lsls r0, 16 + lsrs r0, 16 + adds r1, r5, 0 + bl __modsi3 + adds r5, r0, 0 + movs r4, 0 + b _08196962 +_0819695E: + subs r5, 0x1 +_08196960: + adds r4, 0x1 +_08196962: + cmp r4, 0x6 + bgt _08196980 + lsls r0, r4, 16 + lsrs r0, 16 + mov r1, sp + bl sub_8196E04 + ldr r1, =gUnknown_0203CD88 + strh r0, [r1, 0x2] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bls _08196960 + cmp r5, 0 + bne _0819695E +_08196980: + ldr r0, =gUnknown_0203CD88 + strh r4, [r0] + ldr r1, =gUnknown_0860DEB8 + adds r0, r7, r6 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0xC] + subs r2, r0, 0x1 + ldr r1, =gUnknown_0860EA34 + ldr r0, [sp] + lsls r0, 2 + adds r0, r1 + lsls r1, r2, 3 + ldr r0, [r0] + adds r0, r1 + b _081969D0 + .pool +_081969AC: + ldr r1, =gUnknown_0860DEB8 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 2 + adds r0, r1 + ldrh r2, [r0, 0xA] + lsrs r1, r2, 8 + subs r1, 0x1 + str r1, [sp] + movs r0, 0xFF + ands r0, r2 + subs r2, r0, 0x1 + ldr r0, =gUnknown_0860EA34 + lsls r1, 2 + adds r1, r0 + lsls r2, 3 + ldr r0, [r1] + adds r0, r2 +_081969D0: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8196910 + + thumb_func_start sub_81969E0 +sub_81969E0: @ 81969E0 + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + adds r1, r4, 0x4 + bl sub_81969FC + ldr r1, [r4] + adds r0, r5, 0 + bl StringExpandPlaceholders + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81969E0 + + thumb_func_start sub_81969FC +sub_81969FC: @ 81969FC + push {r4-r7,lr} + adds r7, r0, 0 + adds r6, r1, 0 + movs r4, 0 + ldr r5, =gUnknown_0860EFA0 +_08196A06: + adds r1, r6, r4 + movs r0, 0 + ldrsb r0, [r1, r0] + cmp r0, 0 + blt _08196A1A + adds r1, r0, 0 + ldr r2, [r5] + adds r0, r7, 0 + bl sub_8196A2C +_08196A1A: + adds r5, 0x4 + adds r4, 0x1 + cmp r4, 0x2 + ble _08196A06 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81969FC + + thumb_func_start sub_8196A2C +sub_8196A2C: @ 8196A2C + push {lr} + ldr r3, =gUnknown_0860EFAC + lsls r1, 2 + adds r1, r3 + ldr r3, [r1] + adds r1, r2, 0 + bl _call_via_r3 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8196A2C + + thumb_func_start sub_8196A44 +sub_8196A44: @ 8196A44 + push {r4-r6,lr} + adds r5, r1, 0 + ldr r2, =gUnknown_0860DEB8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r4, [r1] + movs r2, 0 + ldr r3, =gUnknown_0860EFC4 + adds r6, r3, 0 +_08196A5A: + lsls r1, r2, 3 + ldrh r0, [r3] + cmp r0, r4 + bne _08196A78 + adds r0, r6, 0x4 + adds r0, r1, r0 + ldr r1, [r0] + adds r0, r5, 0 + bl StringCopy + b _08196A90 + .pool +_08196A78: + adds r3, 0x8 + adds r2, 0x1 + cmp r2, 0x5 + bls _08196A5A + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + ldr r0, =gTrainers + 0x4 @ name offset + adds r1, r0 + adds r0, r5, 0 + bl StringCopy +_08196A90: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8196A44 + + thumb_func_start sub_8196A9C +sub_8196A9C: @ 8196A9C + push {r4,lr} + adds r4, r1, 0 + bl sub_819672C + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + movs r2, 0 + bl GetMapName + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8196A9C + + thumb_func_start sub_8196AB8 +sub_8196AB8: @ 8196AB8 + push {lr} + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x13 + bgt _08196AD4 + movs r0, 0 + b _08196B4A +_08196AD4: + adds r0, r1, 0 + subs r0, 0x14 + cmp r0, 0x13 + bhi _08196AE0 + movs r0, 0x1 + b _08196B4A +_08196AE0: + adds r0, r1, 0 + subs r0, 0x28 + cmp r0, 0x9 + bhi _08196AEC + movs r0, 0x2 + b _08196B4A +_08196AEC: + adds r0, r1, 0 + subs r0, 0x32 + cmp r0, 0x9 + bhi _08196AF8 + movs r0, 0x3 + b _08196B4A +_08196AF8: + adds r0, r1, 0 + subs r0, 0x3C + cmp r0, 0x9 + bhi _08196B04 + movs r0, 0x4 + b _08196B4A +_08196B04: + adds r0, r1, 0 + subs r0, 0x46 + cmp r0, 0x9 + bhi _08196B10 + movs r0, 0x5 + b _08196B4A +_08196B10: + adds r0, r1, 0 + subs r0, 0x50 + cmp r0, 0x4 + bhi _08196B1C + movs r0, 0x6 + b _08196B4A +_08196B1C: + adds r0, r1, 0 + subs r0, 0x55 + cmp r0, 0x4 + bhi _08196B28 + movs r0, 0x7 + b _08196B4A +_08196B28: + adds r0, r1, 0 + subs r0, 0x5A + cmp r0, 0x3 + bhi _08196B34 + movs r0, 0x8 + b _08196B4A +_08196B34: + adds r0, r1, 0 + subs r0, 0x5E + cmp r0, 0x3 + bhi _08196B40 + movs r0, 0x9 + b _08196B4A +_08196B40: + cmp r1, 0x62 + beq _08196B48 + movs r0, 0xB + b _08196B4A +_08196B48: + movs r0, 0xA +_08196B4A: + pop {r1} + bx r1 + thumb_func_end sub_8196AB8 + + thumb_func_start sub_8196B50 +sub_8196B50: @ 8196B50 + push {lr} + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x3B + bgt _08196B6C + movs r0, 0 + b _08196B92 +_08196B6C: + adds r0, r1, 0 + subs r0, 0x3C + cmp r0, 0x1D + bhi _08196B78 + movs r0, 0x1 + b _08196B92 +_08196B78: + adds r0, r1, 0 + subs r0, 0x5A + cmp r0, 0x4 + bhi _08196B84 + movs r0, 0x2 + b _08196B92 +_08196B84: + adds r0, r1, 0 + subs r0, 0x5F + cmp r0, 0x3 + bls _08196B90 + movs r0, 0x4 + b _08196B92 +_08196B90: + movs r0, 0x3 +_08196B92: + pop {r1} + bx r1 + thumb_func_end sub_8196B50 + + thumb_func_start sub_8196B98 +sub_8196B98: @ 8196B98 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r2, r0, 0 + mov r8, r1 + movs r3, 0 + ldr r0, =gWildMonHeaders + ldrb r1, [r0] + adds r7, r0, 0 + cmp r1, 0xFF + beq _08196C5C + ldr r1, =gUnknown_085500A4 + lsls r0, r2, 4 + adds r2, r0, r1 + ldrh r4, [r2, 0xA] + adds r1, r7, 0 +_08196BBA: + ldrb r0, [r1] + cmp r0, r4 + bne _08196BC8 + ldrb r0, [r1, 0x1] + ldrh r5, [r2, 0xC] + cmp r0, r5 + beq _08196BD2 +_08196BC8: + adds r1, 0x14 + adds r3, 0x1 + ldrb r0, [r1] + cmp r0, 0xFF + bne _08196BBA +_08196BD2: + adds r1, r7, 0 + lsls r0, r3, 2 + adds r0, r3 + lsls r5, r0, 2 + adds r0, r5, r1 + ldrb r0, [r0] + cmp r0, 0xFF + beq _08196C5C + movs r6, 0 + adds r0, r1, 0x4 + adds r0, r5, r0 + ldr r4, [r0] + cmp r4, 0 + beq _08196C02 + bl sub_8196AB8 + lsls r0, 24 + mov r2, sp + ldr r1, [r4, 0x4] + lsrs r0, 22 + adds r0, r1 + ldrh r0, [r0, 0x2] + strh r0, [r2] + movs r6, 0x1 +_08196C02: + adds r0, r7, 0 + adds r0, 0x8 + adds r0, r5, r0 + ldr r4, [r0] + cmp r4, 0 + beq _08196C26 + bl sub_8196B50 + lsls r0, 24 + lsls r1, r6, 1 + mov r3, sp + adds r2, r3, r1 + ldr r1, [r4, 0x4] + lsrs r0, 22 + adds r0, r1 + ldrh r0, [r0, 0x2] + strh r0, [r2] + adds r6, 0x1 +_08196C26: + cmp r6, 0 + beq _08196C5C + bl Random + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl __modsi3 + lsls r0, 1 + add r0, sp + ldrh r1, [r0] + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + mov r0, r8 + bl StringCopy + b _08196C62 + .pool +_08196C5C: + movs r0, 0xFF + mov r5, r8 + strb r0, [r5] +_08196C62: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8196B98 + + thumb_func_start sub_8196C70 +sub_8196C70: @ 8196C70 + push {r4-r7,lr} + adds r7, r1, 0 + ldr r2, =gUnknown_0860DEB8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r1] + bl sub_80B2250 + lsls r0, 16 + lsrs r0, 16 + ldr r5, =gTrainers + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r0, r5, 0 + adds r0, 0x24 + adds r0, r4, r0 + ldr r6, [r0] + bl Random + lsls r0, 16 + lsrs r0, 16 + adds r4, r5 + adds r1, r4, 0 + adds r1, 0x20 + ldrb r1, [r1] + bl __modsi3 + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r4] + cmp r1, 0x1 + beq _08196CD4 + cmp r1, 0x1 + ble _08196CC2 + cmp r1, 0x2 + beq _08196CD0 + cmp r1, 0x3 + beq _08196CD4 +_08196CC2: + lsls r0, 3 + b _08196CD6 + .pool +_08196CD0: + lsls r0, 3 + b _08196CD6 +_08196CD4: + lsls r0, 4 +_08196CD6: + adds r0, r6 + ldrh r1, [r0, 0x4] + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + adds r0, r7, 0 + bl StringCopy + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8196C70 + + thumb_func_start sub_8196CF4 +sub_8196CF4: @ 8196CF4 + push {lr} + adds r0, r1, 0 + ldr r2, =gUnknown_0860EFF4 + ldr r1, =gUnknown_0203CD88 + ldrh r1, [r1] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl StringCopy + pop {r0} + bx r0 + .pool + thumb_func_end sub_8196CF4 + + thumb_func_start sub_8196D14 +sub_8196D14: @ 8196D14 + push {r4-r6,lr} + adds r5, r1, 0 + movs r4, 0 + ldr r0, =gUnknown_0203CD88 + ldrh r1, [r0, 0x2] + adds r6, r0, 0 + cmp r1, 0 + beq _08196D34 +_08196D24: + adds r0, r1, 0 + movs r1, 0xA + bl __divsi3 + adds r1, r0, 0 + adds r4, 0x1 + cmp r1, 0 + bne _08196D24 +_08196D34: + ldrh r1, [r6, 0x2] + lsls r3, r4, 24 + lsrs r3, 24 + adds r0, r5, 0 + movs r2, 0 + bl ConvertIntToDecimalStringN + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8196D14 + + thumb_func_start sub_8196D4C +sub_8196D4C: @ 8196D4C + push {r4,r5,lr} + movs r4, 0 + ldr r5, =gUnknown_0860F010 + b _08196D5C + .pool +_08196D58: + adds r5, 0x2 + adds r4, 0x1 +_08196D5C: + cmp r4, 0x7 + bhi _08196D6C + ldrh r0, [r5] + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _08196D58 +_08196D6C: + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8196D4C + + thumb_func_start sub_8196D74 +sub_8196D74: @ 8196D74 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r7, r0, 0 + bl sub_8196D4C + cmp r0, 0x4 + ble _08196DF4 + bl RtcGetLocalDayCount + adds r4, r0, 0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xA + bl ReadUnalignedWord + adds r6, r0, 0 + ldr r0, =0x0000ffff + ands r6, r0 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00002e6a + adds r0, r1 + ldrh r5, [r0] + bl sub_8196748 + mov r9, r0 + movs r0, 0xD + mov r1, r9 + muls r1, r0 + adds r0, r1, 0 + movs r1, 0xA + bl __divsi3 + mov r8, r0 + movs r0, 0x9 + bl GetGameStat + eors r4, r5 + eors r5, r0 + adds r4, r5 + eors r4, r6 + adds r0, r4, 0 + mov r1, r8 + bl __modsi3 + cmp r0, r9 + bge _08196DF4 + bl sub_8196774 + cmp r0, r7 + bne _08196DF4 + movs r0, 0x1 + b _08196DF6 + .pool +_08196DF4: + movs r0, 0 +_08196DF6: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8196D74 + + thumb_func_start sub_8196E04 +sub_8196E04: @ 8196E04 + push {r4-r6,lr} + adds r5, r1, 0 + lsls r0, 16 + lsrs r0, 16 + movs r4, 0 + cmp r0, 0x6 + bls _08196E14 + b _08196F7E +_08196E14: + lsls r0, 2 + ldr r1, =_08196E24 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08196E24: + .4byte _08196E9C + .4byte _08196E40 + .4byte _08196ED0 + .4byte _08196F38 + .4byte _08196E74 + .4byte _08196F04 + .4byte _08196F60 +_08196E40: + movs r3, 0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000d14 + adds r0, r1 +_08196E4A: + lsls r1, r3, 2 + adds r3, 0x1 + adds r1, r0 + movs r2, 0x1 +_08196E52: + ldrh r6, [r1] + cmp r4, r6 + bcs _08196E5A + ldrh r4, [r1] +_08196E5A: + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _08196E52 + cmp r3, 0x1 + ble _08196E4A + movs r0, 0x3 + b _08196F7C + .pool +_08196E74: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000e08 + adds r0, r1 + movs r3, 0x1 +_08196E7E: + ldrh r6, [r0] + cmp r4, r6 + bcs _08196E86 + ldrh r4, [r0] +_08196E86: + adds r0, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _08196E7E + movs r0, 0x4 + b _08196F7C + .pool +_08196E9C: + movs r3, 0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + movs r1, 0xCF + lsls r1, 4 + adds r0, r1 +_08196EA8: + lsls r1, r3, 2 + adds r3, 0x1 + adds r1, r0 + movs r2, 0x1 +_08196EB0: + ldrh r6, [r1] + cmp r4, r6 + bcs _08196EB8 + ldrh r4, [r1] +_08196EB8: + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _08196EB0 + movs r2, 0x2 + cmp r3, 0x3 + ble _08196EA8 + str r2, [r5] + b _08196F7E + .pool +_08196ED0: + movs r3, 0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + movs r1, 0xDD + lsls r1, 4 + adds r0, r1 +_08196EDC: + lsls r1, r3, 2 + adds r3, 0x1 + adds r1, r0 + movs r2, 0x1 +_08196EE4: + ldrh r6, [r1] + cmp r4, r6 + bcs _08196EEC + ldrh r4, [r1] +_08196EEC: + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _08196EE4 + movs r2, 0x2 + cmp r3, 0x1 + ble _08196EDC + str r2, [r5] + b _08196F7E + .pool +_08196F04: + movs r3, 0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000dea + adds r0, r1 +_08196F0E: + lsls r1, r3, 2 + adds r3, 0x1 + adds r1, r0 + movs r2, 0x1 +_08196F16: + ldrh r6, [r1] + cmp r4, r6 + bcs _08196F1E + ldrh r4, [r1] +_08196F1E: + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _08196F16 + movs r2, 0x2 + cmp r3, 0x1 + ble _08196F0E + str r2, [r5] + b _08196F7E + .pool +_08196F38: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000dde + adds r0, r1 + movs r3, 0x1 +_08196F42: + ldrh r6, [r0] + cmp r4, r6 + bcs _08196F4A + ldrh r4, [r0] +_08196F4A: + adds r0, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _08196F42 + movs r3, 0x2 + str r3, [r5] + b _08196F7E + .pool +_08196F60: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000e1e + adds r0, r1 + movs r3, 0x1 +_08196F6A: + ldrh r6, [r0] + cmp r4, r6 + bcs _08196F72 + ldrh r4, [r0] +_08196F72: + adds r0, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _08196F6A + movs r0, 0x5 +_08196F7C: + str r0, [r5] +_08196F7E: + adds r0, r4, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8196E04 + + thumb_func_start sub_8196F90 +sub_8196F90: @ 8196F90 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x9 + bhi _08196F9E + movs r0, 0 + b _0819707A +_08196F9E: + cmp r4, 0x13 + bhi _08196FA6 + movs r0, 0x1 + b _0819707A +_08196FA6: + cmp r4, 0x1D + bhi _08196FAE + movs r0, 0x2 + b _0819707A +_08196FAE: + cmp r4, 0x27 + bhi _08196FB6 + movs r0, 0x3 + b _0819707A +_08196FB6: + cmp r4, 0x31 + bhi _08196FBE + movs r0, 0x4 + b _0819707A +_08196FBE: + cmp r4, 0x3B + bhi _08196FC6 + movs r0, 0x5 + b _0819707A +_08196FC6: + cmp r4, 0x45 + bhi _08196FCE + movs r0, 0x6 + b _0819707A +_08196FCE: + cmp r4, 0x4F + bhi _08196FD6 + movs r0, 0x7 + b _0819707A +_08196FD6: + cmp r4, 0x59 + bhi _08196FDE + movs r0, 0x8 + b _0819707A +_08196FDE: + cmp r4, 0x63 + bhi _08196FE6 + movs r0, 0x9 + b _0819707A +_08196FE6: + cmp r4, 0x6D + bhi _08196FEE + movs r0, 0xA + b _0819707A +_08196FEE: + cmp r4, 0x77 + bhi _08196FF6 + movs r0, 0xB + b _0819707A +_08196FF6: + cmp r4, 0x81 + bhi _08196FFE + movs r0, 0xC + b _0819707A +_08196FFE: + cmp r4, 0x8B + bhi _08197006 + movs r0, 0xD + b _0819707A +_08197006: + cmp r4, 0x95 + bhi _0819700E + movs r0, 0xE + b _0819707A +_0819700E: + cmp r4, 0x9F + bhi _08197016 + movs r0, 0xF + b _0819707A +_08197016: + cmp r4, 0xA9 + bhi _0819701E + movs r0, 0x10 + b _0819707A +_0819701E: + cmp r4, 0xB3 + bhi _08197026 + movs r0, 0x11 + b _0819707A +_08197026: + cmp r4, 0xBD + bhi _0819702E + movs r0, 0x12 + b _0819707A +_0819702E: + cmp r4, 0xC7 + bls _08197078 + movs r0, 0xCD + lsls r0, 1 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + bl GetSetPokedexFlag + lsls r0, 24 + cmp r0, 0 + beq _08197050 + subs r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 +_08197050: + ldr r0, =0x00000199 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + bl GetSetPokedexFlag + lsls r0, 24 + cmp r0, 0 + beq _0819706C + subs r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 +_0819706C: + cmp r4, 0xC7 + bls _08197078 + movs r0, 0x14 + b _0819707A + .pool +_08197078: + movs r0, 0x13 +_0819707A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8196F90 + + thumb_func_start sub_8197080 +sub_8197080: @ 8197080 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r8, r0 + movs r0, 0xFA + lsls r0, 2 + bl Alloc + adds r7, r0, 0 + cmp r7, 0 + bne _081970A2 + movs r0, 0xFF + mov r1, r8 + strb r0, [r1] + b _0819715C +_081970A2: + movs r0, 0 + bl sub_80C0844 + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x1 + bl sub_80C0844 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, =gStringVar1 + mov r10, r0 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + ldr r1, =gStringVar2 + mov r9, r1 + mov r0, r9 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + adds r0, r6, 0 + bl sub_8196F90 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =gUnknown_082A5C9C + adds r0, r7, 0 + bl StringCopy + adds r5, r0, 0 + movs r6, 0xFB + strb r6, [r5] + adds r5, 0x1 + ldr r1, =gUnknown_082A5D2C + adds r0, r5, 0 + bl StringCopy + adds r5, r0, 0 + strb r6, [r5] + adds r5, 0x1 + ldr r0, =gUnknown_0860F020 + lsls r4, 2 + adds r4, r0 + ldr r1, [r4] + adds r0, r5, 0 + bl StringCopy + mov r0, r8 + adds r1, r7, 0 + bl StringExpandPlaceholders + adds r5, r0, 0 + bl IsNationalPokedexEnabled + cmp r0, 0 + beq _08197156 + strb r6, [r5] + adds r5, 0x1 + movs r0, 0 + bl pokedex_count + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x1 + bl pokedex_count + lsls r0, 16 + lsrs r6, r0, 16 + mov r0, r10 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + mov r0, r9 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + ldr r1, =gUnknown_082A633D + adds r0, r5, 0 + bl StringExpandPlaceholders +_08197156: + adds r0, r7, 0 + bl Free +_0819715C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8197080 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/battle_frontier_2.s b/asm/battle_frontier_2.s new file mode 100755 index 000000000..a8494efe6 --- /dev/null +++ b/asm/battle_frontier_2.s @@ -0,0 +1,31336 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_819A4C8 +sub_819A4C8: @ 819A4C8 + push {lr} + bl AnimateSprites + bl BuildOamBuffer + bl RunTextPrinters + bl UpdatePaletteFade + bl RunTasks + pop {r0} + bx r0 + thumb_func_end sub_819A4C8 + + thumb_func_start sub_819A4E4 +sub_819A4E4: @ 819A4E4 + push {lr} + bl LoadOam + bl ProcessSpriteCopyRequests + bl TransferPlttBuffer + pop {r0} + bx r0 + thumb_func_end sub_819A4E4 + + thumb_func_start sub_819A4F8 +sub_819A4F8: @ 819A4F8 + push {lr} + ldr r0, =gUnknown_0300127C + movs r1, 0 + str r1, [r0] + ldr r0, =sub_819A514 + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_819A4F8 + + thumb_func_start sub_819A514 +sub_819A514: @ 819A514 + push {r4,r5,lr} + sub sp, 0xC + ldr r0, =gMain + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0xA + bls _0819A528 + b _0819A98E +_0819A528: + lsls r0, 2 + ldr r1, =_0819A53C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0819A53C: + .4byte _0819A568 + .4byte _0819A5C0 + .4byte _0819A69C + .4byte _0819A77C + .4byte _0819A7CC + .4byte _0819A868 + .4byte _0819A8A4 + .4byte _0819A8AC + .4byte _0819A8C4 + .4byte _0819A8DC + .4byte _0819A8FC +_0819A568: + ldr r4, =gUnknown_0203CE3C + ldr r0, [r4] + cmp r0, 0 + beq _0819A578 + bl Free + movs r0, 0 + str r0, [r4] +_0819A578: + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + str r0, [sp, 0x8] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, =0x05006000 + add r0, sp, 0x8 + bl CpuSet + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_08610428 + movs r0, 0 + movs r2, 0x3 + bl InitBgsFromTemplates + ldr r0, =gUnknown_08610434 + bl InitWindows + bl DeactivateAllTextPrinters + b _0819A8E6 + .pool +_0819A5C0: + ldr r5, =gUnknown_0203CE2C + movs r4, 0x88 + lsls r4, 3 + adds r0, r4, 0 + bl Alloc + str r0, [r5] + ldr r5, =gUnknown_0203CE30 + adds r0, r4, 0 + bl AllocZeroed + str r0, [r5] + ldr r5, =gUnknown_0203CE34 + movs r4, 0x80 + lsls r4, 4 + adds r0, r4, 0 + bl Alloc + str r0, [r5] + ldr r5, =gUnknown_0203CE38 + adds r0, r4, 0 + bl AllocZeroed + str r0, [r5] + 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, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + movs r0, 0x4C + movs r1, 0 + bl SetGpuReg + movs r0, 0x40 + movs r1, 0 + bl SetGpuReg + movs r0, 0x44 + movs r1, 0 + bl SetGpuReg + movs r0, 0x42 + movs r1, 0 + bl SetGpuReg + movs r0, 0x46 + movs r1, 0 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0 + bl SetGpuReg + movs r0, 0x4A + movs r1, 0 + bl SetGpuReg + ldr r1, =gMain + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _0819A8EE + .pool +_0819A69C: + bl ResetPaletteFade + bl ResetSpriteData + bl ResetTasks + bl FreeAllSpritePalettes + ldr r0, =gUnknown_08DC0754 + ldr r5, =gUnknown_0203CE2C + ldr r1, [r5] + movs r2, 0x88 + lsls r2, 2 + bl CpuSet + ldr r0, =gUnknown_0861033C + ldr r4, =gUnknown_0203CE30 + ldr r1, [r4] + movs r2, 0x30 + bl CpuSet + ldr r1, [r5] + movs r2, 0x88 + lsls r2, 3 + movs r0, 0x1 + movs r3, 0 + bl LoadBgTiles + ldr r1, [r4] + movs r0, 0x3 + movs r2, 0x60 + movs r3, 0 + bl LoadBgTiles + ldr r0, =gUnknown_08DC0B94 + ldr r4, =gUnknown_0203CE34 + ldr r1, [r4] + movs r2, 0x80 + lsls r2, 3 + bl CpuSet + ldr r1, [r4] + movs r2, 0x80 + lsls r2, 4 + movs r0, 0x1 + movs r3, 0 + bl LoadBgTilemap + ldr r0, =gUnknown_08DC0714 + movs r1, 0 + movs r2, 0x40 + bl LoadPalette + ldr r4, =gUnknown_0861046C + adds r0, r4, 0 + movs r1, 0xF0 + movs r2, 0x8 + bl LoadPalette + adds r0, r4, 0 + movs r1, 0xE0 + movs r2, 0xA + bl LoadPalette + ldr r0, =gUnknown_0300127C + ldr r1, [r0] + ldrb r0, [r1, 0x6] + cmp r0, 0x1 + bne _0819A738 + ldr r0, =gPlttBufferUnfaded + movs r2, 0xA9 + lsls r2, 2 + adds r1, r2 + ldrh r1, [r1] + movs r3, 0xE4 + lsls r3, 1 + adds r0, r3 + strh r1, [r0] +_0819A738: + ldr r0, =gUnknown_0861039C + movs r1, 0x20 + movs r2, 0x4 + bl LoadPalette + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819A8EE + .pool +_0819A77C: + ldr r0, =gUnknown_0203CE38 + ldr r1, [r0] + movs r0, 0x3 + bl SetBgTilemapBuffer + ldr r5, =gUnknown_0861023C + movs r4, 0x8 + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x3 + adds r1, r5, 0 + movs r2, 0xB + movs r3, 0x4 + bl CopyToBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x3 + adds r1, r5, 0 + movs r2, 0x2 + movs r3, 0x4 + bl CopyToBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x3 + adds r1, r5, 0 + movs r2, 0x14 + movs r3, 0x4 + bl CopyToBgTilemapBufferRect + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + b _0819A8E6 + .pool +_0819A7CC: + ldr r0, =gUnknown_086103F4 + bl LoadSpritePalettes + ldr r0, =gUnknown_086103BC + bl LoadSpriteSheets + ldr r0, =gUnknown_086103E4 + bl LoadCompressedObjectPic + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + ldr r0, =sub_819A4E4 + bl SetVBlankCallback + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade + movs r1, 0x9A + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + ldrb r0, [r0, 0x6] + cmp r0, 0x1 + bne _0819A854 + movs r0, 0x58 + movs r1, 0x98 + movs r2, 0x20 + movs r3, 0x60 + bl sub_819C5D0 + movs r0, 0x3 + bl ShowBg + ldr r1, =0x00001248 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x0000040b + movs r0, 0x52 + bl SetGpuReg + b _0819A85A + .pool +_0819A854: + movs r0, 0x3 + bl HideBg +_0819A85A: + ldr r1, =gMain + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _0819A8EE + .pool +_0819A868: + ldr r4, =gUnknown_0300127C + ldr r1, [r4] + ldrb r0, [r1, 0x6] + cmp r0, 0x1 + bne _0819A878 + ldr r0, =gUnknown_0203CF20 + ldrb r0, [r0] + strb r0, [r1, 0x3] +_0819A878: + bl sub_819A9AC + bl sub_819AA18 + ldr r0, [r4] + ldrb r0, [r0, 0x6] + cmp r0, 0x1 + bne _0819A88C + bl sub_819BE34 +_0819A88C: + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819A8EE + .pool +_0819A8A4: + bl sub_819BA64 + movs r0, 0x2 + b _0819A8E2 +_0819A8AC: + bl sub_819BCF8 + movs r0, 0x5 + bl PutWindowTilemap + ldr r1, =gMain + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _0819A8EE + .pool +_0819A8C4: + bl sub_819B9E8 + movs r0, 0x1 + bl PutWindowTilemap + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819A8EE + .pool +_0819A8DC: + bl sub_819B9B4 + movs r0, 0 +_0819A8E2: + bl PutWindowTilemap +_0819A8E6: + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 +_0819A8EE: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0819A98E + .pool +_0819A8FC: + ldr r0, =sub_819C69C + movs r1, 0 + bl CreateTask + ldr r2, =gUnknown_0300127C + ldr r1, [r2] + ldr r3, =0x000002a1 + adds r1, r3 + strb r0, [r1] + ldr r3, [r2] + ldrb r5, [r3, 0x6] + cmp r5, 0 + bne _0819A954 + ldr r4, =gTasks + ldr r1, =0x000002a1 + adds r0, r3, r1 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + strh r5, [r0, 0x8] + ldr r0, =sub_819B378 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + strh r5, [r0, 0x8] + b _0819A988 + .pool +_0819A954: + ldr r4, =gTasks + ldr r2, =0x000002a1 + adds r0, r3, r2 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + movs r2, 0 + movs r1, 0x1 + strh r1, [r0, 0x8] + ldr r1, =0x000002a2 + adds r0, r3, r1 + strb r2, [r0] + ldr r0, =sub_819B124 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + movs r1, 0xD + strh r1, [r0, 0x8] +_0819A988: + ldr r0, =sub_819A4C8 + bl SetMainCallback2 +_0819A98E: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819A514 + + thumb_func_start sub_819A9AC +sub_819A9AC: @ 819A9AC + push {r4,r5,lr} + ldr r5, =gUnknown_0300127C + ldr r4, [r5] + cmp r4, 0 + bne _0819AA12 + movs r0, 0xAB + lsls r0, 2 + bl AllocZeroed + str r0, [r5] + strb r4, [r0, 0x3] + ldr r1, [r5] + movs r0, 0x1 + strb r0, [r1, 0x5] + ldr r0, [r5] + strb r4, [r0, 0x6] + movs r2, 0 + movs r4, 0x6C + movs r3, 0 +_0819A9D2: + ldr r0, [r5] + adds r1, r2, 0 + muls r1, r4 + adds r0, r1 + strb r3, [r0, 0x10] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bls _0819A9D2 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + beq _0819AA0C + movs r0, 0 + bl sub_819B484 + b _0819AA12 + .pool +_0819AA0C: + movs r0, 0 + bl sub_819B63C +_0819AA12: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_819A9AC + + thumb_func_start sub_819AA18 +sub_819AA18: @ 819AA18 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r4, 0 + mov r8, r4 + ldr r7, =gSprites +_0819AA24: + lsls r1, r4, 3 + adds r1, r4 + lsls r1, 2 + subs r1, r4 + adds r1, 0x20 + lsls r1, 16 + asrs r1, 16 + ldr r0, =gUnknown_086105D8 + movs r2, 0x40 + movs r3, 0x1 + bl CreateSprite + ldr r6, =gUnknown_0300127C + ldr r2, [r6] + movs r5, 0x6C + adds r1, r4, 0 + muls r1, r5 + adds r2, r1 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r2, 0xE] + ldrh r1, [r2, 0xE] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + mov r1, r8 + strh r1, [r0, 0x2E] + adds r0, r4, 0 + bl sub_819ADAC + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _0819AA24 + ldr r0, [r6] + ldrb r1, [r0, 0x3] + ldr r4, =gSprites + muls r1, r5 + adds r0, r1 + ldrh r0, [r0, 0xE] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldr r0, =gUnknown_086105F0 + movs r2, 0x20 + ldrsh r1, [r1, r2] + movs r2, 0x58 + movs r3, 0 + bl CreateSprite + ldr r1, [r6] + movs r5, 0 + strb r0, [r1, 0x4] + ldr r0, =gUnknown_08610608 + movs r1, 0xB0 + movs r2, 0x70 + movs r3, 0 + bl CreateSprite + ldr r1, [r6] + strb r0, [r1, 0x1] + ldr r0, =gUnknown_08610620 + movs r1, 0xB0 + movs r2, 0x90 + movs r3, 0 + bl CreateSprite + ldr r1, [r6] + strb r0, [r1, 0x2] + ldr r0, [r6] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldr r0, [r6] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + ldr r0, [r6] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x28 + strb r5, [r0] + ldr r0, [r6] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x29 + strb r5, [r0] + ldr r0, [r6] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x28 + strb r5, [r0] + ldr r0, [r6] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x29 + strb r5, [r0] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819AA18 + + thumb_func_start sub_819AB40 +sub_819AB40: @ 819AB40 + push {r4-r6,lr} + movs r4, 0 +_0819AB44: + ldr r6, =gUnknown_0300127C + ldr r1, [r6] + movs r0, 0x6C + muls r0, r4 + adds r1, r0 + ldrh r1, [r1, 0xE] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, =gSprites + adds r0, r5 + bl DestroySprite + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _0819AB44 + ldr r0, [r6] + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl DestroySprite + ldr r0, [r6] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl DestroySprite + ldr r0, [r6] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl DestroySprite + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819AB40 + + thumb_func_start sub_819ABA8 +sub_819ABA8: @ 819ABA8 + push {r4,lr} + lsls r0, 24 + cmp r0, 0 + ble _0819ABC8 + ldr r0, =gUnknown_0300127C + ldr r1, [r0] + ldrb r3, [r1, 0x3] + adds r2, r0, 0 + cmp r3, 0x5 + beq _0819ABC4 + adds r0, r3, 0x1 + b _0819ABDE + .pool +_0819ABC4: + movs r0, 0 + b _0819ABDE +_0819ABC8: + ldr r0, =gUnknown_0300127C + ldr r1, [r0] + ldrb r3, [r1, 0x3] + adds r2, r0, 0 + cmp r3, 0 + beq _0819ABDC + subs r0, r3, 0x1 + b _0819ABDE + .pool +_0819ABDC: + movs r0, 0x5 +_0819ABDE: + strb r0, [r1, 0x3] + ldr r2, [r2] + ldrb r3, [r2, 0x3] + ldr r4, =gSprites + ldrb r0, [r2, 0x4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + movs r0, 0x6C + muls r0, r3 + adds r2, r0 + ldrh r2, [r2, 0xE] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x20] + strh r0, [r1, 0x20] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819ABA8 + + thumb_func_start sub_819AC10 +sub_819AC10: @ 819AC10 + push {lr} + lsls r0, 24 + cmp r0, 0 + ble _0819AC30 + ldr r0, =gUnknown_0300127C + ldr r1, [r0] + ldrb r3, [r1] + adds r2, r0, 0 + cmp r3, 0x2 + beq _0819AC2C + adds r0, r3, 0x1 + b _0819AC46 + .pool +_0819AC2C: + movs r0, 0 + b _0819AC46 +_0819AC30: + ldr r0, =gUnknown_0300127C + ldr r1, [r0] + ldrb r3, [r1] + adds r2, r0, 0 + cmp r3, 0 + beq _0819AC44 + subs r0, r3, 0x1 + b _0819AC46 + .pool +_0819AC44: + movs r0, 0x2 +_0819AC46: + strb r0, [r1] + ldr r3, =gSprites + ldr r2, [r2] + ldrb r0, [r2, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r2] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + ldrb r0, [r2, 0x2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r2] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + pop {r0} + bx r0 + .pool + thumb_func_end sub_819AC10 + + thumb_func_start sub_819AC78 +sub_819AC78: @ 819AC78 + push {lr} + lsls r0, 24 + cmp r0, 0 + ble _0819AC98 + ldr r0, =gUnknown_0300127C + ldr r1, [r0] + ldrb r3, [r1, 0x7] + adds r2, r0, 0 + cmp r3, 0x1 + beq _0819AC94 + adds r0, r3, 0x1 + b _0819ACAE + .pool +_0819AC94: + movs r0, 0 + b _0819ACAE +_0819AC98: + ldr r0, =gUnknown_0300127C + ldr r1, [r0] + ldrb r3, [r1, 0x7] + adds r2, r0, 0 + cmp r3, 0 + beq _0819ACAC + subs r0, r3, 0x1 + b _0819ACAE + .pool +_0819ACAC: + movs r0, 0x1 +_0819ACAE: + strb r0, [r1, 0x7] + ldr r3, =gSprites + ldr r2, [r2] + ldrb r0, [r2, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r2, 0x7] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + ldrb r0, [r2, 0x2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r2, 0x7] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + pop {r0} + bx r0 + .pool + thumb_func_end sub_819AC78 + + thumb_func_start sub_819ACE0 +sub_819ACE0: @ 819ACE0 + push {r4-r6,lr} + ldr r5, =gUnknown_0300127C + ldr r0, [r5] + ldrb r6, [r0, 0x3] + movs r1, 0x6C + adds r4, r6, 0 + muls r4, r1 + adds r0, r4 + ldrb r0, [r0, 0x10] + cmp r0, 0 + beq _0819AD60 + movs r0, 0x64 + bl IndexOfSpritePaletteTag + lsls r0, 24 + lsrs r3, r0, 24 + ldr r1, [r5] + ldrb r0, [r1, 0x5] + cmp r0, 0x3 + bne _0819AD44 + adds r0, r1, r4 + ldrb r0, [r0, 0x10] + cmp r0, 0x1 + bne _0819AD44 + movs r2, 0 + ldrb r0, [r1, 0x10] + cmp r0, 0x2 + beq _0819AD32 + movs r4, 0x6C +_0819AD1A: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bhi _0819AD32 + ldr r0, [r5] + adds r1, r2, 0 + muls r1, r4 + adds r0, r1 + ldrb r0, [r0, 0x10] + cmp r0, 0x2 + bne _0819AD1A +_0819AD32: + cmp r2, 0x6 + beq _0819AD9C + ldr r0, =gUnknown_0300127C + ldr r1, [r0] + movs r0, 0x6C + muls r0, r2 + adds r1, r0 + movs r0, 0x1 + strb r0, [r1, 0x10] +_0819AD44: + ldr r2, =gUnknown_0300127C + ldr r1, [r2] + movs r0, 0x6C + muls r0, r6 + adds r1, r0 + movs r0, 0 + strb r0, [r1, 0x10] + ldr r1, [r2] + ldrb r0, [r1, 0x5] + subs r0, 0x1 + b _0819AD78 + .pool +_0819AD60: + movs r0, 0x65 + bl IndexOfSpritePaletteTag + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, [r5] + adds r1, r0, r4 + ldrb r0, [r0, 0x5] + strb r0, [r1, 0x10] + ldr r1, [r5] + ldrb r0, [r1, 0x5] + adds r0, 0x1 +_0819AD78: + strb r0, [r1, 0x5] + ldr r2, =gSprites + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + movs r1, 0x6C + muls r1, r6 + adds r0, r1 + ldrh r0, [r0, 0xE] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + lsls r3, 4 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x5] +_0819AD9C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819ACE0 + + thumb_func_start sub_819ADAC +sub_819ADAC: @ 819ADAC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + movs r1, 0x6C + muls r1, r4 + adds r0, r1 + ldrb r0, [r0, 0x10] + cmp r0, 0 + beq _0819ADCC + movs r0, 0x65 + b _0819ADCE + .pool +_0819ADCC: + movs r0, 0x64 +_0819ADCE: + bl IndexOfSpritePaletteTag + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, =gSprites + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + movs r1, 0x6C + muls r1, r4 + adds r0, r1 + ldrh r0, [r0, 0xE] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + lsls r3, 4 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x5] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819ADAC + + thumb_func_start sub_819AE08 +sub_819AE08: @ 819AE08 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r6, r0, r1 + movs r1, 0x8 + ldrsh r0, [r6, r1] + cmp r0, 0x7 + beq _0819AE64 + cmp r0, 0x7 + bgt _0819AE30 + cmp r0, 0x6 + beq _0819AE36 + b _0819AF50 + .pool +_0819AE30: + cmp r0, 0x8 + beq _0819AEE8 + b _0819AF50 +_0819AE36: + ldr r1, =gPlttBufferUnfaded + ldr r0, =gPlttBufferFaded + movs r2, 0xE4 + lsls r2, 1 + adds r0, r2 + ldrh r0, [r0] + adds r1, r2 + movs r2, 0 + strh r0, [r1] + movs r0, 0x1 + negs r0, r0 + str r2, [sp] + movs r1, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + movs r0, 0x7 + strh r0, [r6, 0x8] + b _0819AF50 + .pool +_0819AE64: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0819AF50 + ldr r4, =gUnknown_0300127C + ldr r0, [r4] + ldr r2, =0x000002a1 + adds r0, r2 + ldrb r0, [r0] + bl DestroyTask + ldr r1, [r4] + movs r3, 0xA6 + lsls r3, 2 + adds r0, r1, r3 + ldr r0, [r0] + movs r2, 0xA8 + lsls r2, 2 + adds r1, r2 + bl sub_819F444 + bl sub_819AB40 + ldr r4, =gUnknown_0203CE2C + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203CE30 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203CE34 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203CE38 + ldr r0, [r4] + bl Free + str r5, [r4] + bl FreeAllWindowBuffers + movs r0, 0x8 + strh r0, [r6, 0x8] + b _0819AF50 + .pool +_0819AEE8: + ldr r4, =gUnknown_0300127C + ldr r1, [r4] + ldr r0, =gPlttBufferUnfaded + movs r3, 0xE4 + lsls r3, 1 + adds r0, r3 + ldrh r0, [r0] + adds r3, 0xDC + adds r1, r3 + strh r0, [r1] + adds r0, r2, 0 + bl DestroyTask + ldr r1, [r4] + movs r0, 0x1 + strb r0, [r1, 0x6] + ldr r0, [r4] + ldrb r6, [r0, 0x3] + ldr r4, =gUnknown_0203CE3C + movs r0, 0x96 + lsls r0, 2 + bl AllocZeroed + str r0, [r4] + movs r4, 0 +_0819AF1A: + ldr r5, =gUnknown_0203CE3C + ldr r1, [r5] + movs r0, 0x64 + muls r0, r4 + adds r0, r1 + ldr r1, =gUnknown_0300127C + ldr r1, [r1] + movs r2, 0x6C + muls r2, r4 + adds r1, r2 + adds r1, 0x14 + movs r2, 0x64 + bl memcpy + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _0819AF1A + ldr r1, [r5] + ldr r0, =sub_819A514 + str r0, [sp] + movs r0, 0x1 + adds r2, r6, 0 + movs r3, 0x5 + bl sub_81BF8EC +_0819AF50: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819AE08 + + thumb_func_start bc_exit_to_overworld +bc_exit_to_overworld: @ 819AF68 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r7, =gUnknown_0300127C + ldr r0, [r7] + movs r1, 0xA8 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819B00E + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r1, [r4, r0] + cmp r1, 0 + beq _0819AFA0 + cmp r1, 0x1 + beq _0819AFB8 + b _0819B00E + .pool +_0819AFA0: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0819B00E +_0819AFB8: + bl UpdatePaletteFade + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0819B00E + bl sub_819B764 + ldr r0, [r7] + ldr r1, =0x000002a1 + adds r0, r1 + ldrb r0, [r0] + bl DestroyTask + bl sub_819AB40 + ldr r4, =gUnknown_0203CE2C + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203CE34 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203CE38 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r0, [r7] + bl Free + str r5, [r7] + bl FreeAllWindowBuffers + ldr r0, =sub_80861B0 + bl SetMainCallback2 + adds r0, r6, 0 + bl DestroyTask +_0819B00E: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end bc_exit_to_overworld + + thumb_func_start sub_819B02C +sub_819B02C: @ 819B02C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r7, =gUnknown_0300127C + ldr r0, [r7] + movs r1, 0xA8 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819B11A + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x5 + beq _0819B084 + cmp r0, 0x5 + bgt _0819B06C + cmp r0, 0x4 + beq _0819B07A + b _0819B11A + .pool +_0819B06C: + cmp r0, 0xA + bne _0819B11A + bl sub_819C4B4 + movs r0, 0x4 + strh r0, [r5, 0x8] + b _0819B11A +_0819B07A: + bl sub_819B8D4 + movs r0, 0x5 + strh r0, [r5, 0x8] + b _0819B11A +_0819B084: + ldr r2, =gMain + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + mov r8, r0 + movs r6, 0x1 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _0819B0B8 + movs r0, 0x5 + bl PlaySE + ldr r0, [r7] + ldrb r4, [r0, 0x7] + cmp r4, 0 + bne _0819B0C6 + bl sub_819C568 + strh r4, [r5, 0x8] + ldr r0, =bc_exit_to_overworld + str r0, [r5] + b _0819B11A + .pool +_0819B0B8: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0819B0EC + movs r0, 0x5 + bl PlaySE +_0819B0C6: + movs r0, 0x4 + bl sub_819B958 + bl sub_819BC9C + ldr r0, [r7] + ldr r1, =0x000002a2 + adds r0, r1 + mov r1, r8 + strb r1, [r0] + strh r6, [r5, 0x8] + ldr r0, =sub_819B378 + str r0, [r5] + b _0819B11A + .pool +_0819B0EC: + ldrh r1, [r2, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0819B106 + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + negs r0, r0 + bl sub_819AC78 + b _0819B11A +_0819B106: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0819B11A + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + bl sub_819AC78 +_0819B11A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819B02C + + thumb_func_start sub_819B124 +sub_819B124: @ 819B124 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x8] + subs r0, 0x2 + lsls r0, 16 + asrs r0, 16 + adds r6, r1, 0 + cmp r0, 0xB + bls _0819B144 + b _0819B36E +_0819B144: + lsls r0, 2 + ldr r1, =_0819B158 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0819B158: + .4byte _0819B188 + .4byte _0819B1EC + .4byte _0819B36E + .4byte _0819B36E + .4byte _0819B36E + .4byte _0819B36E + .4byte _0819B36E + .4byte _0819B1BC + .4byte _0819B36E + .4byte _0819B36E + .4byte _0819B300 + .4byte _0819B35C +_0819B188: + ldr r0, =gUnknown_0300127C + ldr r1, [r0] + ldrb r0, [r1, 0x6] + cmp r0, 0 + bne _0819B1A2 + ldr r2, =0x00000299 + adds r0, r1, r2 + movs r7, 0xA8 + lsls r7, 2 + adds r1, r7 + movs r2, 0 + bl sub_819F2B4 +_0819B1A2: + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + movs r0, 0x9 + b _0819B36C + .pool +_0819B1BC: + ldr r4, =gUnknown_0300127C + ldr r0, [r4] + movs r1, 0xA8 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0819B1CE + b _0819B36E +_0819B1CE: + bl sub_819B844 + ldr r1, [r4] + movs r0, 0 + strb r0, [r1, 0x6] + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + b _0819B344 + .pool +_0819B1EC: + ldr r2, =gMain + ldrh r1, [r2, 0x2E] + movs r7, 0x1 + movs r6, 0x1 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _0819B27C + movs r0, 0x5 + bl PlaySE + bl sub_819BC04 + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x1 + bne _0819B228 + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + ldr r2, =0x000002a2 + adds r0, r2 + b _0819B2AC + .pool +_0819B228: + cmp r0, 0x2 + bne _0819B248 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0xA + strh r1, [r0, 0x8] + ldr r1, =sub_819B02C + str r1, [r0] + b _0819B36E + .pool +_0819B248: + cmp r1, 0x3 + bne _0819B260 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0xB + strh r1, [r0, 0x8] + b _0819B2BA + .pool +_0819B260: + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x6 + strh r1, [r0, 0x8] + ldr r1, =sub_819AE08 + str r1, [r0] + b _0819B36E + .pool +_0819B27C: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0819B2D0 + movs r0, 0x5 + bl PlaySE + ldr r4, =gUnknown_0300127C + ldr r1, [r4] + movs r2, 0xA6 + lsls r2, 2 + adds r0, r1, r2 + ldr r0, [r0] + adds r2, 0x8 + adds r1, r2 + movs r2, 0 + bl sub_819F3F8 + movs r0, 0x3 + bl sub_819B958 + ldr r0, [r4] + ldr r1, =0x000002a2 + adds r0, r1 +_0819B2AC: + strb r7, [r0] + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + strh r6, [r0, 0x8] +_0819B2BA: + ldr r1, =sub_819B378 + str r1, [r0] + b _0819B36E + .pool +_0819B2D0: + ldrh r1, [r2, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0819B2EA + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + negs r0, r0 + bl sub_819AC10 + b _0819B36E +_0819B2EA: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0819B36E + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + bl sub_819AC10 + b _0819B36E +_0819B300: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + bne _0819B36E + ldr r4, =gUnknown_0300127C + ldr r2, [r4] + ldrb r0, [r2, 0x6] + cmp r0, 0x1 + bne _0819B338 + ldr r1, =gPlttBufferFaded + movs r7, 0xA9 + lsls r7, 2 + adds r0, r2, r7 + ldrh r0, [r0] + movs r2, 0xE4 + lsls r2, 1 + adds r1, r2 + strh r0, [r1] + ldr r0, =gPlttBufferUnfaded + subs r7, 0xBC + adds r1, r0, r7 + ldrh r1, [r1] + adds r0, r2 + strh r1, [r0] +_0819B338: + ldr r0, [r4] + strb r3, [r0, 0x6] + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r6 +_0819B344: + movs r1, 0x3 + strh r1, [r0, 0x8] + b _0819B36E + .pool +_0819B35C: + bl sub_819B844 + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + movs r0, 0xC +_0819B36C: + strh r0, [r1, 0x8] +_0819B36E: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819B124 + + thumb_func_start sub_819B378 +sub_819B378: @ 819B378 + push {r4-r7,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r5, =gUnknown_0300127C + ldr r3, [r5] + movs r7, 0xA8 + lsls r7, 2 + adds r0, r3, r7 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819B476 + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r1, [r4, r0] + cmp r1, 0x1 + beq _0819B3DC + cmp r1, 0x1 + bgt _0819B3B4 + cmp r1, 0 + beq _0819B3BA + b _0819B476 + .pool +_0819B3B4: + cmp r1, 0xB + beq _0819B440 + b _0819B476 +_0819B3BA: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0819B476 + movs r0, 0x1 + movs r1, 0x1 + strh r1, [r4, 0x8] + ldr r2, =0x000002a2 + adds r1, r3, r2 + strb r0, [r1] + b _0819B476 + .pool +_0819B3DC: + ldr r2, =gMain + ldrh r0, [r2, 0x2E] + ands r1, r0 + cmp r1, 0 + beq _0819B40C + movs r0, 0x5 + bl PlaySE + ldr r0, [r5] + ldr r1, =0x000002a2 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + movs r0, 0x2 + strh r0, [r4, 0x8] + ldr r0, =sub_819B124 + str r0, [r4] + b _0819B476 + .pool +_0819B40C: + ldrh r1, [r2, 0x30] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0819B422 + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + negs r0, r0 + b _0819B432 +_0819B422: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0819B476 + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 +_0819B432: + bl sub_819ABA8 + bl sub_819BCF8 + bl sub_819B9E8 + b _0819B476 +_0819B440: + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r6, 0x1 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _0819B476 + movs r0, 0x5 + bl PlaySE + ldr r1, [r5] + movs r2, 0xA6 + lsls r2, 2 + adds r0, r1, r2 + ldr r0, [r0] + adds r1, r7 + movs r2, 0 + bl sub_819F3F8 + bl sub_819BA64 + ldr r0, [r5] + ldr r1, =0x000002a2 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + strh r6, [r4, 0x8] +_0819B476: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819B378 + + thumb_func_start sub_819B484 +sub_819B484: @ 819B484 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x10] + movs r6, 0 + add r0, sp, 0xC + strb r6, [r0] + ldr r0, =0x000040ce + bl VarGet + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + ldr r7, =gSaveBlock2Ptr + ldr r2, [r7] + ldr r0, =0x00000ca9 + adds r4, r2, r0 + ldrb r0, [r4] + lsls r0, 30 + lsrs r0, 30 + adds r5, r0, 0 + lsls r0, r5, 1 + lsls r1, r6, 2 + adds r0, r1 + ldr r1, =0x00000de2 + adds r2, r1 + adds r2, r0 + ldrh r0, [r2] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x18] + ldr r1, =gUnknown_0203BC8C + ldr r0, =gBattleFrontierMons + str r0, [r1] + ldrb r1, [r4] + movs r0, 0x3 + ands r0, r1 + movs r2, 0x32 + str r2, [sp, 0x14] + cmp r0, 0 + beq _0819B4EA + movs r3, 0x64 + str r3, [sp, 0x14] +_0819B4EA: + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_81A6F70 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x1C] + ldr r1, [r7] + ldrb r0, [r1, 0xA] + mov r9, r0 + ldrb r0, [r1, 0xB] + lsls r0, 8 + mov r2, r9 + orrs r2, r0 + ldrb r0, [r1, 0xC] + lsls r0, 16 + orrs r2, r0 + ldrb r0, [r1, 0xD] + lsls r0, 24 + orrs r2, r0 + mov r9, r2 + movs r3, 0 + mov r8, r3 +_0819B518: + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + mov r2, r8 + lsls r0, r2, 1 + add r0, r8 + lsls r0, 2 + adds r1, r0 + movs r3, 0xE7 + lsls r3, 4 + adds r1, r3 + ldrh r5, [r1] + ldr r0, =gUnknown_0300127C + ldr r1, [r0] + ldr r2, [sp, 0x10] + add r2, r8 + movs r3, 0x6C + adds r0, r2, 0 + muls r0, r3 + adds r1, r0 + strh r5, [r1, 0xC] + mov r10, r2 + ldr r0, [sp, 0x1C] + cmp r8, r0 + bcs _0819B570 + ldr r0, [sp, 0x18] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + b _0819B572 + .pool +_0819B570: + ldr r0, [sp, 0x18] +_0819B572: + movs r1, 0 + bl sub_81A6CA8 + lsls r0, 24 + lsrs r6, r0, 24 + movs r1, 0x6C + mov r4, r10 + muls r4, r1 + adds r4, 0xC + ldr r2, =gUnknown_0300127C + ldr r0, [r2] + adds r0, r4 + adds r0, 0x8 + ldr r1, =gUnknown_0203BC8C + ldr r2, [r1] + lsls r5, 4 + adds r2, r5, r2 + ldrh r1, [r2] + ldrb r3, [r2, 0xC] + str r6, [sp] + ldrb r2, [r2, 0xB] + str r2, [sp, 0x4] + mov r2, r9 + str r2, [sp, 0x8] + ldr r2, [sp, 0x14] + bl sub_8068634 + movs r1, 0 + add r0, sp, 0xC + strb r1, [r0] + movs r6, 0 + adds r7, r5, 0 + movs r3, 0x1 + add r8, r3 + ldr r3, =gUnknown_0300127C +_0819B5B8: + ldr r0, [r3] + adds r0, r4 + adds r0, 0x8 + ldr r5, =gUnknown_0203BC8C + ldr r1, [r5] + adds r1, r7, r1 + lsls r2, r6, 1 + adds r1, 0x2 + adds r1, r2 + ldrh r1, [r1] + adds r2, r6, 0 + str r3, [sp, 0x20] + bl sub_81A7024 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r3, [sp, 0x20] + cmp r6, 0x3 + bls _0819B5B8 + movs r0, 0x6C + mov r4, r10 + muls r4, r0 + adds r4, 0xC + ldr r1, =gUnknown_0300127C + ldr r0, [r1] + adds r0, r4 + adds r0, 0x8 + movs r1, 0x20 + add r2, sp, 0xC + bl SetMonData + ldr r2, =gUnknown_0300127C + ldr r0, [r2] + adds r0, r4 + adds r0, 0x8 + ldr r1, [r5] + adds r1, r7, r1 + ldrb r2, [r1, 0xA] + lsls r2, 1 + ldr r1, =gBattleFrontierHeldItems + adds r2, r1 + movs r1, 0xC + bl SetMonData + mov r3, r8 + lsls r0, r3, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x5 + bhi _0819B620 + b _0819B518 +_0819B620: + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819B484 + + thumb_func_start sub_819B63C +sub_819B63C: @ 819B63C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x10] + add r0, sp, 0xC + movs r1, 0 + strb r1, [r0] + ldr r2, =gUnknown_0203BC8C + ldr r0, =gSlateportBattleTentMons + str r0, [r2] + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldrb r3, [r1, 0xA] + ldrb r0, [r1, 0xB] + lsls r0, 8 + orrs r3, r0 + ldrb r0, [r1, 0xC] + lsls r0, 16 + orrs r3, r0 + ldrb r0, [r1, 0xD] + lsls r0, 24 + orrs r3, r0 + mov r10, r3 + movs r7, 0 + mov r9, r7 +_0819B678: + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + mov r2, r9 + lsls r0, r2, 1 + add r0, r9 + lsls r0, 2 + adds r1, r0 + movs r3, 0xE7 + lsls r3, 4 + adds r1, r3 + ldrh r1, [r1] + mov r8, r1 + ldr r7, =gUnknown_0300127C + ldr r0, [r7] + ldr r6, [sp, 0x10] + add r6, r9 + movs r1, 0x6C + adds r4, r6, 0 + muls r4, r1 + adds r1, r0, r4 + mov r2, r8 + strh r2, [r1, 0xC] + adds r4, 0xC + adds r0, r4 + adds r0, 0x8 + ldr r3, =gUnknown_0203BC8C + ldr r2, [r3] + mov r7, r8 + lsls r5, r7, 4 + adds r2, r5, r2 + ldrh r1, [r2] + ldrb r3, [r2, 0xC] + movs r7, 0 + str r7, [sp] + ldrb r2, [r2, 0xB] + str r2, [sp, 0x4] + mov r2, r10 + str r2, [sp, 0x8] + movs r2, 0x1E + bl sub_8068634 + add r0, sp, 0xC + movs r3, 0 + strb r3, [r0] + movs r0, 0x1 + add r9, r0 +_0819B6D4: + ldr r1, =gUnknown_0300127C + ldr r0, [r1] + adds r0, r4 + adds r0, 0x8 + ldr r3, =gUnknown_0203BC8C + ldr r2, [r3] + mov r3, r8 + lsls r1, r3, 4 + adds r1, r2 + lsls r2, r7, 1 + adds r1, 0x2 + adds r1, r2 + ldrh r1, [r1] + adds r2, r7, 0 + bl sub_81A7024 + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x3 + bls _0819B6D4 + movs r7, 0x6C + adds r4, r6, 0 + muls r4, r7 + adds r4, 0xC + ldr r1, =gUnknown_0300127C + ldr r0, [r1] + adds r0, r4 + adds r0, 0x8 + movs r1, 0x20 + add r2, sp, 0xC + bl SetMonData + ldr r2, =gUnknown_0300127C + ldr r0, [r2] + adds r0, r4 + adds r0, 0x8 + ldr r3, =gUnknown_0203BC8C + ldr r1, [r3] + adds r1, r5, r1 + ldrb r2, [r1, 0xA] + lsls r2, 1 + ldr r1, =gBattleFrontierHeldItems + adds r2, r1 + movs r1, 0xC + bl SetMonData + mov r7, r9 + lsls r0, r7, 24 + lsrs r0, 24 + mov r9, r0 + cmp r0, 0x5 + bls _0819B678 + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819B63C + + thumb_func_start sub_819B764 +sub_819B764: @ 819B764 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r7, 0 + ldr r0, =gUnknown_0300127C + mov r10, r0 + ldr r1, =gSaveBlock2Ptr + mov r8, r1 +_0819B778: + movs r2, 0 + adds r0, r7, 0x1 + mov r9, r0 +_0819B77E: + mov r1, r10 + ldr r0, [r1] + movs r1, 0x6C + adds r6, r2, 0 + muls r6, r1 + adds r1, r0, r6 + ldrb r0, [r1, 0x10] + cmp r0, r9 + bne _0819B81C + movs r0, 0x64 + adds r5, r7, 0 + muls r5, r0 + ldr r2, =gPlayerParty + adds r5, r2 + adds r1, 0x14 + adds r0, r5, 0 + movs r2, 0x64 + bl memcpy + mov r0, r8 + ldr r1, [r0] + lsls r4, r7, 1 + adds r4, r7 + lsls r4, 2 + adds r1, r4 + mov r2, r10 + ldr r0, [r2] + adds r0, r6 + ldrh r0, [r0, 0xC] + movs r2, 0xE7 + lsls r2, 4 + adds r1, r2 + strh r0, [r1] + adds r0, r5, 0 + movs r1, 0 + movs r2, 0 + bl GetMonData + mov r2, r8 + ldr r1, [r2] + ldr r2, =0x00000e74 + adds r1, r2 + adds r1, r4 + str r0, [r1] + adds r0, r5, 0 + movs r1, 0x2E + movs r2, 0 + bl GetBoxMonData + mov r2, r8 + ldr r1, [r2] + adds r1, r4 + ldr r2, =0x00000e79 + adds r1, r2 + strb r0, [r1] + adds r0, r5, 0 + movs r1, 0x28 + movs r2, 0 + bl GetBoxMonData + mov r2, r8 + ldr r1, [r2] + adds r1, r4 + ldr r2, =0x00000e78 + adds r1, r2 + strb r0, [r1] + b _0819B826 + .pool +_0819B81C: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bls _0819B77E +_0819B826: + mov r1, r9 + lsls r0, r1, 24 + lsrs r7, r0, 24 + cmp r7, 0x2 + bls _0819B778 + bl CalculatePlayerPartyCount + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819B764 + + thumb_func_start sub_819B844 +sub_819B844: @ 819B844 + push {r4,r5,lr} + ldr r5, =gUnknown_0300127C + ldr r1, [r5] + ldrb r0, [r1, 0x6] + cmp r0, 0 + bne _0819B852 + strb r0, [r1] +_0819B852: + ldr r4, =gSprites + ldr r2, [r5] + ldrb r1, [r2, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xB0 + strh r1, [r0, 0x20] + ldrb r0, [r2, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r0, [r2] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + ldrb r1, [r2, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xD0 + strh r1, [r0, 0x20] + ldrb r0, [r2, 0x2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r0, [r2] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + ldrb r0, [r2, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x5 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r1] + ldr r0, [r5] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + ands r2, r1 + strb r2, [r0] + bl sub_819BAFC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819B844 + + thumb_func_start sub_819B8D4 +sub_819B8D4: @ 819B8D4 + push {r4,r5,lr} + ldr r5, =gUnknown_0300127C + ldr r1, [r5] + movs r0, 0 + strb r0, [r1, 0x7] + ldr r4, =gSprites + ldr r2, [r5] + ldrb r1, [r2, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xB0 + strh r1, [r0, 0x20] + ldrb r1, [r2, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r3, 0x70 + strh r3, [r0, 0x22] + ldrb r1, [r2, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xD0 + strh r1, [r0, 0x20] + ldrb r1, [r2, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r3, [r0, 0x22] + ldrb r0, [r2, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x5 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r1] + ldr r0, [r5] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + ands r2, r1 + strb r2, [r0] + bl sub_819BBA8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819B8D4 + + thumb_func_start sub_819B958 +sub_819B958: @ 819B958 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =gSprites + ldr r3, =gUnknown_0300127C + ldr r0, [r3] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldr r0, [r3] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + adds r0, r4, 0 + movs r1, 0 + bl FillWindowPixelBuffer + adds r0, r4, 0 + movs r1, 0x2 + bl CopyWindowToVram + adds r0, r4, 0 + bl ClearWindowTilemap + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819B958 + + thumb_func_start sub_819B9B4 +sub_819B9B4: @ 819B9B4 + push {lr} + sub sp, 0xC + movs r0, 0 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r2, =gUnknown_085EEBB2 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x2 + bl PrintTextOnWindow + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_819B9B4 + + thumb_func_start sub_819B9E8 +sub_819B9E8: @ 819B9E8 + push {r4,r5,lr} + sub sp, 0xC + ldr r5, =gUnknown_0300127C + ldr r0, [r5] + ldrb r4, [r0, 0x3] + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x6C + muls r0, r4 + ldr r1, [r5] + adds r0, r1 + adds r0, 0x14 + movs r1, 0xB + movs r2, 0 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + ldr r4, =gStringVar4 + movs r1, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + adds r0, r4, 0 + bl StringCopy + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x56 + bl GetStringRightAlignXOffset + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gUnknown_08610479 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0x1 + bl box_print + movs r0, 0x1 + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819B9E8 + + thumb_func_start sub_819BA64 +sub_819BA64: @ 819BA64 + push {lr} + sub sp, 0xC + movs r0, 0x2 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + ldrb r0, [r0, 0x5] + cmp r0, 0x1 + bne _0819BA88 + ldr r2, =gUnknown_085EEBC1 + b _0819BA9C + .pool +_0819BA88: + cmp r0, 0x2 + bne _0819BA94 + ldr r2, =gUnknown_085EEBDB + b _0819BA9C + .pool +_0819BA94: + ldr r2, =gUnknown_085EEC2D + cmp r0, 0x3 + bne _0819BA9C + ldr r2, =gUnknown_085EEBF6 +_0819BA9C: + movs r0, 0x5 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r3, 0x2 + bl PrintTextOnWindow + movs r0, 0x2 + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_819BA64 + + thumb_func_start sub_819BAC8 +sub_819BAC8: @ 819BAC8 + push {lr} + sub sp, 0xC + movs r0, 0x2 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r2, =gUnknown_085EEC50 + movs r0, 0x5 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r3, 0x2 + bl PrintTextOnWindow + movs r0, 0x2 + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_819BAC8 + + thumb_func_start sub_819BAFC +sub_819BAFC: @ 819BAFC + push {r4-r6,lr} + sub sp, 0xC + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + ldrb r2, [r0, 0x3] + movs r1, 0x6C + muls r1, r2 + adds r0, r1 + ldrb r5, [r0, 0x10] + movs r0, 0x3 + bl PutWindowTilemap + movs r0, 0x3 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r4, =gUnknown_08610476 + str r4, [sp] + movs r6, 0 + str r6, [sp, 0x4] + ldr r0, =gUnknown_085EEC15 + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0x7 + movs r3, 0x1 + bl box_print + cmp r5, 0 + beq _0819BB60 + str r4, [sp] + str r6, [sp, 0x4] + ldr r0, =gUnknown_085EEC24 + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0x7 + movs r3, 0x11 + bl box_print + b _0819BB74 + .pool +_0819BB60: + str r4, [sp] + str r5, [sp, 0x4] + ldr r0, =gUnknown_085EEC10 + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0x7 + movs r3, 0x11 + bl box_print +_0819BB74: + ldr r0, =gUnknown_08610476 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + ldr r0, =gUnknown_085EEC1D + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0x7 + movs r3, 0x21 + bl box_print + movs r0, 0x3 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819BAFC + + thumb_func_start sub_819BBA8 +sub_819BBA8: @ 819BBA8 + push {r4,r5,lr} + sub sp, 0xC + movs r0, 0x4 + bl PutWindowTilemap + movs r0, 0x4 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r5, =gUnknown_08610476 + str r5, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r0, =gUnknown_085EEC49 + str r0, [sp, 0x8] + movs r0, 0x4 + movs r1, 0x1 + movs r2, 0x7 + movs r3, 0x1 + bl box_print + str r5, [sp] + str r4, [sp, 0x4] + ldr r0, =gUnknown_085EEC4D + str r0, [sp, 0x8] + movs r0, 0x4 + movs r1, 0x1 + movs r2, 0x7 + movs r3, 0x11 + bl box_print + movs r0, 0x4 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819BBA8 + + thumb_func_start sub_819BC04 +sub_819BC04: @ 819BC04 + push {lr} + ldr r2, =gUnknown_030062E8 + ldr r1, =gUnknown_0861041C + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [r2] + bl _call_via_r0 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_819BC04 + + thumb_func_start sub_819BC30 +sub_819BC30: @ 819BC30 + push {r4,lr} + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + ldrb r2, [r0, 0x3] + movs r1, 0x6C + muls r1, r2 + adds r0, r1 + ldrb r1, [r0, 0x10] + ldrh r0, [r0, 0xC] + cmp r1, 0 + bne _0819BC60 + bl sub_819C634 + cmp r0, 0 + bne _0819BC60 + bl sub_819BAC8 + movs r0, 0x3 + bl sub_819B958 + movs r0, 0x3 + b _0819BC96 + .pool +_0819BC60: + ldr r4, =gUnknown_0300127C + ldr r1, [r4] + movs r2, 0xA6 + lsls r2, 2 + adds r0, r1, r2 + ldr r0, [r0] + adds r2, 0x8 + adds r1, r2 + movs r2, 0 + bl sub_819F3F8 + bl sub_819ACE0 + bl sub_819BA64 + movs r0, 0x3 + bl sub_819B958 + ldr r0, [r4] + ldrb r0, [r0, 0x5] + cmp r0, 0x3 + bhi _0819BC94 + movs r0, 0x1 + b _0819BC96 + .pool +_0819BC94: + movs r0, 0x2 +_0819BC96: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_819BC30 + + thumb_func_start sub_819BC9C +sub_819BC9C: @ 819BC9C + push {lr} + bl sub_819C568 + bl sub_819ACE0 + bl sub_819BA64 + movs r0, 0x3 + bl sub_819B958 + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + ldrb r0, [r0, 0x5] + cmp r0, 0x3 + bhi _0819BCC4 + movs r0, 0x1 + b _0819BCC6 + .pool +_0819BCC4: + movs r0, 0x2 +_0819BCC6: + pop {r1} + bx r1 + thumb_func_end sub_819BC9C + + thumb_func_start sub_819BCCC +sub_819BCCC: @ 819BCCC + movs r0, 0 + bx lr + thumb_func_end sub_819BCCC + + thumb_func_start sub_819BCD0 +sub_819BCD0: @ 819BCD0 + push {lr} + ldr r0, =gUnknown_0300127C + ldr r1, [r0] + movs r2, 0xA6 + lsls r2, 2 + adds r0, r1, r2 + ldr r0, [r0] + adds r2, 0x8 + adds r1, r2 + movs r2, 0 + bl sub_819F3F8 + movs r0, 0x3 + bl sub_819B958 + movs r0, 0x1 + pop {r1} + bx r1 + .pool + thumb_func_end sub_819BCD0 + + thumb_func_start sub_819BCF8 +sub_819BCF8: @ 819BCF8 + push {r4,r5,lr} + sub sp, 0x2C + ldr r5, =gUnknown_0300127C + ldr r0, [r5] + ldrb r4, [r0, 0x3] + cmp r4, 0x5 + bhi _0819BD64 + movs r0, 0x5 + bl PutWindowTilemap + movs r0, 0x5 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x6C + muls r0, r4 + ldr r1, [r5] + adds r0, r1 + adds r0, 0x14 + movs r1, 0xB + movs r2, 0 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + add r1, sp, 0xC + bl sub_81DB468 + movs r0, 0x1 + add r1, sp, 0xC + movs r2, 0x76 + bl GetStringRightAlignXOffset + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x5 + movs r1, 0x1 + add r2, sp, 0xC + bl PrintTextOnWindow + movs r0, 0x5 + movs r1, 0x2 + bl CopyWindowToVram +_0819BD64: + add sp, 0x2C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819BCF8 + + thumb_func_start sub_819BD70 +sub_819BD70: @ 819BD70 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x10 + ldr r6, =gUnknown_0300127C + ldr r2, [r6] + ldrb r1, [r2, 0x3] + movs r0, 0x6C + adds r4, r1, 0 + muls r4, r0 + adds r4, r2 + adds r4, 0x14 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl GetMonData + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl GetMonData + mov r8, r0 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + bl GetMonData + adds r1, r0, 0 + movs r0, 0x58 + str r0, [sp] + movs r0, 0x20 + str r0, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + ldr r0, =0x0000ffff + str r0, [sp, 0xC] + adds r0, r5, 0 + mov r2, r8 + movs r3, 0x1 + bl sub_818D7D8 + ldr r1, [r6] + movs r2, 0xA6 + lsls r2, 2 + adds r1, r2 + movs r3, 0 + strb r0, [r1] + ldr r4, =gSprites + ldr r0, [r6] + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x28 + strb r3, [r0] + ldr r0, [r6] + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x29 + strb r3, [r0] + ldr r0, [r6] + movs r1, 0xA8 + lsls r1, 2 + adds r0, r1 + strb r3, [r0] + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819BD70 + + thumb_func_start sub_819BE20 +sub_819BE20: @ 819BE20 + ldr r1, =gUnknown_0300127C + ldr r1, [r1] + movs r2, 0xA8 + lsls r2, 2 + adds r1, r2 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_819BE20 + + thumb_func_start sub_819BE34 +sub_819BE34: @ 819BE34 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + ldr r0, =gUnknown_08610638 + movs r1, 0x78 + movs r2, 0x40 + movs r3, 0x1 + bl CreateSprite + ldr r6, =gUnknown_0300127C + ldr r1, [r6] + ldr r2, =0x00000299 + mov r10, r2 + add r1, r10 + movs r7, 0 + strb r0, [r1] + ldr r0, [r6] + add r0, r10 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + mov r8, r1 + add r0, r8 + movs r1, 0x2 + bl StartSpriteAffineAnim + ldr r2, [r6] + ldrb r1, [r2, 0x3] + movs r0, 0x6C + adds r4, r1, 0 + muls r4, r0 + adds r4, r2 + adds r4, 0x14 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl GetMonData + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl GetMonData + mov r9, r0 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + bl GetMonData + adds r1, r0, 0 + movs r0, 0x58 + str r0, [sp] + movs r0, 0x20 + str r0, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + ldr r0, =0x0000ffff + str r0, [sp, 0xC] + adds r0, r5, 0 + mov r2, r9 + movs r3, 0x1 + bl sub_818D7D8 + ldr r1, [r6] + movs r2, 0xA6 + lsls r2, 2 + adds r1, r2 + strb r0, [r1] + ldr r0, [r6] + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + adds r0, 0x28 + strb r7, [r0] + ldr r0, [r6] + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + adds r0, 0x29 + strb r7, [r0] + ldr r0, [r6] + add r0, r10 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + 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_819BE34 + + thumb_func_start sub_819BF2C +sub_819BF2C: @ 819BF2C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + movs r7, 0 + ldr r0, =gUnknown_0300127C + mov r9, r0 +_0819BF3E: + movs r2, 0 + adds r1, r7, 0x1 + mov r10, r1 + lsls r0, r7, 2 + mov r8, r0 +_0819BF48: + mov r0, r9 + ldr r1, [r0] + movs r0, 0x6C + adds r4, r2, 0 + muls r4, r0 + adds r0, r1, r4 + ldrb r0, [r0, 0x10] + cmp r0, r10 + bne _0819C008 + adds r4, r1 + adds r4, 0x14 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl GetMonData + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl GetMonData + adds r6, r0, 0 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + bl GetMonData + adds r1, r0, 0 + lsls r0, r7, 3 + adds r0, r7 + lsls r0, 19 + movs r2, 0x80 + lsls r2, 13 + adds r0, r2 + asrs r0, 16 + str r0, [sp] + movs r0, 0x20 + str r0, [sp, 0x4] + adds r0, r7, 0 + adds r0, 0xD + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x8] + ldr r0, =0x0000ffff + str r0, [sp, 0xC] + adds r0, r5, 0 + adds r2, r6, 0 + movs r3, 0x1 + bl sub_818D7D8 + mov r2, r9 + ldr r1, [r2] + add r1, r8 + movs r2, 0xA5 + lsls r2, 2 + adds r1, r2 + strb r0, [r1] + mov r1, r9 + ldr r0, [r1] + add r0, r8 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r2, =gSprites + adds r0, r2 + adds r0, 0x28 + movs r1, 0 + strb r1, [r0] + mov r2, r9 + ldr r0, [r2] + add r0, r8 + movs r1, 0xA5 + lsls r1, 2 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r2, =gSprites + adds r0, r2 + adds r0, 0x29 + movs r1, 0 + strb r1, [r0] + b _0819C012 + .pool +_0819C008: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bls _0819BF48 +_0819C012: + mov r2, r10 + lsls r0, r2, 24 + lsrs r7, r0, 24 + cmp r7, 0x2 + bls _0819BF3E + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + movs r1, 0xA8 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + 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_819BF2C + + thumb_func_start sub_819C040 +sub_819C040: @ 819C040 + push {r4-r6,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0819C0DC + ldr r3, =gSprites + ldr r6, =gUnknown_0300127C + ldr r2, [r6] + ldr r0, =0x00000295 + adds r5, r2, r0 + ldrb r0, [r5] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + adds r1, 0x3F + ldrb r0, [r1] + lsls r0, 26 + cmp r0, 0 + bge _0819C0DC + ldr r1, =0x0000029d + adds r0, r2, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 26 + cmp r0, 0 + bge _0819C0DC + adds r1, r4, 0 + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + ldr r0, [r6] + ldr r1, =0x0000029d + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + ldr r0, =sub_819C1D0 + movs r1, 0x1 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r1, [r1] + bl _call_via_r1 + ldr r0, =SpriteCallbackDummy + str r0, [r4, 0x1C] +_0819C0DC: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819C040 + + thumb_func_start sub_819C100 +sub_819C100: @ 819C100 + push {r4-r7,lr} + adds r5, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0819C1BA + ldr r6, =gSprites + ldr r4, =gUnknown_0300127C + ldr r2, [r4] + ldr r7, =0x00000295 + adds r0, r2, r7 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 26 + cmp r0, 0 + bge _0819C1BA + ldr r1, =0x0000029d + adds r0, r2, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 26 + cmp r0, 0 + bge _0819C1BA + ldrb r0, [r5, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl FreeOamMatrix + ldr r0, [r4] + adds r0, r7 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl FreeOamMatrix + ldr r0, [r4] + ldr r1, =0x0000029d + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl FreeOamMatrix + ldr r0, [r4] + movs r1, 0xA8 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r4] + adds r0, r7 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl DestroySprite + ldr r0, [r4] + ldr r1, =0x0000029d + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl DestroySprite + adds r0, r5, 0 + bl DestroySprite +_0819C1BA: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819C100 + + thumb_func_start sub_819C1D0 +sub_819C1D0: @ 819C1D0 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =gTasks + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0819C24E + cmp r0, 0x1 + bgt _0819C1F8 + cmp r0, 0 + beq _0819C1FE + b _0819C2BA + .pool +_0819C1F8: + cmp r0, 0x2 + beq _0819C270 + b _0819C2BA +_0819C1FE: + movs r0, 0x10 + strh r0, [r4, 0xE] + movs r0, 0xE0 + strh r0, [r4, 0x38] + movs r0, 0x40 + strh r0, [r4, 0x12] + movs r0, 0x41 + strh r0, [r4, 0x18] + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl SetGpuRegBits + ldrh r1, [r4, 0xE] + lsls r1, 8 + ldrh r0, [r4, 0x38] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x40 + bl SetGpuReg + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x18] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0x3F + bl SetGpuReg + movs r0, 0x4A + movs r1, 0x37 + bl SetGpuReg + b _0819C2C6 +_0819C24E: + movs r0, 0x3 + bl ShowBg + ldr r1, =0x00001248 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x0000040b + movs r0, 0x52 + bl SetGpuReg + b _0819C2C6 + .pool +_0819C270: + ldrh r0, [r4, 0x12] + subs r0, 0x4 + strh r0, [r4, 0x12] + ldrh r1, [r4, 0x18] + adds r1, 0x4 + strh r1, [r4, 0x18] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x20 + ble _0819C28C + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x5F + ble _0819C29E +_0819C28C: + movs r0, 0x20 + strh r0, [r4, 0x12] + movs r0, 0x60 + strh r0, [r4, 0x18] + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl ClearGpuRegBits +_0819C29E: + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x18] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl SetGpuReg + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0x20 + bne _0819C2CC + b _0819C2C6 +_0819C2BA: + adds r0, r2, 0 + bl DestroyTask + bl sub_819BF2C + b _0819C2CC +_0819C2C6: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0819C2CC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_819C1D0 + + thumb_func_start sub_819C2D4 +sub_819C2D4: @ 819C2D4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, =gTasks + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0819C2F6 + b _0819C410 +_0819C2F6: + cmp r0, 0x1 + bne _0819C2FC + b _0819C460 +_0819C2FC: + movs r0, 0x3 + bl HideBg + ldr r4, =gSprites + ldr r0, =gUnknown_0300127C + mov r8, r0 + ldr r0, [r0] + ldr r1, =0x00000299 + mov r12, r1 + add r0, r12 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + adds r1, 0x3E + ldrb r2, [r1] + movs r3, 0x5 + negs r3, r3 + adds r0, r3, 0 + ands r0, r2 + strb r0, [r1] + mov r0, r8 + ldr r2, [r0] + mov r1, r12 + adds r0, r2, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r6, r4, 0 + adds r6, 0x1C + adds r0, r6 + ldr r1, =sub_819C100 + str r1, [r0] + ldr r0, =0x00000295 + mov r9, r0 + add r2, r9 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r2, [r0] + adds r1, r3, 0 + ands r1, r2 + strb r1, [r0] + mov r1, r8 + ldr r2, [r1] + mov r1, r9 + adds r0, r2, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldr r1, =SpriteCallbackDummy + mov r10, r1 + str r1, [r0] + ldr r5, =0x0000029d + adds r2, r5 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + ands r3, r1 + strb r3, [r0] + mov r0, r8 + ldr r2, [r0] + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + mov r1, r10 + str r1, [r0] + add r2, r12 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + bl StartSpriteAffineAnim + mov r1, r8 + ldr r0, [r1] + add r0, r9 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + bl StartSpriteAffineAnim + mov r1, r8 + ldr r0, [r1] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + bl StartSpriteAffineAnim + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl ClearGpuRegBits + adds r0, r7, 0 + bl DestroyTask + b _0819C4A4 + .pool +_0819C410: + movs r0, 0x10 + strh r0, [r4, 0xE] + movs r0, 0xE0 + strh r0, [r4, 0x38] + movs r0, 0x20 + strh r0, [r4, 0x12] + movs r0, 0x60 + strh r0, [r4, 0x18] + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl SetGpuRegBits + ldrh r1, [r4, 0xE] + lsls r1, 8 + ldrh r0, [r4, 0x38] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x40 + bl SetGpuReg + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x18] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0x3F + bl SetGpuReg + movs r0, 0x4A + movs r1, 0x37 + bl SetGpuReg + b _0819C49E +_0819C460: + ldrh r0, [r4, 0x12] + adds r0, 0x4 + strh r0, [r4, 0x12] + ldrh r1, [r4, 0x18] + subs r1, 0x4 + strh r1, [r4, 0x18] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3F + bgt _0819C47C + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x41 + bgt _0819C484 +_0819C47C: + movs r0, 0x40 + strh r0, [r4, 0x12] + movs r0, 0x41 + strh r0, [r4, 0x18] +_0819C484: + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x18] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl SetGpuReg + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0x40 + bne _0819C4A4 +_0819C49E: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0819C4A4: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819C2D4 + + thumb_func_start sub_819C4B4 +sub_819C4B4: @ 819C4B4 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r4, =gUnknown_08610638 + adds r0, r4, 0 + movs r1, 0x78 + movs r2, 0x40 + movs r3, 0x1 + bl CreateSprite + ldr r6, =gUnknown_0300127C + ldr r1, [r6] + ldr r2, =0x00000299 + mov r8, r2 + add r1, r8 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x2C + movs r2, 0x40 + movs r3, 0x1 + bl CreateSprite + ldr r1, [r6] + ldr r5, =0x00000295 + adds r1, r5 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0xC4 + movs r2, 0x40 + movs r3, 0x1 + bl CreateSprite + ldr r1, [r6] + ldr r4, =0x0000029d + adds r1, r4 + strb r0, [r1] + ldr r3, =gSprites + ldr r2, [r6] + add r8, r2 + mov r0, r8 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r3, 0x1C + adds r0, r3 + ldr r1, =sub_819C040 + str r1, [r0] + adds r5, r2, r5 + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldr r5, =SpriteCallbackDummy + str r5, [r0] + adds r4, r2, r4 + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + str r5, [r0] + movs r0, 0xA8 + lsls r0, 2 + adds r2, r0 + movs r0, 0x1 + strb r0, [r2] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819C4B4 + + thumb_func_start sub_819C568 +sub_819C568: @ 819C568 + push {r4,lr} + ldr r4, =gUnknown_0300127C + ldr r0, [r4] + movs r1, 0xA5 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + bl sub_818D820 + ldr r0, [r4] + movs r1, 0xA6 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + bl sub_818D820 + ldr r0, [r4] + movs r1, 0xA7 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + bl sub_818D820 + ldr r0, =sub_819C2D4 + movs r1, 0x1 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r1, [r1] + bl _call_via_r1 + ldr r0, [r4] + movs r1, 0xA8 + lsls r1, 2 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819C568 + + thumb_func_start sub_819C5D0 +sub_819C5D0: @ 819C5D0 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r4, r0, 0 + adds r6, r1, 0 + adds r5, r2, 0 + mov r8, r3 + lsls r4, 16 + lsrs r4, 16 + lsls r6, 16 + lsrs r6, 16 + lsls r5, 16 + lsrs r5, 16 + mov r0, r8 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl SetGpuRegBits + lsls r4, 24 + lsrs r4, 16 + orrs r4, r6 + movs r0, 0x40 + adds r1, r4, 0 + bl SetGpuReg + lsls r5, 24 + lsrs r5, 16 + mov r0, r8 + orrs r5, r0 + movs r0, 0x44 + adds r1, r5, 0 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0x3F + bl SetGpuReg + movs r0, 0x4A + movs r1, 0x37 + bl SetGpuReg + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_819C5D0 + + thumb_func_start sub_819C634 +sub_819C634: @ 819C634 + push {r4-r7,lr} + lsls r0, 16 + ldr r2, =gUnknown_0203BC8C + ldr r1, [r2] + lsrs r0, 12 + adds r0, r1 + ldrh r6, [r0] + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + ldrb r5, [r0, 0x5] + movs r3, 0x1 + cmp r3, r5 + bcs _0819C694 + adds r4, r0, 0 + movs r0, 0x6C + mov r12, r0 + adds r7, r2, 0 +_0819C656: + movs r2, 0 +_0819C658: + mov r0, r12 + muls r0, r2 + adds r1, r4, r0 + ldrb r0, [r1, 0x10] + cmp r0, r3 + bne _0819C680 + ldrh r0, [r1, 0xC] + ldr r1, [r7] + lsls r0, 4 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r6 + bne _0819C68A + movs r0, 0 + b _0819C696 + .pool +_0819C680: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bls _0819C658 +_0819C68A: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r5 + bcc _0819C656 +_0819C694: + movs r0, 0x1 +_0819C696: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_819C634 + + thumb_func_start sub_819C69C +sub_819C69C: @ 819C69C + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r5, r0, r1 + movs r0, 0x8 + ldrsh r2, [r5, r0] + cmp r2, 0x1 + beq _0819C6F8 + cmp r2, 0x1 + bgt _0819C6C4 + cmp r2, 0 + beq _0819C6CA + b _0819C7D8 + .pool +_0819C6C4: + cmp r2, 0x2 + beq _0819C7B4 + b _0819C7D8 +_0819C6CA: + ldr r1, =gUnknown_0300127C + ldr r0, [r1] + ldr r3, =0x000002a7 + adds r0, r3 + strb r2, [r0] + ldr r0, [r1] + adds r3, 0x1 + adds r0, r3 + strb r2, [r0] + ldr r0, [r1] + ldr r1, =0x000002a6 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + strh r1, [r5, 0x8] + b _0819C7D8 + .pool +_0819C6F8: + ldr r0, =gUnknown_0300127C + ldr r3, [r0] + ldr r2, =0x000002a2 + adds r1, r3, r2 + ldrb r1, [r1] + adds r7, r0, 0 + cmp r1, 0 + beq _0819C7D8 + ldr r1, =0x000002a9 + adds r0, r3, r1 + ldrb r4, [r0] + cmp r4, 0 + beq _0819C724 + movs r0, 0x2 + strh r0, [r5, 0x8] + b _0819C7D8 + .pool +_0819C724: + ldr r2, =0x000002a7 + adds r1, r3, r2 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r7] + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0x6 + bls _0819C764 + strb r4, [r1] + ldr r1, [r7] + subs r2, 0x1 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _0819C758 + movs r3, 0xAA + lsls r3, 2 + adds r1, r3 + ldrb r0, [r1] + subs r0, 0x1 + b _0819C762 + .pool +_0819C758: + movs r0, 0xAA + lsls r0, 2 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 +_0819C762: + strb r0, [r1] +_0819C764: + movs r0, 0x80 + lsls r0, 7 + ldr r1, [r7] + movs r4, 0xAA + lsls r4, 2 + adds r1, r4 + ldrb r1, [r1] + movs r2, 0 + bl BlendPalettes + ldr r2, [r7] + adds r4, r2, r4 + ldrb r0, [r4] + cmp r0, 0x5 + bls _0819C790 + ldr r3, =0x000002a6 + adds r1, r2, r3 + movs r0, 0 + b _0819C7D6 + .pool +_0819C790: + cmp r0, 0 + bne _0819C7D8 + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + movs r1, 0x2 + strh r1, [r0, 0x8] + ldr r0, =0x000002a6 + adds r1, r2, r0 + movs r0, 0x1 + b _0819C7D6 + .pool +_0819C7B4: + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + ldr r2, =0x000002a9 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xE + bls _0819C7D4 + movs r0, 0 + strb r0, [r1] + movs r0, 0x1 + strh r0, [r5, 0x8] + b _0819C7D8 + .pool +_0819C7D4: + adds r0, 0x1 +_0819C7D6: + strb r0, [r1] +_0819C7D8: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819C69C + + thumb_func_start sub_819C7E0 +sub_819C7E0: @ 819C7E0 + push {lr} + bl AnimateSprites + bl BuildOamBuffer + bl RunTextPrinters + bl UpdatePaletteFade + bl RunTasks + pop {r0} + bx r0 + thumb_func_end sub_819C7E0 + + thumb_func_start sub_819C7FC +sub_819C7FC: @ 819C7FC + push {lr} + bl LoadOam + bl ProcessSpriteCopyRequests + bl TransferPlttBuffer + pop {r0} + bx r0 + thumb_func_end sub_819C7FC + + thumb_func_start sub_819C810 +sub_819C810: @ 819C810 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + ldr r4, =gPlayerParty + ldr r5, =gUnknown_03001284 + ldr r1, [r5] + ldrb r0, [r1, 0x12] + movs r6, 0x64 + muls r0, r6 + adds r0, r4 + ldr r2, =gEnemyParty + mov r9, r2 + ldrb r1, [r1, 0x13] + muls r1, r6 + add r1, r9 + movs r2, 0x64 + bl memcpy + movs r1, 0 + mov r0, sp + strb r1, [r0] + ldr r0, [r5] + ldrb r0, [r0, 0x12] + muls r0, r6 + adds r0, r4 + movs r1, 0x20 + mov r2, sp + bl SetMonData + ldr r3, =gSaveBlock2Ptr + mov r8, r3 + ldr r3, [r3] + ldr r4, [r5] + ldrb r0, [r4, 0x12] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + adds r2, r3, r2 + ldrb r1, [r4, 0x13] + adds r1, 0x3 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r3, r0 + movs r1, 0xE7 + lsls r1, 4 + adds r0, r1 + ldrh r0, [r0] + adds r2, r1 + strh r0, [r2] + ldrb r0, [r4, 0x12] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + adds r2, r3, r2 + ldrb r1, [r4, 0x13] + adds r1, 0x3 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r3, r0 + ldr r0, =0x00000e78 + adds r3, r0 + ldrb r1, [r3] + adds r2, r0 + strb r1, [r2] + ldr r0, [r5] + ldrb r0, [r0, 0x13] + muls r0, r6 + add r0, r9 + movs r1, 0 + movs r2, 0 + bl GetMonData + mov r1, r8 + ldr r2, [r1] + ldr r4, [r5] + ldrb r3, [r4, 0x12] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 2 + ldr r3, =0x00000e74 + adds r2, r3 + adds r2, r1 + str r0, [r2] + ldrb r0, [r4, 0x13] + muls r0, r6 + add r0, r9 + movs r1, 0x2E + movs r2, 0 + bl GetBoxMonData + mov r1, r8 + ldr r2, [r1] + ldr r1, [r5] + ldrb r3, [r1, 0x12] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 2 + adds r2, r1 + ldr r3, =0x00000e79 + adds r2, r3 + strb r0, [r2] + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819C810 + + thumb_func_start sub_819C90C +sub_819C90C: @ 819C90C + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r6, r0, r1 + movs r1, 0x8 + ldrsh r0, [r6, r1] + cmp r0, 0x7 + beq _0819C950 + cmp r0, 0x7 + bgt _0819C934 + cmp r0, 0x6 + beq _0819C93A + b _0819C9F0 + .pool +_0819C934: + cmp r0, 0x8 + beq _0819C9C4 + b _0819C9F0 +_0819C93A: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + movs r0, 0x7 + strh r0, [r6, 0x8] + b _0819C9F0 +_0819C950: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0819C9F0 + ldr r4, =gUnknown_03001284 + ldr r0, [r4] + adds r0, 0x21 + ldrb r0, [r0] + bl DestroyTask + ldr r1, [r4] + ldr r0, [r1, 0x2C] + adds r1, 0x30 + bl sub_819F444 + bl sub_819E538 + ldr r4, =gUnknown_0203CE40 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203CE44 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203CE48 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203CE4C + ldr r0, [r4] + bl Free + str r5, [r4] + bl FreeAllWindowBuffers + movs r0, 0x8 + strh r0, [r6, 0x8] + b _0819C9F0 + .pool +_0819C9C4: + adds r0, r2, 0 + bl DestroyTask + ldr r2, =gUnknown_03001284 + ldr r1, [r2] + movs r0, 0x1 + strb r0, [r1, 0x15] + ldr r2, [r2] + ldr r0, =gPlttBufferUnfaded + movs r1, 0xF4 + lsls r1, 1 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2, 0x24] + ldr r1, =gPlayerParty + ldrb r2, [r2, 0x3] + ldr r0, =sub_819DC1C + str r0, [sp] + movs r0, 0 + movs r3, 0x2 + bl sub_81BF8EC +_0819C9F0: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819C90C + + thumb_func_start sub_819CA08 +sub_819CA08: @ 819CA08 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r7, =gUnknown_03001284 + ldr r2, [r7] + adds r0, r2, 0 + adds r0, 0x30 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819CAFE + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r1, [r4, r0] + cmp r1, 0x1 + beq _0819CA78 + cmp r1, 0x1 + bgt _0819CA44 + cmp r1, 0 + beq _0819CA4E + b _0819CAFE + .pool +_0819CA44: + cmp r1, 0x2 + beq _0819CA8C + cmp r1, 0x3 + beq _0819CAA4 + b _0819CAFE +_0819CA4E: + adds r0, r2, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0819CA68 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + ldr r0, =gScriptResult + strh r1, [r0] + b _0819CAFE + .pool +_0819CA68: + movs r0, 0x2 + strh r0, [r4, 0x8] + ldr r1, =gScriptResult + movs r0, 0x1 + strh r0, [r1] + b _0819CAFE + .pool +_0819CA78: + adds r0, r2, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0819CA9C + ldrb r0, [r2, 0x3] + strb r0, [r2, 0x13] + bl sub_819C810 + b _0819CA9C +_0819CA8C: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade +_0819CA9C: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0819CAFE +_0819CAA4: + bl UpdatePaletteFade + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0819CAFE + ldr r0, [r7] + adds r0, 0x21 + ldrb r0, [r0] + bl DestroyTask + bl sub_819E538 + ldr r4, =gUnknown_0203CE40 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203CE44 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203CE48 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203CE4C + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r0, [r7] + bl Free + str r5, [r7] + bl FreeAllWindowBuffers + ldr r0, =sub_80861B0 + bl SetMainCallback2 + adds r0, r6, 0 + bl DestroyTask +_0819CAFE: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819CA08 + + thumb_func_start sub_819CB1C +sub_819CB1C: @ 819CB1C + push {r4-r7,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r7, =gUnknown_03001284 + ldr r0, [r7] + adds r0, 0x30 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819CBD6 + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x4 + beq _0819CB50 + cmp r0, 0x5 + beq _0819CB5A + b _0819CBD6 + .pool +_0819CB50: + bl sub_819E9E0 + movs r0, 0x5 + strh r0, [r4, 0x8] + b _0819CBD6 +_0819CB5A: + ldr r2, =gMain + ldrh r1, [r2, 0x2E] + movs r6, 0x1 + adds r5, r6, 0 + ands r5, r1 + cmp r5, 0 + beq _0819CB86 + movs r0, 0x5 + bl PlaySE + ldr r0, [r7] + ldrb r0, [r0, 0x16] + cmp r0, 0 + bne _0819CB80 + strh r6, [r4, 0xA] + b _0819CB9C + .pool +_0819CB80: + movs r0, 0 + strh r0, [r4, 0xA] + b _0819CB96 +_0819CB86: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0819CBA8 + movs r0, 0x5 + bl PlaySE + strh r5, [r4, 0xA] +_0819CB96: + movs r0, 0x4 + bl sub_819EA64 +_0819CB9C: + ldrh r0, [r4, 0x14] + ldrh r1, [r4, 0x16] + lsls r0, 16 + orrs r0, r1 + str r0, [r4] + b _0819CBD6 +_0819CBA8: + ldrh r1, [r2, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0819CBC2 + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + negs r0, r0 + bl sub_819E758 + b _0819CBD6 +_0819CBC2: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0819CBD6 + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + bl sub_819E758 +_0819CBD6: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819CB1C + + thumb_func_start sub_819CBDC +sub_819CBDC: @ 819CBDC + 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 + movs r1, 0xA + ldrsh r0, [r2, r1] + cmp r0, 0x1 + bne _0819CC04 + movs r0, 0 + strh r0, [r2, 0x8] + ldr r0, =sub_819CA08 + b _0819CC16 + .pool +_0819CC04: + movs r0, 0 + strh r0, [r2, 0x8] + ldr r1, =sub_819CE40 + lsrs r0, r1, 16 + strh r0, [r2, 0x14] + strh r1, [r2, 0x16] + movs r0, 0x1 + strh r0, [r2, 0x12] + ldr r0, =sub_819D770 +_0819CC16: + str r0, [r2] + pop {r0} + bx r0 + .pool + thumb_func_end sub_819CBDC + + thumb_func_start sub_819CC24 +sub_819CC24: @ 819CC24 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + movs r0, 0x8 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _0819CC5A + ldr r0, =gUnknown_085EECBB + bl sub_819EBEC + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r0, 0x20 + strb r5, [r0] + movs r0, 0x4 + strh r0, [r4, 0x8] + ldr r1, =sub_819CBDC + lsrs r0, r1, 16 + strh r0, [r4, 0x14] + strh r1, [r4, 0x16] + ldr r0, =sub_819CB1C + str r0, [r4] +_0819CC5A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819CC24 + + thumb_func_start sub_819CC74 +sub_819CC74: @ 819CC74 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldr r0, [r1, 0x2C] + adds r1, 0x30 + movs r2, 0x1 + bl sub_819F3F8 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r1 + movs r1, 0xA + ldrsh r0, [r2, r1] + cmp r0, 0x1 + bne _0819CCB0 + movs r0, 0 + strh r0, [r2, 0x8] + ldr r0, =sub_819CA08 + b _0819CCC2 + .pool +_0819CCB0: + movs r0, 0 + strh r0, [r2, 0x8] + ldr r1, =sub_819CE40 + lsrs r0, r1, 16 + strh r0, [r2, 0x14] + strh r1, [r2, 0x16] + movs r0, 0x1 + strh r0, [r2, 0x12] + ldr r0, =sub_819D770 +_0819CCC2: + str r0, [r2] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819CC74 + + thumb_func_start sub_819CCD4 +sub_819CCD4: @ 819CCD4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r5, r1, r2 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0819CD1A + ldr r4, =gUnknown_03001284 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x2D + adds r1, 0x30 + movs r2, 0x1 + bl sub_819F2B4 + ldr r0, =gUnknown_085EECF0 + bl sub_819EBEC + ldr r0, [r4] + adds r0, 0x20 + movs r1, 0x1 + strb r1, [r0] + movs r0, 0x4 + strh r0, [r5, 0x8] + ldr r1, =sub_819CC74 + lsrs r0, r1, 16 + strh r0, [r5, 0x14] + strh r1, [r5, 0x16] + ldr r0, =sub_819CB1C + str r0, [r5] +_0819CD1A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819CCD4 + + thumb_func_start sub_819CD34 +sub_819CD34: @ 819CD34 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x3 + beq _0819CDA4 + cmp r0, 0x3 + bgt _0819CD60 + cmp r0, 0x2 + beq _0819CD66 + b _0819CE36 + .pool +_0819CD60: + cmp r0, 0x9 + beq _0819CD88 + b _0819CE36 +_0819CD66: + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldrb r0, [r1, 0x15] + cmp r0, 0 + bne _0819CD7C + adds r0, r1, 0 + adds r0, 0x2D + adds r1, 0x30 + movs r2, 0x1 + bl sub_819F2B4 +_0819CD7C: + movs r0, 0x9 + strh r0, [r5, 0x8] + b _0819CE36 + .pool +_0819CD88: + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r0, 0x30 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819CE36 + bl sub_819E944 + movs r0, 0x3 + strh r0, [r5, 0x8] + b _0819CE36 + .pool +_0819CDA4: + ldr r7, =gUnknown_03001284 + ldr r0, [r7] + adds r0, 0x30 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819CE36 + ldr r2, =gMain + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + mov r8, r0 + mov r4, r8 + ands r4, r1 + cmp r4, 0 + beq _0819CDD8 + movs r0, 0x5 + bl PlaySE + adds r0, r6, 0 + bl sub_819F0A0 + b _0819CE36 + .pool +_0819CDD8: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0819CE14 + movs r0, 0x5 + bl PlaySE + ldr r1, [r7] + ldr r0, [r1, 0x2C] + adds r1, 0x30 + movs r2, 0x1 + bl sub_819F3F8 + movs r0, 0x3 + bl sub_819EA64 + strh r4, [r5, 0x8] + ldr r1, =sub_819CE40 + lsrs r0, r1, 16 + strh r0, [r5, 0x14] + strh r1, [r5, 0x16] + mov r1, r8 + strh r1, [r5, 0x12] + ldr r0, =sub_819D770 + str r0, [r5] + b _0819CE36 + .pool +_0819CE14: + ldrh r1, [r2, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0819CE28 + movs r0, 0x1 + negs r0, r0 + bl sub_819E7C0 + b _0819CE36 +_0819CE28: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0819CE36 + movs r0, 0x1 + bl sub_819E7C0 +_0819CE36: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819CD34 + + thumb_func_start sub_819CE40 +sub_819CE40: @ 819CE40 + 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 r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0819CE64 + cmp r0, 0x1 + beq _0819CE88 + b _0819CF4C + .pool +_0819CE64: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0819CF4C + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r0, 0x22 + movs r1, 0x1 + strb r1, [r0] + strh r1, [r4, 0x8] + b _0819CF4C + .pool +_0819CE88: + ldr r2, =gMain + ldrh r1, [r2, 0x2E] + adds r5, r1, 0 + ands r5, r0 + cmp r5, 0 + beq _0819CEBC + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r0, 0x22 + movs r1, 0 + strb r1, [r0] + bl sub_819EE08 + bl sub_819EAC0 + adds r0, r6, 0 + bl sub_819F184 + b _0819CF4C + .pool +_0819CEBC: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0819CEF8 + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r0, 0x22 + strb r5, [r0] + bl sub_819EE08 + bl sub_819EAC0 + ldr r1, =sub_819CC24 + lsrs r0, r1, 16 + strh r0, [r4, 0x14] + strh r1, [r4, 0x16] + strh r5, [r4, 0x8] + strh r5, [r4, 0x12] + ldr r0, =sub_819D588 + str r0, [r4] + b _0819CF4C + .pool +_0819CEF8: + ldrh r1, [r2, 0x30] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0819CF0C + movs r0, 0x1 + negs r0, r0 + bl sub_819E694 + b _0819CF2A +_0819CF0C: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0819CF1C + movs r0, 0x1 + bl sub_819E694 + b _0819CF2A +_0819CF1C: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0819CF34 + movs r0, 0x1 + bl sub_819E6E8 +_0819CF2A: + bl sub_819EFA8 + bl sub_819EB4C + b _0819CF4C +_0819CF34: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0819CF4C + movs r0, 0x1 + negs r0, r0 + bl sub_819E6E8 + bl sub_819EFA8 + bl sub_819EB4C +_0819CF4C: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_819CE40 + + thumb_func_start sub_819CF54 +sub_819CF54: @ 819CF54 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r2, [r4, r0] + cmp r2, 0x1 + beq _0819CFA0 + cmp r2, 0x1 + bgt _0819CF7C + cmp r2, 0 + beq _0819CF82 + b _0819D05C + .pool +_0819CF7C: + cmp r2, 0x2 + beq _0819D03C + b _0819D05C +_0819CF82: + ldr r1, =gUnknown_03001284 + ldr r0, [r1] + adds r0, 0x27 + strb r2, [r0] + ldr r0, [r1] + adds r0, 0x28 + strb r2, [r0] + ldr r0, [r1] + adds r0, 0x26 + movs r1, 0x1 + strb r1, [r0] + strh r1, [r4, 0x8] + b _0819D05C + .pool +_0819CFA0: + ldr r1, =gUnknown_03001284 + ldr r2, [r1] + adds r0, r2, 0 + adds r0, 0x22 + ldrb r0, [r0] + adds r6, r1, 0 + cmp r0, 0 + beq _0819D05C + adds r0, r2, 0 + adds r0, 0x29 + ldrb r3, [r0] + cmp r3, 0 + beq _0819CFC4 + movs r0, 0x2 + strh r0, [r4, 0x8] + b _0819D05C + .pool +_0819CFC4: + adds r1, r2, 0 + adds r1, 0x27 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r6] + adds r1, r0, 0 + adds r1, 0x27 + ldrb r0, [r1] + cmp r0, 0x6 + bls _0819CFF8 + strb r3, [r1] + ldr r1, [r6] + adds r0, r1, 0 + adds r0, 0x26 + ldrb r0, [r0] + cmp r0, 0 + bne _0819CFF0 + adds r1, 0x28 + ldrb r0, [r1] + subs r0, 0x1 + b _0819CFF6 +_0819CFF0: + adds r1, 0x28 + ldrb r0, [r1] + adds r0, 0x1 +_0819CFF6: + strb r0, [r1] +_0819CFF8: + movs r0, 0x80 + lsls r0, 7 + ldr r1, [r6] + adds r1, 0x28 + ldrb r1, [r1] + movs r2, 0 + bl BlendPalettes + ldr r2, [r6] + adds r0, r2, 0 + adds r0, 0x28 + ldrb r0, [r0] + cmp r0, 0x5 + bls _0819D01C + adds r1, r2, 0 + adds r1, 0x26 + movs r0, 0 + b _0819D05A +_0819D01C: + cmp r0, 0 + bne _0819D05C + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x2 + strh r1, [r0, 0x8] + adds r1, r2, 0 + adds r1, 0x26 + movs r0, 0x1 + b _0819D05A + .pool +_0819D03C: + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0x29 + ldrb r0, [r1] + cmp r0, 0xE + bls _0819D058 + movs r0, 0 + strb r0, [r1] + movs r0, 0x1 + strh r0, [r4, 0x8] + b _0819D05C + .pool +_0819D058: + adds r0, 0x1 +_0819D05A: + strb r0, [r1] +_0819D05C: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_819CF54 + + thumb_func_start sub_819D064 +sub_819D064: @ 819D064 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + movs r0, 0x8 + ldrsh r1, [r4, r0] + cmp r1, 0x1 + beq _0819D0A4 + cmp r1, 0x1 + bgt _0819D08C + cmp r1, 0 + beq _0819D092 + b _0819D118 + .pool +_0819D08C: + cmp r1, 0x2 + beq _0819D0BC + b _0819D118 +_0819D092: + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r0, 0x27 + strb r1, [r0] + strh r1, [r4, 0x10] + b _0819D0AE + .pool +_0819D0A4: + ldr r0, =gPlttBufferUnfaded+ 0x1E0 + movs r1, 0xE0 + movs r2, 0xA + bl LoadPalette +_0819D0AE: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0819D118 + .pool +_0819D0BC: + ldr r2, =gUnknown_03001284 + ldr r0, [r2] + adds r0, 0x28 + ldrb r0, [r0] + cmp r0, 0xF + bls _0819D0D2 + movs r0, 0x1 + strh r0, [r4, 0x10] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0819D0D2: + ldr r1, [r2] + adds r1, 0x27 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r2] + adds r1, r0, 0 + adds r1, 0x27 + ldrb r0, [r1] + cmp r0, 0x3 + bls _0819D108 + movs r0, 0 + strb r0, [r1] + ldr r1, =gPlttBufferUnfaded + ldr r0, =gPlttBufferFaded + movs r3, 0xE4 + lsls r3, 1 + adds r0, r3 + ldrh r0, [r0] + adds r3, 0x20 + adds r1, r3 + strh r0, [r1] + ldr r1, [r2] + adds r1, 0x28 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_0819D108: + movs r0, 0x80 + lsls r0, 7 + ldr r1, [r2] + adds r1, 0x28 + ldrb r1, [r1] + movs r2, 0 + bl BlendPalettes +_0819D118: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819D064 + + thumb_func_start sub_819D12C +sub_819D12C: @ 819D12C + 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 + str r0, [sp] + ldr r1, =gTasks + lsls r0, 2 + ldr r2, [sp] + adds r0, r2 + lsls r0, 3 + adds r4, r0, r1 + movs r2, 0x8 + ldrsh r3, [r4, r2] + cmp r3, 0 + beq _0819D15C + cmp r3, 0x1 + beq _0819D168 + b _0819D310 + .pool +_0819D15C: + strh r3, [r4, 0xA] + strh r3, [r4, 0xC] + strh r3, [r4, 0xE] + movs r0, 0x1 + strh r0, [r4, 0x8] + b _0819D310 +_0819D168: + movs r3, 0 + str r3, [sp, 0x4] + movs r1, 0x2 + str r0, [sp, 0x8] + ldr r0, =gTasks + str r0, [sp, 0xC] +_0819D174: + lsls r0, r1, 24 + asrs r4, r0, 24 + mov r9, r0 + cmp r4, 0x2 + beq _0819D1F2 + ldr r2, =gSprites + ldr r3, =gUnknown_03001284 + ldr r0, [r3] + adds r0, 0x5 + mov r8, r0 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r6, r0, r2 + ldrh r1, [r6, 0x20] + mov r12, r1 + mov r7, r12 + ldr r1, [sp, 0x4] + subs r0, r1, r7 + lsls r0, 24 + lsrs r5, r0, 24 + mov r10, r2 + cmp r5, 0x10 + beq _0819D1BE + adds r0, r4, 0x2 + lsls r0, 1 + ldr r2, [sp, 0x8] + adds r0, r2 + ldr r1, =gTasks + adds r1, 0x8 + adds r0, r1 + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r0, 0x1 + bne _0819D1D8 +_0819D1BE: + lsls r0, r7, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + mov r0, r12 + adds r0, 0xA + strh r0, [r6, 0x20] + b _0819D210 + .pool +_0819D1D8: + cmp r5, 0x10 + bls _0819D210 + adds r0, r4, 0x1 + add r0, r8 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r10 + ldrh r0, [r0, 0x20] + subs r0, 0x30 + strh r0, [r6, 0x20] + b _0819D210 +_0819D1F2: + ldr r3, =gSprites + ldr r4, =gUnknown_03001284 + ldr r0, [r4] + ldrb r1, [r0, 0x7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r2, [r0, 0x20] + lsls r1, r2, 24 + lsrs r1, 24 + str r1, [sp, 0x4] + adds r2, 0xA + strh r2, [r0, 0x20] + mov r10, r3 +_0819D210: + mov r0, r9 + asrs r2, r0, 24 + adds r0, r2, 0x1 + lsls r0, 1 + ldr r1, [sp, 0x8] + adds r0, r1 + ldr r1, =gTasks + adds r1, 0x8 + adds r0, r1 + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r0, 0x1 + bne _0819D26A + ldr r1, =gUnknown_03001284 + ldr r0, [r1] + adds r0, 0x5 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + mov r3, r10 + adds r1, r0, r3 + movs r0, 0x20 + ldrsh r3, [r1, r0] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 4 + adds r0, 0x48 + cmp r3, r0 + ble _0819D260 + strh r0, [r1, 0x20] + movs r7, 0x1 + b _0819D26C + .pool +_0819D260: + movs r7, 0 + cmp r3, r0 + bne _0819D26C + movs r7, 0x1 + b _0819D26C +_0819D26A: + movs r7, 0 +_0819D26C: + mov r6, r10 + ldr r5, =gUnknown_03001284 + ldr r2, [r5] + mov r1, r9 + asrs r4, r1, 24 + adds r0, r2, 0x5 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r6 + movs r3, 0x20 + ldrsh r0, [r1, r3] + subs r0, 0x10 + cmp r0, 0xF0 + ble _0819D2F8 + ldrh r0, [r1, 0x20] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + ldr r0, =0x0000fff0 + strh r0, [r1, 0x20] + ldrb r0, [r2, 0x14] + cmp r0, 0x1 + bne _0819D2C0 + movs r0, 0x65 + bl IndexOfSpritePaletteTag + ldr r1, [r5] + adds r1, 0x5 + adds r1, r4 + ldrb r1, [r1] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r2, r6 + b _0819D2D8 + .pool +_0819D2C0: + movs r0, 0x64 + bl IndexOfSpritePaletteTag + ldr r2, =gUnknown_03001284 + ldr r1, [r2] + adds r1, 0x5 + adds r1, r4 + ldrb r1, [r1] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + add r2, r10 +_0819D2D8: + lsls r0, 4 + ldrb r3, [r2, 0x5] + movs r1, 0xF + ands r1, r3 + orrs r1, r0 + strb r1, [r2, 0x5] + mov r3, r9 + asrs r0, r3, 23 + adds r0, 0x2 + ldr r1, [sp, 0x8] + adds r0, r1 + ldr r2, [sp, 0xC] + adds r2, 0x8 + adds r0, r2 + movs r1, 0x1 + strh r1, [r0] +_0819D2F8: + movs r0, 0xFF + lsls r0, 24 + add r0, r9 + lsrs r1, r0, 24 + cmp r0, 0 + blt _0819D306 + b _0819D174 +_0819D306: + cmp r7, 0x1 + bne _0819D310 + ldr r0, [sp] + bl DestroyTask +_0819D310: + 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_819D12C + + thumb_func_start sub_819D324 +sub_819D324: @ 819D324 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r7, r0, 24 + movs r0, 0 + mov r8, r0 + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r2, r0, r1 + ldrb r4, [r2, 0xE] + movs r0, 0xC + ldrsh r5, [r2, r0] + mov r10, r1 + cmp r5, 0x1 + bne _0819D352 + lsls r0, r4, 24 + negs r0, r0 + lsrs r4, r0, 24 +_0819D352: + movs r1, 0x8 + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _0819D368 + cmp r0, 0x1 + bne _0819D360 + b _0819D480 +_0819D360: + b _0819D570 + .pool +_0819D368: + ldr r3, =gSprites + ldr r2, =gUnknown_03001284 + ldr r0, [r2] + ldrb r1, [r0, 0x8] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r0, [r0, 0x20] + cmp r5, 0 + bne _0819D39C + lsls r0, 16 + asrs r0, 16 + lsls r2, r4, 24 + asrs r1, r2, 24 + adds r0, r1 + movs r1, 0x1 + cmp r0, 0xEF + ble _0819D3B2 + movs r1, 0 + movs r0, 0xF0 + b _0819D3B0 + .pool +_0819D39C: + lsls r0, 16 + asrs r0, 16 + lsls r2, r4, 24 + asrs r1, r2, 24 + adds r0, r1 + movs r1, 0x1 + cmp r0, 0xA0 + bgt _0819D3B2 + movs r1, 0 + movs r0, 0xA0 +_0819D3B0: + mov r8, r0 +_0819D3B2: + cmp r1, 0x1 + bne _0819D3FC + movs r3, 0 + ldr r7, =gSprites + ldr r6, =gUnknown_03001284 + asrs r5, r2, 24 +_0819D3BE: + movs r4, 0 + adds r2, r3, 0x1 +_0819D3C2: + ldr r1, [r6] + lsls r0, r4, 1 + adds r0, r4 + adds r0, r3, r0 + adds r1, 0x8 + adds r1, r0 + ldrb r1, [r1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, r5 + strh r1, [r0, 0x20] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _0819D3C2 + lsls r0, r2, 24 + lsrs r3, r0, 24 + cmp r3, 0x2 + bls _0819D3BE + b _0819D570 + .pool +_0819D3FC: + movs r4, 0 + lsls r1, r7, 2 + mov r12, r1 + mov r6, r8 + adds r6, 0x10 + movs r0, 0x30 + add r0, r8 + mov r9, r0 + ldr r5, =gSprites +_0819D40E: + ldr r1, =gUnknown_03001284 + ldr r2, [r1] + lsls r3, r4, 1 + adds r3, r4 + adds r0, r2, 0 + adds r0, 0x8 + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + mov r1, r8 + strh r1, [r0, 0x20] + adds r0, r2, 0 + adds r0, 0x9 + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r6, [r0, 0x20] + adds r2, 0xA + adds r2, r3 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + mov r1, r9 + strh r1, [r0, 0x20] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _0819D40E + mov r1, r12 + adds r0, r1, r7 + lsls r0, 3 + add r0, r10 + ldrb r1, [r0, 0xA] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + add r0, r10 + movs r1, 0x1 + strh r1, [r0, 0xE] + adds r0, r7, 0 + bl DestroyTask + b _0819D570 + .pool +_0819D480: + ldr r2, =gSprites + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + ldrb r1, [r0, 0xE] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x20] + cmp r5, 0 + bne _0819D4B4 + lsls r0, 16 + asrs r0, 16 + lsls r2, r4, 24 + asrs r1, r2, 24 + adds r0, r1 + movs r1, 0x1 + cmp r0, 0xEF + ble _0819D4CA + movs r1, 0 + movs r0, 0xF0 + b _0819D4C8 + .pool +_0819D4B4: + lsls r0, 16 + asrs r0, 16 + lsls r2, r4, 24 + asrs r1, r2, 24 + adds r0, r1 + movs r1, 0x1 + cmp r0, 0xC0 + bgt _0819D4CA + movs r1, 0 + movs r0, 0xC0 +_0819D4C8: + mov r8, r0 +_0819D4CA: + cmp r1, 0x1 + bne _0819D510 + movs r3, 0 + ldr r7, =gSprites + ldr r6, =gUnknown_03001284 + asrs r5, r2, 24 +_0819D4D6: + movs r4, 0 + adds r2, r3, 0x1 +_0819D4DA: + ldr r0, [r6] + lsls r1, r4, 1 + adds r1, r3, r1 + adds r0, 0xE + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, r5 + strh r1, [r0, 0x20] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _0819D4DA + lsls r0, r2, 24 + lsrs r3, r0, 24 + cmp r3, 0x1 + bls _0819D4D6 + b _0819D570 + .pool +_0819D510: + movs r4, 0 + lsls r1, r7, 2 + mov r12, r1 + mov r6, r8 + adds r6, 0x10 + ldr r5, =gSprites + ldr r0, =gUnknown_03001284 + mov r9, r0 +_0819D520: + mov r1, r9 + ldr r2, [r1] + lsls r3, r4, 1 + adds r0, r2, 0 + adds r0, 0xE + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + mov r1, r8 + strh r1, [r0, 0x20] + adds r2, 0xF + adds r2, r3 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r6, [r0, 0x20] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _0819D520 + mov r1, r12 + adds r0, r1, r7 + lsls r0, 3 + add r0, r10 + ldrb r1, [r0, 0xA] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + add r0, r10 + movs r1, 0x1 + strh r1, [r0, 0x10] + adds r0, r7, 0 + bl DestroyTask +_0819D570: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819D324 + + thumb_func_start sub_819D588 +sub_819D588: @ 819D588 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r2, 0x8 + ldrsh r0, [r0, r2] + mov r8, r1 + cmp r0, 0x5 + bls _0819D5AA + b _0819D762 +_0819D5AA: + lsls r0, 2 + ldr r1, =_0819D5BC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0819D5BC: + .4byte _0819D5D4 + .4byte _0819D5F0 + .4byte _0819D60C + .4byte _0819D63C + .4byte _0819D6F0 + .4byte _0819D73A +_0819D5D4: + ldr r0, =gUnknown_08610918 + movs r1, 0xE0 + movs r2, 0xA + bl LoadPalette + bl sub_819ED34 + movs r0, 0x5 + bl PutWindowTilemap + b _0819D622 + .pool +_0819D5F0: + movs r0, 0x3 + bl sub_819EA64 + 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 _0819D762 + .pool +_0819D60C: + movs r0, 0x80 + lsls r0, 7 + ldr r1, =gUnknown_0860F13C + adds r1, 0x4A + ldrh r1, [r1] + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade +_0819D622: + 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 _0819D762 + .pool +_0819D63C: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + beq _0819D64E + b _0819D762 +_0819D64E: + movs r0, 0x5 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x5 + movs r1, 0x2 + bl CopyWindowToVram + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + ldrb r0, [r0, 0x14] + cmp r0, 0x1 + bne _0819D6B0 + ldr r0, =sub_819D324 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gTasks + lsls r2, r5, 2 + adds r2, r5 + lsls r2, 3 + adds r2, r1 + strh r6, [r2, 0xE] + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0xA] + strh r6, [r0, 0x8] + strh r6, [r0, 0xC] + movs r1, 0x6 + strh r1, [r0, 0xE] + movs r0, 0x5 + strh r0, [r2, 0xC] + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + b _0819D762 + .pool +_0819D6B0: + ldr r0, =sub_819D324 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r4, r0, 24 + ldr r3, =gTasks + lsls r2, r5, 2 + adds r2, r5 + lsls r2, 3 + adds r2, r3 + movs r1, 0x1 + strh r1, [r2, 0xE] + strh r6, [r2, 0x10] + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r3 + strh r5, [r0, 0xA] + strh r1, [r0, 0x8] + strh r6, [r0, 0xC] + movs r1, 0x6 + strh r1, [r0, 0xE] + ldrh r0, [r2, 0x8] + adds r0, 0x2 + strh r0, [r2, 0x8] + b _0819D762 + .pool +_0819D6F0: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + mov r1, r8 + adds r6, r0, r1 + ldrh r0, [r6, 0xC] + movs r2, 0xC + ldrsh r7, [r6, r2] + cmp r7, 0 + bne _0819D734 + ldr r0, =sub_819D324 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r4, r0, 24 + strh r7, [r6, 0x10] + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + add r0, r8 + strh r5, [r0, 0xA] + movs r1, 0x1 + strh r1, [r0, 0x8] + strh r7, [r0, 0xC] + movs r1, 0x6 + strh r1, [r0, 0xE] + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + b _0819D762 + .pool +_0819D734: + subs r0, 0x1 + strh r0, [r6, 0xC] + b _0819D762 +_0819D73A: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + mov r1, r8 + adds r2, r0, r1 + movs r1, 0xE + ldrsh r0, [r2, r1] + cmp r0, 0x1 + bne _0819D762 + movs r1, 0x10 + ldrsh r0, [r2, r1] + cmp r0, 0x1 + bne _0819D762 + ldrh r0, [r2, 0x12] + strh r0, [r2, 0x8] + ldrh r0, [r2, 0x14] + ldrh r1, [r2, 0x16] + lsls r0, 16 + orrs r0, r1 + str r0, [r2] +_0819D762: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819D588 + + thumb_func_start sub_819D770 +sub_819D770: @ 819D770 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =gUnknown_03001284 + ldr r0, [r1] + adds r0, 0x30 + ldrb r0, [r0] + adds r3, r1, 0 + cmp r0, 0x1 + bne _0819D78C + b _0819D9D8 +_0819D78C: + ldr r0, =gTasks + lsls r2, r6, 2 + adds r1, r2, r6 + lsls r1, 3 + adds r1, r0 + movs r4, 0x8 + ldrsh r1, [r1, r4] + mov r8, r0 + adds r5, r2, 0 + cmp r1, 0x8 + bls _0819D7A4 + b _0819D9D8 +_0819D7A4: + lsls r0, r1, 2 + ldr r1, =_0819D7BC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0819D7BC: + .4byte _0819D7E0 + .4byte _0819D868 + .4byte _0819D8AE + .4byte _0819D8F4 + .4byte _0819D910 + .4byte _0819D928 + .4byte _0819D936 + .4byte _0819D948 + .4byte _0819D9B0 +_0819D7E0: + ldr r0, [r3] + ldrb r7, [r0, 0x14] + cmp r7, 0x1 + bne _0819D828 + ldr r0, =sub_819D324 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r4, r0, 24 + ldr r3, =gTasks + adds r2, r5, r6 + lsls r2, 3 + adds r2, r3 + movs r1, 0 + strh r1, [r2, 0xE] + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r3 + strh r6, [r0, 0xA] + strh r1, [r0, 0x8] + strh r7, [r0, 0xC] + movs r1, 0x6 + strh r1, [r0, 0xE] + movs r0, 0xA + strh r0, [r2, 0xC] + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + b _0819D9D8 + .pool +_0819D828: + ldr r0, =sub_819D324 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r4, r0, 24 + ldr r3, =gTasks + adds r2, r5, r6 + lsls r2, 3 + adds r2, r3 + movs r0, 0 + movs r1, 0x1 + strh r1, [r2, 0xE] + strh r0, [r2, 0x10] + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r3 + strh r6, [r0, 0xA] + strh r1, [r0, 0x8] + strh r1, [r0, 0xC] + movs r1, 0x6 + strh r1, [r0, 0xE] + ldrh r0, [r2, 0x8] + adds r0, 0x2 + strh r0, [r2, 0x8] + b _0819D9D8 + .pool +_0819D868: + adds r0, r5, r6 + lsls r0, 3 + mov r1, r8 + adds r5, r0, r1 + ldrh r0, [r5, 0xC] + movs r2, 0xC + ldrsh r7, [r5, r2] + cmp r7, 0 + bne _0819D8A8 + ldr r0, =sub_819D324 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r4, r0, 24 + strh r7, [r5, 0x10] + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + add r0, r8 + strh r6, [r0, 0xA] + movs r1, 0x1 + strh r1, [r0, 0x8] + strh r1, [r0, 0xC] + movs r1, 0x6 + strh r1, [r0, 0xE] + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + b _0819D9D8 + .pool +_0819D8A8: + subs r0, 0x1 + strh r0, [r5, 0xC] + b _0819D9D8 +_0819D8AE: + adds r0, r5, r6 + lsls r0, 3 + mov r1, r8 + adds r4, r0, r1 + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r0, 0x1 + beq _0819D8C0 + b _0819D9D8 +_0819D8C0: + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0819D8CA + b _0819D9D8 +_0819D8CA: + ldr r1, =gPlttBufferFaded + ldr r0, =gUnknown_0860F13C + adds r0, 0x4A + ldrh r0, [r0] + movs r2, 0xE2 + lsls r2, 1 + adds r1, r2 + strh r0, [r1] + bl sub_819ED34 + movs r0, 0x5 + bl PutWindowTilemap + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0819D9D8 + .pool +_0819D8F4: + movs r0, 0x80 + lsls r0, 7 + ldr r1, =gUnknown_0860F13C + adds r1, 0x4A + ldrh r1, [r1] + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade + b _0819D990 + .pool +_0819D910: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0819D9D8 + movs r0, 0 + bl sub_819EDBC + b _0819D990 + .pool +_0819D928: + movs r0, 0x1 + bl sub_819EDBC + movs r0, 0x3 + bl PutWindowTilemap + b _0819D990 +_0819D936: + movs r0, 0x5 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x5 + movs r1, 0x2 + bl CopyWindowToVram + b _0819D990 +_0819D948: + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + ldrb r0, [r0, 0x14] + cmp r0, 0 + bne _0819D964 + ldr r0, =gUnknown_085EEC73 + bl sub_819EBEC + b _0819D96A + .pool +_0819D964: + ldr r0, =gUnknown_085EEC8B + bl sub_819EBEC +_0819D96A: + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldrb r0, [r1, 0x3] + cmp r0, 0x2 + bhi _0819D98C + ldr r2, =gSprites + ldrb r1, [r1, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] +_0819D98C: + bl sub_819EFA8 +_0819D990: + ldr r0, =gTasks + adds r1, r5, r6 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0819D9D8 + .pool +_0819D9B0: + bl sub_819EEF0 + bl sub_819EADC + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r0, 0x22 + movs r1, 0x1 + strb r1, [r0] + ldr r1, =gTasks + adds r0, r5, r6 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x12] + strh r1, [r0, 0x8] + ldrh r1, [r0, 0x14] + ldrh r2, [r0, 0x16] + lsls r1, 16 + orrs r1, r2 + str r1, [r0] +_0819D9D8: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819D770 + + thumb_func_start sub_819D9EC +sub_819D9EC: @ 819D9EC + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r0, 0x30 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0819DA00 + b _0819DBCA +_0819DA00: + ldr r0, =gTasks + lsls r2, r6, 2 + adds r1, r2, r6 + lsls r1, 3 + adds r1, r0 + movs r3, 0x8 + ldrsh r1, [r1, r3] + adds r3, r0, 0 + adds r7, r2, 0 + cmp r1, 0x4 + bls _0819DA18 + b _0819DBCA +_0819DA18: + lsls r0, r1, 2 + ldr r1, =_0819DA30 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0819DA30: + .4byte _0819DA44 + .4byte _0819DA58 + .4byte _0819DA8C + .4byte _0819DABC + .4byte _0819DBB0 +_0819DA44: + bl sub_819EEF0 + ldr r0, =gTasks + adds r1, r7, r6 + lsls r1, 3 + adds r1, r0 + b _0819DB96 + .pool +_0819DA58: + bl sub_819EADC + ldr r2, =gSprites + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldr r0, =gTasks + adds r1, r7, r6 + lsls r1, 3 + adds r1, r0 + b _0819DB96 + .pool +_0819DA8C: + ldr r0, =sub_819D12C + movs r1, 0 + bl CreateTask + ldr r2, =gTasks + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r0, 0x21 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldr r1, =sub_819D064 + str r1, [r0] + b _0819DB90 + .pool +_0819DABC: + ldr r0, =sub_819D12C + bl FuncIsActiveTask + lsls r0, 24 + cmp r0, 0 + beq _0819DACA + b _0819DBCA +_0819DACA: + ldr r2, =gTasks + ldr r4, =gUnknown_03001284 + ldr r0, [r4] + adds r0, 0x21 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x10 + ldrsh r0, [r0, r1] + cmp r0, 0x1 + bne _0819DBCA + bl sub_819EAC0 + ldr r0, [r4] + ldrb r0, [r0, 0x14] + cmp r0, 0 + bne _0819DB04 + movs r0, 0x1 + bl sub_819F048 + b _0819DB32 + .pool +_0819DB04: + movs r0, 0 + bl sub_819F048 + movs r2, 0 + ldr r5, =gSprites + movs r3, 0x4 +_0819DB10: + ldr r0, [r4] + adds r0, 0xB + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r3 + strb r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x2 + bls _0819DB10 +_0819DB32: + ldr r5, =gSprites + ldr r4, =gUnknown_03001284 + ldr r3, [r4] + ldrb r0, [r3, 0x4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + adds r0, r3, 0x5 + ldrb r2, [r3, 0x3] + adds r0, r2 + ldrb r2, [r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r5 + ldrh r0, [r0, 0x20] + movs r5, 0 + strh r0, [r1, 0x20] + ldr r2, =gTasks + adds r0, r3, 0 + adds r0, 0x21 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldr r1, =sub_819CF54 + str r1, [r0] + adds r3, 0x27 + strb r5, [r3] + ldr r0, [r4] + adds r0, 0x28 + movs r1, 0x6 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0x26 + strb r5, [r0] + ldr r0, [r4] + adds r0, 0x21 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x1 + strh r1, [r0, 0x8] +_0819DB90: + adds r1, r7, r6 + lsls r1, 3 + adds r1, r2 +_0819DB96: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0819DBCA + .pool +_0819DBB0: + adds r0, r7, r6 + lsls r0, 3 + adds r0, r3 + movs r1, 0 + strh r1, [r0, 0x8] + ldr r2, =sub_819CE40 + lsrs r1, r2, 16 + strh r1, [r0, 0x14] + strh r2, [r0, 0x16] + movs r1, 0x1 + strh r1, [r0, 0x12] + ldr r1, =sub_819D770 + str r1, [r0] +_0819DBCA: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819D9EC + + thumb_func_start sub_819DBD8 +sub_819DBD8: @ 819DBD8 + push {r4,r5,lr} + ldr r5, =gUnknown_03001284 + ldr r4, [r5] + cmp r4, 0 + bne _0819DBF6 + movs r0, 0x34 + bl AllocZeroed + str r0, [r5] + strb r4, [r0, 0x3] + ldr r0, [r5] + adds r0, 0x30 + strb r4, [r0] + ldr r0, [r5] + strb r4, [r0, 0x15] +_0819DBF6: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819DBD8 + + thumb_func_start sub_819DC00 +sub_819DC00: @ 819DC00 + push {lr} + ldr r0, =gUnknown_03001284 + movs r1, 0 + str r1, [r0] + ldr r0, =sub_819DC1C + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_819DC00 + + thumb_func_start sub_819DC1C +sub_819DC1C: @ 819DC1C + push {r4-r6,lr} + sub sp, 0xC + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0xF + bls _0819DC32 + b _0819E0AA +_0819DC32: + lsls r0, 2 + ldr r1, =_0819DC44 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0819DC44: + .4byte _0819DC84 + .4byte _0819DCD4 + .4byte _0819DDA8 + .4byte _0819DE68 + .4byte _0819DE94 + .4byte _0819DECC + .4byte _0819DEEC + .4byte _0819DF10 + .4byte _0819DF30 + .4byte _0819DF3C + .4byte _0819DF64 + .4byte _0819DF70 + .4byte _0819DF78 + .4byte _0819DF8C + .4byte _0819DFA4 + .4byte _0819E01C +_0819DC84: + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + str r0, [sp, 0x8] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, =0x05006000 + add r0, sp, 0x8 + bl CpuSet + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_086108B8 + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + ldr r0, =gUnknown_086108C8 + bl InitWindows + bl DeactivateAllTextPrinters + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819E00E + .pool +_0819DCD4: + ldr r5, =gUnknown_0203CE40 + movs r4, 0x88 + lsls r4, 3 + adds r0, r4, 0 + bl Alloc + str r0, [r5] + ldr r5, =gUnknown_0203CE44 + adds r0, r4, 0 + bl AllocZeroed + str r0, [r5] + ldr r5, =gUnknown_0203CE48 + movs r4, 0x80 + lsls r4, 4 + adds r0, r4, 0 + bl Alloc + str r0, [r5] + ldr r5, =gUnknown_0203CE4C + adds r0, r4, 0 + bl AllocZeroed + str r0, [r5] + 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 + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + movs r0, 0x4C + movs r1, 0 + bl SetGpuReg + movs r0, 0x40 + movs r1, 0 + bl SetGpuReg + movs r0, 0x44 + movs r1, 0 + bl SetGpuReg + movs r0, 0x42 + movs r1, 0 + bl SetGpuReg + movs r0, 0x46 + movs r1, 0 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0 + bl SetGpuReg + movs r0, 0x4A + movs r1, 0 + bl SetGpuReg + b _0819E006 + .pool +_0819DDA8: + bl ResetPaletteFade + bl ResetSpriteData + bl ResetTasks + bl FreeAllSpritePalettes + bl dp13_810BB8C + ldr r0, =gUnknown_08DC0754 + ldr r5, =gUnknown_0203CE40 + ldr r1, [r5] + movs r2, 0x88 + lsls r2, 2 + bl CpuSet + ldr r0, =gUnknown_0861033C + ldr r4, =gUnknown_0203CE44 + ldr r1, [r4] + movs r2, 0x30 + bl CpuSet + ldr r1, [r5] + movs r2, 0x88 + lsls r2, 3 + movs r0, 0x1 + movs r3, 0 + bl LoadBgTiles + ldr r1, [r4] + movs r0, 0x3 + movs r2, 0x60 + movs r3, 0 + bl LoadBgTiles + ldr r0, =gUnknown_08DC0B94 + ldr r4, =gUnknown_0203CE48 + ldr r1, [r4] + movs r2, 0x80 + lsls r2, 3 + bl CpuSet + ldr r1, [r4] + movs r2, 0x80 + lsls r2, 4 + movs r0, 0x1 + movs r3, 0 + bl LoadBgTilemap + ldr r0, =gUnknown_08DC0714 + movs r1, 0 + movs r2, 0x40 + bl LoadPalette + ldr r4, =gUnknown_08610918 + adds r0, r4, 0 + movs r1, 0xF0 + movs r2, 0xA + bl LoadPalette + adds r0, r4, 0 + movs r1, 0xE0 + movs r2, 0xA + bl LoadPalette + ldr r0, =gUnknown_0861039C + movs r1, 0x20 + movs r2, 0x4 + bl LoadPalette + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819E00E + .pool +_0819DE68: + ldr r0, =gUnknown_0203CE4C + ldr r1, [r0] + movs r0, 0x3 + bl SetBgTilemapBuffer + ldr r1, =gUnknown_0861023C + movs r0, 0x8 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x3 + movs r2, 0xB + movs r3, 0x4 + bl CopyToBgTilemapBufferRect + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + b _0819E006 + .pool +_0819DE94: + ldr r0, =gUnknown_086106B0 + bl LoadSpritePalettes + ldr r0, =gUnknown_08610650 + bl LoadSpriteSheets + ldr r0, =gUnknown_086106A0 + bl LoadCompressedObjectPic + ldr r0, =sub_819C7FC + bl SetVBlankCallback + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819E00E + .pool +_0819DECC: + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldrb r0, [r1, 0x15] + cmp r0, 0x1 + bne _0819DEDC + ldr r0, =gUnknown_0203CF20 + ldrb r0, [r0] + strb r0, [r1, 0x3] +_0819DEDC: + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + b _0819E00E + .pool +_0819DEEC: + bl sub_819DBD8 + bl sub_819E0C0 + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + ldrb r0, [r0, 0x15] + cmp r0, 0x1 + bne _0819DF02 + bl sub_819F304 +_0819DF02: + movs r0, 0 + bl sub_819F048 + b _0819E006 + .pool +_0819DF10: + ldr r0, =gUnknown_085EEC73 + bl sub_819EBEC + movs r0, 0x2 + bl PutWindowTilemap + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819E00E + .pool +_0819DF30: + bl sub_819EFA8 + movs r0, 0x8 + bl PutWindowTilemap + b _0819E006 +_0819DF3C: + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + ldrb r0, [r0, 0x15] + cmp r0, 0 + bne _0819DF4A + bl sub_819EB4C +_0819DF4A: + movs r0, 0x1 + bl PutWindowTilemap + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819E00E + .pool +_0819DF64: + bl sub_819EB18 + movs r0, 0 + bl PutWindowTilemap + b _0819E006 +_0819DF70: + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + b _0819E00E +_0819DF78: + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + ldrb r0, [r0, 0x15] + cmp r0, 0 + beq _0819E006 + bl sub_819EE08 + b _0819E006 + .pool +_0819DF8C: + bl sub_819ED78 + movs r0, 0x3 + bl PutWindowTilemap + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819E00E + .pool +_0819DFA4: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + ldrb r0, [r0, 0x15] + cmp r0, 0x1 + bne _0819E000 + movs r0, 0x3 + bl ShowBg + ldr r1, =0x00001248 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x0000040b + movs r0, 0x52 + bl SetGpuReg + b _0819E006 + .pool +_0819E000: + movs r0, 0x3 + bl HideBg +_0819E006: + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 +_0819E00E: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0819E0AA + .pool +_0819E01C: + ldr r0, =sub_819CF54 + movs r1, 0 + bl CreateTask + ldr r6, =gUnknown_03001284 + ldr r1, [r6] + adds r1, 0x21 + strb r0, [r1] + ldr r0, [r6] + ldrb r5, [r0, 0x15] + cmp r5, 0 + bne _0819E06C + ldr r4, =gTasks + adds r0, 0x21 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + strh r5, [r0, 0x8] + ldr r0, =sub_819CE40 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + strh r5, [r0, 0x8] + b _0819E0A4 + .pool +_0819E06C: + bl sub_819EAF8 + ldr r4, =gTasks + ldr r2, [r6] + adds r0, r2, 0 + adds r0, 0x21 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + movs r3, 0 + movs r1, 0x1 + strh r1, [r0, 0x8] + adds r2, 0x22 + strb r3, [r2] + ldr r0, =sub_819CD34 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + movs r1, 0x2 + strh r1, [r0, 0x8] +_0819E0A4: + ldr r0, =sub_819C7E0 + bl SetMainCallback2 +_0819E0AA: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819DC1C + + thumb_func_start sub_819E0C0 +sub_819E0C0: @ 819E0C0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + mov r1, sp + ldr r0, =gUnknown_08610834 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2,r5,r6} + stm r1!, {r2,r5,r6} + mov r1, sp + movs r0, 0x65 + strh r0, [r1, 0x2] + movs r6, 0 + ldr r4, =gUnknown_03001284 + movs r7, 0 + ldr r5, =gSprites +_0819E0E6: + lsls r1, r6, 1 + adds r1, r6 + lsls r1, 20 + movs r3, 0x90 + lsls r3, 15 + adds r1, r3 + asrs r1, 16 + mov r0, sp + movs r2, 0x40 + movs r3, 0x1 + bl CreateSprite + ldr r1, [r4] + adds r1, 0x5 + adds r1, r6 + strb r0, [r1] + ldr r0, [r4] + adds r0, 0x5 + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r7, [r0, 0x2E] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x2 + bls _0819E0E6 + ldr r7, =gUnknown_03001284 + ldr r1, [r7] + adds r0, r1, 0x5 + ldrb r1, [r1, 0x3] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =gSprites + adds r0, r4 + movs r5, 0x20 + ldrsh r1, [r0, r5] + ldr r0, =gUnknown_0861084C + movs r2, 0x58 + movs r3, 0 + bl CreateSprite + ldr r1, [r7] + movs r4, 0 + strb r0, [r1, 0x4] + ldr r0, =gUnknown_08610864 + movs r1, 0xB0 + movs r2, 0x70 + movs r3, 0 + bl CreateSprite + ldr r1, [r7] + strb r0, [r1, 0x1] + ldr r0, =gUnknown_0861087C + movs r1, 0xB0 + movs r2, 0x90 + movs r3, 0 + bl CreateSprite + ldr r1, [r7] + strb r0, [r1, 0x2] + ldr r0, [r7] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r6, =gSprites + adds r0, r6 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldr r0, [r7] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + ldr r0, [r7] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x28 + strb r4, [r0] + ldr r0, [r7] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x29 + strb r4, [r0] + ldr r0, [r7] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x28 + strb r4, [r0] + ldr r0, [r7] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x29 + strb r4, [r0] + ldr r0, [r7] + ldrb r0, [r0, 0x15] + movs r1, 0xC0 + str r1, [sp, 0x18] + cmp r0, 0x1 + bne _0819E1E8 + movs r2, 0xF0 + str r2, [sp, 0x18] +_0819E1E8: + mov r1, sp + ldr r0, =gUnknown_0861084C + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + mov r0, sp + movs r4, 0x68 + mov r10, r4 + mov r5, r10 + strh r5, [r0] + movs r1, 0xF0 + movs r2, 0x78 + movs r3, 0xA + bl CreateSprite + ldr r1, [r7] + strb r0, [r1, 0x8] + mov r1, sp + ldr r0, =gUnknown_08610864 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + mov r0, sp + movs r1, 0x69 + mov r9, r1 + mov r2, r9 + strh r2, [r0] + movs r4, 0x80 + lsls r4, 1 + adds r1, r4, 0 + movs r2, 0x78 + movs r3, 0xA + bl CreateSprite + ldr r1, [r7] + strb r0, [r1, 0x9] + movs r5, 0x90 + lsls r5, 1 + mov r0, sp + adds r1, r5, 0 + movs r2, 0x78 + movs r3, 0xA + bl CreateSprite + ldr r1, [r7] + strb r0, [r1, 0xA] + mov r1, sp + ldr r0, =gUnknown_0861084C + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + mov r0, sp + movs r3, 0x6A + mov r8, r3 + mov r6, r8 + strh r6, [r0] + movs r1, 0xF0 + movs r2, 0x78 + movs r3, 0x1 + bl CreateSprite + ldr r1, [r7] + strb r0, [r1, 0xB] + mov r1, sp + ldr r0, =gUnknown_08610864 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + mov r1, sp + movs r0, 0x6B + strh r0, [r1] + mov r0, sp + adds r1, r4, 0 + movs r2, 0x78 + movs r3, 0x1 + bl CreateSprite + ldr r1, [r7] + strb r0, [r1, 0xC] + mov r0, sp + movs r6, 0x6C + strh r6, [r0] + adds r1, r5, 0 + movs r2, 0x78 + movs r3, 0x1 + bl CreateSprite + ldr r1, [r7] + strb r0, [r1, 0xD] + mov r1, sp + ldr r0, =gUnknown_0861084C + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + mov r0, sp + mov r4, r10 + strh r4, [r0] + ldr r1, [sp, 0x18] + movs r2, 0x90 + movs r3, 0xA + bl CreateSprite + ldr r1, [r7] + strb r0, [r1, 0xE] + mov r1, sp + ldr r0, =gUnknown_08610864 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r4,r5} + stm r1!, {r2,r4,r5} + mov r0, sp + mov r3, r9 + strh r3, [r0] + ldr r4, [sp, 0x18] + adds r4, 0x10 + adds r1, r4, 0 + movs r2, 0x90 + movs r3, 0xA + bl CreateSprite + ldr r1, [r7] + strb r0, [r1, 0xF] + mov r1, sp + ldr r0, =gUnknown_0861084C + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + mov r0, sp + mov r5, r8 + strh r5, [r0] + ldr r1, [sp, 0x18] + movs r2, 0x90 + movs r3, 0x1 + bl CreateSprite + ldr r1, [r7] + strb r0, [r1, 0x10] + mov r1, sp + ldr r0, =gUnknown_08610864 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + mov r0, sp + strh r6, [r0] + adds r1, r4, 0 + movs r2, 0x90 + movs r3, 0x1 + bl CreateSprite + ldr r1, [r7] + strb r0, [r1, 0x11] + movs r6, 0 + ldr r5, =gSprites + adds r4, r7, 0 + movs r7, 0 + movs r0, 0x4 + mov r10, r0 +_0819E330: + ldr r0, [r4] + lsls r3, r6, 1 + adds r2, r3, r6 + adds r0, 0x8 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x28 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0x8 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x29 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0x9 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x28 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0x9 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x29 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0xA + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x28 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0xA + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x29 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0xE + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x28 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0xE + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x29 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0xF + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x28 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0xF + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x29 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0x8 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + mov r8, r0 + ldrb r1, [r0] + mov r0, r10 + orrs r1, r0 + mov r0, r8 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0x9 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + mov r8, r0 + ldrb r1, [r0] + mov r0, r10 + orrs r1, r0 + mov r0, r8 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0xA + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + mov r2, r10 + orrs r1, r2 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0xE + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0xF + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r3, =gUnknown_03001284 + mov r8, r3 + ldr r0, =gSprites + mov r9, r0 + cmp r6, 0x1 + bhi _0819E496 + b _0819E330 +_0819E496: + ldr r0, [r3] + ldrb r0, [r0, 0xE] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r9 + adds r1, 0x3E + ldrb r2, [r1] + movs r3, 0x5 + negs r3, r3 + adds r0, r3, 0 + b _0819E4C8 + .pool +_0819E4C8: + ands r0, r2 + strb r0, [r1] + mov r1, r8 + ldr r0, [r1] + ldrb r1, [r0, 0xF] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r9 + adds r0, 0x3E + ldrb r2, [r0] + adds r1, r3, 0 + ands r1, r2 + strb r1, [r0] + mov r2, r8 + ldr r0, [r2] + ldrb r1, [r0, 0x8] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r9 + adds r0, 0x3E + ldrb r2, [r0] + adds r1, r3, 0 + ands r1, r2 + strb r1, [r0] + mov r4, r8 + ldr r0, [r4] + ldrb r1, [r0, 0x9] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r9 + adds r0, 0x3E + ldrb r2, [r0] + adds r1, r3, 0 + ands r1, r2 + strb r1, [r0] + ldr r0, [r4] + ldrb r1, [r0, 0xA] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r9 + adds r0, 0x3E + ldrb r1, [r0] + ands r3, r1 + strb r3, [r0] + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819E0C0 + + thumb_func_start sub_819E538 +sub_819E538: @ 819E538 + push {r4-r7,lr} + movs r5, 0 +_0819E53C: + ldr r6, =gUnknown_03001284 + ldr r0, [r6] + adds r0, 0x5 + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =gSprites + adds r0, r4 + bl DestroySprite + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _0819E53C + ldr r0, [r6] + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl DestroySprite + ldr r0, [r6] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl DestroySprite + ldr r0, [r6] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl DestroySprite + movs r5, 0 +_0819E590: + movs r4, 0 + lsls r6, r5, 1 +_0819E594: + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r1, r6, r5 + adds r1, r4, r1 + adds r0, 0x8 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + bl DestroySprite + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _0819E594 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bls _0819E590 + movs r5, 0 +_0819E5C6: + movs r4, 0 + adds r7, r5, 0x1 + lsls r6, r5, 1 +_0819E5CC: + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r1, r4, r6 + adds r0, 0xE + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + bl DestroySprite + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _0819E5CC + lsls r0, r7, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bls _0819E5C6 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819E538 + + thumb_func_start sub_819E608 +sub_819E608: @ 819E608 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x2 + bhi _0819E65C + ldr r4, =gSprites + ldr r5, =gUnknown_03001284 + ldr r0, [r5] + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + bl sub_819E8EC + ldr r0, [r5] + ldrb r2, [r0, 0x4] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + adds r0, 0x5 + adds r0, r6 + ldrb r2, [r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x20] + strh r0, [r1, 0x20] + b _0819E684 + .pool +_0819E65C: + ldr r2, =gSprites + ldr r3, =gUnknown_03001284 + ldr r0, [r3] + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldr r0, [r3] + ldr r1, [r0, 0x18] + lsls r0, r6, 3 + adds r0, r1 + ldrb r0, [r0] + bl sub_819E838 +_0819E684: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819E608 + + thumb_func_start sub_819E694 +sub_819E694: @ 819E694 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl PlaySE + lsls r4, 24 + cmp r4, 0 + ble _0819E6C0 + ldr r1, =gUnknown_03001284 + ldr r2, [r1] + ldrb r0, [r2, 0x3] + adds r0, 0x1 + ldrb r3, [r2, 0x17] + cmp r0, r3 + bne _0819E6D8 + movs r0, 0 + b _0819E6D8 + .pool +_0819E6C0: + ldr r0, =gUnknown_03001284 + ldr r2, [r0] + ldrb r3, [r2, 0x3] + adds r1, r0, 0 + cmp r3, 0 + beq _0819E6D4 + subs r0, r3, 0x1 + b _0819E6D8 + .pool +_0819E6D4: + ldrb r0, [r2, 0x17] + subs r0, 0x1 +_0819E6D8: + strb r0, [r2, 0x3] + ldr r0, [r1] + ldrb r0, [r0, 0x3] + bl sub_819E608 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_819E694 + + thumb_func_start sub_819E6E8 +sub_819E6E8: @ 819E6E8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl PlaySE + lsls r4, 24 + cmp r4, 0 + ble _0819E728 + ldr r0, =gUnknown_03001284 + ldr r2, [r0] + ldrb r1, [r2, 0x3] + adds r4, r0, 0 + cmp r1, 0x2 + bhi _0819E714 + movs r0, 0x3 + strb r0, [r2, 0x3] + b _0819E74A + .pool +_0819E714: + ldrb r0, [r2, 0x3] + adds r0, 0x1 + ldrb r1, [r2, 0x17] + cmp r0, r1 + beq _0819E722 + strb r0, [r2, 0x3] + b _0819E74A +_0819E722: + movs r0, 0 + strb r0, [r2, 0x3] + b _0819E74A +_0819E728: + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldrb r3, [r1, 0x3] + adds r2, r3, 0 + adds r4, r0, 0 + cmp r2, 0x2 + bls _0819E744 + cmp r2, 0 + beq _0819E744 + subs r0, r3, 0x1 + b _0819E748 + .pool +_0819E744: + ldrb r0, [r1, 0x17] + subs r0, 0x1 +_0819E748: + strb r0, [r1, 0x3] +_0819E74A: + ldr r0, [r4] + ldrb r0, [r0, 0x3] + bl sub_819E608 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_819E6E8 + + thumb_func_start sub_819E758 +sub_819E758: @ 819E758 + push {lr} + lsls r0, 24 + cmp r0, 0 + ble _0819E778 + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldrb r3, [r1, 0x16] + adds r2, r0, 0 + cmp r3, 0x1 + beq _0819E774 + adds r0, r3, 0x1 + b _0819E78E + .pool +_0819E774: + movs r0, 0 + b _0819E78E +_0819E778: + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldrb r3, [r1, 0x16] + adds r2, r0, 0 + cmp r3, 0 + beq _0819E78C + subs r0, r3, 0x1 + b _0819E78E + .pool +_0819E78C: + movs r0, 0x1 +_0819E78E: + strb r0, [r1, 0x16] + ldr r3, =gSprites + ldr r2, [r2] + ldrb r0, [r2, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r2, 0x16] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + ldrb r0, [r2, 0x2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r2, 0x16] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + pop {r0} + bx r0 + .pool + thumb_func_end sub_819E758 + + thumb_func_start sub_819E7C0 +sub_819E7C0: @ 819E7C0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl PlaySE + lsls r4, 24 + cmp r4, 0 + ble _0819E7EC + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldrb r3, [r1] + adds r2, r0, 0 + cmp r3, 0x2 + beq _0819E7E8 + adds r0, r3, 0x1 + b _0819E802 + .pool +_0819E7E8: + movs r0, 0 + b _0819E802 +_0819E7EC: + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldrb r3, [r1] + adds r2, r0, 0 + cmp r3, 0 + beq _0819E800 + subs r0, r3, 0x1 + b _0819E802 + .pool +_0819E800: + movs r0, 0x2 +_0819E802: + strb r0, [r1] + ldr r3, =gSprites + ldr r2, [r2] + ldrb r0, [r2, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r2] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + ldrb r0, [r2, 0x2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r2] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819E7C0 + + thumb_func_start sub_819E838 +sub_819E838: @ 819E838 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r6, r0, 24 + movs r4, 0 + movs r0, 0x5 + negs r0, r0 + mov r9, r0 + movs r2, 0x4 + mov r8, r2 + ldr r0, =gSprites + mov r12, r0 + ldr r7, =gUnknown_03001284 +_0819E856: + cmp r6, 0x2 + bne _0819E898 + ldr r5, =gSprites + ldr r3, =gUnknown_03001284 + ldr r0, [r3] + adds r0, 0xB + adds r0, r4 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + adds r1, 0x3E + ldrb r2, [r1] + mov r0, r9 + ands r0, r2 + strb r0, [r1] + cmp r4, 0x1 + bhi _0819E8D4 + ldr r0, [r3] + adds r0, 0x10 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + b _0819E8CA + .pool +_0819E898: + cmp r6, 0x3 + bne _0819E8D4 + cmp r4, 0x1 + bhi _0819E8BA + ldr r0, [r7] + adds r0, 0x10 + adds r0, r4 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r12 + adds r1, 0x3E + ldrb r2, [r1] + mov r0, r9 + ands r0, r2 + strb r0, [r1] +_0819E8BA: + ldr r0, [r7] + adds r0, 0xB + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r12 +_0819E8CA: + adds r0, 0x3E + ldrb r1, [r0] + mov r2, r8 + orrs r1, r2 + strb r1, [r0] +_0819E8D4: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _0819E856 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819E838 + + thumb_func_start sub_819E8EC +sub_819E8EC: @ 819E8EC + push {r4-r6,lr} + movs r2, 0 + ldr r5, =gSprites + ldr r4, =gUnknown_03001284 + adds r6, r5, 0 + movs r3, 0x4 +_0819E8F8: + ldr r0, [r4] + adds r0, 0xB + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r3 + strb r1, [r0] + cmp r2, 0x1 + bhi _0819E92C + ldr r0, [r4] + adds r0, 0x10 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r3 + strb r1, [r0] +_0819E92C: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x2 + bls _0819E8F8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819E8EC + + thumb_func_start sub_819E944 +sub_819E944: @ 819E944 + push {r4,r5,lr} + ldr r0, =gUnknown_03001284 + ldr r3, [r0] + ldrb r1, [r3, 0x15] + adds r5, r0, 0 + cmp r1, 0x1 + bne _0819E95C + movs r0, 0 + strb r0, [r3, 0x15] + b _0819E960 + .pool +_0819E95C: + movs r0, 0 + strb r0, [r3] +_0819E960: + ldr r4, =gSprites + ldr r2, [r5] + ldrb r1, [r2, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xB0 + strh r1, [r0, 0x20] + ldrb r0, [r2, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r0, [r2] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + ldrb r1, [r2, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xD0 + strh r1, [r0, 0x20] + ldrb r0, [r2, 0x2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r0, [r2] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + ldrb r0, [r2, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x5 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r1] + ldr r0, [r5] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + ands r2, r1 + strb r2, [r0] + bl sub_819EC20 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819E944 + + thumb_func_start sub_819E9E0 +sub_819E9E0: @ 819E9E0 + push {r4,r5,lr} + ldr r5, =gUnknown_03001284 + ldr r1, [r5] + movs r0, 0 + strb r0, [r1, 0x16] + ldr r4, =gSprites + ldr r2, [r5] + ldrb r1, [r2, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xB0 + strh r1, [r0, 0x20] + ldrb r1, [r2, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r3, 0x70 + strh r3, [r0, 0x22] + ldrb r1, [r2, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xD0 + strh r1, [r0, 0x20] + ldrb r1, [r2, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r3, [r0, 0x22] + ldrb r0, [r2, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x5 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r1] + ldr r0, [r5] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + ands r2, r1 + strb r2, [r0] + bl sub_819EC94 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819E9E0 + + thumb_func_start sub_819EA64 +sub_819EA64: @ 819EA64 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =gSprites + ldr r3, =gUnknown_03001284 + ldr r0, [r3] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldr r0, [r3] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + adds r0, r4, 0 + movs r1, 0 + bl FillWindowPixelBuffer + adds r0, r4, 0 + movs r1, 0x2 + bl CopyWindowToVram + adds r0, r4, 0 + bl ClearWindowTilemap + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819EA64 + + thumb_func_start sub_819EAC0 +sub_819EAC0: @ 819EAC0 + push {lr} + movs r0, 0x1 + bl PutWindowTilemap + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x1 + movs r1, 0x2 + bl CopyWindowToVram + pop {r0} + bx r0 + thumb_func_end sub_819EAC0 + + thumb_func_start sub_819EADC +sub_819EADC: @ 819EADC + push {lr} + movs r0, 0x7 + bl PutWindowTilemap + movs r0, 0x7 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x7 + movs r1, 0x2 + bl CopyWindowToVram + pop {r0} + bx r0 + thumb_func_end sub_819EADC + + thumb_func_start sub_819EAF8 +sub_819EAF8: @ 819EAF8 + push {lr} + bl sub_819EAC0 + movs r0, 0x5 + bl PutWindowTilemap + movs r0, 0x5 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x5 + movs r1, 0x2 + bl CopyWindowToVram + pop {r0} + bx r0 + thumb_func_end sub_819EAF8 + + thumb_func_start sub_819EB18 +sub_819EB18: @ 819EB18 + push {lr} + sub sp, 0xC + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r2, =gUnknown_085EEC66 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x2 + bl PrintTextOnWindow + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_819EB18 + + thumb_func_start sub_819EB4C +sub_819EB4C: @ 819EB4C + push {r4,lr} + sub sp, 0xC + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldrb r0, [r1, 0x3] + cmp r0, 0x2 + bls _0819EB70 + movs r0, 0x1 + movs r1, 0x2 + bl CopyWindowToVram + b _0819EBD4 + .pool +_0819EB70: + ldrb r2, [r1, 0x3] + ldrb r0, [r1, 0x14] + cmp r0, 0 + bne _0819EB84 + movs r0, 0x64 + muls r0, r2 + ldr r1, =gPlayerParty + b _0819EB8A + .pool +_0819EB84: + movs r0, 0x64 + muls r0, r2 + ldr r1, =gEnemyParty +_0819EB8A: + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl GetMonData + lsls r0, 16 + lsrs r1, r0, 16 + ldr r4, =gStringVar4 + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + adds r0, r4, 0 + bl StringCopy + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x56 + bl GetStringRightAlignXOffset + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gUnknown_08610925 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0x1 + bl box_print + movs r0, 0x1 + movs r1, 0x3 + bl CopyWindowToVram +_0819EBD4: + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819EB4C + + thumb_func_start sub_819EBEC +sub_819EBEC: @ 819EBEC + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + movs r0, 0x2 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x5 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x2 + bl PrintTextOnWindow + movs r0, 0x2 + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_819EBEC + + thumb_func_start sub_819EC20 +sub_819EC20: @ 819EC20 + push {r4,r5,lr} + sub sp, 0xC + movs r0, 0x3 + bl PutWindowTilemap + movs r0, 0x3 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r5, =gUnknown_08610922 + str r5, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r0, =gUnknown_085EECAA + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0xF + movs r3, 0x1 + bl box_print + str r5, [sp] + str r4, [sp, 0x4] + ldr r0, =gUnknown_085EECA5 + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0xF + movs r3, 0x11 + bl box_print + str r5, [sp] + str r4, [sp, 0x4] + ldr r0, =gUnknown_085EECB2 + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0xF + movs r3, 0x21 + bl box_print + movs r0, 0x3 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819EC20 + + thumb_func_start sub_819EC94 +sub_819EC94: @ 819EC94 + push {r4,r5,lr} + sub sp, 0xC + movs r0, 0x4 + bl PutWindowTilemap + movs r0, 0x4 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r5, =gUnknown_08610922 + str r5, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r0, =gUnknown_085EECCA + str r0, [sp, 0x8] + movs r0, 0x4 + movs r1, 0x1 + movs r2, 0x7 + movs r3, 0x1 + bl box_print + str r5, [sp] + str r4, [sp, 0x4] + ldr r0, =gUnknown_085EECCE + str r0, [sp, 0x8] + movs r0, 0x4 + movs r1, 0x1 + movs r2, 0x7 + movs r3, 0x11 + bl box_print + movs r0, 0x4 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819EC94 + + thumb_func_start sub_819ECF0 +sub_819ECF0: @ 819ECF0 + push {r4-r6,lr} + sub sp, 0xC + adds r6, r0, 0 + adds r5, r1, 0 + adds r4, r2, 0 + movs r0, 0 + adds r1, r6, 0 + movs r2, 0x46 + bl GetStringRightAlignXOffset + adds r2, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_08610922 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r6, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0 + adds r3, r5, 0 + bl box_print + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819ECF0 + + thumb_func_start sub_819ED34 +sub_819ED34: @ 819ED34 + push {lr} + movs r0, 0x5 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + ldrb r0, [r0, 0x14] + cmp r0, 0 + beq _0819ED56 + cmp r0, 0x1 + bne _0819ED60 + ldr r0, =gUnknown_085EECD1 + movs r1, 0 + movs r2, 0x5 + bl sub_819ECF0 +_0819ED56: + ldr r0, =gUnknown_085EECDD + movs r1, 0x18 + movs r2, 0x5 + bl sub_819ECF0 +_0819ED60: + movs r0, 0x5 + movs r1, 0x3 + bl CopyWindowToVram + pop {r0} + bx r0 + .pool + thumb_func_end sub_819ED34 + + thumb_func_start sub_819ED78 +sub_819ED78: @ 819ED78 + push {lr} + movs r0, 0x3 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + ldrb r0, [r0, 0x14] + cmp r0, 0 + beq _0819ED9A + cmp r0, 0x1 + bne _0819EDA4 + ldr r0, =gUnknown_085EECD1 + movs r1, 0x8 + movs r2, 0x3 + bl sub_819ECF0 +_0819ED9A: + ldr r0, =gUnknown_085EECDD + movs r1, 0x20 + movs r2, 0x3 + bl sub_819ECF0 +_0819EDA4: + movs r0, 0x3 + movs r1, 0x3 + bl CopyWindowToVram + pop {r0} + bx r0 + .pool + thumb_func_end sub_819ED78 + + thumb_func_start sub_819EDBC +sub_819EDBC: @ 819EDBC + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _0819EDCC + cmp r0, 0x1 + beq _0819EDEC + b _0819EDF6 +_0819EDCC: + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + ldrb r0, [r0, 0x14] + cmp r0, 0x1 + bne _0819EDF6 + ldr r0, =gUnknown_085EECD1 + movs r1, 0x8 + movs r2, 0x3 + bl sub_819ECF0 + b _0819EDF6 + .pool +_0819EDEC: + ldr r0, =gUnknown_085EECDD + movs r1, 0x20 + movs r2, 0x3 + bl sub_819ECF0 +_0819EDF6: + movs r0, 0x3 + movs r1, 0x3 + bl CopyWindowToVram + pop {r0} + bx r0 + .pool + thumb_func_end sub_819EDBC + + thumb_func_start sub_819EE08 +sub_819EE08: @ 819EE08 + push {r4,lr} + sub sp, 0x18 + ldr r0, =gUnknown_08610918 + add r1, sp, 0xC + movs r2, 0x4 + bl CpuSet + ldr r0, =gUnknown_03001284 + ldr r2, [r0] + ldrb r0, [r2, 0x15] + cmp r0, 0 + bne _0819EE3C + add r0, sp, 0xC + ldr r1, =gPlttBufferFaded + movs r2, 0xE4 + lsls r2, 1 + adds r1, r2 + ldrh r1, [r1] + strh r1, [r0, 0x8] + b _0819EE42 + .pool +_0819EE3C: + add r1, sp, 0xC + ldrh r0, [r2, 0x24] + strh r0, [r1, 0x8] +_0819EE42: + add r0, sp, 0xC + movs r1, 0xF0 + movs r2, 0xA + bl LoadPalette + movs r0, 0x7 + bl PutWindowTilemap + movs r0, 0x7 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldrb r0, [r1, 0x3] + cmp r0, 0x2 + bls _0819EE74 + movs r0, 0x7 + movs r1, 0x3 + bl CopyWindowToVram + b _0819EED8 + .pool +_0819EE74: + ldrb r2, [r1, 0x3] + ldrb r0, [r1, 0x14] + cmp r0, 0 + bne _0819EE88 + movs r0, 0x64 + muls r0, r2 + ldr r1, =gPlayerParty + b _0819EE8E + .pool +_0819EE88: + movs r0, 0x64 + muls r0, r2 + ldr r1, =gEnemyParty +_0819EE8E: + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl GetMonData + lsls r0, 16 + lsrs r1, r0, 16 + ldr r4, =gStringVar4 + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + adds r0, r4, 0 + bl StringCopy + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x56 + bl GetStringRightAlignXOffset + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gUnknown_08610925 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x7 + movs r1, 0x1 + movs r3, 0x1 + bl box_print + movs r0, 0x7 + movs r1, 0x3 + bl CopyWindowToVram +_0819EED8: + add sp, 0x18 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819EE08 + + thumb_func_start sub_819EEF0 +sub_819EEF0: @ 819EEF0 + push {r4,lr} + sub sp, 0xC + ldr r0, =gUnknown_08610918 + movs r1, 0xE0 + movs r2, 0xA + bl LoadPalette + ldr r0, =gPlttBufferUnfaded+ 0x1E0 + ldr r1, =gPlttBufferFaded + 0x1C0 + movs r2, 0x5 + bl CpuSet + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldrb r0, [r1, 0x3] + cmp r0, 0x2 + bls _0819EF2C + movs r0, 0x1 + movs r1, 0x2 + bl CopyWindowToVram + b _0819EF90 + .pool +_0819EF2C: + ldrb r2, [r1, 0x3] + ldrb r0, [r1, 0x14] + cmp r0, 0 + bne _0819EF40 + movs r0, 0x64 + muls r0, r2 + ldr r1, =gPlayerParty + b _0819EF46 + .pool +_0819EF40: + movs r0, 0x64 + muls r0, r2 + ldr r1, =gEnemyParty +_0819EF46: + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl GetMonData + lsls r0, 16 + lsrs r1, r0, 16 + ldr r4, =gStringVar4 + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + adds r0, r4, 0 + bl StringCopy + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x56 + bl GetStringRightAlignXOffset + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gUnknown_08610925 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0x1 + bl box_print + movs r0, 0x1 + movs r1, 0x3 + bl CopyWindowToVram +_0819EF90: + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819EEF0 + + thumb_func_start sub_819EFA8 +sub_819EFA8: @ 819EFA8 + push {r4-r6,lr} + sub sp, 0x2C + ldr r6, =gUnknown_03001284 + ldr r0, [r6] + ldrb r4, [r0, 0x3] + adds r5, r4, 0 + movs r0, 0x8 + movs r1, 0 + bl FillWindowPixelBuffer + cmp r4, 0x2 + bls _0819EFD0 + movs r0, 0x8 + movs r1, 0x2 + bl CopyWindowToVram + b _0819F03A + .pool +_0819EFD0: + movs r0, 0x8 + bl PutWindowTilemap + ldr r0, [r6] + ldrb r0, [r0, 0x14] + cmp r0, 0 + bne _0819EFEC + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + b _0819EFF2 + .pool +_0819EFEC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty +_0819EFF2: + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + add r1, sp, 0xC + bl sub_81DB468 + movs r0, 0x1 + add r1, sp, 0xC + movs r2, 0x76 + bl GetStringRightAlignXOffset + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x8 + movs r1, 0x1 + add r2, sp, 0xC + bl PrintTextOnWindow + movs r0, 0x8 + movs r1, 0x2 + bl CopyWindowToVram +_0819F03A: + add sp, 0x2C + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819EFA8 + + thumb_func_start sub_819F048 +sub_819F048: @ 819F048 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r4, =gUnknown_03001284 + ldr r3, [r4] + ldrb r0, [r3, 0x15] + cmp r0, 0x1 + beq _0819F094 + cmp r2, 0 + beq _0819F068 + cmp r2, 0x1 + beq _0819F080 + b _0819F094 + .pool +_0819F068: + strb r2, [r3, 0x14] + ldr r0, [r4] + strb r2, [r0, 0x3] + ldr r1, [r4] + movs r0, 0x4 + strb r0, [r1, 0x17] + ldr r1, [r4] + ldr r0, =gUnknown_08610928 + b _0819F092 + .pool +_0819F080: + movs r1, 0 + strb r2, [r3, 0x14] + ldr r0, [r4] + strb r1, [r0, 0x3] + ldr r1, [r4] + movs r0, 0x5 + strb r0, [r1, 0x17] + ldr r1, [r4] + ldr r0, =gUnknown_08610948 +_0819F092: + str r0, [r1, 0x18] +_0819F094: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F048 + + thumb_func_start sub_819F0A0 +sub_819F0A0: @ 819F0A0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, =gUnknown_03001280 + ldr r2, =gUnknown_086108AC + ldr r1, =gUnknown_03001284 + ldr r1, [r1] + ldrb r1, [r1] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + str r1, [r3] + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F0A0 + + thumb_func_start sub_819F0CC +sub_819F0CC: @ 819F0CC + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =gUnknown_03001284 + ldr r1, [r5] + ldr r0, [r1, 0x2C] + adds r1, 0x30 + movs r2, 0x1 + bl sub_819F3F8 + ldr r0, [r5] + ldrb r1, [r0, 0x3] + movs r5, 0 + strb r1, [r0, 0x12] + movs r0, 0x3 + bl sub_819EA64 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0x8] + ldr r1, =sub_819D9EC + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F0CC + + thumb_func_start sub_819F114 +sub_819F114: @ 819F114 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0x6 + strh r0, [r1, 0x8] + ldr r0, =sub_819C90C + str r0, [r1] + bx lr + .pool + thumb_func_end sub_819F114 + + thumb_func_start sub_819F134 +sub_819F134: @ 819F134 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldr r0, [r1, 0x2C] + adds r1, 0x30 + movs r2, 0x1 + bl sub_819F3F8 + movs r0, 0x3 + bl sub_819EA64 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x8] + ldr r2, =sub_819CE40 + lsrs r1, r2, 16 + strh r1, [r0, 0x14] + strh r2, [r0, 0x16] + movs r1, 0x1 + strh r1, [r0, 0x12] + ldr r1, =sub_819D770 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F134 + + thumb_func_start sub_819F184 +sub_819F184: @ 819F184 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, =gUnknown_03001280 + ldr r1, =gUnknown_03001284 + ldr r2, [r1] + ldrb r1, [r2, 0x3] + ldr r2, [r2, 0x18] + lsls r1, 3 + adds r1, r2 + ldr r1, [r1, 0x4] + str r1, [r3] + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F184 + + thumb_func_start sub_819F1AC +sub_819F1AC: @ 819F1AC + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, =sub_819CC24 + lsrs r0, r2, 16 + movs r3, 0 + strh r0, [r1, 0x14] + strh r2, [r1, 0x16] + strh r3, [r1, 0x8] + strh r3, [r1, 0x12] + ldr r0, =sub_819D588 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_819F1AC + + thumb_func_start sub_819F1DC +sub_819F1DC: @ 819F1DC + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, =sub_819D9EC + lsrs r0, r2, 16 + movs r3, 0 + strh r0, [r1, 0x14] + strh r2, [r1, 0x16] + strh r3, [r1, 0x12] + strh r3, [r1, 0x8] + ldr r0, =sub_819D588 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_819F1DC + + thumb_func_start sub_819F20C +sub_819F20C: @ 819F20C + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r5, =gUnknown_03001284 + ldr r1, [r5] + ldrb r0, [r1, 0x14] + cmp r0, 0 + bne _0819F240 + ldr r3, =gTasks + lsls r4, r6, 2 + adds r0, r4, r6 + lsls r0, 3 + adds r0, r3 + ldr r2, =sub_819CD34 + lsrs r1, r2, 16 + strh r1, [r0, 0x14] + strh r2, [r0, 0x16] + movs r1, 0x2 + strh r1, [r0, 0x12] + b _0819F292 + .pool +_0819F240: + ldrb r0, [r1, 0x3] + bl sub_819F59C + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bne _0819F278 + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0x2D + adds r1, 0x30 + movs r2, 0x1 + bl sub_819F2B4 + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x8] + strh r4, [r0, 0x12] + ldr r1, =sub_819F488 + b _0819F29E + .pool +_0819F278: + ldr r4, =gTasks + lsls r5, r6, 2 + adds r0, r5, r6 + lsls r0, 3 + adds r0, r4 + ldr r2, =sub_819CCD4 + lsrs r1, r2, 16 + movs r3, 0 + strh r1, [r0, 0x14] + strh r2, [r0, 0x16] + strh r3, [r0, 0x12] + adds r3, r4, 0 + adds r4, r5, 0 +_0819F292: + adds r0, r4, r6 + lsls r0, 3 + adds r0, r3 + movs r1, 0 + strh r1, [r0, 0x8] + ldr r1, =sub_819D588 +_0819F29E: + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F20C + + thumb_func_start sub_819F2B4 +sub_819F2B4: @ 819F2B4 + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r1, 0 + lsls r5, r2, 24 + lsrs r5, 24 + ldr r0, =gUnknown_08610894 + movs r1, 0x78 + movs r2, 0x40 + movs r3, 0x1 + bl CreateSprite + strb r0, [r4] + ldr r2, =gSprites + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r2, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_819F600 + str r1, [r0] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r5, [r0, 0x3C] + movs r0, 0x1 + strb r0, [r6] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F2B4 + + thumb_func_start sub_819F304 +sub_819F304: @ 819F304 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0x10 + ldr r0, =gUnknown_08610894 + movs r1, 0x78 + movs r2, 0x40 + movs r3, 0x1 + bl CreateSprite + ldr r6, =gUnknown_03001284 + ldr r1, [r6] + adds r1, 0x2D + movs r2, 0 + mov r10, r2 + strb r0, [r1] + ldr r0, [r6] + adds r0, 0x2D + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + mov r8, r1 + add r0, r8 + movs r1, 0x2 + bl StartSpriteAffineAnim + ldr r0, [r6] + ldrb r1, [r0, 0x3] + movs r0, 0x64 + adds r4, r1, 0 + muls r4, r0 + ldr r0, =gPlayerParty + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl GetMonData + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl GetMonData + mov r9, r0 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + bl GetMonData + adds r2, r0, 0 + movs r0, 0x58 + str r0, [sp] + movs r0, 0x20 + str r0, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + ldr r0, =0x0000ffff + str r0, [sp, 0xC] + adds r0, r5, 0 + mov r1, r9 + movs r3, 0x1 + bl sub_818D7D8 + ldr r1, [r6] + adds r1, 0x2C + strb r0, [r1] + ldr r0, [r6] + adds r0, 0x2C + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + adds r0, 0x28 + mov r2, r10 + strb r2, [r0] + ldr r0, [r6] + adds r0, 0x2C + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + adds r0, 0x29 + strb r2, [r0] + ldr r0, [r6] + adds r0, 0x2D + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F304 + + thumb_func_start sub_819F3F8 +sub_819F3F8: @ 819F3F8 + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r1, 0 + lsls r5, r2, 24 + lsrs r5, 24 + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_818D820 + ldr r0, =sub_819F7B4 + movs r1, 0x1 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r5, [r1, 0x16] + lsrs r4, 8 + lsls r4, 24 + lsrs r4, 24 + strh r4, [r1, 0x14] + ldr r1, [r1] + bl _call_via_r1 + movs r0, 0x1 + strb r0, [r6] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F3F8 + + thumb_func_start sub_819F444 +sub_819F444: @ 819F444 + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r1, 0 + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_818D820 + ldr r5, =gSprites + lsls r4, 16 + lsrs r1, r4, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r0, [r0, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl FreeOamMatrix + lsrs r4, 24 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r5 + bl DestroySprite + movs r0, 0 + strb r0, [r6] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F444 + + thumb_func_start sub_819F488 +sub_819F488: @ 819F488 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_03001284 + ldr r0, [r1] + adds r0, 0x30 + ldrb r0, [r0] + adds r3, r1, 0 + cmp r0, 0x1 + beq _0819F58A + ldr r2, =gTasks + lsls r1, r4, 2 + adds r0, r1, r4 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r5, r1, 0 + cmp r0, 0x4 + bhi _0819F58A + lsls r0, 2 + ldr r1, =_0819F4C8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0819F4C8: + .4byte _0819F4DC + .4byte _0819F4F8 + .4byte _0819F52C + .4byte _0819F548 + .4byte _0819F568 +_0819F4DC: + ldr r0, =gUnknown_085EED0A + bl sub_819EBEC + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r0, 0x20 + movs r1, 0 + strb r1, [r0] + b _0819F54E + .pool +_0819F4F8: + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0819F50C + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0819F58A +_0819F50C: + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldr r0, [r1, 0x2C] + adds r1, 0x30 + movs r2, 0x1 + bl sub_819F3F8 + b _0819F54E + .pool +_0819F52C: + ldr r0, [r3] + adds r0, 0x30 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819F58A + movs r0, 0x5 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x5 + movs r1, 0x2 + bl CopyWindowToVram + b _0819F54E +_0819F548: + ldr r0, =gUnknown_085EEC8B + bl sub_819EBEC +_0819F54E: + ldr r0, =gTasks + adds r1, r5, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0819F58A + .pool +_0819F568: + bl sub_819EEF0 + bl sub_819EADC + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r0, 0x22 + movs r1, 0x1 + strb r1, [r0] + ldr r1, =gTasks + adds r0, r5, r4 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x12] + strh r1, [r0, 0x8] + ldr r1, =sub_819CE40 + str r1, [r0] +_0819F58A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F488 + + thumb_func_start sub_819F59C +sub_819F59C: @ 819F59C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl GetMonData + lsls r0, 16 + lsrs r5, r0, 16 + movs r4, 0 +_0819F5B8: + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + ldrb r0, [r0, 0x12] + cmp r4, r0 + beq _0819F5EC + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + cmp r0, r5 + bne _0819F5EC + movs r0, 0x1 + b _0819F5F8 + .pool +_0819F5EC: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _0819F5B8 + movs r0, 0 +_0819F5F8: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_819F59C + + thumb_func_start sub_819F600 +sub_819F600: @ 819F600 + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0819F640 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =sub_819F69C + movs r1, 0x1 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrh r2, [r4, 0x3C] + strh r2, [r1, 0x16] + ldr r1, [r1] + bl _call_via_r1 + ldr r0, =SpriteCallbackDummy + str r0, [r4, 0x1C] +_0819F640: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F600 + + thumb_func_start sub_819F654 +sub_819F654: @ 819F654 + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0819F694 + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl FreeOamMatrix + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _0819F688 + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r0, 0x30 + movs r1, 0 + strb r1, [r0] + b _0819F68E + .pool +_0819F688: + movs r0, 0 + bl sub_819BE20 +_0819F68E: + adds r0, r4, 0 + bl DestroySprite +_0819F694: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_819F654 + + thumb_func_start sub_819F69C +sub_819F69C: @ 819F69C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0819F71A + cmp r0, 0x1 + bgt _0819F6C4 + cmp r0, 0 + beq _0819F6CA + b _0819F77C + .pool +_0819F6C4: + cmp r0, 0x2 + beq _0819F73C + b _0819F77C +_0819F6CA: + movs r0, 0x58 + strh r0, [r4, 0xE] + movs r0, 0x98 + strh r0, [r4, 0x38] + movs r0, 0x40 + strh r0, [r4, 0x12] + movs r0, 0x41 + strh r0, [r4, 0x18] + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl SetGpuRegBits + ldrh r1, [r4, 0xE] + lsls r1, 8 + ldrh r0, [r4, 0x38] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x40 + bl SetGpuReg + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x18] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0x3F + bl SetGpuReg + movs r0, 0x4A + movs r1, 0x37 + bl SetGpuReg + b _0819F7A6 +_0819F71A: + movs r0, 0x3 + bl ShowBg + ldr r1, =0x00001248 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x0000040b + movs r0, 0x52 + bl SetGpuReg + b _0819F7A6 + .pool +_0819F73C: + ldrh r0, [r4, 0x12] + subs r0, 0x4 + strh r0, [r4, 0x12] + ldrh r1, [r4, 0x18] + adds r1, 0x4 + strh r1, [r4, 0x18] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x20 + ble _0819F758 + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x5F + ble _0819F760 +_0819F758: + movs r0, 0x20 + strh r0, [r4, 0x12] + movs r0, 0x60 + strh r0, [r4, 0x18] +_0819F760: + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x18] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl SetGpuReg + movs r2, 0x12 + ldrsh r0, [r4, r2] + cmp r0, 0x20 + bne _0819F7AC + b _0819F7A6 +_0819F77C: + adds r0, r5, 0 + bl DestroyTask + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + movs r2, 0x16 + ldrsh r0, [r1, r2] + cmp r0, 0x1 + bne _0819F7A0 + bl sub_819F8E0 + b _0819F7AC + .pool +_0819F7A0: + bl sub_819BD70 + b _0819F7AC +_0819F7A6: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0819F7AC: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_819F69C + + thumb_func_start sub_819F7B4 +sub_819F7B4: @ 819F7B4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0819F844 + cmp r0, 0x1 + beq _0819F894 + movs r0, 0x3 + bl HideBg + ldr r3, =gSprites + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r4, 0x16] + strh r1, [r0, 0x3C] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r3, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_819F654 + str r1, [r0] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0x1 + bl StartSpriteAffineAnim + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl ClearGpuRegBits + adds r0, r5, 0 + bl DestroyTask + b _0819F8D8 + .pool +_0819F844: + movs r0, 0x58 + strh r0, [r4, 0xE] + movs r0, 0x98 + strh r0, [r4, 0x38] + movs r0, 0x20 + strh r0, [r4, 0x12] + movs r0, 0x60 + strh r0, [r4, 0x18] + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl SetGpuRegBits + ldrh r1, [r4, 0xE] + lsls r1, 8 + ldrh r0, [r4, 0x38] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x40 + bl SetGpuReg + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x18] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0x3F + bl SetGpuReg + movs r0, 0x4A + movs r1, 0x37 + bl SetGpuReg + b _0819F8D2 +_0819F894: + ldrh r0, [r4, 0x12] + adds r0, 0x4 + strh r0, [r4, 0x12] + ldrh r1, [r4, 0x18] + subs r1, 0x4 + strh r1, [r4, 0x18] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3F + bgt _0819F8B0 + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x41 + bgt _0819F8B8 +_0819F8B0: + movs r0, 0x40 + strh r0, [r4, 0x12] + movs r0, 0x41 + strh r0, [r4, 0x18] +_0819F8B8: + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x18] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl SetGpuReg + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0x40 + bne _0819F8D8 +_0819F8D2: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0819F8D8: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_819F7B4 + + thumb_func_start sub_819F8E0 +sub_819F8E0: @ 819F8E0 + push {r4-r6,lr} + sub sp, 0x10 + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldrb r0, [r1, 0x14] + cmp r0, 0 + bne _0819F900 + ldrb r1, [r1, 0x3] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + b _0819F908 + .pool +_0819F900: + ldrb r1, [r1, 0x3] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gEnemyParty +_0819F908: + adds r6, r1, r0 + adds r0, r6, 0 + movs r1, 0xB + movs r2, 0 + bl GetMonData + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r6, 0 + movs r1, 0 + movs r2, 0 + bl GetMonData + adds r5, r0, 0 + adds r0, r6, 0 + movs r1, 0x1 + movs r2, 0 + bl GetMonData + adds r1, r0, 0 + movs r0, 0x58 + str r0, [sp] + movs r0, 0x20 + str r0, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + ldr r0, =0x0000ffff + str r0, [sp, 0xC] + adds r0, r4, 0 + adds r2, r5, 0 + movs r3, 0x1 + bl sub_818D7D8 + ldr r2, =gUnknown_03001284 + ldr r1, [r2] + adds r1, 0x2C + movs r3, 0 + strb r0, [r1] + ldr r4, =gSprites + ldr r0, [r2] + adds r0, 0x2C + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x28 + strb r3, [r0] + ldr r0, [r2] + adds r0, 0x2C + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x29 + strb r3, [r0] + ldr r0, [r2] + adds r0, 0x30 + strb r3, [r0] + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F8E0 + + thumb_func_start sub_819F99C +sub_819F99C: @ 819F99C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, =gSaveBlock2Ptr + ldr r1, [r2] + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r1, r0 + adds r1, 0xDE + ldrb r1, [r1] + movs r6, 0 + adds r7, r2, 0 + ldr r0, =gStringVar1 + mov r8, r0 + cmp r1, 0 + beq _0819F9DC +_0819F9C2: + adds r0, r1, 0 + movs r1, 0xA + bl __udivsi3 + lsls r0, 24 + lsrs r1, r0, 24 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r1, 0 + beq _0819F9DC + cmp r6, 0x3 + bls _0819F9C2 +_0819F9DC: + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + ldr r1, [r7] + adds r1, r4, r1 + movs r0, 0x8A + lsls r0, 1 + adds r1, r0 + mov r0, r8 + bl StringCopy7 + ldr r0, [r7] + adds r0, r4 + ldr r1, =0x0000011b + adds r0, r1 + ldrb r1, [r0] + mov r0, r8 + bl ConvertInternationalString + ldr r0, =gStringVar2 + ldr r1, [r7] + adds r1, r4 + adds r1, 0xDE + ldrb r1, [r1] + movs r2, 0x1 + adds r3, r6, 0 + bl ConvertIntToDecimalStringN + ldr r1, =gUnknown_08611330 + ldr r0, [r7] + adds r0, r4 + adds r0, 0xDC + ldrb r0, [r0] + lsls r0, 27 + lsrs r0, 25 + adds r0, r1 + ldr r1, [r0] + ldr r0, =gStringVar4 + bl StringExpandPlaceholders + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F99C + + thumb_func_start sub_819FA50 +sub_819FA50: @ 819FA50 + push {lr} + bl EnableBothScriptContexts + pop {r0} + bx r0 + thumb_func_end sub_819FA50 + + thumb_func_start sub_819FA5C +sub_819FA5C: @ 819FA5C + push {r4,r5,lr} + adds r3, r0, 0 + movs r2, 0 + adds r4, r3, 0 + adds r4, 0x28 + ldr r0, =0x0000ffff + adds r5, r0, 0 +_0819FA6A: + lsls r0, r2, 1 + adds r0, r4, r0 + ldrh r1, [r0] + orrs r1, r5 + strh r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bls _0819FA6A + adds r1, r3, 0 + adds r1, 0x38 + movs r0, 0xFF + strb r0, [r1] + ldrb r1, [r3] + movs r0, 0x20 + negs r0, r0 + ands r0, r1 + movs r1, 0x10 + orrs r0, r1 + strb r0, [r3] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819FA5C + + thumb_func_start sub_819FAA0 +sub_819FAA0: @ 819FAA0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r3, =gSaveBlock2Ptr + ldr r1, [r3] + adds r1, 0xB2 + ldrb r2, [r1] + movs r0, 0x19 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + movs r0, 0 + mov r12, r0 + adds r5, r3, 0 + mov r8, r0 + ldr r1, =0x0000ffff + mov r10, r1 +_0819FAC6: + movs r2, 0 + mov r3, r12 + lsls r7, r3, 4 + movs r4, 0x1 + add r4, r12 + mov r9, r4 + adds r0, r7, r3 + lsls r3, r0, 2 +_0819FAD6: + ldr r1, [r5] + lsls r0, r2, 1 + adds r0, r3 + movs r4, 0x82 + lsls r4, 1 + adds r1, r4 + adds r1, r0 + ldrh r0, [r1] + mov r4, r10 + orrs r0, r4 + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bls _0819FAD6 + ldr r2, [r5] + mov r0, r12 + adds r3, r7, r0 + lsls r3, 2 + adds r2, r3 + adds r2, 0xDC + ldrb r1, [r2] + movs r0, 0x20 + negs r0, r0 + ands r0, r1 + movs r1, 0x10 + orrs r0, r1 + strb r0, [r2] + ldr r0, [r5] + adds r0, r3 + movs r1, 0x8A + lsls r1, 1 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldr r1, [r5] + adds r1, r3 + adds r1, 0xDC + ldrb r2, [r1] + movs r0, 0x61 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r0, [r5] + adds r0, r3 + adds r0, 0xDE + mov r4, r8 + strb r4, [r0] + ldr r0, [r5] + adds r0, r3 + adds r0, 0xDD + strb r4, [r0] + movs r2, 0 + ldr r6, =gSaveBlock2Ptr + movs r4, 0x88 + lsls r4, 1 +_0819FB48: + ldr r0, [r6] + adds r1, r2, r3 + adds r0, r4 + adds r0, r1 + mov r1, r8 + strb r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _0819FB48 + ldr r0, [r5] + mov r3, r12 + adds r2, r7, r3 + lsls r2, 2 + adds r0, r2 + ldr r4, =gGameLanguage + ldrb r1, [r4] + ldr r3, =0x0000011b + adds r0, r3 + strb r1, [r0] + ldr r0, [r5] + movs r4, 0x8E + lsls r4, 1 + adds r0, r4 + adds r0, r2 + mov r1, r8 + str r1, [r0] + mov r3, r9 + lsls r0, r3, 24 + lsrs r0, 24 + mov r12, r0 + cmp r0, 0x3 + bls _0819FAC6 + bl sub_81A087C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819FAA0 + + thumb_func_start sub_819FBB0 +sub_819FBB0: @ 819FBB0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB1 + ldrb r0, [r0] + movs r1, 0x3 + ands r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + bx lr + .pool + thumb_func_end sub_819FBB0 + + thumb_func_start sub_819FBC8 +sub_819FBC8: @ 819FBC8 + push {r4,r5,lr} + ldr r2, =gSaveBlock2Ptr + ldr r0, [r2] + adds r0, 0xDE + ldrb r0, [r0] + cmp r0, 0 + bne _0819FC10 + adds r4, r2, 0 + ldr r5, =gUnknown_08611548 +_0819FBDA: + bl Random + ldr r2, [r4] + lsls r0, 16 + movs r1, 0xE0 + lsls r1, 11 + ands r1, r0 + lsrs r1, 16 + adds r1, r5 + ldrb r0, [r1] + adds r2, 0xB0 + strb r0, [r2] + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0xB0 + adds r0, 0xDC + ldrb r0, [r0] + lsls r0, 27 + ldrb r1, [r1] + lsrs r0, 27 + cmp r1, r0 + beq _0819FBDA + b _0819FC38 + .pool +_0819FC10: + adds r4, r2, 0 +_0819FC12: + bl Random + ldr r2, [r4] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xF + ands r0, r1 + adds r2, 0xB0 + strb r0, [r2] + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0xB0 + adds r0, 0xDC + ldrb r0, [r0] + lsls r0, 27 + ldrb r1, [r1] + lsrs r0, 27 + cmp r1, r0 + beq _0819FC12 +_0819FC38: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_819FBC8 + + thumb_func_start sub_819FC40 +sub_819FC40: @ 819FC40 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gSaveBlock2Ptr + ldr r2, [r1] + adds r2, 0xB1 + movs r1, 0x3 + ands r0, r1 + ldrb r3, [r2] + subs r1, 0x7 + ands r1, r3 + orrs r1, r0 + strb r1, [r2] + bx lr + .pool + thumb_func_end sub_819FC40 + + thumb_func_start sub_819FC60 +sub_819FC60: @ 819FC60 + push {r4-r7,lr} + sub sp, 0xC + movs r5, 0 +_0819FC66: + mov r1, sp + adds r0, r1, r5 + strb r5, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x9 + bls _0819FC66 + movs r5, 0 +_0819FC78: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + mov r7, sp + adds r2, r7, r4 + ldrb r3, [r2] + adds r1, r7, r0 + ldrb r0, [r1] + strb r0, [r2] + strb r3, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x31 + bls _0819FC78 + movs r5, 0 + ldr r6, =gSaveBlock2Ptr + movs r4, 0xF +_0819FCBC: + ldr r3, [r6] + adds r3, 0xB4 + adds r3, r5 + lsls r2, r5, 1 + mov r1, sp + adds r0, r1, r2 + ldrb r0, [r0] + adds r1, r4, 0 + ands r1, r0 + lsls r1, 4 + adds r2, 0x1 + mov r7, sp + adds r0, r7, r2 + ldrb r2, [r0] + adds r0, r4, 0 + ands r0, r2 + orrs r1, r0 + strb r1, [r3] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _0819FCBC + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819FC60 + + thumb_func_start sub_819FCF8 +sub_819FCF8: @ 819FCF8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + cmp r0, 0x2 + bne _0819FD4C + ldr r6, =gUnknown_030062EC +_0819FD06: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r5, r0, 24 + movs r3, 0 + movs r2, 0 + ldr r1, [r6] + lsls r0, r5, 2 + adds r0, r5 + lsls r4, r0, 1 + adds r1, 0x2 +_0819FD26: + lsls r0, r2, 1 + adds r0, r4 + adds r0, r1, r0 + ldrh r0, [r0] + cmp r0, 0 + beq _0819FD38 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 +_0819FD38: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x4 + bls _0819FD26 + cmp r3, 0x3 + bhi _0819FD06 + b _0819FD5A + .pool +_0819FD4C: + cmp r0, 0x1 + bne _0819FD5A + ldrb r0, [r2] + adds r1, r0 + ldrb r5, [r1] + adds r0, 0x1 + strb r0, [r2] +_0819FD5A: + adds r0, r5, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_819FCF8 + + thumb_func_start sub_819FD64 +sub_819FD64: @ 819FD64 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + movs r5, 0 + mov r0, sp + adds r0, 0xC + str r0, [sp, 0x14] + mov r1, sp + adds r1, 0x10 + str r1, [sp, 0x18] + adds r1, r0, 0 +_0819FD80: + adds r0, r1, r5 + strb r5, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _0819FD80 + movs r5, 0 + ldr r6, [sp, 0x14] +_0819FD92: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r4, r0, 24 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + adds r2, r6, r4 + ldrb r3, [r2] + adds r1, r6, r0 + ldrb r0, [r1] + strb r0, [r2] + strb r3, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x9 + bls _0819FD92 + movs r5, 0 + ldr r2, =gUnknown_086114D3 +_0819FDD0: + mov r4, sp + adds r1, r4, r5 + adds r0, r5, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x9 + bls _0819FDD0 + movs r5, 0 +_0819FDE6: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 24 + lsrs r4, r0, 24 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + mov r6, sp + adds r2, r6, r4 + ldrb r3, [r2] + adds r1, r6, r0 + ldrb r0, [r1] + strb r0, [r2] + strb r3, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x31 + bls _0819FDE6 + ldr r4, =gUnknown_030062EC + movs r0, 0x30 + bl AllocZeroed + str r0, [r4] + movs r1, 0 + strb r1, [r0] + movs r5, 0 + movs r2, 0x4 +_0819FE34: + movs r3, 0 +_0819FE36: + ldr r0, [r4] + lsls r1, r3, 2 + adds r1, r3 + adds r1, r5, r1 + adds r0, 0x20 + adds r0, r1 + strb r2, [r0] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x2 + bls _0819FE36 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x4 + bls _0819FE34 + movs r0, 0 + ldr r7, [sp, 0x18] + strb r0, [r7] + movs r5, 0 +_0819FE60: + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + lsls r4, r5, 2 + adds r3, r4 + mov r1, sp + adds r6, r1, r5 + ldrb r0, [r6] + adds r3, 0xB8 + movs r2, 0x3 + ands r2, r0 + ldrb r0, [r3] + movs r7, 0x4 + negs r7, r7 + adds r1, r7, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r3] + ldrb r0, [r6] + adds r5, 0x1 + str r5, [sp, 0x1C] + mov r8, r4 + cmp r0, 0x3 + beq _0819FF62 + ldrb r0, [r6] + ldr r1, [sp, 0x14] + ldr r2, [sp, 0x18] + bl sub_819FCF8 + ldr r1, =gSaveBlock2Ptr + ldr r3, [r1] + add r3, r8 + adds r3, 0xB8 + movs r2, 0x3 + ands r2, r0 + lsls r2, 2 + ldrb r0, [r3] + movs r4, 0xD + negs r4, r4 + adds r1, r4, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r3] + ldr r7, =gSaveBlock2Ptr + ldr r0, [r7] + add r0, r8 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 28 + lsrs r7, r0, 30 + ldrb r0, [r6] + cmp r0, 0x2 + bne _0819FF62 + lsls r0, r7, 2 + adds r0, r7 + mov r10, r0 + ldr r0, =gUnknown_030062EC + mov r9, r0 +_0819FED2: + bl Random + lsls r0, 16 + lsrs r4, r0, 16 + movs r1, 0x3 + ands r4, r1 + movs r3, 0 + mov r6, r9 + ldr r2, [r6] + ldrb r0, [r2] + adds r1, r0, 0x1 + lsls r5, r7, 2 + cmp r3, r1 + bge _0819FF12 + adds r2, 0x20 + mov r6, r10 + adds r0, r2, r6 + ldrb r0, [r0] + cmp r0, r4 + beq _0819FF12 + adds r6, r1, 0 + adds r1, r5, r7 +_0819FEFE: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r6 + bge _0819FF12 + adds r0, r3, r1 + adds r0, r2, r0 + ldrb r0, [r0] + cmp r0, r4 + bne _0819FEFE +_0819FF12: + mov r1, r9 + ldr r0, [r1] + ldrb r0, [r0] + adds r0, 0x1 + ldr r1, =gUnknown_030062EC + cmp r3, r0 + bne _0819FED2 + ldr r0, [r1] + orrs r5, r7 + ldrb r2, [r0] + adds r1, r5, r2 + adds r0, 0x20 + adds r0, r1 + strb r4, [r0] + ldr r6, =gSaveBlock2Ptr + ldr r2, [r6] + add r2, r8 + adds r2, 0xB8 + movs r7, 0x3 + ands r4, r7 + lsls r3, r4, 4 + ldrb r0, [r2] + movs r4, 0x31 + negs r4, r4 + adds r1, r4, 0 + ands r0, r1 + orrs r0, r3 + strb r0, [r2] + ldr r0, [r6] + add r0, r8 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 28 + lsrs r0, 30 + bl sub_819FF98 + ldr r1, [r6] + add r1, r8 + adds r1, 0xBA + strh r0, [r1] +_0819FF62: + ldr r6, [sp, 0x1C] + lsls r0, r6, 24 + lsrs r5, r0, 24 + cmp r5, 0x8 + bhi _0819FF6E + b _0819FE60 +_0819FF6E: + ldr r4, =gUnknown_030062EC + ldr r0, [r4] + bl Free + movs r0, 0 + str r0, [r4] + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819FD64 + + thumb_func_start sub_819FF98 +sub_819FF98: @ 819FF98 + 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 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0xC] + movs r7, 0 + ldr r1, [sp] + cmp r1, 0x2 + bhi _0819FFE0 + ldr r2, =gSaveBlock2Ptr + ldr r1, [r2] + adds r0, r1, 0 + adds r0, 0xB4 + ldr r3, [sp] + adds r0, r3 + ldrb r4, [r0] + adds r1, 0xB2 + ldrb r0, [r1] + lsls r0, 29 + lsrs r0, 29 + asrs r0, r3 + movs r1, 0x1 + ands r0, r1 + lsls r0, 2 + asrs r4, r0 + movs r0, 0xF + ands r4, r0 + b _0819FFE4 + .pool +_0819FFE0: + movs r4, 0 + ldr r2, =gSaveBlock2Ptr +_0819FFE4: + ldr r3, =gUnknown_08610970 + lsls r1, r4, 1 + ldr r4, [r2] + adds r0, r4, 0 + adds r0, 0xB0 + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, r0 + adds r3, 0x34 + adds r1, r3 + ldrh r1, [r1] + str r1, [sp, 0x8] + ldr r1, =gLevelUpLearnsets + ldr r2, [sp, 0x8] + lsls r0, r2, 2 + adds r0, r1 + ldr r6, [r0] + movs r3, 0 + adds r4, 0xB1 + ldrb r1, [r4] + movs r0, 0x3 + ands r0, r1 + movs r5, 0x3C + cmp r0, 0x1 + bne _081A001A + movs r5, 0x32 +_081A001A: + ldrh r1, [r6] + ldr r4, =0x0000ffff + cmp r1, r4 + beq _081A004C + movs r2, 0xFE + lsls r2, 8 + adds r0, r2, 0 + ands r0, r1 + lsls r1, r5, 9 + cmp r0, r1 + bgt _081A004C + adds r5, r2, 0 + adds r2, r1, 0 +_081A0034: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 1 + adds r0, r6 + ldrh r1, [r0] + cmp r1, r4 + beq _081A004C + adds r0, r5, 0 + ands r0, r1 + cmp r0, r2 + ble _081A0034 +_081A004C: + adds r5, r3, 0 + movs r3, 0 + str r3, [sp, 0x4] +_081A0052: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081A0068 + ldr r0, [sp, 0xC] + cmp r0, 0x1 + bne _081A00E0 +_081A0068: + ldr r1, =0x000001ff + mov r8, r1 +_081A006C: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3A + bl __umodsi3 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, [sp, 0x8] + adds r1, r4, 0 + bl CanSpeciesLearnTMHM + adds r2, r0, 0 + cmp r2, 0 + beq _081A006C + ldr r2, =0x00000121 + adds r0, r4, r2 + bl ItemIdToBattleMoveId + lsls r0, 16 + lsrs r7, r0, 16 + movs r2, 0x1 + cmp r5, 0x4 + bhi _081A00BC + movs r3, 0 + b _081A00C6 + .pool +_081A00BC: + subs r0, r5, 0x4 + b _081A00C2 +_081A00C0: + adds r0, r3, 0x1 +_081A00C2: + lsls r0, 24 + lsrs r3, r0, 24 +_081A00C6: + cmp r3, r5 + bcs _081A00DA + lsls r0, r3, 1 + adds r0, r6 + ldrh r0, [r0] + mov r1, r8 + ands r0, r1 + cmp r0, r7 + bne _081A00C0 + movs r2, 0 +_081A00DA: + cmp r2, 0x1 + bne _081A006C + b _081A0146 +_081A00E0: + cmp r5, 0x4 + bhi _081A00EA + movs r2, 0x1 + str r2, [sp, 0xC] + b _081A0168 +_081A00EA: + subs r4, r5, 0x4 + ldr r3, =0x000001ff + mov r10, r3 + mov r8, r3 + lsls r0, r4, 24 + mov r9, r0 +_081A00F6: + bl Random + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl __modsi3 + lsls r0, 24 + lsrs r0, 23 + adds r0, r6 + ldrh r0, [r0] + mov r7, r8 + ands r7, r0 + movs r2, 0x1 + mov r1, r9 + lsrs r3, r1, 24 + cmp r3, r5 + bcs _081A0142 + lsls r0, r3, 1 + adds r0, r6 + ldrh r1, [r0] + mov r0, r8 + b _081A013A + .pool +_081A0128: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r5 + bcs _081A0142 + lsls r0, r3, 1 + adds r0, r6 + ldrh r0, [r0] + mov r1, r10 +_081A013A: + ands r0, r1 + cmp r0, r7 + bne _081A0128 + movs r2, 0 +_081A0142: + cmp r2, 0x1 + bne _081A00F6 +_081A0146: + ldr r0, [sp] + adds r1, r7, 0 + bl sub_81A0194 + lsls r0, 24 + cmp r0, 0 + beq _081A0168 + ldr r0, =gUnknown_08611370 + adds r0, r7, r0 + ldrb r0, [r0] + cmp r0, 0 + bne _081A0170 + ldr r0, [sp, 0x4] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] +_081A0168: + ldr r2, [sp, 0x4] + cmp r2, 0x4 + bhi _081A0170 + b _081A0052 +_081A0170: + ldr r0, =gUnknown_030062EC + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + adds r0, r7, 0 + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_819FF98 + + thumb_func_start sub_81A0194 +sub_81A0194: @ 81A0194 + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 16 + lsrs r5, r1, 16 + movs r3, 0 + ldr r0, =gUnknown_030062EC + mov r12, r0 + ldr r2, [r0] + lsls r1, r4, 2 + adds r0, r1, r4 + lsls r6, r0, 1 + adds r2, 0x2 + adds r7, r1, 0 +_081A01B0: + lsls r0, r3, 1 + adds r0, r6 + adds r0, r2, r0 + ldrh r0, [r0] + cmp r0, r5 + bne _081A01C4 + movs r0, 0 + b _081A01E2 + .pool +_081A01C4: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x4 + bls _081A01B0 + mov r2, r12 + ldr r1, [r2] + adds r0, r7, r4 + ldrb r2, [r1] + adds r0, r2 + lsls r0, 1 + adds r1, 0x2 + adds r1, r0 + strh r5, [r1] + movs r0, 0x1 +_081A01E2: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81A0194 + + thumb_func_start sub_81A01E8 +sub_81A01E8: @ 81A01E8 + push {r4-r7,lr} + mov r12, r1 + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB1 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + movs r4, 0x3C + cmp r0, 0x1 + bne _081A0204 + movs r4, 0x32 +_081A0204: + ldr r1, =gLevelUpLearnsets + lsls r0, r2, 2 + adds r0, r1 + ldr r6, [r0] + movs r5, 0 + ldrh r1, [r6] + ldr r3, =0x0000ffff + cmp r1, r3 + beq _081A0240 + movs r2, 0xFE + lsls r2, 8 + adds r0, r2, 0 + ands r0, r1 + lsls r1, r4, 9 + cmp r0, r1 + bgt _081A0240 + adds r4, r2, 0 + adds r2, r1, 0 +_081A0228: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 1 + adds r0, r6 + ldrh r1, [r0] + cmp r1, r3 + beq _081A0240 + adds r0, r4, 0 + ands r0, r1 + cmp r0, r2 + ble _081A0228 +_081A0240: + adds r4, r5, 0 + cmp r4, 0x4 + bls _081A0248 + movs r4, 0x4 +_081A0248: + movs r2, 0 + cmp r2, r4 + bcs _081A026C + ldr r7, =0x000001ff +_081A0250: + lsls r3, r2, 1 + add r3, r12 + adds r2, 0x1 + subs r0, r5, r2 + lsls r0, 1 + adds r0, r6 + ldrh r1, [r0] + adds r0, r7, 0 + ands r0, r1 + strh r0, [r3] + lsls r2, 24 + lsrs r2, 24 + cmp r2, r4 + bcc _081A0250 +_081A026C: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A01E8 + + thumb_func_start sub_81A0284 +sub_81A0284: @ 81A0284 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r5, r2, 24 + ldr r1, =gSaveBlock2Ptr + ldr r2, [r1] + adds r0, r2, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + adds r7, r1, 0 + cmp r0, 0x2 + bhi _081A02B8 + movs r0, 0 + b _081A037C + .pool +_081A02B8: + movs r4, 0 + movs r3, 0 + adds r0, r2, 0 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + ldr r1, =gUnknown_08610970 + mov r12, r1 + lsls r6, 1 + lsls r5, 1 + mov r9, r5 + cmp r0, 0 + beq _081A02F4 + adds r2, r7, 0 +_081A02D4: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x8 + bhi _081A02F4 + ldr r0, [r2] + lsls r1, r3, 2 + adds r0, r1 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + cmp r0, 0 + bne _081A02D4 +_081A02F4: + ldr r0, [r7] + adds r0, 0xB0 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r6, r0 + mov r1, r12 + adds r1, 0x34 + adds r0, r1 + ldrh r0, [r0] + mov r1, sp + bl sub_81A01E8 + movs r3, 0 + cmp r3, r4 + bcs _081A0376 + ldr r1, [r7] + adds r0, r1, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + cmp r3, r0 + bge _081A0376 + adds r6, r7, 0 + adds r5, r1, 0 +_081A032A: + lsls r0, r3, 2 + adds r2, r5, r0 + adds r0, r2, 0 + adds r0, 0xB8 + ldrb r1, [r0] + lsls r0, r1, 30 + lsrs r0, 30 + cmp r0, 0x2 + bne _081A035C + lsls r0, r1, 28 + lsrs r0, 30 + cmp r0, r8 + bne _081A035C + lsrs r0, r1, 6 + cmp r0, 0 + beq _081A035C + lsls r0, r1, 26 + lsrs r0, 30 + lsls r0, 1 + mov r7, sp + adds r1, r7, r0 + adds r0, r2, 0 + adds r0, 0xBA + ldrh r0, [r0] + strh r0, [r1] +_081A035C: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r4 + bcs _081A0376 + ldr r0, [r6] + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + cmp r3, r0 + blt _081A032A +_081A0376: + mov r0, sp + add r0, r9 + ldrh r0, [r0] +_081A037C: + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A0284 + + thumb_func_start sub_81A0390 +sub_81A0390: @ 81A0390 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r5, 0 + ldr r7, =gSaveBlock2Ptr + adds r6, r7, 0 + movs r4, 0 +_081A03A6: + ldr r0, [r6] + lsls r2, r5, 1 + adds r2, r5 + lsls r2, 2 + adds r0, r2 + adds r1, r0, 0 + adds r1, 0xE0 + strh r4, [r1] + adds r0, 0xEA + strh r4, [r0] + movs r3, 0 +_081A03BC: + ldr r0, [r6] + lsls r1, r3, 1 + adds r1, r2 + adds r0, 0xE2 + adds r0, r1 + strh r4, [r0] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3 + bls _081A03BC + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _081A03A6 + ldr r0, [r7] + adds r0, 0xB1 + ldrb r0, [r0] + lsrs r3, r0, 6 + movs r5, 0 +_081A03E6: + lsls r0, r3, 2 + mov r1, sp + adds r2, r1, r0 + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, 0xE0 + ldr r1, [r7] + adds r1, r0 + str r1, [r2] + adds r0, r3, 0x1 + movs r1, 0x3 + bl __modsi3 + lsls r0, 24 + lsrs r3, r0, 24 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _081A03E6 + movs r5, 0 + ldr r7, =gSaveBlock2Ptr + ldr r6, =gUnknown_086109A4 +_081A0416: + ldr r0, [r7] + mov r12, r0 + adds r0, 0xB4 + adds r0, r5 + ldrb r2, [r0] + mov r0, r12 + adds r0, 0xB2 + ldrb r0, [r0] + lsls r0, 29 + lsrs r0, 29 + asrs r0, r5 + movs r1, 0x1 + ands r0, r1 + lsls r0, 2 + asrs r2, r0 + movs r0, 0xF + ands r2, r0 + lsls r0, r5, 2 + mov r1, sp + adds r3, r1, r0 + ldr r4, [r3] + lsls r2, 1 + mov r0, r12 + adds r0, 0xB0 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r2, r0 + adds r2, r6 + ldrh r0, [r2] + strh r0, [r4] + ldr r1, [r3] + ldrh r0, [r1] + adds r1, 0x2 + bl sub_81A01E8 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _081A0416 + movs r5, 0 + cmp r5, r8 + bcs _081A04D6 + ldr r7, =gSaveBlock2Ptr +_081A0470: + ldr r1, [r7] + lsls r0, r5, 2 + adds r4, r1, r0 + adds r0, r4, 0 + adds r0, 0xB8 + ldrb r2, [r0] + lsls r0, r2, 30 + lsrs r1, r0, 30 + lsls r0, r2, 28 + lsrs r3, r0, 30 + adds r6, r3, 0 + cmp r1, 0x1 + bne _081A04A8 + lsrs r0, r2, 6 + cmp r0, 0 + beq _081A04CC + lsls r0, r3, 2 + add r0, sp + ldr r1, [r0] + adds r0, r4, 0 + adds r0, 0xBA + ldrh r0, [r0] + strh r0, [r1, 0xA] + b _081A04CC + .pool +_081A04A8: + cmp r1, 0x2 + bne _081A04CC + lsls r0, r2, 24 + lsrs r0, 30 + cmp r0, 0 + beq _081A04CC + lsls r2, 26 + lsrs r2, 30 + lsls r0, r6, 2 + add r0, sp + ldr r1, [r0] + lsls r2, 1 + adds r1, 0x2 + adds r1, r2 + adds r0, r4, 0 + adds r0, 0xBA + ldrh r0, [r0] + strh r0, [r1] +_081A04CC: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r8 + bcc _081A0470 +_081A04D6: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81A0390 + + thumb_func_start sub_81A04E4 +sub_81A04E4: @ 81A04E4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + lsls r0, 24 + lsrs r0, 24 + movs r7, 0x2 + cmp r0, 0x6 + bls _081A04FC + b _081A064C +_081A04FC: + lsls r0, 2 + ldr r1, =_081A050C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A050C: + .4byte _081A0528 + .4byte _081A0540 + .4byte _081A05B4 + .4byte _081A05F4 + .4byte _081A061C + .4byte _081A064C + .4byte _081A0634 +_081A0528: + movs r0, 0x12 + mov r10, r0 + movs r6, 0x8 + ldr r0, =gUnknown_085EAEB1 + str r0, [sp, 0xC] + ldr r0, =gUnknown_085EAEB8 + str r0, [sp, 0x10] + b _081A0652 + .pool +_081A0540: + movs r7, 0x3 + movs r1, 0x12 + mov r10, r1 + movs r6, 0x6 + movs r4, 0 + ldr r0, =gSpeciesNames + mov r9, r0 + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + movs r1, 0xB2 + adds r1, r3 + mov r12, r1 + adds r5, r3, 0 + adds r5, 0xB0 + ldr r0, =gUnknown_086109A4 + mov r8, r0 +_081A0560: + adds r0, r3, 0 + adds r0, 0xB4 + adds r0, r4 + ldrb r2, [r0] + mov r1, r12 + ldrb r0, [r1] + lsls r0, 29 + lsrs r0, 29 + asrs r0, r4 + movs r1, 0x1 + ands r0, r1 + lsls r0, 2 + asrs r2, r0 + movs r0, 0xF + ands r2, r0 + lsls r2, 1 + ldrb r1, [r5] + movs r0, 0x58 + muls r0, r1 + adds r2, r0 + add r2, r8 + ldrh r1, [r2] + lsls r0, r4, 2 + mov r2, sp + adds r2, r0 + adds r2, 0xC + movs r0, 0xB + muls r0, r1 + add r0, r9 + str r0, [r2] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _081A0560 + b _081A0652 + .pool +_081A05B4: + movs r0, 0x12 + mov r10, r0 + movs r6, 0x8 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + cmp r0, 0x2 + bls _081A05CC + b _081A06FA +_081A05CC: + ldr r0, =gUnknown_030062F0 + ldr r3, [r0] + ldrh r0, [r3, 0x2] + movs r2, 0xB + muls r0, r2 + ldr r1, =gSpeciesNames + adds r0, r1 + str r0, [sp, 0x10] + ldrh r0, [r3] + muls r0, r2 + adds r0, r1 + str r0, [sp, 0xC] + b _081A0652 + .pool +_081A05F4: + movs r1, 0x11 + mov r10, r1 + movs r6, 0x8 + ldr r0, =gUnknown_030062F0 + ldr r3, [r0] + ldrh r0, [r3, 0x4] + movs r2, 0xD + muls r0, r2 + ldr r1, =gMoveNames + adds r0, r1 + str r0, [sp, 0xC] + ldrh r0, [r3, 0x6] + muls r0, r2 + adds r0, r1 + str r0, [sp, 0x10] + b _081A0652 + .pool +_081A061C: + movs r0, 0x12 + mov r10, r0 + movs r6, 0x8 + ldr r0, =gUnknown_085ED193 + str r0, [sp, 0xC] + ldr r0, =gUnknown_085ED198 + str r0, [sp, 0x10] + b _081A0652 + .pool +_081A0634: + movs r1, 0x14 + mov r10, r1 + movs r6, 0x8 + ldr r0, =gUnknown_085EAE62 + str r0, [sp, 0xC] + ldr r0, =gUnknown_085EAE66 + str r0, [sp, 0x10] + b _081A0652 + .pool +_081A064C: + movs r0, 0 + mov r10, r0 + movs r6, 0 +_081A0652: + movs r5, 0 + movs r4, 0 + lsls r1, r7, 25 + mov r8, r1 + cmp r4, r7 + bcs _081A067E +_081A065E: + lsls r0, r4, 2 + add r0, sp + adds r0, 0xC + ldr r1, [r0] + movs r0, 0x1 + movs r2, 0 + bl GetStringWidth + cmp r0, r5 + ble _081A0674 + adds r5, r0, 0 +_081A0674: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r7 + bcc _081A065E +_081A067E: + adds r0, r5, 0 + bl convert_pixel_width_to_tile_width + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + mov r0, r10 + adds r1, r4, 0 + bl sub_80E2D5C + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + mov r0, r8 + lsrs r3, r0, 24 + mov r0, r10 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_81A0784 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + movs r1, 0 + bl SetStandardWindowBorderStyle + movs r4, 0 + cmp r4, r7 + bcs _081A06E6 +_081A06B8: + lsls r0, r4, 2 + add r0, sp + adds r0, 0xC + ldr r2, [r0] + lsls r0, r4, 4 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r5, 0 + movs r1, 0x1 + movs r3, 0x8 + bl PrintTextOnWindow + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r7 + bcc _081A06B8 +_081A06E6: + adds r0, r5, 0 + adds r1, r7, 0 + movs r2, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + movs r0, 0x1 + adds r1, r7, 0 + adds r2, r5, 0 + bl sub_81A0804 +_081A06FA: + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81A04E4 + + thumb_func_start sub_81A070C +sub_81A070C: @ 81A070C + 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 + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081A0730 + bl ProcessMenuInputNoWrapAround + b _081A0734 + .pool +_081A0730: + bl ProcessMenuInput +_081A0734: + lsls r0, 24 + lsrs r0, 24 + lsls r0, 24 + asrs r1, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r1, r0 + beq _081A0778 + adds r0, 0x1 + cmp r1, r0 + bne _081A0764 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081A0778 + movs r0, 0x5 + bl PlaySE + ldr r1, =gScriptResult + movs r0, 0x7F + strh r0, [r1] + b _081A0768 + .pool +_081A0764: + ldr r0, =gScriptResult + strh r1, [r0] +_081A0768: + ldrb r0, [r4, 0xC] + bl sub_81A07E8 + adds r0, r5, 0 + bl DestroyTask + bl EnableBothScriptContexts +_081A0778: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A070C + + thumb_func_start sub_81A0784 +sub_81A0784: @ 81A0784 + push {r4,r5,lr} + sub sp, 0x20 + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsls r5, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x80 + lsls r0, 17 + adds r4, r0 + lsrs r4, 24 + adds r5, r0 + lsrs r5, 24 + str r2, [sp] + str r3, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + movs r0, 0x64 + str r0, [sp, 0xC] + add r0, sp, 0x10 + movs r1, 0 + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_8198A50 + ldr r0, [sp, 0x10] + ldr r1, [sp, 0x14] + str r0, [sp, 0x18] + str r1, [sp, 0x1C] + add r0, sp, 0x18 + bl AddWindow + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram + adds r0, r4, 0 + add sp, 0x20 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81A0784 + + thumb_func_start sub_81A07E8 +sub_81A07E8: @ 81A07E8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8198070 + adds r0, r4, 0 + bl RemoveWindow + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81A07E8 + + thumb_func_start sub_81A0804 +sub_81A0804: @ 81A0804 + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r0, =sub_81A070C + movs r1, 0x50 + bl CreateTask + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0, r1 + strh r4, [r1, 0x10] + cmp r5, 0x3 + bls _081A0840 + movs r0, 0x1 + b _081A0842 + .pool +_081A0840: + movs r0, 0 +_081A0842: + strh r0, [r1, 0x12] + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + strh r6, [r0, 0x14] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A0804 + + thumb_func_start sub_81A085C +sub_81A085C: @ 81A085C + push {lr} + ldr r1, =gUnknown_086114E0 + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A085C + + thumb_func_start sub_81A087C +sub_81A087C: @ 81A087C + push {r4-r7,lr} + bl sub_819FBC8 + ldr r3, =gSaveBlock2Ptr + ldr r1, [r3] + adds r1, 0xB1 + ldrb r2, [r1] + movs r0, 0x4 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r3] + adds r1, 0xB1 + ldrb r2, [r1] + movs r0, 0x3D + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r3] + adds r1, 0xB1 + ldrb r2, [r1] + movs r0, 0x3F + ands r0, r2 + strb r0, [r1] + ldr r1, [r3] + adds r1, 0xB2 + ldrb r2, [r1] + movs r0, 0x8 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + movs r4, 0 + movs r1, 0 +_081A08BE: + ldr r0, [r3] + adds r0, 0xB4 + adds r0, r4 + strb r1, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _081A08BE + movs r4, 0 + ldr r5, =gSaveBlock2Ptr + movs r0, 0x4 + negs r0, r0 + mov r12, r0 + movs r7, 0xD + negs r7, r7 + movs r6, 0x31 + negs r6, r6 +_081A08E2: + ldr r1, [r5] + lsls r3, r4, 2 + adds r1, r3 + adds r1, 0xB8 + ldrb r2, [r1] + mov r0, r12 + ands r0, r2 + strb r0, [r1] + ldr r1, [r5] + adds r1, r3 + adds r1, 0xB8 + ldrb r2, [r1] + adds r0, r7, 0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r5] + adds r1, r3 + adds r1, 0xB8 + ldrb r2, [r1] + adds r0, r6, 0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r5] + adds r1, r3 + adds r1, 0xB8 + ldrb r2, [r1] + movs r0, 0x3F + ands r0, r2 + strb r0, [r1] + ldr r0, [r5] + adds r0, r3 + adds r0, 0xBA + movs r1, 0 + strh r1, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x8 + bls _081A08E2 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A087C + + thumb_func_start sub_81A093C +sub_81A093C: @ 81A093C + push {lr} + bl sub_819FBB0 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _081A0954 + ldr r0, =gScriptResult + strh r1, [r0] + b _081A095A + .pool +_081A0954: + ldr r1, =gScriptResult + movs r0, 0x1 + strh r0, [r1] +_081A095A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A093C + + thumb_func_start sub_81A0964 +sub_81A0964: @ 81A0964 + push {lr} + ldr r0, =gSpecialVar_0x8005 + ldrb r0, [r0] + bl sub_819FC40 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A0964 + + thumb_func_start sub_81A0978 +sub_81A0978: @ 81A0978 + push {lr} + bl sub_819FBC8 + pop {r0} + bx r0 + thumb_func_end sub_81A0978 + + thumb_func_start sub_81A0984 +sub_81A0984: @ 81A0984 + push {lr} + bl sub_819FD64 + pop {r0} + bx r0 + thumb_func_end sub_81A0984 + + thumb_func_start sub_81A0990 +sub_81A0990: @ 81A0990 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + adds r2, 0xB1 + ldrb r3, [r2] + lsls r1, r3, 26 + lsrs r1, 28 + adds r1, 0x1 + movs r0, 0xF + ands r1, r0 + lsls r1, 2 + movs r0, 0x3D + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + bx lr + .pool + thumb_func_end sub_81A0990 + + thumb_func_start sub_81A09B4 +sub_81A09B4: @ 81A09B4 + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_81A09B4 + + thumb_func_start sub_81A09D0 +sub_81A09D0: @ 81A09D0 + push {lr} + ldr r3, =gSaveBlock2Ptr + ldr r0, [r3] + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r1, r0, 0x3 + cmp r1, 0 + bge _081A09F4 + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] + b _081A0A1C + .pool +_081A09F4: + ldr r2, =gScriptResult + cmp r1, 0x8 + ble _081A09FE + movs r0, 0x1 + strh r0, [r2] +_081A09FE: + ldr r0, [r3] + lsls r1, 2 + adds r0, r1 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + cmp r0, 0 + bne _081A0A18 + movs r0, 0x1 + b _081A0A1A + .pool +_081A0A18: + movs r0, 0 +_081A0A1A: + strh r0, [r2] +_081A0A1C: + pop {r0} + bx r0 + thumb_func_end sub_81A09D0 + + thumb_func_start sub_81A0A20 +sub_81A0A20: @ 81A0A20 + push {lr} + ldr r0, =gSpecialVar_0x8005 + ldrb r0, [r0] + bl sub_81A04E4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A0A20 + + thumb_func_start sub_81A0A34 +sub_81A0A34: @ 81A0A34 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8197224 + lsls r0, 16 + cmp r0, 0 + bne _081A0A68 + adds r0, r4, 0 + bl DestroyTask + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0 + beq _081A0A64 + ldr r0, =EnableBothScriptContexts + bl sub_81A172C + b _081A0A68 + .pool +_081A0A64: + bl EnableBothScriptContexts +_081A0A68: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81A0A34 + + thumb_func_start sub_81A0A70 +sub_81A0A70: @ 81A0A70 + push {lr} + ldr r1, =gSpecialVar_0x8006 + ldrh r0, [r1] + cmp r0, 0x6 + bne _081A0A94 + ldr r1, =gUnknown_08610FF0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 3 + b _081A0C66 + .pool +_081A0A94: + cmp r0, 0x7 + bne _081A0AB0 + ldr r1, =gUnknown_08610FF0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 3 + adds r1, 0x4 + b _081A0C66 + .pool +_081A0AB0: + cmp r0, 0x8 + bne _081A0ACC + ldr r1, =gUnknown_086111B0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 3 + b _081A0C66 + .pool +_081A0ACC: + cmp r0, 0x9 + bne _081A0AE8 + ldr r1, =gUnknown_086111B0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 3 + adds r1, 0x4 + b _081A0C66 + .pool +_081A0AE8: + cmp r0, 0x4 + bne _081A0B04 + ldr r1, =gUnknown_08611230 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 3 + b _081A0C66 + .pool +_081A0B04: + cmp r0, 0x5 + bne _081A0B20 + ldr r1, =gUnknown_08611230 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 3 + adds r1, 0x4 + b _081A0C66 + .pool +_081A0B20: + cmp r0, 0xA + bne _081A0B40 + ldr r2, =gUnknown_08611070 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + b _081A0BD6 + .pool +_081A0B40: + cmp r0, 0xB + bne _081A0B5C + ldr r1, =gUnknown_086112B0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 3 + b _081A0C66 + .pool +_081A0B5C: + cmp r0, 0xC + bne _081A0B7C + ldr r2, =gUnknown_08611070 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0xC + b _081A0BD6 + .pool +_081A0B7C: + cmp r0, 0xD + bne _081A0B9C + ldr r2, =gUnknown_08611070 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0x4 + b _081A0BD6 + .pool +_081A0B9C: + ldrh r0, [r1] + cmp r0, 0x10 + bne _081A0BC0 + ldr r2, =gUnknown_08611070 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0x10 + b _081A0BD6 + .pool +_081A0BC0: + cmp r0, 0xE + bne _081A0BE4 + ldr r2, =gUnknown_08611070 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0x8 +_081A0BD6: + adds r0, r2 + ldr r1, [r0] + b _081A0C7A + .pool +_081A0BE4: + cmp r0, 0xF + bne _081A0C00 + ldr r1, =gUnknown_086112B0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 3 + adds r1, 0x4 + b _081A0C66 + .pool +_081A0C00: + cmp r0, 0 + bne _081A0C1C + ldr r1, =gUnknown_08610EF0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 4 + b _081A0C66 + .pool +_081A0C1C: + cmp r0, 0x1 + bne _081A0C38 + ldr r1, =gUnknown_08610EF0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 4 + adds r1, 0x4 + b _081A0C66 + .pool +_081A0C38: + cmp r0, 0x2 + bne _081A0C54 + ldr r1, =gUnknown_08610EF0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 4 + adds r1, 0x8 + b _081A0C66 + .pool +_081A0C54: + cmp r0, 0x3 + bne _081A0C74 + ldr r1, =gUnknown_08610EF0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 4 + adds r1, 0xC +_081A0C66: + adds r0, r1 + ldr r1, [r0] + b _081A0C7A + .pool +_081A0C74: + bl EnableBothScriptContexts + b _081A0C8E +_081A0C7A: + ldr r0, =gStringVar4 + bl StringExpandPlaceholders + movs r0, 0x1 + bl AddTextPrinterForMessage + ldr r0, =sub_81A0A34 + movs r1, 0x1 + bl CreateTask +_081A0C8E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A0A70 + + thumb_func_start sub_81A0C9C +sub_81A0C9C: @ 81A0C9C + push {lr} + bl ScriptContext2_Enable + bl player_bitmagic + bl sub_808B864 + bl sub_808BCF4 + movs r0, 0 + movs r1, 0x1 + bl sub_81973C4 + bl sub_81A0A70 + pop {r0} + bx r0 + thumb_func_end sub_81A0C9C + + thumb_func_start sub_81A0CC0 +sub_81A0CC0: @ 81A0CC0 + push {lr} + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r1, r0, 26 + lsrs r0, r1, 28 + cmp r0, 0x2 + bhi _081A0CE4 + ldr r1, =gScriptResult + movs r0, 0x2 + b _081A0D34 + .pool +_081A0CE4: + lsrs r0, r1, 28 + cmp r0, 0xB + bhi _081A0D30 + lsrs r0, r1, 28 + subs r0, 0x3 + lsls r0, 2 + adds r0, r2, r0 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + cmp r0, 0x2 + beq _081A0D18 + cmp r0, 0x2 + bgt _081A0D08 + cmp r0, 0x1 + beq _081A0D0E + b _081A0D30 +_081A0D08: + cmp r0, 0x3 + beq _081A0D24 + b _081A0D30 +_081A0D0E: + ldr r1, =gScriptResult + movs r0, 0x4 + b _081A0D34 + .pool +_081A0D18: + ldr r1, =gScriptResult + movs r0, 0x3 + b _081A0D34 + .pool +_081A0D24: + ldr r1, =gScriptResult + movs r0, 0x1 + b _081A0D34 + .pool +_081A0D30: + ldr r1, =gScriptResult + movs r0, 0x5 +_081A0D34: + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A0CC0 + + thumb_func_start sub_81A0D40 +sub_81A0D40: @ 81A0D40 + push {r4,lr} + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0 + beq _081A0D6E + ldr r4, =gSpecialVar_0x8006 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + adds r2, 0xB2 + ldrb r3, [r2] + lsls r0, r3, 29 + lsrs r0, 29 + movs r1, 0x1 + ldrb r4, [r4] + lsls r1, r4 + orrs r1, r0 + movs r0, 0x7 + ands r1, r0 + movs r0, 0x8 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] +_081A0D6E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A0D40 + + thumb_func_start sub_81A0D80 +sub_81A0D80: @ 81A0D80 + push {lr} + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + adds r0, r3, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r1, r0, 26 + lsrs r0, r1, 28 + cmp r0, 0x2 + bls _081A0DCE + subs r0, 0x3 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0 + beq _081A0DC0 + lsls r2, 2 + adds r2, r3, r2 + adds r2, 0xB8 + ldrb r1, [r2] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + b _081A0DCE + .pool +_081A0DC0: + lsls r0, r2, 2 + adds r0, r3, r0 + adds r0, 0xB8 + ldrb r2, [r0] + movs r1, 0x3F + ands r1, r2 + strb r1, [r0] +_081A0DCE: + pop {r0} + bx r0 + thumb_func_end sub_81A0D80 + + thumb_func_start sub_81A0DD4 +sub_81A0DD4: @ 81A0DD4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r6, 0 + movs r2, 0 + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + ldr r3, =gUnknown_030062F0 + mov r9, r3 + cmp r0, 0 + beq _081A0E14 + adds r3, r1, 0 +_081A0DF4: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x8 + bhi _081A0E14 + ldr r0, [r3] + lsls r1, r2, 2 + adds r0, r1 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + cmp r0, 0 + bne _081A0DF4 +_081A0E14: + mov r4, r9 + movs r0, 0x8 + bl AllocZeroed + adds r7, r0, 0 + str r7, [r4] + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x2 + bne _081A0E88 + ldr r0, =gSaveBlock2Ptr + ldr r5, [r0] + adds r6, r5, 0 + adds r6, 0xB1 + ldrb r0, [r6] + lsls r1, r0, 26 + lsrs r0, r1, 28 + cmp r0, 0x2 + bls _081A0E3C + b _081A0FCE +_081A0E3C: + adds r2, r5, 0 + adds r2, 0xB4 + adds r0, r2, r0 + ldrb r0, [r0] + lsrs r4, r0, 4 + ldr r3, =gUnknown_08610970 + lsls r1, r4, 1 + adds r5, 0xB0 + ldrb r0, [r5] + movs r4, 0x58 + muls r0, r4 + adds r1, r0 + adds r3, 0x34 + adds r1, r3 + ldrh r0, [r1] + strh r0, [r7, 0x2] + ldrb r0, [r6] + lsls r0, 26 + lsrs r0, 28 + adds r2, r0 + ldrb r1, [r2] + movs r0, 0xF + ands r0, r1 + lsls r0, 1 + ldrb r1, [r5] + muls r1, r4 + adds r0, r1 + adds r0, r3 + b _081A0FCA + .pool +_081A0E88: + cmp r0, 0x3 + bne _081A0F54 + ldr r0, =gSaveBlock2Ptr + mov r8, r0 + ldr r5, [r0] + movs r1, 0xB1 + adds r1, r5 + mov r12, r1 + ldrb r0, [r1] + lsls r2, r0, 26 + lsrs r0, r2, 28 + cmp r0, 0x2 + bhi _081A0EA4 + b _081A0FCE +_081A0EA4: + adds r1, r0, 0 + adds r0, r6, 0x3 + cmp r1, r0 + blt _081A0EAE + b _081A0FCE +_081A0EAE: + adds r0, r1, 0 + subs r0, 0x3 + lsls r0, 2 + adds r0, r5, r0 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + cmp r0, 0x2 + beq _081A0EC4 + b _081A0FCE +_081A0EC4: + adds r0, r1, 0 + subs r0, 0x3 + lsls r0, 2 + adds r0, r5, r0 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 28 + lsrs r6, r0, 30 + adds r0, r5, 0 + adds r0, 0xB2 + ldrb r1, [r0] + lsls r1, 29 + lsrs r1, 29 + asrs r1, r6 + movs r0, 0x1 + ands r1, r0 + adds r0, r5, 0 + adds r0, 0xB4 + adds r0, r6 + ldrb r4, [r0] + lsls r1, 2 + asrs r4, r1 + movs r0, 0xF + ands r4, r0 + ldr r2, =gUnknown_08610970 + lsls r1, r4, 1 + adds r0, r5, 0 + adds r0, 0xB0 + ldrb r3, [r0] + movs r0, 0x58 + muls r0, r3 + adds r1, r0 + adds r2, 0x34 + adds r1, r2 + ldrh r0, [r1] + strh r0, [r7] + mov r3, r12 + ldrb r0, [r3] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + lsls r0, 2 + adds r0, r5, r0 + adds r0, 0xB8 + ldrb r2, [r0] + lsls r2, 26 + lsrs r2, 30 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_81A0284 + mov r1, r9 + ldr r2, [r1] + strh r0, [r2, 0x4] + mov r3, r8 + ldr r1, [r3] + adds r0, r1, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + lsls r0, 2 + adds r1, r0 + adds r1, 0xBA + ldrh r0, [r1] + strh r0, [r2, 0x6] + b _081A0FCE + .pool +_081A0F54: + cmp r0, 0x4 + bne _081A0FCE + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + adds r0, r3, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r2, r0, 26 + lsrs r0, r2, 28 + cmp r0, 0x2 + bls _081A0FCE + adds r1, r0, 0 + adds r0, r6, 0x3 + cmp r1, r0 + bge _081A0FCE + adds r0, r1, 0 + subs r0, 0x3 + lsls r0, 2 + adds r0, r3, r0 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + cmp r0, 0x1 + bne _081A0FCE + adds r0, r1, 0 + subs r0, 0x3 + lsls r0, 2 + adds r0, r3, r0 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 28 + lsrs r6, r0, 30 + adds r0, r3, 0 + adds r0, 0xB2 + ldrb r1, [r0] + lsls r1, 29 + lsrs r1, 29 + asrs r1, r6 + movs r0, 0x1 + ands r1, r0 + adds r0, r3, 0 + adds r0, 0xB4 + adds r0, r6 + ldrb r0, [r0] + lsls r1, 2 + asrs r0, r1 + movs r1, 0xF + ands r0, r1 + ldr r2, =gUnknown_08610970 + lsls r0, 1 + adds r1, r3, 0 + adds r1, 0xB0 + ldrb r3, [r1] + movs r1, 0x58 + muls r1, r3 + adds r0, r1 + adds r2, 0x34 + adds r0, r2 +_081A0FCA: + ldrh r0, [r0] + strh r0, [r7] +_081A0FCE: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A0DD4 + + thumb_func_start sub_81A0FE4 +sub_81A0FE4: @ 81A0FE4 + push {r4,lr} + ldr r4, =gUnknown_030062F0 + ldr r0, [r4] + bl Free + movs r0, 0 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A0FE4 + + thumb_func_start sub_81A0FFC +sub_81A0FFC: @ 81A0FFC + push {r4-r6,lr} + sub sp, 0x10 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x1 + beq _081A1028 + cmp r0, 0x1 + bgt _081A1018 + cmp r0, 0 + beq _081A101E + b _081A11E6 + .pool +_081A1018: + cmp r0, 0x2 + beq _081A1030 + b _081A11E6 +_081A101E: + ldr r5, =gStringVar1 + b _081A1032 + .pool +_081A1028: + ldr r5, =gStringVar2 + b _081A1032 + .pool +_081A1030: + ldr r5, =gStringVar3 +_081A1032: + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + cmp r0, 0x9 + bls _081A103C + b _081A11E6 +_081A103C: + lsls r0, 2 + ldr r1, =_081A1054 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A1054: + .4byte _081A107C + .4byte _081A1094 + .4byte _081A10AC + .4byte _081A10C4 + .4byte _081A10DC + .4byte _081A10F4 + .4byte _081A1118 + .4byte _081A1164 + .4byte _081A1140 + .4byte _081A1184 +_081A107C: + ldr r0, =gUnknown_030062F0 + ldr r0, [r0] + ldrh r1, [r0] + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + b _081A1174 + .pool +_081A1094: + ldr r0, =gUnknown_030062F0 + ldr r0, [r0] + ldrh r1, [r0, 0x2] + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + b _081A1174 + .pool +_081A10AC: + ldr r0, =gUnknown_030062F0 + ldr r0, [r0] + ldrh r1, [r0] + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + b _081A1174 + .pool +_081A10C4: + ldr r0, =gUnknown_030062F0 + ldr r0, [r0] + ldrh r1, [r0, 0x4] + movs r0, 0xD + muls r1, r0 + ldr r0, =gMoveNames + adds r1, r0 + b _081A1174 + .pool +_081A10DC: + ldr r0, =gUnknown_030062F0 + ldr r0, [r0] + ldrh r1, [r0, 0x6] + movs r0, 0xD + muls r1, r0 + ldr r0, =gMoveNames + adds r1, r0 + b _081A1174 + .pool +_081A10F4: + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + lsls r0, 2 + adds r1, r0 + adds r1, 0xBA + ldrh r0, [r1] + bl ItemId_GetItem + adds r1, r0, 0 + b _081A1174 + .pool +_081A1118: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + movs r1, 0x2 + bl sub_81A1650 + adds r1, r0, 0 + mov r0, sp + movs r2, 0x2 + bl sub_81DB5E8 + adds r0, r5, 0 + mov r1, sp + bl StringCopy + b _081A11E6 + .pool +_081A1140: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB1 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + bne _081A115C + ldr r1, =gUnknown_085EAEB1 + b _081A1174 + .pool +_081A115C: + ldr r1, =gUnknown_085EAEB8 + b _081A1174 + .pool +_081A1164: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + movs r1, 0x82 + lsls r1, 1 + adds r0, r1 + bl ConvertBattleFrontierTrainerSpeechToString + ldr r1, =gStringVar4 +_081A1174: + adds r0, r5, 0 + bl StringCopy + b _081A11E6 + .pool +_081A1184: + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + adds r1, r3, 0 + adds r1, 0xB1 + ldrb r1, [r1] + lsls r4, r1, 24 + lsrs r1, r4, 30 + adds r6, r0, 0 + cmp r1, 0x2 + bhi _081A11C0 + adds r0, r3, 0 + adds r0, 0xB4 + adds r0, r1 + ldrb r2, [r0] + adds r0, r3, 0 + adds r0, 0xB2 + ldrb r0, [r0] + lsls r0, 29 + lsrs r0, 29 + asrs r0, r1 + movs r1, 0x1 + ands r0, r1 + lsls r0, 2 + asrs r2, r0 + movs r0, 0xF + ands r2, r0 + b _081A11C2 + .pool +_081A11C0: + movs r2, 0 +_081A11C2: + ldr r3, =gUnknown_08610970 + lsls r1, r2, 1 + ldr r0, [r6] + adds r0, 0xB0 + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, r0 + adds r3, 0x34 + adds r1, r3 + ldrh r1, [r1] + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + adds r0, r5, 0 + bl StringCopy +_081A11E6: + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A0FFC + + thumb_func_start sub_81A11F8 +sub_81A11F8: @ 81A11F8 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r0, =gSpecialVar_0x8005 + ldrb r1, [r0] + adds r2, 0xB1 + lsls r1, 6 + ldrb r3, [r2] + movs r0, 0x3F + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + bx lr + .pool + thumb_func_end sub_81A11F8 + + thumb_func_start sub_81A1218 +sub_81A1218: @ 81A1218 + push {lr} + bl sub_81AAC28 + pop {r0} + bx r0 + thumb_func_end sub_81A1218 + + thumb_func_start sub_81A1224 +sub_81A1224: @ 81A1224 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r1, =gSaveBlock2Ptr + ldr r3, [r1] + adds r0, r3, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + adds r7, r1, 0 + cmp r0, 0x2 + bhi _081A1242 + b _081A1362 +_081A1242: + movs r5, 0 + movs r2, 0 + adds r0, r3, 0 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + ldr r1, =gSpecialVar_0x8005 + mov r12, r1 + ldr r1, =gScriptResult + mov r8, r1 + cmp r0, 0 + beq _081A127C + adds r3, r7, 0 +_081A125C: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x8 + bhi _081A127C + ldr r0, [r3] + lsls r1, r2, 2 + adds r0, r1 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + cmp r0, 0 + bne _081A125C +_081A127C: + movs r4, 0 + cmp r4, r5 + bcs _081A1322 + ldr r0, [r7] + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + cmp r4, r0 + bge _081A1322 + adds r6, r7, 0 + mov r9, r4 +_081A1296: + ldr r3, [r6] + lsls r0, r4, 2 + adds r2, r3, r0 + adds r0, r2, 0 + adds r0, 0xB8 + ldrb r1, [r0] + lsls r0, r1, 30 + lsrs r0, 30 + cmp r0, 0x1 + bne _081A1308 + lsrs r0, r1, 6 + cmp r0, 0 + beq _081A1308 + adds r0, r2, 0 + adds r0, 0xBA + ldrh r0, [r0] + mov r2, r12 + ldrh r2, [r2] + cmp r0, r2 + bne _081A1308 + adds r0, r3, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + lsls r0, 2 + adds r0, r3, r0 + adds r0, 0xB8 + ldrb r2, [r0] + movs r1, 0x3F + ands r1, r2 + strb r1, [r0] + ldr r1, [r6] + adds r0, r1, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + lsls r0, 2 + adds r1, r0 + mov r2, r12 + ldrh r0, [r2] + adds r1, 0xBA + strh r0, [r1] + mov r1, r9 + mov r0, r8 + strh r1, [r0] + b _081A1362 + .pool +_081A1308: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcs _081A1322 + ldr r0, [r6] + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + cmp r4, r0 + blt _081A1296 +_081A1322: + ldr r2, [r7] + adds r0, r2, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + lsls r0, 2 + adds r2, r0 + adds r2, 0xB8 + ldrb r1, [r2] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + ldr r1, [r7] + adds r0, r1, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + lsls r0, 2 + adds r1, r0 + mov r2, r12 + ldrh r0, [r2] + adds r1, 0xBA + strh r0, [r1] + movs r0, 0x1 + mov r1, r8 + strh r0, [r1] +_081A1362: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81A1224 + + thumb_func_start sub_81A1370 +sub_81A1370: @ 81A1370 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + movs r2, 0x8A + lsls r2, 1 + adds r1, r2 + ldrb r1, [r1] + adds r4, r0, 0 + cmp r1, 0xFF + beq _081A1422 + movs r5, 0 +_081A138E: + ldr r1, [r4] + adds r2, r5, 0x1 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r3, r1, r0 + movs r5, 0x8A + lsls r5, 1 + adds r0, r3, r5 + ldrb r0, [r0] + cmp r0, 0xFF + bne _081A13B8 + adds r0, r3, 0 + adds r0, 0xDC + adds r1, 0xDC + movs r2, 0x44 + bl memcpy + b _081A1422 + .pool +_081A13B8: + adds r5, r2, 0 + cmp r5, 0x2 + ble _081A138E + ldr r0, =0x0000ffff + mov r10, r0 + movs r2, 0x1 + negs r2, r2 + mov r9, r2 + movs r5, 0x1 + ldr r7, =gSaveBlock2Ptr + movs r0, 0x90 + lsls r0, 1 + mov r8, r0 + movs r6, 0x44 +_081A13D4: + ldr r0, [r7] + add r0, r8 + adds r0, 0x34 + bl ReadUnalignedWord + adds r4, r0, 0 + ldr r0, [r7] + adds r0, 0xA + bl ReadUnalignedWord + cmp r4, r0 + bne _081A13FC + ldr r0, [r7] + adds r0, r6 + adds r0, 0xDE + ldrb r0, [r0] + cmp r0, r10 + bge _081A13FC + mov r10, r0 + mov r9, r5 +_081A13FC: + movs r2, 0x44 + add r8, r2 + adds r6, 0x44 + adds r5, 0x1 + cmp r5, 0x3 + ble _081A13D4 + mov r5, r9 + cmp r5, 0 + ble _081A1422 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + lsls r0, r5, 4 + add r0, r9 + lsls r0, 2 + adds r0, r1, r0 + adds r0, 0xDC + adds r1, 0xDC + bl memcpy +_081A1422: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1370 + + thumb_func_start sub_81A1438 +sub_81A1438: @ 81A1438 + push {r4,r5,lr} + ldr r4, =gSaveBlock2Ptr + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0xB0 + ldrb r0, [r0] + adds r2, 0xDC + movs r1, 0x1F + ands r1, r0 + ldrb r3, [r2] + movs r0, 0x20 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0xB1 + ldrb r1, [r0] + lsls r1, 30 + adds r2, 0xDC + lsrs r1, 25 + ldrb r3, [r2] + movs r0, 0x61 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + movs r2, 0 + ldr r0, [r4] + b _081A148C + .pool +_081A147C: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x8 + bhi _081A1496 + ldr r0, [r4] + lsls r1, r2, 2 + adds r0, r1 +_081A148C: + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + cmp r0, 0 + bne _081A147C +_081A1496: + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + adds r0, 0xDD + strb r2, [r0] + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0xDE + ldrb r0, [r1] + cmp r0, 0xFE + bhi _081A14AE + adds r0, 0x1 + strb r0, [r1] +_081A14AE: + ldr r0, [r4] + adds r0, 0xDD + ldrb r0, [r0] + bl sub_81A0390 + movs r2, 0 + adds r3, r4, 0 + movs r4, 0x88 + lsls r4, 1 + adds r5, r3, 0 +_081A14C2: + ldr r0, [r3] + adds r1, r0, r4 + adds r1, r2 + adds r0, 0xA + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _081A14C2 + ldr r1, [r5] + movs r2, 0x8A + lsls r2, 1 + adds r0, r1, r2 + bl StringCopy + ldr r1, [r5] + ldr r0, =gGameLanguage + ldrb r0, [r0] + ldr r2, =0x0000011b + adds r1, r2 + strb r0, [r1] + ldr r0, [r5] + adds r0, 0xDC + bl sub_8165AE8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1438 + + thumb_func_start sub_81A150C +sub_81A150C: @ 81A150C + push {lr} + ldr r2, =gUnknown_08610970 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xDC + ldrb r0, [r0] + lsls r0, 27 + lsrs r0, 27 + movs r1, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x32 + ldrb r2, [r0] + movs r1, 0 + ldr r3, =gUnknown_085DCEDC + ldrb r0, [r3] + cmp r0, r2 + beq _081A1542 +_081A1530: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1D + bhi _081A1542 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _081A1530 +_081A1542: + cmp r1, 0x1E + beq _081A1568 + ldr r0, =gUnknown_085DCF0E + adds r0, r1, r0 + ldrb r1, [r0] + ldr r0, =0x00004010 + bl VarSet + b _081A1594 + .pool +_081A1568: + movs r1, 0 + ldr r3, =gUnknown_085DCEFA + ldrb r0, [r3] + cmp r0, r2 + beq _081A1584 +_081A1572: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x13 + bhi _081A1584 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _081A1572 +_081A1584: + cmp r1, 0x14 + beq _081A1594 + ldr r0, =gUnknown_085DCF2C + adds r0, r1, r0 + ldrb r1, [r0] + ldr r0, =0x00004010 + bl VarSet +_081A1594: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A150C + + thumb_func_start sub_81A15A4 +sub_81A15A4: @ 81A15A4 + push {lr} + ldr r2, =gUnknown_08610970 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x32 + ldrb r2, [r0] + movs r1, 0 + ldr r3, =gUnknown_085DCEDC + ldrb r0, [r3] + cmp r0, r2 + beq _081A15D6 +_081A15C4: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1D + bhi _081A15D6 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _081A15C4 +_081A15D6: + cmp r1, 0x1E + beq _081A15FC + ldr r0, =gUnknown_085DCF0E + adds r0, r1, r0 + ldrb r1, [r0] + ldr r0, =0x00004010 + bl VarSet + b _081A1628 + .pool +_081A15FC: + movs r1, 0 + ldr r3, =gUnknown_085DCEFA + ldrb r0, [r3] + cmp r0, r2 + beq _081A1618 +_081A1606: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x13 + bhi _081A1618 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _081A1606 +_081A1618: + cmp r1, 0x14 + beq _081A1628 + ldr r0, =gUnknown_085DCF2C + adds r0, r1, r0 + ldrb r1, [r0] + ldr r0, =0x00004010 + bl VarSet +_081A1628: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A15A4 + + thumb_func_start sub_81A1638 +sub_81A1638: @ 81A1638 + ldr r1, =gSpecialVar_0x8004 + movs r0, 0x1 + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_81A1638 + + thumb_func_start sub_81A1644 +sub_81A1644: @ 81A1644 + ldr r1, =gSpecialVar_0x8004 + movs r0, 0x1 + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_81A1644 + + thumb_func_start sub_81A1650 +sub_81A1650: @ 81A1650 + push {lr} + movs r2, 0x58 + muls r2, r0 + ldr r0, =gUnknown_08610970 + adds r2, r0 + subs r0, r1, 0x1 + cmp r0, 0x6 + bhi _081A16AC + lsls r0, 2 + ldr r1, =_081A1674 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A1674: + .4byte _081A1690 + .4byte _081A1694 + .4byte _081A169A + .4byte _081A16A0 + .4byte _081A16A6 + .4byte _081A16AC + .4byte _081A16AC +_081A1690: + adds r0, r2, 0 + b _081A16B0 +_081A1694: + adds r0, r2, 0 + adds r0, 0x8 + b _081A16B0 +_081A169A: + adds r0, r2, 0 + adds r0, 0x10 + b _081A16B0 +_081A16A0: + adds r0, r2, 0 + adds r0, 0x18 + b _081A16B0 +_081A16A6: + adds r0, r2, 0 + adds r0, 0x20 + b _081A16B0 +_081A16AC: + adds r0, r2, 0 + adds r0, 0x28 +_081A16B0: + pop {r1} + bx r1 + thumb_func_end sub_81A1650 + + thumb_func_start sub_81A16B4 +sub_81A16B4: @ 81A16B4 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081A16CE + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081A16D4 +_081A16CE: + adds r0, r2, 0 + bl SwitchTaskToFollowupFunc +_081A16D4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A16B4 + + thumb_func_start sub_81A16DC +sub_81A16DC: @ 81A16DC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081A16F6 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081A1718 +_081A16F6: + ldr r2, =gUnknown_030062F4 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x8] + movs r3, 0xA + ldrsh r0, [r0, r3] + lsls r0, 16 + orrs r1, r0 + str r1, [r2] + bl _call_via_r1 + adds r0, r4, 0 + bl DestroyTask +_081A1718: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A16DC + + thumb_func_start sub_81A172C +sub_81A172C: @ 81A172C + push {r4,lr} + adds r4, r0, 0 + ldr r0, =sub_81A16DC + movs r1, 0x1 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + lsrs r4, 16 + strh r4, [r1, 0xA] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A172C + + thumb_func_start sub_81A175C +sub_81A175C: @ 81A175C + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =sub_81A16B4 + adds r0, r4, 0 + movs r1, 0x1 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + adds r2, r5, 0 + bl SetTaskFuncWithFollowupFunc + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A175C + + thumb_func_start sub_81A1780 +sub_81A1780: @ 81A1780 + push {lr} + ldr r1, =gUnknown_08611C18 + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1780 + + thumb_func_start sub_81A17A0 +sub_81A17A0: @ 81A17A0 + push {lr} + movs r0, 0x80 + lsls r0, 7 + movs r1, 0xFF + bl VarSet + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca8 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x4 + bhi _081A1822 + lsls r0, 2 + ldr r1, =_081A17D0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A17D0: + .4byte _081A1822 + .4byte _081A17E4 + .4byte _081A1810 + .4byte _081A17EC + .4byte _081A17E8 +_081A17E4: + movs r0, 0 + b _081A17EE +_081A17E8: + movs r0, 0 + b _081A17EE +_081A17EC: + movs r0, 0x1 +_081A17EE: + bl sub_813A878 + movs r0, 0x80 + lsls r0, 7 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + ldr r2, =0x00000ca8 + adds r1, r2 + ldrb r1, [r1] + bl VarSet + b _081A1822 + .pool +_081A1810: + movs r0, 0x80 + lsls r0, 7 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + ldr r2, =0x00000ca8 + adds r1, r2 + ldrb r1, [r1] + bl VarSet +_081A1822: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A17A0 + + thumb_func_start sub_81A1830 +sub_81A1830: @ 81A1830 + push {r4-r6,lr} + ldr r0, =0x000040cf + bl VarGet + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r6, 0 + bl sub_81A3B30 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bne _081A184C + movs r5, 0x1 +_081A184C: + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x7 + bls _081A1856 + b _081A1956 +_081A1856: + lsls r0, 2 + ldr r1, =_081A186C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A186C: + .4byte _081A188C + .4byte _081A18A8 + .4byte _081A18C8 + .4byte _081A18E4 + .4byte _081A1956 + .4byte _081A1900 + .4byte _081A1918 + .4byte _081A1938 +_081A188C: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000ca8 + adds r0, r2 + ldrb r0, [r0] + strh r0, [r1] + b _081A1956 + .pool +_081A18A8: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000ca9 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + strh r0, [r1] + b _081A1956 + .pool +_081A18C8: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000cb2 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + b _081A1956 + .pool +_081A18E4: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000ca9 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 29 + b _081A1926 + .pool +_081A1900: + ldr r2, =gScriptResult + ldr r1, =gBattleOutcome + ldrb r0, [r1] + strh r0, [r2] + movs r0, 0 + strb r0, [r1] + b _081A1956 + .pool +_081A1918: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000ca9 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 28 +_081A1926: + lsrs r0, 31 + strh r0, [r1] + b _081A1956 + .pool +_081A1938: + ldr r4, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + movs r0, 0xD0 + lsls r0, 4 + adds r2, r0 + ldr r3, =gUnknown_08611BFC + lsls r0, r5, 1 + lsls r1, r6, 2 + adds r0, r1 + adds r0, r3 + ldrh r1, [r2] + ldrh r0, [r0] + ands r0, r1 + strh r0, [r4] +_081A1956: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1830 + + thumb_func_start sub_81A1968 +sub_81A1968: @ 81A1968 + push {r4,r5,lr} + ldr r0, =0x000040cf + bl VarGet + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + bl sub_81A3B30 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bne _081A1984 + movs r4, 0x1 +_081A1984: + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x7 + bls _081A198E + b _081A1AC4 +_081A198E: + lsls r0, 2 + ldr r1, =_081A19A4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A19A4: + .4byte _081A19C4 + .4byte _081A19E0 + .4byte _081A1A0C + .4byte _081A1A28 + .4byte _081A1A50 + .4byte _081A1AC4 + .4byte _081A1A7C + .4byte _081A1AA8 +_081A19C4: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =gSpecialVar_0x8006 + ldrh r1, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + strb r1, [r0] + b _081A1AC4 + .pool +_081A19E0: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r1, =0x00000ca9 + adds r2, r1 + movs r1, 0x3 + ands r1, r0 + ldrb r3, [r2] + movs r0, 0x4 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + b _081A1AC4 + .pool +_081A1A0C: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =gSpecialVar_0x8006 + ldrh r1, [r1] + ldr r2, =0x00000cb2 + adds r0, r2 + strh r1, [r0] + b _081A1AC4 + .pool +_081A1A28: + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r1, =0x00000ca9 + adds r3, r1 + movs r1, 0x1 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r3] + movs r0, 0x5 + negs r0, r0 + b _081A1A94 + .pool +_081A1A50: + movs r2, 0 + ldr r5, =gSaveBlock2Ptr + ldr r4, =0x00000caa + ldr r3, =gUnknown_0203CEF8 +_081A1A58: + ldr r1, [r5] + lsls r0, r2, 1 + adds r1, r4 + adds r1, r0 + adds r0, r2, r3 + ldrb r0, [r0] + strh r0, [r1] + adds r2, 0x1 + cmp r2, 0x3 + ble _081A1A58 + b _081A1AC4 + .pool +_081A1A7C: + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r2, =0x00000ca9 + adds r3, r2 + movs r1, 0x1 + ands r1, r0 + lsls r1, 3 + ldrb r2, [r3] + movs r0, 0x9 + negs r0, r0 +_081A1A94: + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + b _081A1AC4 + .pool +_081A1AA8: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + movs r0, 0xD0 + lsls r0, 4 + adds r2, r0 + ldr r3, =gUnknown_08611BFC + lsls r1, r4, 1 + lsls r0, r5, 2 + adds r1, r0 + adds r1, r3 + ldrh r0, [r2] + ldrh r1, [r1] + orrs r0, r1 + strh r0, [r2] +_081A1AC4: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1968 + + thumb_func_start sub_81A1AD4 +sub_81A1AD4: @ 81A1AD4 + push {r4-r7,lr} + bl sub_81B8558 + movs r3, 0 + ldr r4, =gSpecialVar_0x8005 + ldrh r0, [r4] + cmp r3, r0 + bge _081A1B00 + ldr r7, =gUnknown_0203CEF8 + ldr r6, =gSaveBlock2Ptr + ldr r5, =0x00000caa +_081A1AEA: + adds r2, r3, r7 + ldr r0, [r6] + lsls r1, r3, 1 + adds r0, r5 + adds r0, r1 + ldrh r0, [r0] + strb r0, [r2] + adds r3, 0x1 + ldrh r0, [r4] + cmp r3, r0 + blt _081A1AEA +_081A1B00: + bl sub_80F94E8 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1AD4 + + thumb_func_start sub_81A1B1C +sub_81A1B1C: @ 81A1B1C + push {lr} + bl DoSoftReset + pop {r0} + bx r0 + thumb_func_end sub_81A1B1C + + thumb_func_start sub_81A1B28 +sub_81A1B28: @ 81A1B28 + ldr r1, =gUnknown_0203BC88 + ldr r0, =gBattleFrontierTrainers + str r0, [r1] + bx lr + .pool + thumb_func_end sub_81A1B28 + + thumb_func_start sub_81A1B38 +sub_81A1B38: @ 81A1B38 + push {r4,r5,lr} + movs r4, 0 + movs r5, 0x64 +_081A1B3E: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000caa + adds r0, r2 + adds r1, r0, r1 + ldrh r0, [r1] + subs r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x5 + bhi _081A1B76 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldrh r1, [r1] + subs r1, 0x1 + muls r1, r5 + adds r0, r1 + movs r1, 0x8E + lsls r1, 2 + adds r0, r1 + ldr r2, =gPlayerParty + adds r1, r4, 0 + muls r1, r5 + adds r1, r2 + movs r2, 0x64 + bl memcpy +_081A1B76: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _081A1B3E + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1B38 + + thumb_func_start sub_81A1B98 +sub_81A1B98: @ 81A1B98 + push {lr} + ldr r0, =gSpecialVar_0x8006 + ldrh r1, [r0] + adds r2, r0, 0 + cmp r1, 0x3 + bls _081A1BA8 + movs r0, 0 + strh r0, [r2] +_081A1BA8: + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x7 + bhi _081A1C1E + lsls r0, 2 + ldr r1, =_081A1BC8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A1BC8: + .4byte _081A1BE8 + .4byte _081A1BF0 + .4byte _081A1BF8 + .4byte _081A1C0E + .4byte _081A1C06 + .4byte _081A1C00 + .4byte _081A1C14 + .4byte _081A1C1A +_081A1BE8: + ldrb r0, [r2] + bl sub_81A1EA8 + b _081A1C1E +_081A1BF0: + ldrb r0, [r2] + bl sub_81A2134 + b _081A1C1E +_081A1BF8: + ldrb r0, [r2] + bl sub_81A2460 + b _081A1C1E +_081A1C00: + bl sub_81A2698 + b _081A1C1E +_081A1C06: + ldrb r0, [r2] + bl sub_81A2C94 + b _081A1C1E +_081A1C0E: + bl sub_81A2968 + b _081A1C1E +_081A1C14: + bl sub_81A2F38 + b _081A1C1E +_081A1C1A: + bl sub_81A2FF8 +_081A1C1E: + pop {r0} + bx r0 + thumb_func_end sub_81A1B98 + + thumb_func_start sub_81A1C24 +sub_81A1C24: @ 81A1C24 + push {lr} + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + ldr r2, =0x00000cdc + adds r1, r2 + ldr r1, [r1] + ands r1, r0 + cmp r1, 0 + bne _081A1C44 + movs r0, 0 + b _081A1C46 + .pool +_081A1C44: + movs r0, 0x1 +_081A1C46: + pop {r1} + bx r1 + thumb_func_end sub_81A1C24 + + thumb_func_start sub_81A1C4C +sub_81A1C4C: @ 81A1C4C + push {r4,r5,lr} + sub sp, 0xC + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xE0 + bl GetStringCenterAlignXOffset + adds r3, r0, 0 + lsls r0, r5, 3 + adds r5, r0, 0x1 + ldr r0, =gUnknown_0203AB74 + ldrb r0, [r0] + lsls r3, 24 + lsrs r3, 24 + lsls r1, r5, 24 + lsrs r1, 24 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + bl PrintTextOnWindow + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1C4C + + thumb_func_start sub_81A1C90 +sub_81A1C90: @ 81A1C90 + push {r4,lr} + sub sp, 0x34 + adds r2, r0, 0 + ldr r3, =gUnknown_0203AB74 + movs r1, 0xAE + mov r0, sp + adds r0, 0x2F +_081A1C9E: + strb r1, [r0] + subs r0, 0x1 + add r4, sp, 0xC + cmp r0, r4 + bge _081A1C9E + add r1, sp, 0x30 + movs r0, 0xFF + strb r0, [r1] + lsls r0, r2, 3 + adds r2, r0, 0x1 + ldrb r0, [r3] + lsls r1, r2, 24 + lsrs r1, 24 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x4 + bl PrintTextOnWindow + add sp, 0x34 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1C90 + + thumb_func_start sub_81A1CD8 +sub_81A1CD8: @ 81A1CD8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + adds r5, r0, 0 + adds r4, r2, 0 + ldr r0, [sp, 0x30] + lsls r1, 16 + lsrs r6, r1, 16 + lsls r4, 24 + lsrs r4, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0xC] + lsls r0, 24 + lsrs r0, 24 + adds r7, r0, 0 + ldr r0, =gUnknown_0203AB74 + mov r10, r0 + ldrb r0, [r0] + str r7, [sp] + movs r1, 0xFF + mov r9, r1 + str r1, [sp, 0x4] + movs r1, 0 + mov r8, r1 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + adds r3, r4, 0 + bl PrintTextOnWindow + ldr r0, =0x0000270f + cmp r6, r0 + bls _081A1D24 + adds r6, r0, 0 +_081A1D24: + ldr r0, =gStringVar1 + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EE302 + adds r0, r4, 0 + bl StringExpandPlaceholders + mov r1, r10 + ldrb r0, [r1] + str r7, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + ldr r3, [sp, 0xC] + bl PrintTextOnWindow + 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_81A1CD8 + + thumb_func_start sub_81A1D78 +sub_81A1D78: @ 81A1D78 + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, [sp, 0x10] + lsls r0, 24 + lsls r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r4, =gSaveBlock2Ptr + ldr r4, [r4] + lsrs r1, 23 + lsrs r0, 22 + adds r1, r0 + movs r0, 0xCF + lsls r0, 4 + adds r4, r0 + adds r4, r1 + ldrh r1, [r4] + ldr r0, =gUnknown_085EE319 + str r5, [sp] + bl sub_81A1CD8 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1D78 + + thumb_func_start sub_81A1DBC +sub_81A1DBC: @ 81A1DBC + push {lr} + lsls r0, 24 + lsls r1, 24 + ldr r2, =gSaveBlock2Ptr + ldr r2, [r2] + lsrs r1, 23 + lsrs r0, 22 + adds r1, r0 + movs r0, 0xCE + lsls r0, 4 + adds r2, r0 + adds r2, r1 + ldrh r0, [r2] + ldr r1, =0x0000270f + cmp r0, r1 + bls _081A1DDE + adds r0, r1, 0 +_081A1DDE: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A1DBC + + thumb_func_start sub_81A1DEC +sub_81A1DEC: @ 81A1DEC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + ldr r4, [sp, 0x20] + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r3, 24 + mov r9, r3 + lsls r4, 24 + lsrs r7, r4, 24 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_81A1DBC + lsls r0, 16 + lsrs r4, r0, 16 + cmp r5, 0x1 + beq _081A1E38 + cmp r5, 0x1 + ble _081A1E2C + cmp r5, 0x2 + beq _081A1E48 + cmp r5, 0x3 + beq _081A1E58 +_081A1E2C: + cmp r6, 0 + beq _081A1E34 + movs r0, 0x2 + b _081A1E66 +_081A1E34: + movs r0, 0x1 + b _081A1E66 +_081A1E38: + cmp r6, 0 + beq _081A1E42 + movs r0, 0x80 + lsls r0, 8 + b _081A1E66 +_081A1E42: + movs r0, 0x80 + lsls r0, 7 + b _081A1E66 +_081A1E48: + cmp r6, 0 + beq _081A1E52 + movs r0, 0x80 + lsls r0, 10 + b _081A1E66 +_081A1E52: + movs r0, 0x80 + lsls r0, 9 + b _081A1E66 +_081A1E58: + cmp r6, 0 + beq _081A1E62 + movs r0, 0x80 + lsls r0, 12 + b _081A1E66 +_081A1E62: + movs r0, 0x80 + lsls r0, 11 +_081A1E66: + bl sub_81A1C24 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081A1E88 + ldr r0, =gUnknown_085EE311 + str r7, [sp] + adds r1, r4, 0 + mov r2, r8 + mov r3, r9 + bl sub_81A1CD8 + b _081A1E96 + .pool +_081A1E88: + ldr r0, =gUnknown_085EE320 + str r7, [sp] + adds r1, r4, 0 + mov r2, r8 + mov r3, r9 + bl sub_81A1CD8 +_081A1E96: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1DEC + + thumb_func_start sub_81A1EA8 +sub_81A1EA8: @ 81A1EA8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, =gUnknown_0203AB74 + ldr r0, =gUnknown_08611C74 + bl AddWindow + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + movs r1, 0x11 + bl FillWindowPixelBuffer + cmp r7, 0 + bne _081A1EF0 + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EE158 + bl StringExpandPlaceholders + b _081A1F28 + .pool +_081A1EF0: + cmp r7, 0x1 + bne _081A1F08 + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EE178 + bl StringExpandPlaceholders + b _081A1F28 + .pool +_081A1F08: + cmp r7, 0x2 + bne _081A1F20 + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EE198 + bl StringExpandPlaceholders + b _081A1F28 + .pool +_081A1F20: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EE1B7 + bl StringExpandPlaceholders +_081A1F28: + ldr r0, =gStringVar4 + movs r1, 0x2 + bl sub_81A1C4C + ldr r6, =gUnknown_0203AB74 + ldrb r0, [r6] + ldr r2, =gUnknown_085EE2F2 + movs r1, 0x31 + mov r8, r1 + str r1, [sp] + movs r5, 0xFF + str r5, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x10 + bl PrintTextOnWindow + ldrb r0, [r6] + ldr r2, =gUnknown_085EE2F9 + movs r1, 0x61 + mov r9, r1 + str r1, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x10 + bl PrintTextOnWindow + movs r0, 0xA + bl sub_81A1C90 + mov r0, r8 + str r0, [sp] + adds r0, r7, 0 + movs r1, 0 + movs r2, 0x48 + movs r3, 0x84 + bl sub_81A1DEC + movs r0, 0x41 + str r0, [sp] + adds r0, r7, 0 + movs r1, 0 + movs r2, 0x48 + movs r3, 0x84 + bl sub_81A1D78 + mov r1, r9 + str r1, [sp] + adds r0, r7, 0 + movs r1, 0x1 + movs r2, 0x48 + movs r3, 0x84 + bl sub_81A1DEC + movs r0, 0x71 + str r0, [sp] + adds r0, r7, 0 + movs r1, 0x1 + movs r2, 0x48 + movs r3, 0x84 + bl sub_81A1D78 + ldrb r0, [r6] + bl PutWindowTilemap + ldrb r0, [r6] + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1EA8 + + thumb_func_start sub_81A1FD8 +sub_81A1FD8: @ 81A1FD8 + push {lr} + lsls r0, 24 + lsls r1, 24 + ldr r2, =gSaveBlock2Ptr + ldr r2, [r2] + lsrs r1, 23 + lsrs r0, 22 + adds r1, r0 + ldr r0, =0x00000d0c + adds r2, r0 + adds r2, r1 + ldrh r0, [r2] + ldr r1, =0x0000270f + cmp r0, r1 + bls _081A1FF8 + adds r0, r1, 0 +_081A1FF8: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A1FD8 + + thumb_func_start sub_81A2008 +sub_81A2008: @ 81A2008 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + mov r12, r0 + adds r7, r1, 0 + adds r4, r2, 0 + ldr r6, [sp, 0x2C] + ldr r5, [sp, 0x30] + lsls r4, 16 + lsrs r4, 16 + lsls r3, 24 + lsrs r3, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_0203AB74 + mov r10, r0 + ldrb r0, [r0] + str r5, [sp] + movs r1, 0xFF + mov r9, r1 + str r1, [sp, 0x4] + movs r1, 0 + mov r8, r1 + str r1, [sp, 0x8] + movs r1, 0x1 + mov r2, r12 + bl PrintTextOnWindow + ldr r0, =gStringVar1 + adds r1, r4, 0 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + adds r0, r4, 0 + adds r1, r7, 0 + bl StringExpandPlaceholders + mov r1, r10 + ldrb r0, [r1] + str r5, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + adds r3, r6, 0 + bl PrintTextOnWindow + 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_81A2008 + + thumb_func_start sub_81A2094 +sub_81A2094: @ 81A2094 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + ldr r4, [sp, 0x24] + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + lsls r3, 24 + lsrs r7, r3, 24 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_81A1FD8 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + cmp r5, 0 + beq _081A20CC + cmp r5, 0x1 + beq _081A20D8 +_081A20CC: + cmp r6, 0 + beq _081A20D4 + movs r0, 0x8 + b _081A20E6 +_081A20D4: + movs r0, 0x4 + b _081A20E6 +_081A20D8: + cmp r6, 0 + beq _081A20E2 + movs r0, 0x80 + lsls r0, 14 + b _081A20E6 +_081A20E2: + movs r0, 0x80 + lsls r0, 13 +_081A20E6: + bl sub_81A1C24 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081A210C + ldr r0, =gUnknown_085EE311 + ldr r1, =gUnknown_085EE338 + str r7, [sp] + str r4, [sp, 0x4] + mov r2, r8 + mov r3, r9 + bl sub_81A2008 + b _081A211C + .pool +_081A210C: + ldr r0, =gUnknown_085EE320 + ldr r1, =gUnknown_085EE338 + str r7, [sp] + str r4, [sp, 0x4] + mov r2, r8 + mov r3, r9 + bl sub_81A2008 +_081A211C: + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2094 + + thumb_func_start sub_81A2134 +sub_81A2134: @ 81A2134 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, =gUnknown_0203AB74 + ldr r0, =gUnknown_08611C74 + bl AddWindow + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + movs r1, 0x11 + bl FillWindowPixelBuffer + cmp r7, 0 + bne _081A217C + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EE1DB + bl StringExpandPlaceholders + b _081A2184 + .pool +_081A217C: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EE1FE + bl StringExpandPlaceholders +_081A2184: + ldr r0, =gStringVar4 + movs r1, 0 + bl sub_81A1C4C + ldr r1, =gUnknown_0203AB74 + ldrb r0, [r1] + ldr r2, =gUnknown_085EE2F2 + movs r6, 0x21 + str r6, [sp] + movs r5, 0xFF + str r5, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl PrintTextOnWindow + ldr r1, =gUnknown_0203AB74 + ldrb r0, [r1] + ldr r2, =gUnknown_085EE2F9 + movs r1, 0x61 + str r1, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl PrintTextOnWindow + movs r0, 0xA + bl sub_81A1C90 + str r6, [sp] + adds r0, r7, 0 + movs r1, 0 + movs r2, 0x40 + movs r3, 0x79 + bl sub_81A2094 + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + lsls r5, r7, 2 + ldr r1, =0x00000d14 + adds r0, r1 + adds r0, r5 + ldrh r2, [r0] + movs r0, 0x79 + mov r9, r0 + str r0, [sp] + movs r0, 0x31 + str r0, [sp, 0x4] + ldr r0, =gUnknown_085EE319 + ldr r1, =gUnknown_085EE338 + movs r3, 0x40 + bl sub_81A2008 + ldr r1, =gUnknown_085EE332 + mov r10, r1 + ldr r0, =gUnknown_085EE349 + mov r8, r0 + ldr r0, [r4] + ldr r1, =0x00000d1c + adds r0, r1 + adds r0, r5 + ldrh r2, [r0] + movs r6, 0x70 + str r6, [sp] + movs r0, 0x41 + str r0, [sp, 0x4] + mov r0, r10 + mov r1, r8 + movs r3, 0x40 + bl sub_81A2008 + movs r0, 0x61 + str r0, [sp] + adds r0, r7, 0 + movs r1, 0x1 + movs r2, 0x40 + movs r3, 0x79 + bl sub_81A2094 + ldr r0, [r4] + ldr r1, =0x00000d16 + adds r0, r1 + adds r0, r5 + ldrh r2, [r0] + mov r0, r9 + str r0, [sp] + movs r0, 0x71 + str r0, [sp, 0x4] + ldr r0, =gUnknown_085EE319 + ldr r1, =gUnknown_085EE338 + movs r3, 0x40 + bl sub_81A2008 + ldr r0, [r4] + ldr r1, =0x00000d1e + adds r0, r1 + adds r0, r5 + ldrh r2, [r0] + str r6, [sp] + movs r0, 0x81 + str r0, [sp, 0x4] + mov r0, r10 + mov r1, r8 + movs r3, 0x40 + bl sub_81A2008 + ldr r1, =gUnknown_0203AB74 + ldrb r0, [r1] + bl PutWindowTilemap + ldr r1, =gUnknown_0203AB74 + ldrb r0, [r1] + movs r1, 0x3 + bl CopyWindowToVram + 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_81A2134 + + thumb_func_start sub_81A22B8 +sub_81A22B8: @ 81A22B8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + adds r5, r0, 0 + adds r4, r2, 0 + ldr r0, [sp, 0x30] + lsls r1, 16 + lsrs r6, r1, 16 + lsls r4, 24 + lsrs r4, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0xC] + lsls r0, 24 + lsrs r0, 24 + adds r7, r0, 0 + ldr r0, =gUnknown_0203AB74 + mov r10, r0 + ldrb r0, [r0] + str r7, [sp] + movs r1, 0xFF + mov r9, r1 + str r1, [sp, 0x4] + movs r1, 0 + mov r8, r1 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + adds r3, r4, 0 + bl PrintTextOnWindow + ldr r0, =0x0000270f + cmp r6, r0 + bls _081A2304 + adds r6, r0, 0 +_081A2304: + ldr r0, =gStringVar1 + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EE302 + adds r0, r4, 0 + bl StringExpandPlaceholders + mov r1, r10 + ldrb r0, [r1] + str r7, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + ldr r3, [sp, 0xC] + bl PrintTextOnWindow + 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_81A22B8 + + thumb_func_start sub_81A2358 +sub_81A2358: @ 81A2358 + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, [sp, 0x10] + lsls r0, 24 + lsls r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r4, =gSaveBlock2Ptr + ldr r4, [r4] + lsrs r1, 23 + lsrs r0, 22 + adds r1, r0 + movs r0, 0xDD + lsls r0, 4 + adds r4, r0 + adds r4, r1 + ldrh r1, [r4] + ldr r0, =gUnknown_085EE319 + str r5, [sp] + bl sub_81A22B8 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2358 + + thumb_func_start sub_81A239C +sub_81A239C: @ 81A239C + push {lr} + lsls r0, 24 + lsls r1, 24 + ldr r2, =gSaveBlock2Ptr + ldr r2, [r2] + lsrs r1, 23 + lsrs r0, 22 + adds r1, r0 + ldr r0, =0x00000dc8 + adds r2, r0 + adds r2, r1 + ldrh r0, [r2] + ldr r1, =0x0000270f + cmp r0, r1 + bls _081A23BC + adds r0, r1, 0 +_081A23BC: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A239C + + thumb_func_start sub_81A23CC +sub_81A23CC: @ 81A23CC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + ldr r4, [sp, 0x20] + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r3, 24 + mov r9, r3 + lsls r4, 24 + lsrs r7, r4, 24 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_81A239C + lsls r0, 16 + lsrs r4, r0, 16 + cmp r5, 0 + beq _081A2404 + cmp r5, 0x1 + beq _081A2410 +_081A2404: + cmp r6, 0 + beq _081A240C + movs r0, 0x20 + b _081A241E +_081A240C: + movs r0, 0x10 + b _081A241E +_081A2410: + cmp r6, 0 + beq _081A241A + movs r0, 0x80 + lsls r0, 16 + b _081A241E +_081A241A: + movs r0, 0x80 + lsls r0, 15 +_081A241E: + bl sub_81A1C24 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081A2440 + ldr r0, =gUnknown_085EE311 + str r7, [sp] + adds r1, r4, 0 + mov r2, r8 + mov r3, r9 + bl sub_81A22B8 + b _081A244E + .pool +_081A2440: + ldr r0, =gUnknown_085EE320 + str r7, [sp] + adds r1, r4, 0 + mov r2, r8 + mov r3, r9 + bl sub_81A22B8 +_081A244E: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A23CC + + thumb_func_start sub_81A2460 +sub_81A2460: @ 81A2460 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, =gUnknown_0203AB74 + ldr r0, =gUnknown_08611C74 + bl AddWindow + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + movs r1, 0x11 + bl FillWindowPixelBuffer + cmp r7, 0 + bne _081A24A8 + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EE221 + bl StringExpandPlaceholders + b _081A24B0 + .pool +_081A24A8: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EE241 + bl StringExpandPlaceholders +_081A24B0: + ldr r0, =gStringVar4 + movs r1, 0x2 + bl sub_81A1C4C + ldr r6, =gUnknown_0203AB74 + ldrb r0, [r6] + ldr r2, =gUnknown_085EE2F2 + movs r1, 0x31 + mov r8, r1 + str r1, [sp] + movs r5, 0xFF + str r5, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x10 + bl PrintTextOnWindow + ldrb r0, [r6] + ldr r2, =gUnknown_085EE2F9 + movs r1, 0x61 + mov r9, r1 + str r1, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x10 + bl PrintTextOnWindow + movs r0, 0xA + bl sub_81A1C90 + mov r0, r8 + str r0, [sp] + adds r0, r7, 0 + movs r1, 0 + movs r2, 0x48 + movs r3, 0x83 + bl sub_81A23CC + movs r0, 0x41 + str r0, [sp] + adds r0, r7, 0 + movs r1, 0 + movs r2, 0x48 + movs r3, 0x83 + bl sub_81A2358 + mov r1, r9 + str r1, [sp] + adds r0, r7, 0 + movs r1, 0x1 + movs r2, 0x48 + movs r3, 0x83 + bl sub_81A23CC + movs r0, 0x71 + str r0, [sp] + adds r0, r7, 0 + movs r1, 0x1 + movs r2, 0x48 + movs r3, 0x83 + bl sub_81A2358 + ldrb r0, [r6] + bl PutWindowTilemap + ldrb r0, [r6] + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2460 + + thumb_func_start sub_81A2560 +sub_81A2560: @ 81A2560 + push {lr} + lsls r0, 24 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + lsrs r0, 23 + ldr r2, =0x00000e04 + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + ldr r1, =0x0000270f + cmp r0, r1 + bls _081A257A + adds r0, r1, 0 +_081A257A: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A2560 + + thumb_func_start sub_81A258C +sub_81A258C: @ 81A258C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + mov r12, r0 + adds r7, r1, 0 + adds r4, r2, 0 + ldr r6, [sp, 0x2C] + ldr r5, [sp, 0x30] + lsls r4, 16 + lsrs r4, 16 + lsls r3, 24 + lsrs r3, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_0203AB74 + mov r10, r0 + ldrb r0, [r0] + str r5, [sp] + movs r1, 0xFF + mov r9, r1 + str r1, [sp, 0x4] + movs r1, 0 + mov r8, r1 + str r1, [sp, 0x8] + movs r1, 0x1 + mov r2, r12 + bl PrintTextOnWindow + ldr r0, =gStringVar1 + adds r1, r4, 0 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + adds r0, r4, 0 + adds r1, r7, 0 + bl StringExpandPlaceholders + mov r1, r10 + ldrb r0, [r1] + str r5, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + adds r3, r6, 0 + bl PrintTextOnWindow + 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_81A258C + + thumb_func_start sub_81A2618 +sub_81A2618: @ 81A2618 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r2, 24 + lsrs r5, r2, 24 + lsls r3, 24 + lsrs r6, r3, 24 + adds r0, r4, 0 + bl sub_81A2560 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r4, 0 + beq _081A2648 + movs r0, 0x80 + lsls r0, 4 + b _081A264C +_081A2648: + movs r0, 0x80 + lsls r0, 3 +_081A264C: + bl sub_81A1C24 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081A2674 + ldr r0, =gUnknown_085EE311 + ldr r1, =gUnknown_085EE35B + str r5, [sp] + str r6, [sp, 0x4] + adds r2, r7, 0 + mov r3, r8 + bl sub_81A2008 + b _081A2684 + .pool +_081A2674: + ldr r0, =gUnknown_085EE320 + ldr r1, =gUnknown_085EE35B + str r5, [sp] + str r6, [sp, 0x4] + adds r2, r7, 0 + mov r3, r8 + bl sub_81A2008 +_081A2684: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2618 + + thumb_func_start sub_81A2698 +sub_81A2698: @ 81A2698 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + ldr r6, =gUnknown_0203AB74 + ldr r0, =gUnknown_08611C74 + bl AddWindow + strb r0, [r6] + ldrb r0, [r6] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r6] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EE261 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0 + bl sub_81A1C4C + ldrb r0, [r6] + ldr r2, =gUnknown_085EE2F2 + movs r1, 0x21 + str r1, [sp] + movs r5, 0xFF + str r5, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl PrintTextOnWindow + ldrb r0, [r6] + ldr r2, =gUnknown_085EE2F9 + movs r1, 0x61 + str r1, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl PrintTextOnWindow + movs r0, 0xA + bl sub_81A1C90 + movs r0, 0 + movs r1, 0x40 + movs r2, 0x72 + movs r3, 0x21 + bl sub_81A2618 + ldr r0, =gUnknown_085EE319 + mov r10, r0 + ldr r7, =gUnknown_085EE35B + ldr r5, =gSaveBlock2Ptr + ldr r0, [r5] + ldr r1, =0x00000e08 + adds r0, r1 + ldrh r2, [r0] + movs r4, 0x72 + str r4, [sp] + movs r0, 0x31 + str r0, [sp, 0x4] + mov r0, r10 + adds r1, r7, 0 + movs r3, 0x40 + bl sub_81A258C + ldr r0, =gUnknown_085EE332 + mov r8, r0 + ldr r1, =gUnknown_085EE36D + mov r9, r1 + ldr r0, [r5] + ldr r1, =0x00000e0c + adds r0, r1 + ldrh r2, [r0] + str r4, [sp] + movs r0, 0x41 + str r0, [sp, 0x4] + mov r0, r8 + mov r1, r9 + movs r3, 0x40 + bl sub_81A258C + movs r0, 0x1 + movs r1, 0x40 + movs r2, 0x72 + movs r3, 0x61 + bl sub_81A2618 + ldr r0, [r5] + ldr r1, =0x00000e0a + adds r0, r1 + ldrh r2, [r0] + str r4, [sp] + movs r0, 0x71 + str r0, [sp, 0x4] + mov r0, r10 + adds r1, r7, 0 + movs r3, 0x40 + bl sub_81A258C + ldr r0, [r5] + ldr r1, =0x00000e0e + adds r0, r1 + ldrh r2, [r0] + str r4, [sp] + movs r0, 0x81 + str r0, [sp, 0x4] + mov r0, r8 + mov r1, r9 + movs r3, 0x40 + bl sub_81A258C + ldrb r0, [r6] + bl PutWindowTilemap + ldrb r0, [r6] + movs r1, 0x3 + bl CopyWindowToVram + 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_81A2698 + + thumb_func_start sub_81A27E8 +sub_81A27E8: @ 81A27E8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + adds r5, r0, 0 + adds r4, r2, 0 + ldr r0, [sp, 0x30] + lsls r1, 16 + lsrs r6, r1, 16 + lsls r4, 24 + lsrs r4, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0xC] + lsls r0, 24 + lsrs r0, 24 + adds r7, r0, 0 + ldr r0, =gUnknown_0203AB74 + mov r10, r0 + ldrb r0, [r0] + str r7, [sp] + movs r1, 0xFF + mov r9, r1 + str r1, [sp, 0x4] + movs r1, 0 + mov r8, r1 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + adds r3, r4, 0 + bl PrintTextOnWindow + ldr r0, =0x0000270f + cmp r6, r0 + bls _081A2834 + adds r6, r0, 0 +_081A2834: + ldr r0, =gStringVar1 + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EE381 + adds r0, r4, 0 + bl StringExpandPlaceholders + mov r1, r10 + ldrb r0, [r1] + str r7, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + ldr r3, [sp, 0xC] + bl PrintTextOnWindow + 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_81A27E8 + + thumb_func_start sub_81A2888 +sub_81A2888: @ 81A2888 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r1, 0 + adds r5, r2, 0 + lsls r0, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r3, 24 + lsrs r3, 24 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + lsrs r0, 23 + ldr r2, =0x00000dde + adds r1, r2 + adds r1, r0 + ldrh r1, [r1] + ldr r0, =gUnknown_085EE319 + str r3, [sp] + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_81A27E8 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2888 + + thumb_func_start sub_81A28CC +sub_81A28CC: @ 81A28CC + push {lr} + lsls r0, 24 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + lsrs r0, 23 + ldr r2, =0x00000dda + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + ldr r1, =0x0000270f + cmp r0, r1 + bls _081A28E6 + adds r0, r1, 0 +_081A28E6: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A28CC + + thumb_func_start sub_81A28F8 +sub_81A28F8: @ 81A28F8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r6, r3, 24 + adds r0, r4, 0 + bl sub_81A28CC + lsls r0, 16 + lsrs r5, r0, 16 + cmp r4, 0 + beq _081A2926 + movs r0, 0x80 + b _081A2928 +_081A2926: + movs r0, 0x40 +_081A2928: + bl sub_81A1C24 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081A2948 + ldr r0, =gUnknown_085EE311 + str r6, [sp] + adds r1, r5, 0 + adds r2, r7, 0 + mov r3, r8 + bl sub_81A27E8 + b _081A2956 + .pool +_081A2948: + ldr r0, =gUnknown_085EE320 + str r6, [sp] + adds r1, r5, 0 + adds r2, r7, 0 + mov r3, r8 + bl sub_81A27E8 +_081A2956: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A28F8 + + thumb_func_start sub_81A2968 +sub_81A2968: @ 81A2968 + push {r4-r6,lr} + sub sp, 0xC + ldr r5, =gUnknown_0203AB74 + ldr r0, =gUnknown_08611C74 + bl AddWindow + strb r0, [r5] + ldrb r0, [r5] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r5] + movs r1, 0x11 + bl FillWindowPixelBuffer + movs r0, 0xA + bl sub_81A1C90 + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EE27C + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x2 + bl sub_81A1C4C + ldrb r0, [r5] + ldr r2, =gUnknown_085EE2F2 + movs r1, 0x31 + str r1, [sp] + movs r6, 0xFF + str r6, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x10 + bl PrintTextOnWindow + ldrb r0, [r5] + ldr r2, =gUnknown_085EE2F9 + movs r1, 0x61 + str r1, [sp] + str r6, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x10 + bl PrintTextOnWindow + movs r0, 0 + movs r1, 0x48 + movs r2, 0x7E + movs r3, 0x31 + bl sub_81A28F8 + movs r0, 0 + movs r1, 0x48 + movs r2, 0x7E + movs r3, 0x41 + bl sub_81A2888 + movs r0, 0x1 + movs r1, 0x48 + movs r2, 0x7E + movs r3, 0x61 + bl sub_81A28F8 + movs r0, 0x1 + movs r1, 0x48 + movs r2, 0x7E + movs r3, 0x71 + bl sub_81A2888 + ldrb r0, [r5] + bl PutWindowTilemap + ldrb r0, [r5] + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2968 + + thumb_func_start sub_81A2A28 +sub_81A2A28: @ 81A2A28 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + mov r12, r0 + ldr r4, [sp, 0x38] + ldr r5, [sp, 0x3C] + ldr r0, [sp, 0x40] + lsls r1, 16 + lsrs r7, r1, 16 + lsls r2, 16 + lsrs r2, 16 + str r2, [sp, 0xC] + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + str r4, [sp, 0x10] + lsls r5, 24 + lsrs r5, 24 + str r5, [sp, 0x14] + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + ldr r0, =gUnknown_0203AB74 + mov r10, r0 + ldrb r0, [r0] + str r6, [sp] + movs r1, 0xFF + mov r9, r1 + str r1, [sp, 0x4] + movs r1, 0 + mov r8, r1 + str r1, [sp, 0x8] + movs r1, 0x1 + mov r2, r12 + bl PrintTextOnWindow + ldr r0, =0x0000270f + cmp r7, r0 + bls _081A2A80 + adds r7, r0, 0 +_081A2A80: + ldr r5, =gStringVar1 + adds r0, r5, 0 + adds r1, r7, 0 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EE302 + adds r0, r4, 0 + bl StringExpandPlaceholders + mov r1, r10 + ldrb r0, [r1] + str r6, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + ldr r3, [sp, 0x10] + bl PrintTextOnWindow + adds r0, r5, 0 + ldr r1, [sp, 0xC] + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalStringN + ldr r1, =gUnknown_085EE392 + adds r0, r4, 0 + bl StringExpandPlaceholders + mov r1, r10 + ldrb r0, [r1] + str r6, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + ldr r3, [sp, 0x14] + bl PrintTextOnWindow + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2A28 + + thumb_func_start sub_81A2B04 +sub_81A2B04: @ 81A2B04 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + adds r6, r2, 0 + ldr r4, [sp, 0x24] + ldr r5, [sp, 0x28] + lsls r0, 24 + lsls r1, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r2, =gSaveBlock2Ptr + ldr r2, [r2] + lsrs r1, 23 + lsrs r0, 22 + adds r1, r0 + ldr r7, =0x00000dea + adds r0, r2, r7 + adds r0, r1 + ldrh r0, [r0] + mov r8, r0 + ldr r0, =0x00000dfa + adds r2, r0 + adds r2, r1 + ldrh r2, [r2] + ldr r0, =gUnknown_085EE319 + str r3, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + mov r1, r8 + adds r3, r6, 0 + bl sub_81A2A28 + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2B04 + + thumb_func_start sub_81A2B70 +sub_81A2B70: @ 81A2B70 + push {lr} + lsls r0, 24 + lsls r1, 24 + ldr r2, =gSaveBlock2Ptr + ldr r2, [r2] + lsrs r1, 23 + lsrs r0, 22 + adds r1, r0 + ldr r0, =0x00000de2 + adds r2, r0 + adds r2, r1 + ldrh r0, [r2] + ldr r1, =0x0000270f + cmp r0, r1 + bls _081A2B90 + adds r0, r1, 0 +_081A2B90: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A2B70 + + thumb_func_start sub_81A2BA0 +sub_81A2BA0: @ 81A2BA0 + push {lr} + lsls r0, 24 + lsls r1, 24 + ldr r2, =gSaveBlock2Ptr + ldr r2, [r2] + lsrs r1, 23 + lsrs r0, 22 + adds r1, r0 + ldr r0, =0x00000df2 + adds r2, r0 + adds r2, r1 + ldrh r0, [r2] + ldr r1, =0x0000270f + cmp r0, r1 + bls _081A2BC0 + adds r0, r1, 0 +_081A2BC0: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A2BA0 + + thumb_func_start sub_81A2BD0 +sub_81A2BD0: @ 81A2BD0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + ldr r4, [sp, 0x30] + ldr r5, [sp, 0x34] + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0xC] + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + lsls r4, 24 + lsrs r4, 24 + mov r9, r4 + lsls r5, 24 + lsrs r5, 24 + mov r10, r5 + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_81A2B70 + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_81A2BA0 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r6, 0 + beq _081A2C20 + cmp r6, 0x1 + beq _081A2C30 +_081A2C20: + cmp r7, 0 + beq _081A2C2A + movs r0, 0x80 + lsls r0, 2 + b _081A2C3E +_081A2C2A: + movs r0, 0x80 + lsls r0, 1 + b _081A2C3E +_081A2C30: + cmp r7, 0 + beq _081A2C3A + movs r0, 0x80 + lsls r0, 18 + b _081A2C3E +_081A2C3A: + movs r0, 0x80 + lsls r0, 17 +_081A2C3E: + bl sub_81A1C24 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081A2C68 + ldr r0, =gUnknown_085EE311 + mov r1, r8 + str r1, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r10 + str r1, [sp, 0x8] + adds r1, r5, 0 + adds r2, r4, 0 + ldr r3, [sp, 0xC] + bl sub_81A2A28 + b _081A2C80 + .pool +_081A2C68: + ldr r0, =gUnknown_085EE320 + mov r1, r8 + str r1, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r10 + str r1, [sp, 0x8] + adds r1, r5, 0 + adds r2, r4, 0 + ldr r3, [sp, 0xC] + bl sub_81A2A28 +_081A2C80: + 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_81A2BD0 + + thumb_func_start sub_81A2C94 +sub_81A2C94: @ 81A2C94 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, =gUnknown_0203AB74 + ldr r0, =gUnknown_08611C74 + bl AddWindow + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + movs r1, 0x11 + bl FillWindowPixelBuffer + cmp r7, 0 + bne _081A2CD8 + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EE298 + bl StringExpandPlaceholders + b _081A2CE0 + .pool +_081A2CD8: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EE2B8 + bl StringExpandPlaceholders +_081A2CE0: + ldr r0, =gStringVar4 + movs r1, 0 + bl sub_81A1C4C + ldr r0, =gUnknown_0203AB74 + mov r8, r0 + ldrb r0, [r0] + ldr r2, =gUnknown_085EE2F2 + movs r6, 0x21 + str r6, [sp] + movs r5, 0xFF + str r5, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl PrintTextOnWindow + mov r1, r8 + ldrb r0, [r1] + ldr r2, =gUnknown_085EE326 + str r6, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x98 + bl PrintTextOnWindow + mov r1, r8 + ldrb r0, [r1] + ldr r2, =gUnknown_085EE2F9 + movs r1, 0x61 + str r1, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl PrintTextOnWindow + movs r0, 0xA + bl sub_81A1C90 + movs r4, 0x9E + str r4, [sp] + movs r0, 0x31 + str r0, [sp, 0x4] + adds r0, r7, 0 + movs r1, 0 + movs r2, 0x8 + movs r3, 0x40 + bl sub_81A2BD0 + str r4, [sp] + movs r0, 0x41 + str r0, [sp, 0x4] + adds r0, r7, 0 + movs r1, 0 + movs r2, 0x8 + movs r3, 0x40 + bl sub_81A2B04 + str r4, [sp] + movs r0, 0x71 + str r0, [sp, 0x4] + adds r0, r7, 0 + movs r1, 0x1 + movs r2, 0x8 + movs r3, 0x40 + bl sub_81A2BD0 + str r4, [sp] + movs r0, 0x81 + str r0, [sp, 0x4] + adds r0, r7, 0 + movs r1, 0x1 + movs r2, 0x8 + movs r3, 0x40 + bl sub_81A2B04 + mov r1, r8 + ldrb r0, [r1] + bl PutWindowTilemap + mov r1, r8 + ldrb r0, [r1] + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2C94 + + thumb_func_start sub_81A2DB4 +sub_81A2DB4: @ 81A2DB4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + adds r5, r0, 0 + adds r4, r2, 0 + ldr r0, [sp, 0x30] + lsls r1, 16 + lsrs r6, r1, 16 + lsls r4, 24 + lsrs r4, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0xC] + lsls r0, 24 + lsrs r0, 24 + adds r7, r0, 0 + ldr r0, =gUnknown_0203AB74 + mov r10, r0 + ldrb r0, [r0] + str r7, [sp] + movs r1, 0xFF + mov r9, r1 + str r1, [sp, 0x4] + movs r1, 0 + mov r8, r1 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + adds r3, r4, 0 + bl PrintTextOnWindow + ldr r0, =0x0000270f + cmp r6, r0 + bls _081A2E00 + adds r6, r0, 0 +_081A2E00: + ldr r0, =gStringVar1 + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EE39C + adds r0, r4, 0 + bl StringExpandPlaceholders + mov r1, r10 + ldrb r0, [r1] + str r7, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + ldr r3, [sp, 0xC] + bl PrintTextOnWindow + 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_81A2DB4 + + thumb_func_start sub_81A2E54 +sub_81A2E54: @ 81A2E54 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r1, 0 + adds r5, r2, 0 + lsls r0, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r3, 24 + lsrs r3, 24 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + lsrs r0, 23 + ldr r2, =0x00000e1e + adds r1, r2 + adds r1, r0 + ldrh r1, [r1] + ldr r0, =gUnknown_085EE319 + str r3, [sp] + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_81A2DB4 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2E54 + + thumb_func_start sub_81A2E98 +sub_81A2E98: @ 81A2E98 + push {lr} + lsls r0, 24 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + lsrs r0, 23 + ldr r2, =0x00000e1a + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + ldr r1, =0x0000270f + cmp r0, r1 + bls _081A2EB2 + adds r0, r1, 0 +_081A2EB2: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A2E98 + + thumb_func_start sub_81A2EC4 +sub_81A2EC4: @ 81A2EC4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r6, r3, 24 + adds r0, r4, 0 + bl sub_81A2E98 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r4, 0 + beq _081A2EF4 + movs r0, 0x80 + lsls r0, 6 + b _081A2EF8 +_081A2EF4: + movs r0, 0x80 + lsls r0, 5 +_081A2EF8: + bl sub_81A1C24 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081A2F18 + ldr r0, =gUnknown_085EE311 + str r6, [sp] + adds r1, r5, 0 + adds r2, r7, 0 + mov r3, r8 + bl sub_81A2DB4 + b _081A2F26 + .pool +_081A2F18: + ldr r0, =gUnknown_085EE320 + str r6, [sp] + adds r1, r5, 0 + adds r2, r7, 0 + mov r3, r8 + bl sub_81A2DB4 +_081A2F26: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2EC4 + + thumb_func_start sub_81A2F38 +sub_81A2F38: @ 81A2F38 + push {r4-r6,lr} + sub sp, 0xC + ldr r5, =gUnknown_0203AB74 + ldr r0, =gUnknown_08611C74 + bl AddWindow + strb r0, [r5] + ldrb r0, [r5] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r5] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EE2D8 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x2 + bl sub_81A1C4C + ldrb r0, [r5] + ldr r2, =gUnknown_085EE2F2 + movs r1, 0x31 + str r1, [sp] + movs r6, 0xFF + str r6, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl PrintTextOnWindow + ldrb r0, [r5] + ldr r2, =gUnknown_085EE2F9 + movs r1, 0x61 + str r1, [sp] + str r6, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl PrintTextOnWindow + movs r0, 0xA + bl sub_81A1C90 + movs r0, 0 + movs r1, 0x40 + movs r2, 0x6F + movs r3, 0x31 + bl sub_81A2EC4 + movs r0, 0 + movs r1, 0x40 + movs r2, 0x6F + movs r3, 0x41 + bl sub_81A2E54 + movs r0, 0x1 + movs r1, 0x40 + movs r2, 0x6F + movs r3, 0x61 + bl sub_81A2EC4 + movs r0, 0x1 + movs r1, 0x40 + movs r2, 0x6F + movs r3, 0x71 + bl sub_81A2E54 + ldrb r0, [r5] + bl PutWindowTilemap + ldrb r0, [r5] + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2F38 + + thumb_func_start sub_81A2FF8 +sub_81A2FF8: @ 81A2FF8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + ldr r4, =gUnknown_0203AB74 + ldr r0, =gUnknown_08611C7C + bl AddWindow + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r0, =gStringVar4 + mov r9, r0 + ldr r1, =gUnknown_085EDF86 + bl StringExpandPlaceholders + movs r0, 0x1 + mov r1, r9 + movs r2, 0xD0 + bl GetStringCenterAlignXOffset + adds r3, r0, 0 + ldrb r0, [r4] + lsls r3, 24 + lsrs r3, 24 + movs r1, 0x1 + str r1, [sp] + movs r6, 0xFF + str r6, [sp, 0x4] + movs r5, 0 + str r5, [sp, 0x8] + mov r2, r9 + bl PrintTextOnWindow + ldr r7, =gUnknown_085EDFA0 + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0x26 + bl GetStringRightAlignXOffset + adds r3, r0, 0 + adds r3, 0x32 + ldrb r0, [r4] + lsls r3, 24 + lsrs r3, 24 + movs r1, 0x19 + mov r8, r1 + str r1, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + adds r2, r7, 0 + bl PrintTextOnWindow + ldr r7, =gUnknown_085EDFA4 + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0x26 + bl GetStringRightAlignXOffset + adds r3, r0, 0 + adds r3, 0x58 + ldrb r0, [r4] + lsls r3, 24 + lsrs r3, 24 + mov r2, r8 + str r2, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + adds r2, r7, 0 + bl PrintTextOnWindow + ldr r7, =gUnknown_085EDFA8 + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0x26 + bl GetStringRightAlignXOffset + adds r3, r0, 0 + adds r3, 0x7E + ldrb r0, [r4] + lsls r3, 24 + lsrs r3, 24 + mov r1, r8 + str r1, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + adds r2, r7, 0 + bl PrintTextOnWindow + ldr r7, =gUnknown_085EDFAC + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0x26 + bl GetStringRightAlignXOffset + adds r3, r0, 0 + adds r3, 0xA4 + ldrb r0, [r4] + lsls r3, 24 + lsrs r3, 24 + mov r2, r8 + str r2, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + adds r2, r7, 0 + bl PrintTextOnWindow + ldrb r0, [r4] + ldr r2, =gUnknown_085EB0E8 + movs r1, 0x29 + str r1, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x6 + bl PrintTextOnWindow + ldrb r0, [r4] + ldr r2, =gUnknown_085EB0ED + movs r1, 0x39 + str r1, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x6 + bl PrintTextOnWindow + ldrb r0, [r4] + ldr r2, =gUnknown_085EB0F4 + movs r1, 0x49 + str r1, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x6 + bl PrintTextOnWindow + ldrb r0, [r4] + ldr r2, =gUnknown_085EB0F9 + movs r1, 0x59 + str r1, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x6 + bl PrintTextOnWindow + ldrb r0, [r4] + ldr r2, =gUnknown_085EB0FF + movs r1, 0x69 + str r1, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x6 + bl PrintTextOnWindow + movs r1, 0 +_081A314A: + movs r5, 0 + adds r0, r1, 0x1 + mov r8, r0 + lsls r0, r1, 28 + movs r2, 0xA4 + lsls r2, 22 + adds r0, r2 + lsrs r7, r0, 24 + lsls r4, r1, 3 +_081A315C: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000624 + adds r0, r1 + adds r0, r4 + ldrh r1, [r0] + mov r0, r9 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalStringN + ldr r6, =gUnknown_0203AB74 + ldrb r0, [r6] + movs r1, 0x26 + adds r3, r5, 0 + muls r3, r1 + adds r3, 0x40 + lsls r3, 24 + lsrs r3, 24 + str r7, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + mov r2, r9 + bl PrintTextOnWindow + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _081A315C + mov r1, r8 + cmp r1, 0x4 + ble _081A314A + ldrb r0, [r6] + bl PutWindowTilemap + ldrb r0, [r6] + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2FF8 + + thumb_func_start sub_81A31FC +sub_81A31FC: @ 81A31FC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r7, r0, 30 + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + cmp r4, 0x6 + bls _081A3232 + b _081A35CE +_081A3232: + lsls r0, r4, 2 + ldr r1, =_081A3250 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A3250: + .4byte _081A326C + .4byte _081A33A8 + .4byte _081A3414 + .4byte _081A347C + .4byte _081A34CC + .4byte _081A354C + .4byte _081A3594 +_081A326C: + ldr r2, =gSaveBlock2Ptr + mov r9, r2 + ldr r0, [r2] + lsls r3, r7, 1 + mov r10, r3 + mov r2, r8 + lsls r1, r2, 2 + add r1, r10 + str r1, [sp, 0x20] + movs r3, 0xCE + lsls r3, 4 + adds r1, r0, r3 + ldr r2, [sp, 0x20] + adds r1, r2 + adds r3, 0x10 + adds r0, r3 + adds r0, r2 + ldrh r1, [r1] + ldrh r2, [r0] + cmp r1, r2 + bhi _081A3298 + b _081A35CE +_081A3298: + strh r1, [r0] + mov r3, r8 + cmp r3, 0x3 + bne _081A32F2 + ldr r6, =gBattleScripting + adds r6, 0x25 + ldrb r0, [r6] + movs r4, 0x1 + eors r0, r4 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r5, =gLinkPlayers + 8 + adds r1, r5 + mov r0, sp + bl StringCopy + mov r0, sp + bl StripExtCtrlCodes + lsls r1, r7, 3 + ldr r0, =0x00000ee1 + adds r1, r0 + mov r2, r9 + ldr r0, [r2] + adds r0, r1 + mov r1, sp + bl StringCopy + ldrb r0, [r6] + eors r4, r0 + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + subs r5, 0x4 + adds r0, r5 + ldr r0, [r0] + lsls r2, r7, 2 + ldr r1, =0x00000ef1 + adds r2, r1 + mov r3, r9 + ldr r1, [r3] + adds r1, r2 + bl WriteUnalignedWord +_081A32F2: + mov r7, r9 + ldr r0, [r7] + movs r1, 0xCE + lsls r1, 4 + adds r0, r1 + ldr r2, [sp, 0x20] + adds r0, r2 + ldrh r0, [r0] + cmp r0, 0x1 + bhi _081A3308 + b _081A35CE +_081A3308: + bl sub_80EE818 + lsls r0, 24 + cmp r0, 0 + bne _081A3314 + b _081A35CE +_081A3314: + mov r3, r8 + cmp r3, 0x1 + beq _081A335A + cmp r3, 0x1 + bgt _081A3338 + cmp r3, 0 + beq _081A3344 + b _081A35CE + .pool +_081A3338: + mov r7, r8 + cmp r7, 0x2 + beq _081A3374 + cmp r7, 0x3 + beq _081A338E + b _081A35CE +_081A3344: + mov r1, r9 + ldr r0, [r1] + movs r2, 0xCE + lsls r2, 4 + adds r0, r2 + add r0, r10 + ldrh r0, [r0] + movs r1, 0x1 + bl sub_80EE8C8 + b _081A35CE +_081A335A: + mov r3, r9 + ldr r0, [r3] + mov r1, r10 + adds r1, 0x4 + movs r7, 0xCE + lsls r7, 4 + adds r0, r7 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x2 + bl sub_80EE8C8 + b _081A35CE +_081A3374: + mov r1, r9 + ldr r0, [r1] + mov r1, r10 + adds r1, 0x8 + movs r2, 0xCE + lsls r2, 4 + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x3 + bl sub_80EE8C8 + b _081A35CE +_081A338E: + mov r3, r9 + ldr r0, [r3] + mov r1, r10 + adds r1, 0xC + movs r7, 0xCE + lsls r7, 4 + adds r0, r7 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x4 + bl sub_80EE8C8 + b _081A35CE +_081A33A8: + ldr r6, =gSaveBlock2Ptr + ldr r0, [r6] + lsls r7, 1 + mov r2, r8 + lsls r1, r2, 2 + adds r4, r7, r1 + ldr r5, =0x00000d0c + adds r1, r0, r5 + adds r1, r4 + ldr r3, =0x00000d14 + adds r0, r3 + adds r0, r4 + ldrh r2, [r1] + ldrh r3, [r0] + cmp r2, r3 + bhi _081A33CA + b _081A35CE +_081A33CA: + strh r2, [r0] + ldrh r0, [r1] + cmp r0, 0x1 + bhi _081A33D4 + b _081A35CE +_081A33D4: + bl sub_80EE818 + lsls r0, 24 + cmp r0, 0 + bne _081A33E0 + b _081A35CE +_081A33E0: + mov r0, r8 + cmp r0, 0 + bne _081A3404 + ldr r0, [r6] + adds r0, r5 + adds r0, r7 + ldrh r0, [r0] + movs r1, 0x5 + bl sub_80EE8C8 + b _081A35CE + .pool +_081A3404: + ldr r0, [r6] + adds r0, r5 + adds r0, r4 + ldrh r0, [r0] + movs r1, 0x6 + bl sub_80EE8C8 + b _081A35CE +_081A3414: + ldr r6, =gSaveBlock2Ptr + ldr r0, [r6] + lsls r7, 1 + mov r2, r8 + lsls r1, r2, 2 + adds r4, r7, r1 + ldr r5, =0x00000dc8 + adds r1, r0, r5 + adds r1, r4 + movs r3, 0xDD + lsls r3, 4 + adds r0, r3 + adds r0, r4 + ldrh r2, [r1] + ldrh r3, [r0] + cmp r2, r3 + bhi _081A3438 + b _081A35CE +_081A3438: + strh r2, [r0] + ldrh r0, [r1] + cmp r0, 0x1 + bhi _081A3442 + b _081A35CE +_081A3442: + bl sub_80EE818 + lsls r0, 24 + cmp r0, 0 + bne _081A344E + b _081A35CE +_081A344E: + mov r0, r8 + cmp r0, 0 + bne _081A346C + ldr r0, [r6] + adds r0, r5 + adds r0, r7 + ldrh r0, [r0] + movs r1, 0xB + bl sub_80EE8C8 + b _081A35CE + .pool +_081A346C: + ldr r0, [r6] + adds r0, r5 + adds r0, r4 + ldrh r0, [r0] + movs r1, 0xC + bl sub_80EE8C8 + b _081A35CE +_081A347C: + ldr r6, =gSaveBlock2Ptr + ldr r1, [r6] + lsls r4, r7, 1 + ldr r5, =0x00000dda + adds r0, r1, r5 + adds r0, r4 + ldr r2, =0x00000dde + adds r1, r2 + adds r1, r4 + ldrh r2, [r0] + ldrh r3, [r1] + cmp r2, r3 + bhi _081A3498 + b _081A35CE +_081A3498: + strh r2, [r1] + ldrh r0, [r0] + cmp r0, 0x1 + bhi _081A34A2 + b _081A35CE +_081A34A2: + bl sub_80EE818 + lsls r0, 24 + cmp r0, 0 + bne _081A34AE + b _081A35CE +_081A34AE: + ldr r0, [r6] + adds r0, r5 + adds r0, r4 + ldrh r0, [r0] + movs r1, 0xA + bl sub_80EE8C8 + b _081A35CE + .pool +_081A34CC: + ldr r6, =gSaveBlock2Ptr + ldr r2, [r6] + lsls r7, 1 + mov r9, r7 + mov r7, r8 + lsls r0, r7, 2 + mov r1, r9 + adds r4, r1, r0 + ldr r5, =0x00000de2 + adds r0, r2, r5 + adds r3, r0, r4 + ldr r7, =0x00000dea + adds r0, r2, r7 + adds r0, r4 + ldrh r1, [r3] + ldrh r7, [r0] + cmp r1, r7 + bls _081A35CE + strh r1, [r0] + ldr r0, =0x00000dfa + adds r1, r2, r0 + adds r1, r4 + ldr r7, =0x00000df2 + adds r0, r2, r7 + adds r0, r4 + ldrh r0, [r0] + strh r0, [r1] + ldrh r0, [r3] + cmp r0, 0x1 + bls _081A35CE + bl sub_80EE818 + lsls r0, 24 + cmp r0, 0 + beq _081A35CE + mov r0, r8 + cmp r0, 0 + bne _081A353C + ldr r0, [r6] + adds r0, r5 + add r0, r9 + ldrh r0, [r0] + movs r1, 0x7 + bl sub_80EE8C8 + b _081A35CE + .pool +_081A353C: + ldr r0, [r6] + adds r0, r5 + adds r0, r4 + ldrh r0, [r0] + movs r1, 0x8 + bl sub_80EE8C8 + b _081A35CE +_081A354C: + ldr r6, =gSaveBlock2Ptr + ldr r1, [r6] + lsls r4, r7, 1 + ldr r5, =0x00000e04 + adds r0, r1, r5 + adds r0, r4 + ldr r2, =0x00000e08 + adds r1, r2 + adds r1, r4 + ldrh r2, [r0] + ldrh r3, [r1] + cmp r2, r3 + bls _081A35CE + strh r2, [r1] + ldrh r0, [r0] + cmp r0, 0x1 + bls _081A35CE + bl sub_80EE818 + lsls r0, 24 + cmp r0, 0 + beq _081A35CE + ldr r0, [r6] + adds r0, r5 + adds r0, r4 + ldrh r0, [r0] + movs r1, 0x9 + bl sub_80EE8C8 + b _081A35CE + .pool +_081A3594: + ldr r6, =gSaveBlock2Ptr + ldr r1, [r6] + lsls r4, r7, 1 + ldr r5, =0x00000e1a + adds r0, r1, r5 + adds r0, r4 + ldr r7, =0x00000e1e + adds r1, r7 + adds r1, r4 + ldrh r2, [r0] + ldrh r3, [r1] + cmp r2, r3 + bls _081A35CE + strh r2, [r1] + ldrh r0, [r0] + cmp r0, 0x1 + bls _081A35CE + bl sub_80EE818 + lsls r0, 24 + cmp r0, 0 + beq _081A35CE + ldr r0, [r6] + adds r0, r5 + adds r0, r4 + ldrh r0, [r0] + movs r1, 0xD + bl sub_80EE8C8 +_081A35CE: + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A31FC + + thumb_func_start sub_81A35EC +sub_81A35EC: @ 81A35EC + push {r4,lr} + ldr r0, =0x000040cf + bl VarGet + ldr r4, =gScriptResult + bl sub_81A3610 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A35EC + + thumb_func_start sub_81A3610 +sub_81A3610: @ 81A3610 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r0, 0 + mov r8, r0 + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, =0x000040ce + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl sub_81A39C4 + lsls r0, 16 + ldr r1, =gUnknown_08611550 + mov r9, r1 + lsls r7, r6, 2 + adds r1, 0x3 + adds r1, r7, r1 + lsrs r0, 16 + ldrb r1, [r1] + adds r5, r0, r1 + cmp r4, 0 + beq _081A365C + movs r0, 0 + b _081A36C2 + .pool +_081A365C: + lsls r0, r6, 24 + lsrs r0, 24 + bl sub_81A3B30 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + blt _081A3680 + cmp r1, 0x1 + bgt _081A3680 + adds r0, r1, r7 + add r0, r9 + ldrb r0, [r0] + cmp r5, r0 + bne _081A36BC + adds r1, 0x1 + mov r8, r1 + b _081A36BC +_081A3680: + ldr r1, =gUnknown_08611550 + lsls r2, r6, 2 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r5, r0 + bne _081A3694 + movs r0, 0x3 + b _081A36BA + .pool +_081A3694: + adds r0, r1, 0x1 + adds r0, r2, r0 + ldrb r0, [r0] + cmp r5, r0 + bne _081A36A4 + movs r1, 0x4 + mov r8, r1 + b _081A36BC +_081A36A4: + cmp r5, r0 + ble _081A36BC + subs r0, r5, r0 + adds r1, 0x2 + adds r1, r2, r1 + ldrb r1, [r1] + bl __modsi3 + cmp r0, 0 + bne _081A36BC + movs r0, 0x4 +_081A36BA: + mov r8, r0 +_081A36BC: + mov r1, r8 + lsls r0, r1, 24 + lsrs r0, 24 +_081A36C2: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81A3610 + + thumb_func_start sub_81A36D0 +sub_81A36D0: @ 81A36D0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + adds r2, r0, 0 + lsls r1, 16 + lsrs r3, r1, 16 + cmp r0, 0x1 + beq _081A3766 + cmp r0, 0x1 + bgt _081A36EA + cmp r0, 0 + beq _081A36F2 + b _081A38F8 +_081A36EA: + cmp r2, 0x2 + bne _081A36F0 + b _081A3818 +_081A36F0: + b _081A38F8 +_081A36F2: + movs r0, 0xFA + lsls r0, 1 + cmp r3, r0 + bne _081A370C + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000bfc + b _081A38C4 + .pool +_081A370C: + ldr r0, =0x000003fe + cmp r3, r0 + beq _081A3786 + ldr r0, =0x0000012b + cmp r3, r0 + bhi _081A3738 + ldr r2, =gUnknown_0203BC88 + movs r0, 0x34 + adds r1, r3, 0 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0xC + bl ConvertBattleFrontierTrainerSpeechToString + b _081A38F8 + .pool +_081A3738: + ldr r0, =0x0000018f + cmp r3, r0 + bhi _081A3758 + ldr r1, =gSaveBlock2Ptr + movs r0, 0xEC + muls r0, r3 + ldr r1, [r1] + adds r0, r1 + ldr r1, =0xfffef2b8 + b _081A38C4 + .pool +_081A3758: + adds r0, r3, 0 + adds r0, 0x70 + lsls r0, 24 + lsrs r0, 24 + bl sub_819F99C + b _081A38F8 +_081A3766: + movs r0, 0xFA + lsls r0, 1 + cmp r3, r0 + bne _081A3780 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000c08 + b _081A38C4 + .pool +_081A3780: + ldr r0, =0x000003fe + cmp r3, r0 + bne _081A3794 +_081A3786: + movs r0, 0 + bl sub_81A51A8 + b _081A38F8 + .pool +_081A3794: + ldr r0, =0x0000012b + cmp r3, r0 + bhi _081A37B8 + ldr r2, =gUnknown_0203BC88 + movs r0, 0x34 + adds r1, r3, 0 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0x18 + bl ConvertBattleFrontierTrainerSpeechToString + b _081A38F8 + .pool +_081A37B8: + ldr r0, =0x0000018f + cmp r3, r0 + bhi _081A37EC + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + bne _081A387C + ldr r1, =gSaveBlock2Ptr + movs r0, 0xEC + muls r0, r3 + ldr r1, [r1] + adds r0, r1 + ldr r1, =0xfffef2c4 + b _081A38C4 + .pool +_081A37EC: + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + bne _081A387C + ldr r1, =gSaveBlock2Ptr + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 2 + ldr r1, [r1] + adds r0, r1 + ldr r1, =0xffff96c4 + b _081A38C4 + .pool +_081A3818: + movs r0, 0xFA + lsls r0, 1 + cmp r3, r0 + bne _081A3830 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000c14 + b _081A38C4 + .pool +_081A3830: + ldr r0, =0x000003fe + cmp r3, r0 + bne _081A3844 + movs r0, 0x1 + bl sub_81A51A8 + b _081A38F8 + .pool +_081A3844: + ldr r0, =0x0000012b + cmp r3, r0 + bhi _081A3868 + ldr r2, =gUnknown_0203BC88 + movs r0, 0x34 + adds r1, r3, 0 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0x24 + bl ConvertBattleFrontierTrainerSpeechToString + b _081A38F8 + .pool +_081A3868: + ldr r0, =0x0000018f + cmp r3, r0 + bhi _081A38A8 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _081A3890 +_081A387C: + bl sub_81864E0 + bl ConvertBattleFrontierTrainerSpeechToString + b _081A38F8 + .pool +_081A3890: + ldr r1, =gSaveBlock2Ptr + movs r0, 0xEC + muls r0, r3 + ldr r1, [r1] + adds r0, r1 + ldr r1, =0xfffef2d0 + b _081A38C4 + .pool +_081A38A8: + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _081A38D4 + bl sub_81864A8 + lsls r0, 24 + lsrs r3, r0, 24 + movs r0, 0x58 + muls r0, r3 + ldr r1, =gUnknown_086109BA +_081A38C4: + adds r0, r1 + bl ConvertBattleFrontierTrainerSpeechToString + b _081A38F8 + .pool +_081A38D4: + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r0, =0xfffffe70 + adds r2, r3, r0 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0 + adds r1, 0xDC + ldrb r0, [r1] + lsls r0, 27 + lsrs r3, r0, 27 + movs r0, 0x58 + muls r0, r3 + ldr r1, =gUnknown_086109BA + adds r0, r1 + bl ConvertBattleFrontierTrainerSpeechToString +_081A38F8: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A36D0 + + thumb_func_start sub_81A3908 +sub_81A3908: @ 81A3908 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r2, =0x00000cdc + adds r1, r2 + movs r2, 0 + str r2, [r1] + movs r4, 0 + mov r9, r0 + mov r8, r9 + movs r6, 0 +_081A3926: + movs r5, 0 + lsls r7, r4, 2 + mov r10, r7 + adds r0, r4, 0x1 + mov r12, r0 +_081A3930: + mov r1, r8 + ldr r2, [r1] + lsls r3, r5, 1 + mov r7, r10 + adds r1, r3, r7 + movs r7, 0xCE + lsls r7, 4 + adds r0, r2, r7 + adds r0, r1 + strh r6, [r0] + cmp r4, 0x1 + bgt _081A3960 + adds r7, 0x2C + adds r0, r2, r7 + adds r0, r1 + strh r6, [r0] + adds r7, 0xBC + adds r0, r2, r7 + adds r0, r1 + strh r6, [r0] + adds r7, 0x1A + adds r0, r2, r7 + adds r0, r1 + strh r6, [r0] +_081A3960: + cmp r4, 0 + bne _081A3980 + mov r1, r8 + ldr r0, [r1] + ldr r2, =0x00000dda + adds r1, r0, r2 + adds r1, r3 + strh r4, [r1] + ldr r7, =0x00000e04 + adds r1, r0, r7 + adds r1, r3 + strh r4, [r1] + ldr r1, =0x00000e1a + adds r0, r1 + adds r0, r3 + strh r4, [r0] +_081A3980: + adds r5, 0x1 + cmp r5, 0x1 + ble _081A3930 + mov r4, r12 + cmp r4, 0x3 + ble _081A3926 + mov r2, r9 + ldr r0, [r2] + ldr r7, =0x00000ca8 + adds r1, r0, r7 + ldrb r0, [r1] + cmp r0, 0 + beq _081A399E + movs r0, 0x1 + strb r0, [r1] +_081A399E: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A3908 + + thumb_func_start sub_81A39C4 +sub_81A39C4: @ 81A39C4 + push {r4,r5,lr} + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r4, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x6 + bhi _081A3AC4 + lsls r0, 2 + ldr r1, =_081A3A0C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A3A0C: + .4byte _081A3A28 + .4byte _081A3A3C + .4byte _081A3A54 + .4byte _081A3A6C + .4byte _081A3A80 + .4byte _081A3A98 + .4byte _081A3AAC +_081A3A28: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + lsls r2, r5, 2 + adds r1, r2 + movs r2, 0xCE + lsls r2, 4 + b _081A3AB4 + .pool +_081A3A3C: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + lsls r2, r5, 2 + adds r1, r2 + ldr r2, =0x00000d0c + b _081A3AB4 + .pool +_081A3A54: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + lsls r2, r5, 2 + adds r1, r2 + ldr r2, =0x00000dc8 + b _081A3AB4 + .pool +_081A3A6C: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000dda + b _081A3AB4 + .pool +_081A3A80: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + lsls r2, r5, 2 + adds r1, r2 + ldr r2, =0x00000de2 + b _081A3AB4 + .pool +_081A3A98: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000e04 + b _081A3AB4 + .pool +_081A3AAC: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000e1a +_081A3AB4: + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + b _081A3AC6 + .pool +_081A3AC4: + movs r0, 0 +_081A3AC6: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81A39C4 + + thumb_func_start sub_81A3ACC +sub_81A3ACC: @ 81A3ACC + push {r4,r5,lr} + movs r2, 0 + ldr r5, =gSaveBlock2Ptr + ldr r4, =0x00000cb4 + ldr r0, =0x0000ffff + adds r3, r0, 0 +_081A3AD8: + ldr r0, [r5] + lsls r1, r2, 1 + adds r0, r4 + adds r0, r1 + ldrh r1, [r0] + orrs r1, r3 + strh r1, [r0] + adds r2, 0x1 + cmp r2, 0x13 + ble _081A3AD8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A3ACC + + thumb_func_start sub_81A3B00 +sub_81A3B00: @ 81A3B00 + push {lr} + ldr r0, =gTrainerBattleOpponent_A + ldrh r1, [r0] + ldr r0, =0x000003fe + cmp r1, r0 + bne _081A3B20 + ldr r1, =gScriptResult + movs r0, 0x1 + b _081A3B24 + .pool +_081A3B20: + ldr r1, =gScriptResult + movs r0, 0 +_081A3B24: + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A3B00 + + thumb_func_start sub_81A3B30 +sub_81A3B30: @ 81A3B30 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 23 + ldr r1, =0x000008c4 + adds r0, r4, r1 + bl FlagGet + adds r5, r0, 0 + ldr r0, =0x000008c5 + adds r4, r0 + adds r0, r4, 0 + bl FlagGet + adds r5, r0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A3B30 + + thumb_func_start sub_81A3B64 +sub_81A3B64: @ 81A3B64 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r5, 0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r4, r0, 30 + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r7, r0, 16 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r6, r0, 16 + cmp r7, 0x6 + bhi _081A3C78 + lsls r0, r7, 2 + ldr r1, =_081A3BB4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A3BB4: + .4byte _081A3BD0 + .4byte _081A3BE4 + .4byte _081A3C00 + .4byte _081A3C18 + .4byte _081A3C2C + .4byte _081A3C44 + .4byte _081A3C60 +_081A3BD0: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + lsls r2, r6, 2 + adds r1, r2 + movs r2, 0xCE + lsls r2, 4 + b _081A3C68 + .pool +_081A3BE4: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + lsls r2, r6, 2 + adds r1, r2 + ldr r2, =0x00000d0c + adds r0, r2 + adds r0, r1 + ldrh r5, [r0] + b _081A3C78 + .pool +_081A3C00: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + lsls r2, r6, 2 + adds r1, r2 + ldr r2, =0x00000dc8 + b _081A3C68 + .pool +_081A3C18: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000dda + b _081A3C68 + .pool +_081A3C2C: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + lsls r2, r6, 2 + adds r1, r2 + ldr r2, =0x00000de2 + b _081A3C68 + .pool +_081A3C44: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000e04 + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0xE + b _081A3C70 + .pool +_081A3C60: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000e1a +_081A3C68: + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x7 +_081A3C70: + bl __udivsi3 + lsls r0, 16 + lsrs r5, r0, 16 +_081A3C78: + cmp r5, 0 + beq _081A3C7E + subs r5, 0x1 +_081A3C7E: + cmp r5, 0x1D + bls _081A3C84 + movs r5, 0x1D +_081A3C84: + ldr r2, =gUnknown_086118B4 + lsls r1, r7, 2 + adds r1, r6, r1 + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + adds r1, r0 + adds r7, r1, r2 + ldrb r5, [r7] + ldr r0, =gTrainerBattleOpponent_A + mov r9, r0 + ldrh r0, [r0] + ldr r1, =0x000003fe + mov r8, r1 + cmp r0, r8 + bne _081A3CA6 + adds r5, 0xA +_081A3CA6: + ldr r6, =gSaveBlock2Ptr + ldr r1, [r6] + ldr r4, =0x00000eb8 + adds r1, r4 + ldrh r0, [r1] + adds r0, r5 + strh r0, [r1] + ldr r0, =gStringVar1 + adds r1, r5, 0 + movs r2, 0 + movs r3, 0x2 + bl ConvertIntToDecimalStringN + ldr r0, [r6] + adds r2, r0, r4 + ldrh r0, [r2] + ldr r1, =0x0000270f + cmp r0, r1 + bls _081A3CCE + strh r1, [r2] +_081A3CCE: + ldr r0, [r6] + ldr r4, =0x00000eba + adds r0, r4 + ldrh r5, [r0] + ldrb r0, [r7] + adds r5, r0 + bl sub_80EED60 + mov r2, r9 + ldrh r0, [r2] + cmp r0, r8 + bne _081A3CEE + adds r5, 0xA + movs r0, 0xA + bl sub_80EED60 +_081A3CEE: + ldr r0, =0x0000ffff + cmp r5, r0 + ble _081A3CF6 + adds r5, r0, 0 +_081A3CF6: + ldr r0, [r6] + adds r0, r4 + strh r5, [r0] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A3B64 + + thumb_func_start sub_81A3D30 +sub_81A3D30: @ 81A3D30 + push {r4,lr} + ldr r0, =0x000040cf + bl VarGet + ldr r4, =gScriptResult + lsls r0, 24 + lsrs r0, 24 + bl sub_81A3B30 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A3D30 + + thumb_func_start sub_81A3D58 +sub_81A3D58: @ 81A3D58 + push {r4,lr} + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r4, r0, 16 + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_81A3B30 + lsls r0, 24 + cmp r0, 0 + bne _081A3D88 + lsls r0, r4, 17 + ldr r1, =0x8C4 << 16 + adds r0, r1 + lsrs r0, 16 + bl FlagSet + b _081A3D94 + .pool +_081A3D88: + lsls r0, r4, 17 + ldr r1, =0x8C5 << 16 + adds r0, r1 + lsrs r0, 16 + bl FlagSet +_081A3D94: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A3D58 + + thumb_func_start sub_81A3DA0 +sub_81A3DA0: @ 81A3DA0 + push {lr} + ldr r0, =gBattleTypeFlags + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + ldr r2, [r0] + ands r2, r1 + cmp r2, 0 + beq _081A3DC4 + ldr r1, =gScriptResult + movs r0, 0x1 + strh r0, [r1] + b _081A3DC8 + .pool +_081A3DC4: + ldr r0, =gScriptResult + strh r2, [r0] +_081A3DC8: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A3DA0 + + thumb_func_start sub_81A3DD0 +sub_81A3DD0: @ 81A3DD0 + push {r4-r6,lr} + adds r5, r2, 0 + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 24 + lsrs r4, r1, 24 + adds r0, r6, 0 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + bl GetSetPokedexFlag + lsls r0, 24 + cmp r0, 0 + beq _081A3ED6 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + subs r0, r4, 0x1 + cmp r0, 0xA + bhi _081A3EA0 + lsls r0, 2 + ldr r1, =_081A3E0C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A3E0C: + .4byte _081A3E38 + .4byte _081A3E68 + .4byte _081A3E38 + .4byte _081A3EA0 + .4byte _081A3E38 + .4byte _081A3EA0 + .4byte _081A3E38 + .4byte _081A3EA0 + .4byte _081A3E38 + .4byte _081A3EA0 + .4byte _081A3E38 +_081A3E38: + cmp r5, r4 + bne _081A3E50 + ldr r0, =gStringVar1 + ldr r1, =gUnknown_085CCB79 + bl StringAppend + b _081A3EC8 + .pool +_081A3E50: + cmp r5, r4 + ble _081A3EC8 + ldr r0, =gStringVar1 + ldr r1, =gUnknown_085CCB7F + bl StringAppend + b _081A3EC8 + .pool +_081A3E68: + cmp r4, r5 + bne _081A3E80 + ldr r0, =gStringVar1 + ldr r1, =gUnknown_085CCB79 + bl StringAppend + b _081A3E88 + .pool +_081A3E80: + ldr r0, =gStringVar1 + ldr r1, =gUnknown_085CCB7F + bl StringAppend +_081A3E88: + ldr r0, =gStringVar1 + ldr r1, =gUnknown_085CCB86 + bl StringAppend + b _081A3EC8 + .pool +_081A3EA0: + cmp r4, r5 + bne _081A3EB8 + ldr r0, =gStringVar1 + ldr r1, =gUnknown_085CCB79 + bl StringAppend + b _081A3EC0 + .pool +_081A3EB8: + ldr r0, =gStringVar1 + ldr r1, =gUnknown_085CCB7F + bl StringAppend +_081A3EC0: + ldr r0, =gStringVar1 + ldr r1, =gUnknown_085CCB84 + bl StringAppend +_081A3EC8: + ldr r0, =gStringVar1 + movs r1, 0xB + muls r1, r6 + ldr r2, =gSpeciesNames + adds r1, r2 + bl StringAppend +_081A3ED6: + adds r0, r4, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A3DD0 + + thumb_func_start sub_81A3EF0 +sub_81A3EF0: @ 81A3EF0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r2, [sp, 0x20] + ldr r4, [sp, 0x24] + mov r9, r4 + ldr r4, [sp, 0x28] + mov r10, r4 + ldr r7, [sp, 0x2C] + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 16 + lsrs r6, r1, 16 + lsls r3, 24 + lsrs r3, 24 + mov r12, r3 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + movs r2, 0 + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + beq _081A3FBE + cmp r4, 0 + beq _081A3FBE + ldr r0, =gUnknown_08611C9A + ldrh r1, [r0] + ldr r5, =0x0000ffff + adds r3, r0, 0 + cmp r1, r5 + beq _081A3F54 + cmp r1, r4 + beq _081A3F48 + adds r1, r3, 0 +_081A3F3A: + adds r1, 0x2 + adds r2, 0x1 + ldrh r0, [r1] + cmp r0, r5 + beq _081A3F54 + cmp r0, r4 + bne _081A3F3A +_081A3F48: + lsls r0, r2, 1 + adds r0, r3 + ldrh r1, [r0] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _081A3FBE +_081A3F54: + mov r0, r12 + cmp r0, 0 + bne _081A3F60 + mov r1, r8 + cmp r1, 0x32 + bhi _081A3FBE +_081A3F60: + movs r2, 0 + ldrb r3, [r7] + cmp r2, r3 + bge _081A3F80 + mov r1, r9 + ldrh r0, [r1] + cmp r0, r4 + beq _081A3F80 + adds r5, r3, 0 +_081A3F72: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, r5 + bge _081A3F80 + ldrh r0, [r1] + cmp r0, r4 + bne _081A3F72 +_081A3F80: + cmp r2, r3 + bne _081A3FBE + cmp r6, 0 + beq _081A3FAA + movs r2, 0 + cmp r2, r3 + bge _081A3FA6 + mov r1, r10 + ldrh r0, [r1] + cmp r0, r6 + beq _081A3FA6 + adds r5, r3, 0 +_081A3F98: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, r5 + bge _081A3FA6 + ldrh r0, [r1] + cmp r0, r6 + bne _081A3F98 +_081A3FA6: + cmp r2, r3 + bne _081A3FBE +_081A3FAA: + lsls r0, r3, 1 + add r0, r9 + strh r4, [r0] + ldrb r0, [r7] + lsls r0, 1 + add r0, r10 + strh r6, [r0] + ldrb r0, [r7] + adds r0, 0x1 + strb r0, [r7] +_081A3FBE: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A3EF0 + + thumb_func_start sub_81A3FD4 +sub_81A3FD4: @ 81A3FD4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x34 + movs r0, 0 + str r0, [sp, 0x2C] + add r4, sp, 0x28 + strb r0, [r4] + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r0, 16 + mov r10, r4 + cmp r0, 0x1 + beq _081A4016 + cmp r0, 0x1 + bgt _081A4008 + cmp r0, 0 + beq _081A4010 + b _081A402A + .pool +_081A4008: + cmp r0, 0x3 + bgt _081A402A + movs r0, 0x2 + b _081A4028 +_081A4010: + movs r1, 0x3 + str r1, [sp, 0x2C] + b _081A402A +_081A4016: + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + movs r1, 0x3 + str r1, [sp, 0x2C] + cmp r0, 0 + bne _081A402A + movs r0, 0x4 +_081A4028: + str r0, [sp, 0x2C] +_081A402A: + movs r1, 0 + mov r9, r1 + b _081A4040 + .pool +_081A4034: + mov r1, r10 + ldrb r0, [r1] + ldr r1, [sp, 0x2C] + cmp r0, r1 + blt _081A4040 + b _081A41E0 +_081A4040: + mov r5, r9 + movs r0, 0 + mov r1, r10 + strb r0, [r1] + mov r0, r9 + adds r0, 0x1 + str r0, [sp, 0x30] +_081A404E: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =gPlayerParty + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x41 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + adds r0, r4, 0 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r7, r0, 16 + adds r0, r4, 0 + movs r1, 0x38 + bl GetMonData + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r4, 0 + movs r1, 0x39 + bl GetMonData + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x6 + bne _081A40C8 + cmp r7, 0 + bne _081A40E4 + ldr r0, =gScriptResult + ldrb r3, [r0] + str r6, [sp] + add r1, sp, 0x10 + str r1, [sp, 0x4] + add r0, sp, 0x1C + str r0, [sp, 0x8] + mov r0, r10 + str r0, [sp, 0xC] + mov r0, r8 + movs r1, 0 + adds r2, r4, 0 + bl sub_81A3EF0 + b _081A40E4 + .pool +_081A40C8: + ldr r0, =gScriptResult + ldrb r3, [r0] + str r6, [sp] + add r1, sp, 0x10 + str r1, [sp, 0x4] + add r0, sp, 0x1C + str r0, [sp, 0x8] + mov r0, r10 + str r0, [sp, 0xC] + mov r0, r8 + adds r1, r7, 0 + adds r2, r4, 0 + bl sub_81A3EF0 +_081A40E4: + adds r5, 0x1 + cmp r5, 0x5 + ble _081A40EC + movs r5, 0 +_081A40EC: + cmp r5, r9 + bne _081A404E + ldr r1, [sp, 0x30] + mov r9, r1 + cmp r1, 0x5 + ble _081A4034 + mov r1, r10 + ldrb r0, [r1] + ldr r1, [sp, 0x2C] + cmp r0, r1 + bge _081A41E0 + movs r6, 0 + ldr r0, =gUnknown_08611C9A + ldrh r2, [r0] + ldr r1, =0x0000ffff + mov r8, r0 + cmp r2, r1 + beq _081A4134 + mov r4, r8 +_081A4112: + adds r0, r2, 0 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + bl GetSetPokedexFlag + lsls r0, 24 + cmp r0, 0 + beq _081A412A + adds r6, 0x1 +_081A412A: + adds r4, 0x2 + ldrh r2, [r4] + ldr r0, =0x0000ffff + cmp r2, r0 + bne _081A4112 +_081A4134: + ldr r1, =gStringVar1 + movs r0, 0xFF + strb r0, [r1] + ldr r1, =gSpecialVar_0x8004 + movs r0, 0x1 + strh r0, [r1] + movs r0, 0 + mov r1, r10 + strb r0, [r1] + mov r1, r8 + ldrh r0, [r1] + ldr r1, =0x0000ffff + cmp r0, r1 + beq _081A416A + mov r5, r10 + adds r7, r1, 0 + mov r4, r8 +_081A4156: + ldrh r0, [r4] + ldrb r1, [r5] + adds r2, r6, 0 + bl sub_81A3DD0 + strb r0, [r5] + adds r4, 0x2 + ldrh r0, [r4] + cmp r0, r7 + bne _081A4156 +_081A416A: + mov r0, r10 + ldrb r4, [r0] + cmp r4, 0 + bne _081A41A4 + ldr r4, =gStringVar1 + ldr r1, =gUnknown_085CCB82 + adds r0, r4, 0 + bl StringAppend + ldr r1, =gUnknown_085CCB88 + adds r0, r4, 0 + bl StringAppend + b _081A4202 + .pool +_081A41A4: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _081A41C0 + ldr r0, =gStringVar1 + ldr r1, =gUnknown_085CCB84 + bl StringAppend + b _081A41C8 + .pool +_081A41C0: + ldr r0, =gStringVar1 + ldr r1, =gUnknown_085CCB82 + bl StringAppend +_081A41C8: + ldr r0, =gStringVar1 + ldr r1, =gUnknown_085CCB8C + bl StringAppend + b _081A4202 + .pool +_081A41E0: + ldr r1, =gSpecialVar_0x8004 + movs r0, 0 + strh r0, [r1] + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r0, =gScriptResult + ldrb r0, [r0] + ldr r1, =0x00000ca9 + adds r2, r1 + movs r1, 0x3 + ands r1, r0 + ldrb r3, [r2] + movs r0, 0x4 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] +_081A4202: + add sp, 0x34 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A3FD4 + + thumb_func_start sub_81A4224 +sub_81A4224: @ 81A4224 + push {lr} + bl sub_81652B4 + pop {r0} + bx r0 + thumb_func_end sub_81A4224 + + thumb_func_start sub_81A4230 +sub_81A4230: @ 81A4230 + push {r4-r7,lr} + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r4, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x6 + bls _081A425A + b _081A4394 +_081A425A: + lsls r0, 2 + ldr r1, =_081A4278 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A4278: + .4byte _081A4294 + .4byte _081A42DC + .4byte _081A431C + .4byte _081A4338 + .4byte _081A434C + .4byte _081A4368 + .4byte _081A437C +_081A4294: + ldr r7, =gSaveBlock2Ptr + ldr r0, [r7] + lsls r4, 1 + lsls r1, r5, 2 + adds r1, r4, r1 + movs r6, 0xCE + lsls r6, 4 + adds r3, r0, r6 + adds r2, r3, r1 + ldrh r1, [r2] + ldr r0, =0x0000270e + cmp r1, r0 + bhi _081A4394 + adds r0, r1, 0x1 + strh r0, [r2] + cmp r5, 0 + bne _081A4394 + adds r0, r3, r4 + ldrh r1, [r0] + movs r0, 0x20 + bl sav12_xor_set + ldr r1, [r7] + adds r0, r1, r6 + adds r0, r4 + ldrh r0, [r0] + ldr r2, =0x00000d02 + adds r1, r2 + b _081A4392 + .pool +_081A42DC: + ldr r6, =gSaveBlock2Ptr + ldr r0, [r6] + lsls r2, r4, 1 + lsls r1, r5, 2 + adds r1, r2, r1 + ldr r3, =0x00000d0c + adds r0, r3 + adds r3, r0, r1 + ldrh r0, [r3] + ldr r2, =0x0000270e + cmp r0, r2 + bhi _081A42F8 + adds r0, 0x1 + strh r0, [r3] +_081A42F8: + ldr r0, [r6] + ldr r3, =0x00000d1c + adds r0, r3 + adds r1, r0, r1 + ldrh r0, [r1] + cmp r0, r2 + bhi _081A4394 + adds r0, 0x1 + b _081A4392 + .pool +_081A431C: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + lsls r0, r4, 1 + lsls r1, r5, 2 + adds r0, r1 + ldr r1, =0x00000dc8 + adds r2, r1 + adds r1, r2, r0 + b _081A4388 + .pool +_081A4338: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000dda + adds r0, r2 + b _081A4386 + .pool +_081A434C: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + lsls r0, r4, 1 + lsls r1, r5, 2 + adds r0, r1 + ldr r3, =0x00000de2 + adds r2, r3 + adds r1, r2, r0 + b _081A4388 + .pool +_081A4368: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000e04 + adds r0, r2 + b _081A4386 + .pool +_081A437C: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + ldr r3, =0x00000e1a + adds r0, r3 +_081A4386: + adds r1, r0, r1 +_081A4388: + ldrh r3, [r1] + ldr r0, =0x0000270e + cmp r3, r0 + bhi _081A4394 + adds r0, r3, 0x1 +_081A4392: + strh r0, [r1] +_081A4394: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A4230 + + thumb_func_start sub_81A43A8 +sub_81A43A8: @ 81A43A8 + push {r4-r6,lr} + sub sp, 0x4 + movs r4, 0 + ldr r6, =gSaveBlock1Ptr + movs r5, 0x64 +_081A43B2: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000caa + adds r0, r2 + adds r1, r0, r1 + ldrh r0, [r1] + cmp r0, 0 + beq _081A43EE + adds r1, r0, 0 + muls r1, r5 + movs r0, 0xEA + lsls r0, 1 + adds r1, r0 + ldr r0, [r6] + adds r0, r1 + movs r1, 0xC + movs r2, 0 + bl GetMonData + mov r1, sp + strh r0, [r1] + adds r0, r4, 0 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xC + mov r2, sp + bl SetMonData +_081A43EE: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _081A43B2 + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A43A8 + + thumb_func_start sub_81A4410 +sub_81A4410: @ 81A4410 + push {r4,lr} + ldr r4, =gScriptResult + bl sub_8185338 + strh r0, [r4] + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x8 + orrs r0, r2 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A4410 + + thumb_func_start sub_81A443C +sub_81A443C: @ 81A443C + push {lr} + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0 + beq _081A4450 + cmp r0, 0x1 + beq _081A4464 + b _081A446E + .pool +_081A4450: + ldr r0, =gStringVar1 + ldr r1, =gTrainerBattleOpponent_A + ldrh r1, [r1] + bl GetFrontierTrainerName + b _081A446E + .pool +_081A4464: + ldr r0, =gStringVar2 + ldr r1, =gTrainerBattleOpponent_A + ldrh r1, [r1] + bl GetFrontierTrainerName +_081A446E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A443C + + thumb_func_start sub_81A447C +sub_81A447C: @ 81A447C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + movs r0, 0 + str r0, [sp] +_081A448C: + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r2, [sp] + lsls r1, r2, 1 + ldr r4, =0x00000caa + adds r0, r4 + adds r0, r1 + ldrh r0, [r0] + subs r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r9, r1 + adds r2, 0x1 + str r2, [sp, 0x4] + cmp r0, 0x5 + bhi _081A454E + movs r6, 0 + ldr r0, [sp] + movs r2, 0x64 + adds r1, r0, 0 + muls r1, r2 + ldr r0, =gPlayerParty + adds r7, r1, r0 +_081A44BA: + movs r5, 0 + movs r4, 0xD + adds r4, r6 + mov r8, r4 + adds r0, r6, 0x1 + mov r10, r0 +_081A44C6: + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r2, =0x00000caa + adds r0, r2 + add r0, r9 + ldrh r0, [r0] + movs r4, 0x64 + adds r1, r0, 0 + muls r1, r4 + movs r0, 0xEA + lsls r0, 1 + adds r1, r0 + ldr r2, =gSaveBlock1Ptr + ldr r0, [r2] + adds r0, r1 + adds r1, r5, 0 + adds r1, 0xD + movs r2, 0 + bl GetMonData + adds r4, r0, 0 + adds r0, r7, 0 + mov r1, r8 + movs r2, 0 + bl GetMonData + cmp r4, r0 + beq _081A4508 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _081A44C6 +_081A4508: + cmp r5, 0x4 + bne _081A4516 + adds r0, r7, 0 + movs r1, 0xA6 + adds r2, r6, 0 + bl SetMonMoveSlot +_081A4516: + mov r4, r10 + lsls r0, r4, 24 + lsrs r6, r0, 24 + cmp r6, 0x3 + bls _081A44BA + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =gSaveBlock2Ptr + ldr r1, [r2] + ldr r4, =0x00000caa + adds r1, r4 + add r1, r9 + ldrh r1, [r1] + subs r1, 0x1 + movs r3, 0x64 + muls r1, r3 + adds r0, r1 + movs r1, 0x8E + lsls r1, 2 + adds r0, r1 + ldr r2, =gPlayerParty + ldr r4, [sp] + adds r1, r4, 0 + muls r1, r3 + adds r1, r2 + movs r2, 0x64 + bl memcpy +_081A454E: + ldr r1, [sp, 0x4] + lsls r0, r1, 24 + lsrs r0, 24 + str r0, [sp] + cmp r0, 0x3 + bls _081A448C + 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_81A447C + + thumb_func_start sub_81A457C +sub_81A457C: @ 81A457C + push {lr} + ldr r0, =0x000040cf + bl VarGet + lsls r0, 24 + lsrs r0, 24 + bl sub_81A5030 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A457C + + thumb_func_start sub_81A4594 +sub_81A4594: @ 81A4594 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + mov r8, r1 + adds r6, r3, 0 + ldr r1, =gUnknown_0203AB74 + ldrb r5, [r1] + lsls r4, r0, 1 + adds r4, r0 + ldr r1, =gUnknown_085EE424 + adds r4, r1 + mov r1, r8 + lsls r3, r1, 27 + lsrs r3, 24 + lsls r1, r0, 2 + adds r1, r0 + adds r2, r1 + lsls r2, 3 + adds r2, 0x1 + lsls r2, 24 + lsrs r7, r2, 24 + str r7, [sp] + movs r0, 0xFF + mov r10, r0 + str r0, [sp, 0x4] + movs r1, 0 + mov r9, r1 + str r1, [sp, 0x8] + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl PrintTextOnWindow + movs r0, 0xFF + strb r0, [r6, 0xD] + ldrh r0, [r6, 0x4] + cmp r0, 0 + beq _081A465C + adds r1, r6, 0x6 + ldrb r2, [r6, 0xE] + add r0, sp, 0xC + bl sub_81DB5E8 + ldr r1, =gUnknown_0203AB74 + ldrb r0, [r1] + mov r3, r8 + adds r3, 0x2 + lsls r3, 27 + lsrs r3, 24 + str r7, [sp] + mov r1, r10 + str r1, [sp, 0x4] + mov r1, r9 + str r1, [sp, 0x8] + movs r1, 0x1 + add r2, sp, 0xC + bl PrintTextOnWindow + ldrh r1, [r6, 0x4] + ldr r0, =0x0000270f + cmp r1, r0 + bls _081A4618 + adds r1, r0, 0 +_081A4618: + ldr r0, =gStringVar2 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalStringN + ldr r5, =gStringVar4 + ldr r1, =gUnknown_08611D08 + ldr r0, [sp, 0x4C] + lsls r0, 2 + adds r0, r1 + ldr r4, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xC8 + bl GetStringRightAlignXOffset + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + ldr r1, =gUnknown_0203AB74 + ldrb r0, [r1] + str r7, [sp] + mov r1, r10 + str r1, [sp, 0x4] + mov r1, r9 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + bl PrintTextOnWindow +_081A465C: + add sp, 0x2C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A4594 + + thumb_func_start sub_81A4684 +sub_81A4684: @ 81A4684 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + adds r6, r0, 0 + adds r7, r1, 0 + mov r10, r2 + adds r5, r3, 0 + ldr r1, =gUnknown_0203AB74 + ldrb r0, [r1] + lsls r2, r6, 1 + adds r2, r6 + ldr r1, =gUnknown_085EE424 + adds r2, r1 + lsls r3, r7, 27 + lsrs r3, 24 + mov r12, r3 + lsls r1, r6, 2 + adds r1, r6 + mov r3, r10 + adds r4, r3, r1 + lsls r1, r4, 3 + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + movs r1, 0xFF + mov r9, r1 + str r1, [sp, 0x4] + movs r3, 0 + mov r8, r3 + str r3, [sp, 0x8] + movs r1, 0x1 + mov r3, r12 + bl PrintTextOnWindow + ldrh r0, [r5, 0x8] + cmp r0, 0 + beq _081A47BC + movs r0, 0xFF + strb r0, [r5, 0x11] + movs r0, 0x1 + negs r0, r0 + strb r0, [r5, 0x19] + adds r1, r5, 0 + adds r1, 0xA + ldrb r2, [r5, 0x1A] + add r0, sp, 0xC + bl sub_81DB5E8 + ldr r1, =gUnknown_0203AB74 + ldrb r0, [r1] + adds r3, r7, 0x2 + lsls r3, 27 + lsrs r3, 24 + subs r1, r4, 0x1 + lsls r1, 3 + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + mov r2, r9 + str r2, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + add r2, sp, 0xC + bl PrintTextOnWindow + adds r4, r5, 0 + adds r4, 0x12 + adds r0, r4, 0 + bl sub_8009228 + cmp r0, 0 + beq _081A4734 + add r0, sp, 0xC + adds r1, r4, 0 + movs r2, 0x1 + bl sub_81DB5E8 + b _081A473C + .pool +_081A4734: + add r0, sp, 0xC + adds r1, r4, 0 + bl StringCopy +_081A473C: + ldr r2, =gUnknown_0203AB74 + mov r9, r2 + ldrb r0, [r2] + adds r3, r7, 0x4 + lsls r3, 27 + lsrs r3, 24 + lsls r1, r6, 2 + adds r1, r6 + mov r2, r10 + adds r6, r2, r1 + adds r1, r6, 0x1 + lsls r1, 3 + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + movs r1, 0xFF + mov r8, r1 + str r1, [sp, 0x4] + movs r7, 0 + str r7, [sp, 0x8] + movs r1, 0x1 + add r2, sp, 0xC + bl PrintTextOnWindow + ldrh r1, [r5, 0x8] + ldr r0, =0x0000270f + cmp r1, r0 + bls _081A4778 + adds r1, r0, 0 +_081A4778: + ldr r0, =gStringVar2 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalStringN + ldr r5, =gStringVar4 + ldr r0, =gUnknown_08611D08 + ldr r4, [r0, 0x24] + adds r0, r5, 0 + adds r1, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xC8 + bl GetStringRightAlignXOffset + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + mov r2, r9 + ldrb r0, [r2] + lsls r1, r6, 3 + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + mov r1, r8 + str r1, [sp, 0x4] + str r7, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + bl PrintTextOnWindow +_081A47BC: + add sp, 0x2C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A4684 + + thumb_func_start sub_81A47E0 +sub_81A47E0: @ 81A47E0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x44 + mov r9, r0 + mov r10, r1 + str r2, [sp, 0x40] + movs r0, 0xAC + lsls r0, 1 + bl AllocZeroed + mov r8, r0 + bl sub_80E8260 + add r0, sp, 0x30 + mov r12, r0 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r3, [sp, 0x40] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 4 + mov r4, r10 + lsls r0, r4, 1 + add r0, r10 + lsls r0, 5 + adds r1, r0 + adds r4, r1, r2 + mov r3, sp + movs r2, 0x2 +_081A4820: + adds r0, r3, 0 + movs r5, 0x87 + lsls r5, 2 + adds r1, r4, r5 + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldr r1, [r1] + str r1, [r0] + adds r4, 0x10 + adds r3, 0x10 + subs r2, 0x1 + cmp r2, 0 + bge _081A4820 + ldr r6, [sp, 0x40] + lsls r0, r6, 4 + mov r7, r10 + lsls r1, r7, 5 + adds r0, r1 + mov r1, r12 + add r0, r8 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r0, [r0] + str r0, [r1] + movs r2, 0 +_081A4852: + movs r1, 0 + movs r4, 0 + movs r3, 0 + lsls r5, r2, 4 + adds r6, r2, 0x1 + mov r2, sp +_081A485E: + ldrh r0, [r2, 0x4] + cmp r0, r1 + ble _081A4868 + adds r4, r3, 0 + adds r1, r0, 0 +_081A4868: + adds r2, 0x10 + adds r3, 0x1 + cmp r3, 0x3 + ble _081A485E + mov r0, sp + ldrh r0, [r0, 0x34] + cmp r0, r1 + blt _081A487A + movs r4, 0x3 +_081A487A: + lsls r0, r4, 4 + mov r7, sp + adds r2, r7, r0 + mov r0, r9 + adds r1, r5, r0 + adds r0, r2, 0 + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldr r0, [r0] + str r0, [r1] + movs r0, 0 + strh r0, [r2, 0x4] + adds r2, r6, 0 + cmp r2, 0x2 + ble _081A4852 + mov r0, r8 + bl Free + add sp, 0x44 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A47E0 + + thumb_func_start sub_81A48B4 +sub_81A48B4: @ 81A48B4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x74 + mov r9, r0 + mov r10, r1 + movs r0, 0xAC + lsls r0, 1 + bl AllocZeroed + mov r8, r0 + bl sub_80E8260 + mov r0, sp + adds r0, 0x54 + str r0, [sp, 0x70] + add r1, sp, 0x5C + mov r12, r1 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + movs r0, 0x54 + mov r2, r10 + muls r2, r0 + adds r0, r2, 0 + adds r3, r0, r1 + mov r2, sp + movs r4, 0x2 +_081A48EE: + adds r0, r2, 0 + ldr r5, =0x0000057c + adds r1, r3, r5 + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldr r1, [r1] + str r1, [r0] + adds r3, 0x1C + adds r2, 0x1C + subs r4, 0x1 + cmp r4, 0 + bge _081A48EE + mov r6, r10 + lsls r0, r6, 3 + subs r0, r6 + lsls r0, 2 + add r0, r8 + ldr r1, [sp, 0x70] + movs r7, 0x90 + lsls r7, 1 + adds r0, r7 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldr r0, [r0] + str r0, [r1] + movs r4, 0 +_081A492A: + movs r1, 0 + movs r5, 0 + movs r3, 0 + lsls r6, r4, 3 + adds r7, r4, 0x1 + mov r2, sp +_081A4936: + ldrh r0, [r2, 0x8] + cmp r0, r1 + ble _081A4940 + adds r5, r3, 0 + adds r1, r0, 0 +_081A4940: + adds r2, 0x1C + adds r3, 0x1 + cmp r3, 0x2 + ble _081A4936 + mov r2, r12 + ldrh r0, [r2] + cmp r0, r1 + blt _081A4952 + movs r5, 0x3 +_081A4952: + subs r1, r6, r4 + lsls r1, 2 + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + mov r3, sp + adds r2, r3, r0 + add r1, r9 + adds r0, r2, 0 + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldr r0, [r0] + str r0, [r1] + movs r0, 0 + strh r0, [r2, 0x8] + adds r4, r7, 0 + cmp r4, 0x2 + ble _081A492A + mov r0, r8 + bl Free + add sp, 0x74 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A48B4 + + thumb_func_start sub_81A4998 +sub_81A4998: @ 81A4998 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x94 + adds r7, r0, 0 + str r1, [sp, 0x90] + ldr r0, =gStringVar1 + ldr r4, =gUnknown_08611CB0 + lsls r5, r7, 3 + adds r1, r5, r4 + ldr r1, [r1] + bl StringCopy + ldr r6, =gStringVar4 + adds r4, 0x4 + adds r5, r4 + ldr r1, [r5] + adds r0, r6, 0 + bl StringExpandPlaceholders + ldr r0, =gUnknown_0203AB74 + mov r8, r0 + ldrb r0, [r0] + movs r1, 0x1 + mov r10, r1 + str r1, [sp] + movs r2, 0xFF + mov r9, r2 + str r2, [sp, 0x4] + movs r5, 0 + str r5, [sp, 0x8] + adds r2, r6, 0 + movs r3, 0 + bl PrintTextOnWindow + ldr r1, =gUnknown_08611D00 + ldr r2, [sp, 0x90] + lsls r0, r2, 2 + adds r0, r1 + ldr r4, [r0] + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xD0 + bl GetStringRightAlignXOffset + adds r3, r0, 0 + mov r1, r8 + ldrb r0, [r1] + lsls r3, 24 + lsrs r3, 24 + mov r2, r10 + str r2, [sp] + mov r1, r9 + str r1, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + bl PrintTextOnWindow + cmp r7, 0x9 + bne _081A4A6C + ldr r2, =gSaveBlock2Ptr + ldr r0, [r2] + ldr r1, =0x00000ee8 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldr r0, [r2] + movs r2, 0xEF + lsls r2, 4 + adds r0, r2 + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + add r4, sp, 0x3C + adds r0, r4, 0 + ldr r1, [sp, 0x90] + bl sub_81A48B4 +_081A4A3A: + adds r0, r5, 0 + movs r1, 0x1 + movs r2, 0x4 + adds r3, r4, 0 + bl sub_81A4684 + adds r4, 0x1C + adds r5, 0x1 + cmp r5, 0x2 + ble _081A4A3A + b _081A4A90 + .pool +_081A4A6C: + add r0, sp, 0xC + adds r1, r7, 0 + ldr r2, [sp, 0x90] + bl sub_81A47E0 + movs r5, 0 + add r4, sp, 0xC +_081A4A7A: + str r7, [sp] + adds r0, r5, 0 + movs r1, 0x1 + movs r2, 0x4 + adds r3, r4, 0 + bl sub_81A4594 + adds r4, 0x10 + adds r5, 0x1 + cmp r5, 0x2 + ble _081A4A7A +_081A4A90: + add sp, 0x94 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81A4998 + + thumb_func_start sub_81A4AA0 +sub_81A4AA0: @ 81A4AA0 + push {r4,lr} + ldr r4, =gUnknown_0203AB74 + ldr r0, =gUnknown_08611C84 + bl AddWindow + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + movs r1, 0 + bl sub_81A4998 + ldrb r0, [r4] + bl PutWindowTilemap + ldrb r0, [r4] + movs r1, 0x3 + bl CopyWindowToVram + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A4AA0 + + thumb_func_start sub_81A4AE8 +sub_81A4AE8: @ 81A4AE8 + push {r4,lr} + ldr r4, =gUnknown_0203AB74 + ldrb r0, [r4] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + movs r1, 0x1 + bl sub_81A4998 + ldrb r0, [r4] + movs r1, 0x2 + bl CopyWindowToVram + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A4AE8 + + thumb_func_start sub_81A4B14 +sub_81A4B14: @ 81A4B14 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + movs r1, 0 + ldr r3, =gSaveBlock2Ptr +_081A4B24: + movs r6, 0 + lsls r0, r1, 1 + adds r2, r1, 0x1 + mov r10, r2 + adds r0, r1 + lsls r0, 5 + mov r8, r0 + movs r7, 0 + movs r0, 0x87 + lsls r0, 2 + add r0, r8 + mov r9, r0 +_081A4B3C: + movs r5, 0 + adds r2, r7, 0 + mov r1, r8 + adds r4, r7, r1 +_081A4B44: + ldr r0, [r3] + add r0, r9 + adds r0, r2 + lsls r1, r5, 4 + adds r0, r1 + movs r1, 0 + str r2, [sp] + str r3, [sp, 0x4] + bl CopyUnalignedWord + ldr r3, [sp, 0x4] + ldr r0, [r3] + adds r0, r4 + ldr r1, =0x00000222 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldr r0, [r3] + adds r0, r4 + movs r1, 0x88 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + adds r4, 0x10 + adds r5, 0x1 + ldr r2, [sp] + cmp r5, 0x2 + ble _081A4B44 + adds r7, 0x30 + adds r6, 0x1 + cmp r6, 0x1 + ble _081A4B3C + mov r1, r10 + cmp r1, 0x8 + ble _081A4B24 + movs r6, 0 + ldr r7, =gSaveBlock2Ptr + movs r2, 0x54 + mov r10, r2 + movs r3, 0xFF + mov r9, r3 +_081A4B98: + adds r0, r6, 0x1 + mov r8, r0 + mov r1, r10 + muls r1, r6 + movs r0, 0x54 + adds r4, r6, 0 + muls r4, r0 + movs r2, 0 + ldr r3, =0x0000057c + adds r6, r1, r3 + movs r5, 0x2 +_081A4BAE: + ldr r0, [r7] + adds r0, r6 + adds r0, r2 + movs r1, 0 + str r2, [sp] + bl CopyUnalignedWord + ldr r0, [r7] + adds r0, r6 + ldr r2, [sp] + adds r0, r2 + adds r0, 0x4 + movs r1, 0 + bl CopyUnalignedWord + ldr r1, [r7] + adds r1, r4 + ldr r0, =0x00000586 + adds r1, r0 + ldrb r0, [r1] + mov r3, r9 + orrs r0, r3 + strb r0, [r1] + ldr r1, [r7] + adds r1, r4 + ldr r0, =0x0000058e + adds r1, r0 + ldrb r0, [r1] + orrs r0, r3 + strb r0, [r1] + ldr r0, [r7] + adds r0, r4 + ldr r1, =0x00000584 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + adds r4, 0x1C + ldr r2, [sp] + adds r2, 0x1C + subs r5, 0x1 + cmp r5, 0 + bge _081A4BAE + mov r6, r8 + cmp r6, 0x1 + ble _081A4B98 + 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_81A4B14 + + thumb_func_start sub_81A4C30 +sub_81A4C30: @ 81A4C30 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r0, 0x96 + lsls r0, 2 + bl AllocZeroed + adds r7, r0, 0 + adds r4, r7, 0 + movs r5, 0 + movs r0, 0xFA + lsls r0, 1 + adds r6, r7, r0 + ldr r0, =gPlayerParty + mov r8, r0 +_081A4C4E: + mov r0, r8 + adds r1, r5, r0 + adds r0, r4, 0 + movs r2, 0x64 + bl memcpy + adds r4, 0x64 + adds r5, 0x64 + cmp r4, r6 + ble _081A4C4E + ldr r4, =gPlayerPartyCount + ldrb r5, [r4] + bl copy_player_party_from_sav1 + bl sub_8076D5C + movs r0, 0x1 + bl TrySavingData + bl sav2_gender2_inplace_and_xFE + strb r5, [r4] + adds r4, r7, 0 + ldr r5, =gPlayerParty + movs r0, 0xFA + lsls r0, 1 + adds r6, r7, r0 +_081A4C84: + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x64 + bl memcpy + adds r4, 0x64 + adds r5, 0x64 + cmp r4, r6 + ble _081A4C84 + adds r0, r7, 0 + bl Free + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A4C30 + + thumb_func_start sub_81A4CB0 +sub_81A4CB0: @ 81A4CB0 + push {lr} + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _081A4CD0 + bl sub_8185EA0 + lsls r0, 24 + lsrs r0, 24 + b _081A4CDA + .pool +_081A4CD0: + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r0, 16 +_081A4CDA: + ldr r2, =gTrainers + ldr r1, =gUnknown_08611D30 + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x3] + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A4CB0 + + thumb_func_start sub_81A4D00 +sub_81A4D00: @ 81A4D00 + push {lr} + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _081A4D20 + bl sub_8185EA0 + lsls r0, 24 + lsrs r0, 24 + b _081A4D2A + .pool +_081A4D20: + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r0, 16 +_081A4D2A: + ldr r2, =gTrainers + ldr r1, =gUnknown_08611D30 + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x1] + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A4D00 + + thumb_func_start sub_81A4D50 +sub_81A4D50: @ 81A4D50 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _081A4D70 + bl sub_8185EA0 + lsls r0, 24 + lsrs r0, 24 + b _081A4D7A + .pool +_081A4D70: + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r0, 16 +_081A4D7A: + movs r3, 0 + lsls r0, 1 + ldr r2, =gTrainers + ldr r1, =gUnknown_08611D30 + adds r0, r1 + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r2, 0x4 + adds r2, r0, r2 +_081A4D90: + adds r1, r4, r3 + ldrb r0, [r2] + strb r0, [r1] + adds r2, 0x1 + adds r3, 0x1 + cmp r3, 0x6 + ble _081A4D90 + adds r1, r4, r3 + movs r0, 0xFF + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A4D50 + + thumb_func_start sub_81A4DB8 +sub_81A4DB8: @ 81A4DB8 + push {lr} + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + ldr r1, =gUnknown_08611C8C + lsrs r0, 15 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A4DB8 + + thumb_func_start sub_81A4DD8 +sub_81A4DD8: @ 81A4DD8 + push {lr} + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + ldr r2, =0x00004010 + ldr r1, =gUnknown_08611C8C + lsrs r0, 15 + adds r0, r1 + ldrb r1, [r0] + adds r0, r2, 0 + bl VarSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A4DD8 + + thumb_func_start sub_81A4E04 +sub_81A4E04: @ 81A4E04 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x44 + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x20] + bl sub_81A513C + str r0, [sp, 0x24] + ldr r0, [sp, 0x20] + cmp r0, 0x1 + bne _081A4E44 + ldr r0, =0x000003fe + bl sub_81953A0 + lsls r0, 16 + lsrs r0, 16 + bl sub_818FC78 + adds r4, r0, 0 + b _081A4E46 + .pool +_081A4E44: + movs r4, 0x7 +_081A4E46: + bl ZeroEnemyPartyMons + movs r1, 0 + str r1, [sp, 0x18] + bl sub_8165C40 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x1C] + movs r2, 0 + str r2, [sp, 0x14] +_081A4E5C: + movs r0, 0x1 + ands r0, r4 + asrs r4, 1 + str r4, [sp, 0x30] + ldr r3, [sp, 0x14] + adds r3, 0x1 + str r3, [sp, 0x28] + cmp r0, 0 + bne _081A4E70 + b _081A4FC4 +_081A4E70: + ldr r4, [sp, 0x14] + lsls r4, 2 + mov r9, r4 + ldr r0, [sp, 0x24] + lsls r0, 4 + str r0, [sp, 0x38] + ldr r1, [sp, 0x20] + lsls r1, 4 + str r1, [sp, 0x34] + ldr r2, [sp, 0x1C] + lsls r2, 24 + str r2, [sp, 0x3C] + ldr r3, [sp, 0x18] + adds r3, 0x1 + str r3, [sp, 0x2C] + ldr r0, [sp, 0x14] + add r0, r9 + lsls r0, 2 + mov r8, r0 +_081A4E96: + bl Random + adds r4, r0, 0 + bl Random + lsls r4, 16 + lsrs r7, r4, 16 + lsls r0, 16 + orrs r7, r0 + ldr r0, =0x0000ef2a + adds r1, r7, 0 + bl IsShinyOtIdPersonality + lsls r0, 24 + cmp r0, 0 + bne _081A4E96 + ldr r4, [sp, 0x38] + ldr r1, [sp, 0x24] + subs r0, r4, r1 + lsls r5, r0, 2 + mov r2, r8 + adds r4, r2, r5 + ldr r3, [sp, 0x34] + ldr r1, [sp, 0x20] + subs r0, r3, r1 + lsls r6, r0, 3 + adds r4, r6 + ldr r2, =gUnknown_0861156C + adds r4, r2 + adds r0, r7, 0 + bl GetNatureFromPersonality + ldrb r1, [r4, 0x5] + lsls r0, 24 + lsrs r0, 24 + cmp r1, r0 + bne _081A4E96 + ldr r4, [sp, 0x18] + movs r0, 0x64 + adds r3, r4, 0 + muls r3, r0 + mov r8, r3 + ldr r1, =gEnemyParty + add r1, r8 + mov r10, r1 + ldr r4, [sp, 0x14] + add r4, r9 + lsls r4, 2 + adds r0, r4, r5 + adds r0, r6 + ldr r2, =gUnknown_0861156C + adds r0, r2 + ldrh r1, [r0] + ldr r3, [sp, 0x3C] + lsrs r2, r3, 24 + ldrb r3, [r0, 0x4] + movs r0, 0x1 + str r0, [sp] + str r7, [sp, 0x4] + str r0, [sp, 0x8] + ldr r0, =0x0000ef2a + str r0, [sp, 0xC] + mov r0, r10 + bl CreateMon + ldr r0, =gUnknown_0861156C + adds r5, r0 + adds r5, r6, r5 + adds r4, r5, r4 + adds r4, 0x2 + mov r0, r10 + movs r1, 0xC + adds r2, r4, 0 + bl SetMonData + movs r7, 0 + mov r6, r8 + ldr r3, =gEnemyParty +_081A4F32: + adds r1, r7, 0 + adds r1, 0x1A + ldr r0, [sp, 0x14] + add r0, r9 + lsls r4, r0, 2 + adds r2, r5, r4 + adds r0, r7, 0x6 + adds r2, r0 + adds r0, r6, r3 + str r3, [sp, 0x40] + bl SetMonData + adds r7, 0x1 + ldr r3, [sp, 0x40] + cmp r7, 0x5 + ble _081A4F32 + movs r1, 0xFF + add r0, sp, 0x10 + strb r1, [r0] + movs r7, 0 + ldr r1, [sp, 0x18] + movs r2, 0x64 + adds r6, r1, 0 + muls r6, r2 + ldr r3, =gUnknown_08611578 + mov r8, r3 + ldr r3, =gEnemyParty + adds r5, r4, 0 +_081A4F6A: + ldr r4, [sp, 0x38] + ldr r0, [sp, 0x24] + subs r1, r4, r0 + lsls r1, 2 + adds r1, r5, r1 + ldr r2, [sp, 0x34] + ldr r4, [sp, 0x20] + subs r0, r2, r4 + lsls r0, 3 + adds r1, r0 + add r1, r8 + ldrh r4, [r1] + lsls r2, r7, 24 + lsrs r2, 24 + adds r0, r6, r3 + adds r1, r4, 0 + str r3, [sp, 0x40] + bl SetMonMoveSlot + ldr r3, [sp, 0x40] + cmp r4, 0xDA + bne _081A4F9C + movs r1, 0 + add r0, sp, 0x10 + strb r1, [r0] +_081A4F9C: + adds r5, 0x2 + adds r7, 0x1 + cmp r7, 0x3 + ble _081A4F6A + ldr r0, [sp, 0x18] + movs r1, 0x64 + adds r4, r0, 0 + muls r4, r1 + ldr r0, =gEnemyParty + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x20 + add r2, sp, 0x10 + bl SetMonData + adds r0, r4, 0 + bl CalculateMonStats + ldr r2, [sp, 0x2C] + str r2, [sp, 0x18] +_081A4FC4: + ldr r4, [sp, 0x30] + ldr r3, [sp, 0x28] + str r3, [sp, 0x14] + cmp r3, 0x2 + bgt _081A4FD0 + b _081A4E5C +_081A4FD0: + add sp, 0x44 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A4E04 + + thumb_func_start sub_81A4FF0 +sub_81A4FF0: @ 81A4FF0 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x000040cf + bl VarGet + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + bl sub_81A513C + ldr r3, =gUnknown_0861156C + lsls r2, r4, 2 + adds r2, r4 + lsls r1, r0, 4 + subs r1, r0 + adds r1, r2 + lsls r1, 2 + lsls r0, r5, 4 + subs r0, r5 + lsls r0, 3 + adds r1, r0 + adds r1, r3 + ldrh r0, [r1] + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A4FF0 + + thumb_func_start sub_81A5030 +sub_81A5030: @ 81A5030 + push {lr} + lsls r0, 24 + ldr r2, =gTrainerBattleOpponent_A + ldr r3, =0x000003fe + adds r1, r3, 0 + strh r1, [r2] + ldr r2, =0x00004010 + ldr r1, =gUnknown_08611C8C + lsrs r0, 23 + adds r0, r1 + ldrb r1, [r0] + adds r0, r2, 0 + bl VarSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5030 + + thumb_func_start sub_81A5060 +sub_81A5060: @ 81A5060 + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + lsls r6, 24 + lsrs r6, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x000040cf + bl VarGet + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + bl sub_81A513C + ldr r2, =gUnknown_0861156C + lsls r4, 1 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 2 + adds r4, r1 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 2 + adds r4, r1 + lsls r0, r5, 4 + subs r0, r5 + lsls r0, 3 + adds r4, r0 + adds r2, 0xC + adds r4, r2 + ldrh r0, [r4] + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A5060 + + thumb_func_start sub_81A50B0 +sub_81A50B0: @ 81A50B0 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x000040cf + bl VarGet + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + bl sub_81A513C + ldr r3, =gUnknown_0861156C + lsls r2, r4, 2 + adds r2, r4 + lsls r1, r0, 4 + subs r1, r0 + adds r1, r2 + lsls r1, 2 + lsls r0, r5, 4 + subs r0, r5 + lsls r0, 3 + adds r1, r0 + adds r1, r3 + ldrb r0, [r1, 0x5] + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A50B0 + + thumb_func_start sub_81A50F0 +sub_81A50F0: @ 81A50F0 + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + lsls r6, 24 + lsrs r6, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x000040cf + bl VarGet + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + bl sub_81A513C + ldr r2, =gUnknown_0861156C + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 2 + adds r4, r1 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 2 + adds r4, r1 + lsls r0, r5, 4 + subs r0, r5 + lsls r0, 3 + adds r4, r0 + adds r2, 0x6 + adds r4, r2 + ldrb r0, [r4] + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A50F0 + + thumb_func_start sub_81A513C +sub_81A513C: @ 81A513C + push {r4,r5,lr} + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r5, r0, 16 + lsls r0, r5, 24 + lsrs r0, 24 + bl sub_81A3B30 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bne _081A51A0 + bl sub_81A39C4 + lsls r0, 16 + ldr r3, =gUnknown_08611550 + lsls r2, r5, 2 + adds r1, r3, 0x3 + adds r1, r2, r1 + lsrs r0, 16 + ldrb r1, [r1] + adds r1, r0, r1 + adds r0, r2, r3 + ldrb r0, [r0] + cmp r1, r0 + bne _081A5180 + movs r4, 0 + b _081A51A0 + .pool +_081A5180: + adds r0, r3, 0x1 + adds r0, r2, r0 + ldrb r0, [r0] + cmp r1, r0 + beq _081A519E + cmp r1, r0 + ble _081A51A0 + subs r0, r1, r0 + adds r1, r3, 0x2 + adds r1, r2, r1 + ldrb r1, [r1] + bl __modsi3 + cmp r0, 0 + bne _081A51A0 +_081A519E: + movs r4, 0x1 +_081A51A0: + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81A513C + + thumb_func_start sub_81A51A8 +sub_81A51A8: @ 81A51A8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _081A51D4 + bl sub_8185EA0 + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8185EAC + lsls r0, 24 + lsrs r1, r0, 24 + b _081A51E4 + .pool +_081A51D4: + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r4, r0, 16 + bl sub_81A513C + adds r1, r0, 0 +_081A51E4: + cmp r5, 0 + beq _081A51F4 + cmp r5, 0x1 + beq _081A5214 + b _081A5228 + .pool +_081A51F4: + ldr r0, =gStringVar4 + ldr r2, =gUnknown_08611DB0 + lsls r1, 2 + adds r1, r2 + ldr r2, [r1] + lsls r1, r4, 2 + adds r1, r2 + ldr r1, [r1] + bl StringCopy + b _081A5228 + .pool +_081A5214: + ldr r0, =gStringVar4 + ldr r2, =gUnknown_08611DB8 + lsls r1, 2 + adds r1, r2 + ldr r2, [r1] + lsls r1, r4, 2 + adds r1, r2 + ldr r1, [r1] + bl StringCopy +_081A5228: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A51A8 + + thumb_func_start sub_81A5238 +sub_81A5238: @ 81A5238 + push {lr} + ldr r1, =gUnknown_08611F84 + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5238 + + thumb_func_start sub_81A5258 +sub_81A5258: @ 81A5258 + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + movs r6, 0 + ldrb r0, [r5] + cmp r0, 0xA + bls _081A5268 + b _081A5544 +_081A5268: + lsls r0, 2 + ldr r1, =_081A5278 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A5278: + .4byte _081A52A4 + .4byte _081A52F4 + .4byte _081A531C + .4byte _081A53B4 + .4byte _081A540C + .4byte _081A542C + .4byte _081A544C + .4byte _081A5490 + .4byte _081A553E + .4byte _081A54D4 + .4byte _081A5520 +_081A52A4: + ldr r0, =0x7fffff1c + movs r1, 0 + str r1, [sp] + movs r1, 0x4 + movs r2, 0 + movs r3, 0x8 + bl BeginNormalPaletteFade + ldr r1, =0x00003f3e + movs r0, 0x48 + bl SetGpuReg + ldr r0, =gUnknown_08611F74 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_08D855E8 + movs r1, 0xF8 + lsls r1, 1 + movs r2, 0x20 + bl LoadCompressedPalette + ldr r1, =gUnknown_02022E24 + movs r0, 0xFF + strh r0, [r1] + ldr r1, =gUnknown_02022E26 + movs r0, 0x70 + strh r0, [r1] + b _081A553E + .pool +_081A52F4: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _081A5306 + b _081A5544 +_081A5306: + str r0, [sp] + movs r0, 0x5 + movs r1, 0 + movs r2, 0x18 + movs r3, 0xD + bl sub_8056A3C + b _081A553E + .pool +_081A531C: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + beq _081A5328 + b _081A5544 +_081A5328: + ldr r1, =gBattleTextBuff1 + movs r2, 0xA1 + strb r2, [r1] + movs r0, 0xFF + strb r0, [r1, 0x1] + ldr r1, =gBattleTextBuff2 + strb r2, [r1] + movs r0, 0x1 + negs r0, r0 + strb r0, [r1, 0x1] + ldr r0, =gUnknown_085CCDB2 + bl StrCpyDecodeToDisplayedStringBattle + ldr r4, =gDisplayedStringBattle + adds r0, r4, 0 + movs r1, 0xF + bl battle_show_message_maybe + ldr r0, =gUnknown_085CCDB5 + movs r1, 0x10 + bl battle_show_message_maybe + ldr r0, =gUnknown_085CCDB8 + bl StrCpyDecodeToDisplayedStringBattle + adds r0, r4, 0 + movs r1, 0x11 + bl battle_show_message_maybe + ldr r0, =gUnknown_085CCDBB + movs r1, 0x12 + bl battle_show_message_maybe + ldr r0, =gUnknown_085CCDC0 + movs r1, 0x13 + bl battle_show_message_maybe + ldr r0, =gUnknown_085CCDC6 + movs r1, 0x14 + bl battle_show_message_maybe + ldr r0, =gUnknown_085CCDCB + bl StrCpyDecodeToDisplayedStringBattle + adds r0, r4, 0 + movs r1, 0x15 + bl battle_show_message_maybe + b _081A553E + .pool +_081A53B4: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + beq _081A53C0 + b _081A5544 +_081A53C0: + ldr r1, =0x00003f3f + movs r0, 0x48 + bl SetGpuReg + movs r6, 0x80 + lsls r6, 15 + movs r4, 0x7 +_081A53CE: + asrs r1, r6, 16 + ldr r0, =gUnknown_08611F5C + movs r2, 0x54 + movs r3, 0 + bl CreateSprite + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + movs r1, 0x3 + bl StartSpriteAnim + movs r0, 0x80 + lsls r0, 13 + adds r6, r0 + subs r4, 0x1 + cmp r4, 0 + bge _081A53CE + b _081A553C + .pool +_081A540C: + ldr r0, =0x00000109 + bl PlaySE + movs r0, 0x50 + movs r1, 0x28 + movs r2, 0 + movs r3, 0 + bl sub_81A5558 + movs r0, 0xA0 + movs r1, 0x28 + movs r2, 0 + b _081A5464 + .pool +_081A542C: + ldr r0, =0x00000109 + bl PlaySE + movs r0, 0x50 + movs r1, 0x38 + movs r2, 0x1 + movs r3, 0 + bl sub_81A5558 + movs r0, 0xA0 + movs r1, 0x38 + movs r2, 0x1 + b _081A5464 + .pool +_081A544C: + ldr r0, =0x00000109 + bl PlaySE + movs r0, 0x50 + movs r1, 0x48 + movs r2, 0x2 + movs r3, 0 + bl sub_81A5558 + movs r0, 0xA0 + movs r1, 0x48 + movs r2, 0x2 +_081A5464: + movs r3, 0x1 + bl sub_81A5558 + ldr r0, =gUnknown_085CCDCB + bl StrCpyDecodeToDisplayedStringBattle + ldr r0, =gDisplayedStringBattle + movs r1, 0x15 + bl battle_show_message_maybe + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + movs r6, 0x1 + b _081A5544 + .pool +_081A5490: + movs r0, 0x85 + lsls r0, 1 + bl PlaySE + ldr r0, =gBattleTextBuff1 + ldr r1, =gBattleTextBuff2 + ldrb r2, [r0] + ldrb r0, [r1] + cmp r2, r0 + bls _081A54BC + movs r6, 0x2 + ldr r1, =gBattleScripting + movs r0, 0 + strb r0, [r1, 0x17] + b _081A553E + .pool +_081A54BC: + cmp r2, r0 + bcs _081A54D0 + movs r6, 0x3 + ldr r1, =gBattleScripting + movs r0, 0x1 + strb r0, [r1, 0x17] + b _081A553E + .pool +_081A54D0: + movs r6, 0x4 + b _081A553E +_081A54D4: + ldr r1, =0x00003f3e + movs r0, 0x48 + bl SetGpuReg + movs r0, 0x1 + str r0, [sp] + movs r0, 0x5 + movs r1, 0 + movs r2, 0x18 + movs r3, 0xD + bl sub_8056A3C + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldr r0, =gMPlay_BGM + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl m4aMPlayVolumeControl + ldr r0, =0x7fffff1c + movs r1, 0 + str r1, [sp] + movs r1, 0x4 + movs r2, 0x8 + movs r3, 0 + bl BeginNormalPaletteFade + b _081A553E + .pool +_081A5520: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081A5544 + ldr r1, =0x00003f3f + movs r0, 0x48 + bl SetGpuReg + movs r0, 0xFA + lsls r0, 2 + bl FreeSpriteTilesByTag +_081A553C: + movs r6, 0x1 +_081A553E: + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] +_081A5544: + adds r0, r6, 0 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A5258 + + thumb_func_start sub_81A5558 +sub_81A5558: @ 81A5558 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + lsls r3, 24 + lsrs r7, r3, 24 + movs r6, 0 + movs r1, 0 + ldr r0, =gBattleStruct + ldr r0, [r0] + movs r3, 0xA6 + lsls r3, 2 + adds r4, r0, r3 + ldr r5, =0x0000029a + adds r3, r0, r5 + adds r5, 0x2 + adds r5, r0 + mov r8, r5 + cmp r2, 0x1 + beq _081A55C4 + cmp r2, 0x1 + bgt _081A55A8 + cmp r2, 0 + beq _081A55B0 + b _081A5612 + .pool +_081A55A8: + mov r0, r9 + cmp r0, 0x2 + beq _081A55D8 + b _081A5612 +_081A55B0: + adds r0, r4, r7 + movs r6, 0 + ldrsb r6, [r0, r6] + movs r1, 0x1 + adds r0, r7, 0 + eors r0, r1 + adds r0, r4, r0 + movs r1, 0 + ldrsb r1, [r0, r1] + b _081A5612 +_081A55C4: + adds r0, r3, r7 + movs r6, 0 + ldrsb r6, [r0, r6] + movs r1, 0x1 + adds r0, r7, 0 + eors r0, r1 + adds r0, r3, r0 + movs r1, 0 + ldrsb r1, [r0, r1] + b _081A5612 +_081A55D8: + ldr r3, =gBattleMons + mov r9, r3 + movs r5, 0x58 + adds r0, r7, 0 + muls r0, r5 + add r0, r9 + ldrh r0, [r0, 0x28] + movs r4, 0x64 + muls r0, r4 + lsls r1, r7, 1 + add r1, r8 + ldrh r1, [r1] + bl __divsi3 + adds r6, r0, 0 + movs r0, 0x1 + adds r1, r7, 0 + eors r1, r0 + adds r0, r1, 0 + muls r0, r5 + add r0, r9 + ldrh r0, [r0, 0x28] + muls r0, r4 + lsls r1, 1 + add r1, r8 + ldrh r1, [r1] + bl __divsi3 + adds r1, r0, 0 +_081A5612: + cmp r6, r1 + ble _081A5638 + movs r4, 0x2 + cmp r7, 0 + beq _081A5628 + ldr r1, =gBattleTextBuff2 + b _081A562A + .pool +_081A5628: + ldr r1, =gBattleTextBuff1 +_081A562A: + ldrb r0, [r1] + adds r0, 0x2 + strb r0, [r1] + b _081A565E + .pool +_081A5638: + cmp r6, r1 + bne _081A565C + movs r4, 0x1 + cmp r7, 0 + beq _081A564C + ldr r1, =gBattleTextBuff2 + b _081A564E + .pool +_081A564C: + ldr r1, =gBattleTextBuff1 +_081A564E: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _081A565E + .pool +_081A565C: + movs r4, 0 +_081A565E: + ldr r0, =gUnknown_08611F5C + ldr r1, [sp] + mov r2, r10 + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + adds r1, r4, 0 + bl StartSpriteAnim + 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_81A5558 + + thumb_func_start sub_81A5698 +sub_81A5698: @ 81A5698 + push {lr} + adds r1, r0, 0 + ldr r0, =gBattleCommunication + ldrb r0, [r0] + cmp r0, 0x8 + bls _081A56AA + adds r0, r1, 0 + bl DestroySprite +_081A56AA: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5698 + + thumb_func_start sub_81A56B4 +sub_81A56B4: @ 81A56B4 + ldr r0, =gBattleStruct + ldr r2, [r0] + movs r0, 0xA6 + lsls r0, 2 + adds r1, r2, r0 + adds r0, 0x2 + adds r3, r2, r0 + adds r0, 0x2 + adds r2, r0 + movs r0, 0 + strb r0, [r1] + strb r0, [r1, 0x1] + strb r0, [r3] + strb r0, [r3, 0x1] + ldr r0, =gBattleMons + ldrh r1, [r0, 0x28] + strh r1, [r2] + adds r0, 0x80 + ldrh r0, [r0] + strh r0, [r2, 0x2] + bx lr + .pool + thumb_func_end sub_81A56B4 + + thumb_func_start sub_81A56E8 +sub_81A56E8: @ 81A56E8 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gBattleStruct + ldr r1, [r1] + movs r2, 0xA6 + lsls r2, 2 + adds r1, r2 + adds r1, r0 + ldr r2, =gBattleArenaMoveMindRatings + ldr r0, =gCurrentMove + ldrh r0, [r0] + adds r0, r2 + ldrb r0, [r0] + ldrb r2, [r1] + adds r0, r2 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_81A56E8 + + thumb_func_start sub_81A5718 +sub_81A5718: @ 81A5718 + push {r4-r6,lr} + lsls r0, 24 + lsrs r3, r0, 24 + adds r6, r3, 0 + ldr r0, =gBattleStruct + ldr r2, [r0] + ldr r0, =0x0000029a + adds r5, r2, r0 + ldr r0, =gHitMarker + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 18 + ands r0, r1 + cmp r0, 0 + beq _081A57DA + ldr r0, =0x000002a2 + adds r4, r2, r0 + ldrb r2, [r4] + ldr r0, =gBitTable + lsls r1, r3, 2 + adds r1, r0 + ldr r1, [r1] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _081A576C + bics r2, r1 + strb r2, [r4] + adds r1, r5, r3 + ldrb r0, [r1] + subs r0, 0x2 + b _081A57D8 + .pool +_081A576C: + ldr r0, =gBattleMoveFlags + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _081A5798 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081A5788 + ldr r0, =gBattleCommunication + ldrb r0, [r0, 0x6] + cmp r0, 0x1 + beq _081A57DA +_081A5788: + adds r1, r5, r3 + ldrb r0, [r1] + subs r0, 0x2 + b _081A57D8 + .pool +_081A5798: + movs r0, 0x6 + ands r0, r1 + cmp r0, 0x6 + bne _081A57A4 + adds r1, r5, r3 + b _081A57D4 +_081A57A4: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081A57B4 + adds r1, r5, r3 + ldrb r0, [r1] + adds r0, 0x2 + b _081A57D8 +_081A57B4: + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _081A57C4 + adds r1, r5, r3 + ldrb r0, [r1] + subs r0, 0x1 + b _081A57D8 +_081A57C4: + ldr r0, =gProtectStructs + lsls r1, r6, 4 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 31 + cmp r0, 0 + bne _081A57DA + adds r1, r5, r6 +_081A57D4: + ldrb r0, [r1] + adds r0, 0x1 +_081A57D8: + strb r0, [r1] +_081A57DA: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5718 + + thumb_func_start sub_81A57E4 +sub_81A57E4: @ 81A57E4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 16 + lsrs r1, 16 + adds r2, r1, 0 + ldr r0, =gBattleStruct + ldr r0, [r0] + ldr r5, =0x0000029a + adds r3, r0, r5 + movs r0, 0x99 + lsls r0, 1 + cmp r1, r0 + bgt _081A582A + subs r0, 0x1 + cmp r1, r0 + bge _081A585C + cmp r1, 0xC5 + bgt _081A581C + cmp r1, 0xC3 + bge _081A585C + cmp r1, 0x77 + beq _081A585C + b _081A5864 + .pool +_081A581C: + cmp r1, 0xC7 + blt _081A5864 + cmp r1, 0xCC + ble _081A585C + cmp r1, 0xCE + beq _081A585C + b _081A5864 +_081A582A: + ldr r0, =0x00000147 + cmp r1, r0 + beq _081A585C + cmp r1, r0 + bgt _081A5848 + subs r0, 0x12 + cmp r1, r0 + beq _081A585C + adds r0, 0x2 + cmp r1, r0 + beq _081A585C + b _081A5864 + .pool +_081A5848: + movs r0, 0xAD + lsls r0, 1 + cmp r2, r0 + blt _081A5864 + adds r0, 0x1 + cmp r2, r0 + ble _081A585C + adds r0, 0x3 + cmp r2, r0 + bne _081A5864 +_081A585C: + adds r1, r3, r4 + ldrb r0, [r1] + subs r0, 0x3 + strb r0, [r1] +_081A5864: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81A57E4 + + thumb_func_start sub_81A586C +sub_81A586C: @ 81A586C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gBattleStruct + ldr r3, [r1] + movs r1, 0xA7 + lsls r1, 2 + adds r3, r1 + lsls r2, r0, 1 + adds r2, r3 + ldr r5, =gBattleMons + movs r4, 0x58 + adds r1, r0, 0 + muls r1, r4 + adds r1, r5 + ldrh r1, [r1, 0x28] + strh r1, [r2] + movs r1, 0x1 + eors r0, r1 + lsls r1, r0, 1 + adds r1, r3 + muls r0, r4 + adds r0, r5 + ldrh r2, [r0, 0x28] + ldrh r0, [r1] + cmp r0, r2 + bls _081A58A4 + strh r2, [r1] +_081A58A4: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A586C + + thumb_func_start sub_81A58B4 +sub_81A58B4: @ 81A58B4 + push {r4-r6,lr} + ldr r4, =gSaveBlock2Ptr + ldr r1, [r4] + ldr r3, =0x00000ca9 + adds r0, r1, r3 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + ldr r0, =0x00000ca8 + adds r1, r0 + movs r2, 0 + strb r2, [r1] + ldr r1, [r4] + ldr r6, =0x00000cb2 + adds r0, r1, r6 + strh r2, [r0] + adds r1, r3 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r4] + adds r1, r3 + ldrb r2, [r1] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + cmp r5, 0 + beq _081A5914 + ldr r0, [r4] + ldr r1, =0x00000cdc + adds r0, r1 + ldr r2, [r0] + movs r0, 0x80 + b _081A591E + .pool +_081A5914: + ldr r0, [r4] + ldr r3, =0x00000cdc + adds r0, r3 + ldr r2, [r0] + movs r0, 0x40 +_081A591E: + ands r2, r0 + cmp r2, 0 + bne _081A5930 + ldr r0, [r4] + lsls r1, r5, 1 + ldr r6, =0x00000dda + adds r0, r6 + adds r0, r1 + strh r2, [r0] +_081A5930: + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0x4 + ldrsb r1, [r0, r1] + movs r2, 0x5 + ldrsb r2, [r0, r2] + movs r3, 0x1 + negs r3, r3 + movs r0, 0 + bl saved_warp2_set + ldr r1, =gTrainerBattleOpponent_A + movs r0, 0 + strh r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A58B4 + + thumb_func_start sub_81A5964 +sub_81A5964: @ 81A5964 + push {r4,lr} + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r1, =0x00000ca9 + adds r0, r3, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r1, r0, 30 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x1 + beq _081A59B0 + cmp r0, 0x1 + bgt _081A5994 + cmp r0, 0 + beq _081A599A + b _081A59EE + .pool +_081A5994: + cmp r0, 0x2 + beq _081A59C8 + b _081A59EE +_081A599A: + ldr r0, =gScriptResult + ldr r2, =0x00000dd8 + adds r1, r3, r2 + ldrh r1, [r1] + strh r1, [r0] + b _081A59EE + .pool +_081A59B0: + ldr r2, =gScriptResult + lsls r1, 1 + ldr r4, =0x00000dda + adds r0, r3, r4 + adds r0, r1 + ldrh r0, [r0] + b _081A59EC + .pool +_081A59C8: + cmp r1, 0 + beq _081A59E0 + ldr r2, =gScriptResult + ldr r1, =0x00000cdc + adds r0, r3, r1 + ldr r0, [r0] + movs r1, 0x80 + b _081A59EA + .pool +_081A59E0: + ldr r2, =gScriptResult + ldr r4, =0x00000cdc + adds r0, r3, r4 + ldr r0, [r0] + movs r1, 0x40 +_081A59EA: + ands r0, r1 +_081A59EC: + strh r0, [r2] +_081A59EE: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5964 + + thumb_func_start sub_81A59FC +sub_81A59FC: @ 81A59FC + push {lr} + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r1, =0x00000ca9 + adds r0, r2, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r1, r0, 30 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x1 + beq _081A5A48 + cmp r0, 0x1 + bgt _081A5A2C + cmp r0, 0 + beq _081A5A32 + b _081A5ABA + .pool +_081A5A2C: + cmp r0, 0x2 + beq _081A5A60 + b _081A5ABA +_081A5A32: + ldr r0, =gSpecialVar_0x8006 + ldrh r1, [r0] + ldr r3, =0x00000dd8 + adds r0, r2, r3 + strh r1, [r0] + b _081A5ABA + .pool +_081A5A48: + lsls r1, 1 + ldr r3, =0x00000dda + adds r0, r2, r3 + adds r0, r1 + ldr r1, =gSpecialVar_0x8006 + ldrh r1, [r1] + strh r1, [r0] + b _081A5ABA + .pool +_081A5A60: + cmp r1, 0 + beq _081A5A90 + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + cmp r0, 0 + beq _081A5A80 + ldr r1, =0x00000cdc + adds r0, r2, r1 + ldr r1, [r0] + movs r2, 0x80 + orrs r1, r2 + b _081A5AB8 + .pool +_081A5A80: + ldr r3, =0x00000cdc + adds r0, r2, r3 + ldr r1, [r0] + movs r2, 0x81 + negs r2, r2 + b _081A5AB6 + .pool +_081A5A90: + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + cmp r0, 0 + beq _081A5AAC + ldr r1, =0x00000cdc + adds r0, r2, r1 + ldr r1, [r0] + movs r2, 0x40 + orrs r1, r2 + b _081A5AB8 + .pool +_081A5AAC: + ldr r3, =0x00000cdc + adds r0, r2, r3 + ldr r1, [r0] + movs r2, 0x41 + negs r2, r2 +_081A5AB6: + ands r1, r2 +_081A5AB8: + str r1, [r0] +_081A5ABA: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A59FC + + thumb_func_start sub_81A5AC4 +sub_81A5AC4: @ 81A5AC4 + push {r4,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl VarSet + ldr r1, [r4] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl sub_81A4C30 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5AC4 + + thumb_func_start sub_81A5B08 +sub_81A5B08: @ 81A5B08 + push {r4,r5,lr} + ldr r4, =gSaveBlock2Ptr + ldr r1, [r4] + ldr r2, =0x00000ca9 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 29 + ldr r2, =0x00000dda + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0x29 + bls _081A5B58 + bl Random + ldr r4, [r4] + ldr r5, =gUnknown_08611FAC + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x9 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 15 + adds r0, r5 + ldrh r0, [r0] + ldr r1, =0x00000dd8 + adds r4, r1 + b _081A5B76 + .pool +_081A5B58: + bl Random + ldr r4, [r4] + ldr r5, =gUnknown_08611FA0 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x6 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 15 + adds r0, r5 + ldrh r0, [r0] + ldr r2, =0x00000dd8 + adds r4, r2 +_081A5B76: + strh r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5B08 + + thumb_func_start sub_81A5B88 +sub_81A5B88: @ 81A5B88 + push {r4,r5,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000dd8 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x1 + bl AddBagItem + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bne _081A5BD0 + ldr r0, [r4] + ldr r1, =0x00000dd8 + adds r0, r1 + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r0, [r4] + ldr r1, =0x00000dd8 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + ldr r0, =gScriptResult + strh r5, [r0] + b _081A5BD6 + .pool +_081A5BD0: + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] +_081A5BD6: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5B88 + + thumb_func_start sub_81A5BE0 +sub_81A5BE0: @ 81A5BE0 + push {lr} + ldr r0, =gStringVar1 + ldr r1, =gTrainerBattleOpponent_A + ldrh r1, [r1] + bl GetFrontierTrainerName + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5BE0 + + thumb_func_start sub_81A5BF8 +sub_81A5BF8: @ 81A5BF8 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0xC + movs r0, 0x1B + mov r8, r0 + movs r5, 0x7 + movs r4, 0x1 + str r4, [sp] + movs r6, 0x6 + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0xFE + movs r3, 0xE + bl FillBgTilemapBufferRect + str r4, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0x20 + movs r3, 0xE + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x31 + movs r2, 0 + movs r3, 0xE + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x33 + movs r2, 0x1 + movs r3, 0xE + bl FillBgTilemapBufferRect + mov r0, r8 + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x34 + movs r2, 0x2 + movs r3, 0xE + bl FillBgTilemapBufferRect + movs r0, 0x1C + mov r8, r0 + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x35 + movs r2, 0x1C + movs r3, 0xE + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x36 + movs r2, 0x1D + movs r3, 0xE + bl FillBgTilemapBufferRect + str r4, [sp] + movs r6, 0x5 + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x37 + movs r2, 0 + movs r3, 0xF + bl FillBgTilemapBufferRect + mov r0, r8 + str r0, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x39 + movs r2, 0x1 + movs r3, 0xF + bl FillBgTilemapBufferRect + str r4, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x3A + movs r2, 0x1D + movs r3, 0xF + bl FillBgTilemapBufferRect + ldr r1, =0x00000831 + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r2, 0 + movs r3, 0x13 + bl FillBgTilemapBufferRect + ldr r1, =0x00000833 + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r2, 0x1 + movs r3, 0x13 + bl FillBgTilemapBufferRect + ldr r1, =0x00000834 + movs r0, 0x1A + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r2, 0x2 + movs r3, 0x13 + bl FillBgTilemapBufferRect + ldr r1, =0x00000835 + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r2, 0x1C + movs r3, 0x13 + bl FillBgTilemapBufferRect + ldr r1, =0x00000836 + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r2, 0x1D + movs r3, 0x13 + bl FillBgTilemapBufferRect + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5BF8 + + thumb_func_start sub_81A5D44 +sub_81A5D44: @ 81A5D44 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0xC + movs r5, 0 + movs r4, 0x1 + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x3 + movs r2, 0 + movs r3, 0xE + bl FillBgTilemapBufferRect + movs r6, 0x4 + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x4 + movs r2, 0x1 + movs r3, 0xE + bl FillBgTilemapBufferRect + movs r0, 0x1B + mov r8, r0 + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x5 + movs r2, 0x2 + movs r3, 0xE + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x6 + movs r2, 0x1C + movs r3, 0xE + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x7 + movs r2, 0x1D + movs r3, 0xE + bl FillBgTilemapBufferRect + str r4, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x8 + movs r2, 0 + movs r3, 0xF + bl FillBgTilemapBufferRect + str r4, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x9 + movs r2, 0x1 + movs r3, 0xF + bl FillBgTilemapBufferRect + mov r0, r8 + str r0, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0xA + movs r2, 0x2 + movs r3, 0xF + bl FillBgTilemapBufferRect + str r4, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0xB + movs r2, 0x1C + movs r3, 0xF + bl FillBgTilemapBufferRect + str r4, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0xC + movs r2, 0x1D + movs r3, 0xF + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0xD + movs r2, 0 + movs r3, 0x13 + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0xE + movs r2, 0x1 + movs r3, 0x13 + bl FillBgTilemapBufferRect + mov r0, r8 + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0xF + movs r2, 0x2 + movs r3, 0x13 + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x10 + movs r2, 0x1C + movs r3, 0x13 + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x11 + movs r2, 0x1D + movs r3, 0x13 + bl FillBgTilemapBufferRect + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81A5D44 + + thumb_func_start sub_81A5E74 +sub_81A5E74: @ 81A5E74 + push {lr} + ldr r1, =gUnknown_08612120 + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5E74 + + thumb_func_start sub_81A5E94 +sub_81A5E94: @ 81A5E94 + push {r4-r7,lr} + ldr r5, =gSaveBlock2Ptr + ldr r0, [r5] + ldr r4, =0x00000ca9 + adds r0, r4 + ldrb r0, [r0] + lsls r0, 30 + lsrs r7, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, [r5] + ldr r1, =0x00000ca8 + adds r0, r1 + movs r2, 0 + strb r2, [r0] + ldr r1, [r5] + ldr r3, =0x00000cb2 + adds r0, r1, r3 + strh r2, [r0] + adds r1, r4 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r5] + adds r1, r4 + ldrb r2, [r1] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r4, [r5] + ldr r0, =0x00000cdc + adds r3, r4, r0 + ldr r2, =gUnknown_08612164 + lsls r0, r7, 2 + lsls r1, r6, 3 + adds r0, r1 + adds r0, r2 + ldr r3, [r3] + ldr r0, [r0] + ands r3, r0 + cmp r3, 0 + bne _081A5F0A + lsls r1, r7, 1 + lsls r0, r6, 2 + adds r1, r0 + ldr r2, =0x00000de2 + adds r0, r4, r2 + adds r0, r1 + strh r3, [r0] + adds r2, 0x10 + adds r0, r4, r2 + adds r0, r1 + strh r3, [r0] +_081A5F0A: + ldr r1, =gUnknown_03001288 + movs r0, 0 + strb r0, [r1] + movs r2, 0 + ldr r6, =gSaveBlock1Ptr + movs r4, 0xE7 + lsls r4, 4 + ldr r0, =0x0000ffff + adds r3, r0, 0 +_081A5F1C: + ldr r1, [r5] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r1, r0 + adds r1, r4 + ldrh r0, [r1] + orrs r0, r3 + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bls _081A5F1C + movs r2, 0 + ldr r4, =gUnknown_03006298 + ldr r1, =0x0000ffff + adds r3, r1, 0 +_081A5F40: + lsls r0, r2, 1 + adds r0, r4 + ldrh r1, [r0] + orrs r1, r3 + strh r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x2 + bls _081A5F40 + ldr r0, [r6] + movs r1, 0x4 + ldrsb r1, [r0, r1] + movs r2, 0x5 + ldrsb r2, [r0, r2] + movs r3, 0x1 + negs r3, r3 + movs r0, 0 + bl saved_warp2_set + ldr r1, =gTrainerBattleOpponent_A + movs r0, 0 + strh r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5E94 + + thumb_func_start sub_81A5FA8 +sub_81A5FA8: @ 81A5FA8 + push {r4-r7,lr} + ldr r7, =gSaveBlock2Ptr + ldr r0, [r7] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r6, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x2 + beq _081A6000 + cmp r0, 0x2 + bgt _081A5FE4 + cmp r0, 0x1 + beq _081A5FEA + b _081A6044 + .pool +_081A5FE4: + cmp r0, 0x3 + beq _081A6030 + b _081A6044 +_081A5FEA: + ldr r3, =gScriptResult + ldr r0, [r7] + lsls r1, r6, 1 + lsls r2, r5, 2 + adds r1, r2 + ldr r2, =0x00000de2 + b _081A603C + .pool +_081A6000: + ldr r4, =gScriptResult + ldr r2, [r7] + ldr r0, =0x00000cdc + adds r2, r0 + ldr r3, =gUnknown_08612164 + lsls r0, r6, 2 + lsls r1, r5, 3 + adds r0, r1 + adds r0, r3 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + strh r0, [r4] + b _081A6044 + .pool +_081A6030: + ldr r3, =gScriptResult + ldr r0, [r7] + lsls r1, r6, 1 + lsls r2, r5, 2 + adds r1, r2 + ldr r2, =0x00000df2 +_081A603C: + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r3] +_081A6044: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5FA8 + + thumb_func_start sub_81A6054 +sub_81A6054: @ 81A6054 + push {r4-r6,lr} + ldr r6, =gSaveBlock2Ptr + ldr r0, [r6] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x2 + beq _081A60B4 + cmp r0, 0x2 + bgt _081A6090 + cmp r0, 0x1 + beq _081A6096 + b _081A6128 + .pool +_081A6090: + cmp r0, 0x3 + beq _081A6108 + b _081A6128 +_081A6096: + ldr r2, [r6] + lsls r0, r5, 1 + lsls r1, r4, 2 + adds r0, r1 + ldr r1, =0x00000de2 + adds r2, r1 + adds r2, r0 + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + strh r0, [r2] + b _081A6128 + .pool +_081A60B4: + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + cmp r0, 0 + beq _081A60E4 + ldr r2, [r6] + ldr r0, =0x00000cdc + adds r2, r0 + ldr r3, =gUnknown_08612164 + lsls r1, r5, 2 + lsls r0, r4, 3 + adds r1, r0 + adds r1, r3 + ldr r0, [r2] + ldr r1, [r1] + orrs r0, r1 + str r0, [r2] + b _081A6128 + .pool +_081A60E4: + ldr r2, [r6] + ldr r1, =0x00000cdc + adds r2, r1 + ldr r3, =gUnknown_08612174 + lsls r1, r5, 2 + lsls r0, r4, 3 + adds r1, r0 + adds r1, r3 + ldr r0, [r2] + ldr r1, [r1] + ands r0, r1 + str r0, [r2] + b _081A6128 + .pool +_081A6108: + ldr r3, =gUnknown_03001288 + ldrb r0, [r3] + cmp r0, 0x1 + bne _081A6128 + ldr r2, [r6] + lsls r0, r5, 1 + lsls r1, r4, 2 + adds r0, r1 + ldr r1, =0x00000df2 + adds r2, r1 + adds r2, r0 + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + movs r1, 0 + strh r0, [r2] + strb r1, [r3] +_081A6128: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A6054 + + thumb_func_start sub_81A613C +sub_81A613C: @ 81A613C + push {r4,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl VarSet + ldr r1, [r4] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl sub_81A4C30 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A613C + + thumb_func_start nullsub_75 +nullsub_75: @ 81A6180 + bx lr + thumb_func_end nullsub_75 + + thumb_func_start nullsub_123 +nullsub_123: @ 81A6184 + bx lr + thumb_func_end nullsub_123 + + thumb_func_start sub_81A6188 +sub_81A6188: @ 81A6188 + push {lr} + bl ZeroPlayerPartyMons + bl sub_819A4F8 + pop {r0} + bx r0 + thumb_func_end sub_81A6188 + + thumb_func_start sub_81A6198 +sub_81A6198: @ 81A6198 + push {lr} + bl sub_819DC00 + pop {r0} + bx r0 + thumb_func_end sub_81A6198 + + thumb_func_start sub_81A61A4 +sub_81A61A4: @ 81A61A4 + ldr r1, =gUnknown_03001288 + movs r0, 0x1 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_81A61A4 + + thumb_func_start sub_81A61B0 +sub_81A61B0: @ 81A61B0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + str r0, [sp, 0x10] + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + ldr r1, [r4] + ldr r3, [sp, 0x10] + lsls r2, r3, 1 + lsrs r0, 14 + adds r2, r0 + ldr r6, =0x00000de2 + adds r1, r6 + adds r1, r2 + ldrh r0, [r1] + movs r1, 0x7 + bl __udivsi3 + ldr r2, =gUnknown_0203BC88 + ldr r1, =gBattleFrontierTrainers + str r1, [r2] + ldr r5, =0x00000cb2 + lsls r0, 24 + str r0, [sp, 0x20] + mov r8, r0 +_081A61FA: + ldr r0, [r4] + adds r0, r5 + ldrb r1, [r0] + mov r2, r8 + lsrs r0, r2, 24 + bl sub_8162548 + lsls r0, 16 + lsrs r3, r0, 16 + movs r7, 0 + ldr r1, [r4] + adds r0, r1, r5 + ldr r6, [sp, 0x10] + lsls r6, 24 + str r6, [sp, 0x1C] + ldrh r0, [r0] + cmp r7, r0 + bge _081A6244 + ldr r2, =0x00000cb4 + adds r0, r1, r2 + ldrh r0, [r0] + ldr r6, =gSaveBlock2Ptr + cmp r0, r3 + beq _081A6244 + ldr r1, [r6] + ldr r6, =0x00000cb2 + adds r0, r1, r6 + ldrh r2, [r0] + ldr r0, =0x00000cb4 + adds r1, r0 +_081A6236: + adds r1, 0x2 + adds r7, 0x1 + cmp r7, r2 + bge _081A6244 + ldrh r0, [r1] + cmp r0, r3 + bne _081A6236 +_081A6244: + ldr r0, [r4] + ldr r1, =0x00000cb2 + adds r0, r1 + ldr r6, =gSaveBlock2Ptr + ldrh r0, [r0] + cmp r7, r0 + bne _081A61FA + ldr r0, =gTrainerBattleOpponent_A + strh r3, [r0] + ldr r2, [r6] + adds r1, r2, r1 + ldrh r0, [r1] + cmp r0, 0x5 + bhi _081A626C + adds r1, r0, 0 + lsls r1, 1 + ldr r4, =0x00000cb4 + adds r0, r2, r4 + adds r0, r1 + strh r3, [r0] +_081A626C: + movs r7, 0 + mov r10, sp + movs r6, 0 + lsls r6, 1 + str r6, [sp, 0x14] + add r6, sp + str r6, [sp, 0x18] +_081A627A: + ldr r1, [sp, 0x1C] + lsrs r0, r1, 24 + ldr r2, [sp, 0x20] + lsrs r1, r2, 24 + movs r2, 0 + bl sub_81A6EF0 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + ldr r4, =gUnknown_0203BC8C + ldr r2, [r4] + lsls r1, r0, 4 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r0, 0xC9 + beq _081A636E + movs r3, 0 + ldr r6, =gSaveBlock2Ptr + mov r8, r1 + adds r5, r0, 0 + ldr r1, [r6] +_081A62A6: + movs r4, 0xE7 + lsls r4, 4 + adds r0, r1, r4 + ldrh r0, [r0] + lsls r0, 4 + adds r0, r2 + ldrh r0, [r0] + cmp r5, r0 + beq _081A62C0 + adds r1, 0xC + adds r3, 0x1 + cmp r3, 0x5 + ble _081A62A6 +_081A62C0: + cmp r3, 0x6 + bne _081A636E + ldr r6, [sp, 0x10] + cmp r6, 0 + bne _081A62D0 + ldr r0, =0x00000351 + cmp r9, r0 + bhi _081A636E +_081A62D0: + movs r2, 0 + adds r4, r2, r7 + cmp r2, r4 + bge _081A6302 + ldr r1, [sp, 0x18] + ldrh r0, [r1] + cmp r0, r5 + beq _081A6302 + adds r6, r4, 0 + ldr r3, =gUnknown_0203BC8C + mov r12, r3 + mov r5, r8 + ldr r3, [sp, 0x14] + add r3, sp +_081A62EC: + adds r3, 0x2 + adds r2, 0x1 + cmp r2, r6 + bge _081A6302 + mov r1, r12 + ldr r0, [r1] + adds r0, r5, r0 + ldrh r1, [r3] + ldrh r0, [r0] + cmp r1, r0 + bne _081A62EC +_081A6302: + cmp r2, r4 + bne _081A636E + movs r2, 0 + cmp r2, r4 + bge _081A633E + ldr r3, =gBattleFrontierHeldItems + mov r12, r3 + add r0, sp, 0x8 + ldr r6, [sp, 0x14] + adds r3, r0, r6 + mov r0, r8 + str r0, [sp, 0x24] + adds r5, r4, 0 +_081A631C: + ldrh r1, [r3] + cmp r1, 0 + beq _081A6336 + ldr r6, =gUnknown_0203BC8C + ldr r0, [r6] + ldr r6, [sp, 0x24] + adds r0, r6, r0 + ldrb r0, [r0, 0xA] + lsls r0, 1 + add r0, r12 + ldrh r0, [r0] + cmp r1, r0 + beq _081A633E +_081A6336: + adds r3, 0x2 + adds r2, 0x1 + cmp r2, r5 + blt _081A631C +_081A633E: + cmp r2, r4 + bne _081A636E + lsls r4, r7, 1 + ldr r0, =gUnknown_0203BC8C + ldr r1, [r0] + add r1, r8 + ldrh r0, [r1] + mov r2, r10 + strh r0, [r2] + add r2, sp, 0x8 + adds r2, r4 + ldr r3, =gBattleFrontierHeldItems + ldrb r0, [r1, 0xA] + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + strh r0, [r2] + ldr r0, =gUnknown_03006298 + adds r4, r0 + mov r3, r9 + strh r3, [r4] + movs r4, 0x2 + add r10, r4 + adds r7, 0x1 +_081A636E: + cmp r7, 0x3 + bne _081A627A + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A61B0 + + thumb_func_start sub_81A63B8 +sub_81A63B8: @ 81A63B8 + push {lr} + ldr r0, =gTrainerBattleOpponent_A + ldrh r0, [r0] + movs r1, 0 + bl sub_8162614 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A63B8 + + thumb_func_start sub_81A63CC +sub_81A63CC: @ 81A63CC + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + beq _081A63FC + ldr r1, =gUnknown_0203BC8C + ldr r0, =gBattleFrontierMons + b _081A6400 + .pool +_081A63FC: + ldr r1, =gUnknown_0203BC8C + ldr r0, =gSlateportBattleTentMons +_081A6400: + str r0, [r1] + movs r7, 0 + ldr r2, =gSaveBlock2Ptr + mov r8, r2 +_081A6408: + mov r0, r8 + ldr r1, [r0] + adds r0, r7, 0x3 + lsls r4, r0, 1 + adds r4, r0 + lsls r4, 2 + adds r1, r4 + ldr r0, =gUnknown_03006298 + lsls r6, r7, 1 + adds r6, r0 + ldrh r0, [r6] + movs r2, 0xE7 + lsls r2, 4 + adds r1, r2 + strh r0, [r1] + movs r0, 0x64 + adds r5, r7, 0 + muls r5, r0 + ldr r0, =gEnemyParty + adds r5, r0 + adds r0, r5, 0 + movs r1, 0x28 + movs r2, 0 + bl GetBoxMonData + mov r2, r8 + ldr r1, [r2] + adds r1, r4 + ldr r2, =0x00000e78 + adds r1, r2 + strb r0, [r1] + adds r0, r5, 0 + movs r1, 0 + movs r2, 0 + bl GetMonData + mov r2, r8 + ldr r1, [r2] + ldr r2, =0x00000e74 + adds r1, r2 + adds r1, r4 + str r0, [r1] + adds r0, r5, 0 + movs r1, 0x2E + movs r2, 0 + bl GetBoxMonData + mov r2, r8 + ldr r1, [r2] + adds r1, r4 + ldr r2, =0x00000e79 + adds r1, r2 + strb r0, [r1] + ldrh r1, [r6] + ldr r0, =gUnknown_0203BC8C + ldr r0, [r0] + lsls r1, 4 + adds r1, r0 + ldrb r2, [r1, 0xA] + lsls r2, 1 + ldr r0, =gBattleFrontierHeldItems + adds r2, r0 + adds r0, r5, 0 + movs r1, 0xC + bl SetMonData + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x2 + bls _081A6408 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A63CC + + thumb_func_start sub_81A64C4 +sub_81A64C4: @ 81A64C4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r2, r0, r1 + ldrb r1, [r2] + movs r3, 0x3 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0x2 + bne _081A6500 + ldr r1, =gUnknown_0203BC8C + ldr r0, =gSlateportBattleTentMons + str r0, [r1] + movs r2, 0x1E + str r2, [sp, 0x14] + b _081A6518 + .pool +_081A6500: + ldr r1, =gUnknown_0203BC8C + ldr r0, =gBattleFrontierMons + str r0, [r1] + ldrb r1, [r2] + adds r0, r3, 0 + ands r0, r1 + movs r4, 0x32 + str r4, [sp, 0x14] + cmp r0, 0 + beq _081A6518 + movs r5, 0x64 + str r5, [sp, 0x14] +_081A6518: + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x1 + bls _081A6522 + b _081A666C +_081A6522: + bl ZeroPlayerPartyMons + movs r0, 0 + mov r8, r0 + mov r1, sp + adds r1, 0x12 + str r1, [sp, 0x1C] + ldr r2, =gUnknown_0203BC8C + mov r9, r2 +_081A6534: + ldr r4, =gSaveBlock2Ptr + ldr r2, [r4] + mov r5, r8 + lsls r5, 1 + mov r10, r5 + mov r3, r10 + add r3, r8 + lsls r3, 2 + adds r1, r2, r3 + movs r4, 0xE7 + lsls r4, 4 + adds r0, r1, r4 + ldrh r7, [r0] + ldr r5, =0x00000e78 + adds r1, r5 + ldrb r6, [r1] + movs r1, 0x64 + mov r0, r8 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + mov r4, r9 + ldr r1, [r4] + lsls r4, r7, 4 + adds r1, r4, r1 + ldrh r1, [r1] + movs r5, 0x1 + str r5, [sp] + ldr r5, =0x00000e74 + adds r2, r5 + adds r2, r3 + ldr r2, [r2] + str r2, [sp, 0x4] + movs r2, 0 + str r2, [sp, 0x8] + str r2, [sp, 0xC] + ldr r2, [sp, 0x14] + adds r3, r6, 0 + bl CreateMon + movs r1, 0 + mov r2, r9 + ldr r0, [r2] + adds r4, r0 + ldrb r4, [r4, 0xB] + mov r5, r8 + adds r5, 0x1 + str r5, [sp, 0x18] + movs r5, 0x5 +_081A6596: + adds r0, r4, 0 + movs r2, 0x1 + ands r0, r2 + cmp r0, 0 + beq _081A65A2 + adds r1, 0x1 +_081A65A2: + lsrs r4, 1 + subs r5, 0x1 + cmp r5, 0 + bge _081A6596 + movs r0, 0xFF + lsls r0, 1 + bl __divsi3 + add r1, sp, 0x10 + strh r0, [r1] + movs r4, 0x1 + movs r5, 0 + lsls r7, 4 + movs r0, 0x64 + mov r6, r8 + muls r6, r0 + ldr r3, =gPlayerParty +_081A65C4: + mov r1, r9 + ldr r0, [r1] + adds r0, r7, r0 + ldrb r0, [r0, 0xB] + ands r0, r4 + cmp r0, 0 + beq _081A65E2 + adds r1, r5, 0 + adds r1, 0x1A + adds r0, r6, r3 + add r2, sp, 0x10 + str r3, [sp, 0x20] + bl SetMonData + ldr r3, [sp, 0x20] +_081A65E2: + lsls r0, r4, 25 + lsrs r4, r0, 24 + adds r5, 0x1 + cmp r5, 0x5 + ble _081A65C4 + movs r2, 0x64 + mov r4, r8 + muls r4, r2 + ldr r5, =gPlayerParty + adds r0, r4, r5 + bl CalculateMonStats + movs r0, 0 + ldr r1, [sp, 0x1C] + strb r0, [r1] + movs r6, 0 +_081A6602: + mov r2, r9 + ldr r0, [r2] + adds r0, r7, r0 + lsls r1, r6, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r1, [r0] + lsls r2, r6, 24 + lsrs r2, 24 + adds r0, r4, r5 + bl sub_81A7024 + adds r6, 0x1 + cmp r6, 0x3 + ble _081A6602 + movs r5, 0x64 + mov r4, r8 + muls r4, r5 + ldr r0, =gPlayerParty + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x20 + ldr r2, [sp, 0x1C] + bl SetMonData + mov r1, r9 + ldr r0, [r1] + adds r0, r7, r0 + ldrb r2, [r0, 0xA] + lsls r2, 1 + ldr r0, =gBattleFrontierHeldItems + adds r2, r0 + adds r0, r4, 0 + movs r1, 0xC + bl SetMonData + mov r2, r10 + add r2, r8 + lsls r2, 2 + ldr r5, =gSaveBlock2Ptr + ldr r0, [r5] + adds r2, r0 + ldr r0, =0x00000e79 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x2E + bl SetMonData + ldr r1, [sp, 0x18] + mov r8, r1 + cmp r1, 0x2 + bgt _081A666C + b _081A6534 +_081A666C: + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0 + beq _081A667A + cmp r0, 0x2 + beq _081A667A + b _081A67AE +_081A667A: + movs r2, 0 + mov r8, r2 + ldr r4, =gUnknown_0203BC8C + mov r9, r4 +_081A6682: + ldr r5, =gSaveBlock2Ptr + ldr r3, [r5] + mov r0, r8 + adds r0, 0x3 + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + adds r1, r3, r2 + movs r4, 0xE7 + lsls r4, 4 + adds r0, r1, r4 + ldrh r7, [r0] + ldr r5, =0x00000e78 + adds r1, r5 + ldrb r6, [r1] + movs r1, 0x64 + mov r0, r8 + muls r0, r1 + ldr r1, =gEnemyParty + adds r0, r1 + mov r4, r9 + ldr r1, [r4] + lsls r4, r7, 4 + adds r1, r4, r1 + ldrh r1, [r1] + movs r5, 0x1 + str r5, [sp] + ldr r5, =0x00000e74 + adds r3, r5 + adds r3, r2 + ldr r2, [r3] + str r2, [sp, 0x4] + movs r2, 0 + str r2, [sp, 0x8] + str r2, [sp, 0xC] + ldr r2, [sp, 0x14] + adds r3, r6, 0 + bl CreateMon + movs r1, 0 + mov r2, r9 + ldr r0, [r2] + adds r4, r0 + ldrb r4, [r4, 0xB] + mov r5, r8 + lsls r5, 1 + mov r10, r5 + mov r0, r8 + adds r0, 0x1 + str r0, [sp, 0x18] + movs r5, 0x5 +_081A66E8: + adds r0, r4, 0 + movs r2, 0x1 + ands r0, r2 + cmp r0, 0 + beq _081A66F4 + adds r1, 0x1 +_081A66F4: + lsrs r4, 1 + subs r5, 0x1 + cmp r5, 0 + bge _081A66E8 + add r4, sp, 0x10 + movs r0, 0xFF + lsls r0, 1 + bl __divsi3 + strh r0, [r4] + movs r4, 0x1 + movs r5, 0 + lsls r7, 4 + movs r0, 0x64 + mov r6, r8 + muls r6, r0 + ldr r3, =gEnemyParty +_081A6716: + mov r1, r9 + ldr r0, [r1] + adds r0, r7, r0 + ldrb r0, [r0, 0xB] + ands r0, r4 + cmp r0, 0 + beq _081A6734 + adds r1, r5, 0 + adds r1, 0x1A + adds r0, r6, r3 + add r2, sp, 0x10 + str r3, [sp, 0x20] + bl SetMonData + ldr r3, [sp, 0x20] +_081A6734: + lsls r0, r4, 25 + lsrs r4, r0, 24 + adds r5, 0x1 + cmp r5, 0x5 + ble _081A6716 + movs r2, 0x64 + mov r4, r8 + muls r4, r2 + ldr r5, =gEnemyParty + adds r0, r4, r5 + bl CalculateMonStats + movs r6, 0 +_081A674E: + mov r1, r9 + ldr r0, [r1] + adds r0, r7, r0 + lsls r1, r6, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r1, [r0] + lsls r2, r6, 24 + lsrs r2, 24 + adds r0, r4, r5 + bl sub_81A7024 + adds r6, 0x1 + cmp r6, 0x3 + ble _081A674E + movs r2, 0x64 + mov r4, r8 + muls r4, r2 + ldr r0, =gEnemyParty + adds r4, r0 + mov r5, r9 + ldr r0, [r5] + adds r0, r7, r0 + ldrb r2, [r0, 0xA] + lsls r2, 1 + ldr r0, =gBattleFrontierHeldItems + adds r2, r0 + adds r0, r4, 0 + movs r1, 0xC + bl SetMonData + mov r2, r10 + add r2, r8 + lsls r2, 2 + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + adds r2, r0 + ldr r5, =0x00000e9d + adds r2, r5 + adds r0, r4, 0 + movs r1, 0x2E + bl SetMonData + ldr r0, [sp, 0x18] + mov r8, r0 + cmp r0, 0x2 + bgt _081A67AE + b _081A6682 +_081A67AE: + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A64C4 + + thumb_func_start sub_81A67EC +sub_81A67EC: @ 81A67EC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4C + ldr r1, =gUnknown_0203BC88 + ldr r0, =gBattleFrontierTrainers + str r0, [r1] + mov r0, sp + adds r0, 0xC + str r0, [sp, 0x38] + mov r1, sp + adds r1, 0x18 + str r1, [sp, 0x3C] + ldr r2, =gSaveBlock2Ptr + mov r9, r2 + movs r2, 0 + adds r3, r1, 0 + adds r1, r0, 0 + mov r0, sp + movs r4, 0x5 + mov r8, r4 +_081A681A: + strh r2, [r0] + strh r2, [r1] + strh r2, [r3] + adds r3, 0x2 + adds r1, 0x2 + adds r0, 0x2 + movs r5, 0x1 + negs r5, r5 + add r8, r5 + mov r4, r8 + cmp r4, 0 + bge _081A681A + mov r5, r9 + ldr r0, [r5] + ldr r7, =0x00000ca9 + adds r0, r7 + ldrb r4, [r0] + lsls r4, 30 + lsrs r4, 30 + ldr r6, =0x000040ce + adds r0, r6, 0 + bl VarGet + lsls r0, 24 + ldr r1, [r5] + lsls r4, 1 + lsrs r0, 22 + adds r4, r0 + ldr r5, =0x00000de2 + adds r1, r5 + adds r1, r4 + ldrh r0, [r1] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x24] + adds r0, r6, 0 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + movs r2, 0 + cmp r0, 0x1 + bne _081A6878 + movs r2, 0x1 +_081A6878: + ldr r1, =gUnknown_0203BC8C + ldr r0, =gBattleFrontierMons + str r0, [r1] + mov r1, r9 + ldr r0, [r1] + adds r0, r7 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081A68B4 + movs r4, 0x1 + str r4, [sp, 0x28] + b _081A68B8 + .pool +_081A68B4: + movs r5, 0 + str r5, [sp, 0x28] +_081A68B8: + adds r0, r2, 0 + ldr r1, [sp, 0x28] + bl sub_81A6F70 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x2C] + movs r0, 0 + mov r10, r0 + mov r8, r0 + ldr r1, [sp, 0x3C] + str r1, [sp, 0x40] + mov r2, sp + str r2, [sp, 0x44] + lsls r4, r0, 1 + str r4, [sp, 0x30] + ldr r5, [sp, 0x38] + adds r5, r4 + str r5, [sp, 0x34] +_081A68DE: + ldr r0, [sp, 0x2C] + cmp r8, r0 + bge _081A68EC + ldr r0, [sp, 0x28] + ldr r1, [sp, 0x24] + movs r2, 0x1 + b _081A68F2 +_081A68EC: + ldr r0, [sp, 0x28] + ldr r1, [sp, 0x24] + movs r2, 0 +_081A68F2: + bl sub_81A6EF0 + lsls r0, 16 + lsrs r7, r0, 16 + ldr r0, =gUnknown_0203BC8C + ldr r1, [r0] + lsls r2, r7, 4 + adds r4, r2, r1 + ldrh r1, [r4] + mov r9, r2 + cmp r1, 0xC9 + beq _081A69E2 + movs r3, 0 + mov r2, r8 + adds r6, r3, r2 + cmp r3, r6 + bge _081A6950 + ldr r5, [sp, 0x34] + ldrh r0, [r5] + cmp r0, r7 + beq _081A6950 + mov r12, r4 + adds r2, r1, 0 + lsls r4, r3, 1 + ldr r1, [sp, 0x30] + add r1, sp + str r6, [sp, 0x48] +_081A6928: + ldrh r0, [r1] + cmp r0, r2 + bne _081A693A + mov r0, r10 + cmp r0, 0 + bne _081A6950 + mov r5, r12 + ldrh r5, [r5] + mov r10, r5 +_081A693A: + adds r4, 0x2 + adds r1, 0x2 + adds r3, 0x1 + ldr r0, [sp, 0x48] + cmp r3, r0 + bge _081A6950 + ldr r5, [sp, 0x38] + adds r0, r5, r4 + ldrh r0, [r0] + cmp r0, r7 + bne _081A6928 +_081A6950: + cmp r3, r6 + bne _081A69E2 + movs r3, 0 + cmp r3, r6 + bge _081A699C + ldr r0, =gBattleFrontierHeldItems + mov r12, r0 + ldr r1, [sp, 0x30] + ldr r2, [sp, 0x3C] + adds r5, r1, r2 +_081A6964: + ldrh r4, [r5] + cmp r4, 0 + beq _081A6994 + ldr r1, =gUnknown_0203BC8C + ldr r0, [r1] + mov r2, r9 + adds r1, r2, r0 + ldrb r0, [r1, 0xA] + lsls r0, 1 + add r0, r12 + ldrh r0, [r0] + cmp r4, r0 + bne _081A6994 + ldrh r0, [r1] + cmp r0, r10 + bne _081A699C + movs r4, 0 + mov r10, r4 + b _081A699C + .pool +_081A6994: + adds r5, 0x2 + adds r3, 0x1 + cmp r3, r6 + blt _081A6964 +_081A699C: + cmp r3, r6 + bne _081A69E2 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + mov r5, r8 + lsls r3, r5, 1 + adds r0, r3, r5 + lsls r0, 2 + adds r1, r0 + movs r0, 0xE7 + lsls r0, 4 + adds r1, r0 + strh r7, [r1] + ldr r2, =gUnknown_0203BC8C + ldr r1, [r2] + add r1, r9 + ldrh r0, [r1] + ldr r4, [sp, 0x44] + strh r0, [r4] + ldr r2, =gBattleFrontierHeldItems + ldrb r0, [r1, 0xA] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + ldr r5, [sp, 0x40] + strh r0, [r5] + ldr r0, [sp, 0x38] + adds r3, r0, r3 + strh r7, [r3] + adds r5, 0x2 + str r5, [sp, 0x40] + adds r4, 0x2 + str r4, [sp, 0x44] + movs r1, 0x1 + add r8, r1 +_081A69E2: + mov r2, r8 + cmp r2, 0x6 + beq _081A69EA + b _081A68DE +_081A69EA: + add sp, 0x4C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A67EC + + thumb_func_start sub_81A6A08 +sub_81A6A08: @ 81A6A08 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x18 + ldr r1, =gUnknown_0203BC8C + ldr r0, =gBattleFrontierMons + str r0, [r1] + movs r4, 0 + add r5, sp, 0x14 + ldr r7, =gScriptResult + movs r1, 0 +_081A6A1E: + mov r2, sp + adds r0, r2, r4 + strb r1, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x11 + bls _081A6A1E + movs r4, 0 + ldr r0, =gUnknown_03006298 + mov r8, r0 + ldr r0, =gUnknown_0203BC8C + ldr r6, [r0] + ldr r1, =gBaseStats + mov r12, r1 +_081A6A3C: + lsls r0, r4, 1 + add r0, r8 + ldrh r0, [r0] + lsls r0, 4 + adds r0, r6 + ldrh r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + mov r2, r12 + adds r3, r0, r2 + ldrb r2, [r3, 0x6] + mov r0, sp + adds r1, r0, r2 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldrb r1, [r3, 0x7] + cmp r2, r1 + beq _081A6A70 + ldrb r0, [r3, 0x7] + mov r2, sp + adds r1, r2, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_081A6A70: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _081A6A3C + movs r0, 0 + strb r0, [r5] + strb r0, [r5, 0x1] + movs r4, 0x1 + adds r3, r5, 0 +_081A6A84: + ldrb r0, [r3] + add r0, sp + mov r2, sp + adds r1, r2, r4 + ldrb r2, [r0] + ldrb r0, [r1] + cmp r2, r0 + bcs _081A6AAC + strb r4, [r5] + b _081A6AB2 + .pool +_081A6AAC: + cmp r2, r0 + bne _081A6AB2 + strb r4, [r3, 0x1] +_081A6AB2: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x11 + bls _081A6A84 + ldrb r1, [r5] + mov r4, sp + adds r0, r4, r1 + ldrb r2, [r0] + cmp r2, 0 + beq _081A6ADA + ldrb r3, [r5, 0x1] + adds r0, r4, r3 + ldrb r0, [r0] + cmp r2, r0 + bhi _081A6AD6 + cmp r1, r3 + bne _081A6ADA +_081A6AD6: + strh r1, [r7] + b _081A6ADE +_081A6ADA: + movs r0, 0x12 + strh r0, [r7] +_081A6ADE: + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81A6A08 + + thumb_func_start sub_81A6AEC +sub_81A6AEC: @ 81A6AEC + push {r4-r7,lr} + sub sp, 0x8 + movs r7, 0 + ldr r1, =gUnknown_0203BC8C + ldr r0, =gBattleFrontierMons + str r0, [r1] + movs r4, 0 + movs r1, 0 +_081A6AFC: + mov r2, sp + adds r0, r2, r4 + strb r1, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _081A6AFC + movs r4, 0 +_081A6B0E: + ldr r1, =gUnknown_03006298 + lsls r0, r4, 1 + adds r0, r1 + ldrh r6, [r0] + movs r5, 0 +_081A6B18: + ldr r0, =gUnknown_0203BC8C + ldr r1, [r0] + lsls r0, r6, 4 + adds r0, r1 + lsls r1, r5, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r0, [r0] + bl sub_81A6BA4 + lsls r0, 24 + lsrs r0, 24 + mov r2, sp + adds r1, r2, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _081A6B18 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _081A6B0E + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] + movs r4, 0x1 + adds r5, r1, 0 + ldr r3, =gBattleFactoryStyleRequiredMoveCounts + adds r2, r5, 0 +_081A6B5C: + mov r1, sp + adds r0, r1, r4 + subs r1, r4, 0x1 + adds r1, r3 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bcc _081A6B74 + strh r4, [r2] + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 +_081A6B74: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _081A6B5C + cmp r7, 0x2 + bls _081A6B86 + movs r0, 0x8 + strh r0, [r5] +_081A6B86: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A6AEC + + thumb_func_start sub_81A6BA4 +sub_81A6BA4: @ 81A6BA4 + push {r4-r6,lr} + lsls r0, 16 + lsrs r5, r0, 16 + movs r2, 0 + ldr r6, =gBattleFactoryStyleMoveListPointers +_081A6BAE: + movs r3, 0 + lsls r0, r2, 2 + adds r0, r6 + ldr r1, [r0] + ldrh r0, [r1] + adds r4, r2, 0x1 + cmp r0, 0 + beq _081A6BE4 + lsls r0, r4, 24 + lsrs r2, r0, 24 +_081A6BC2: + lsls r0, r3, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r5 + bne _081A6BD4 + adds r0, r2, 0 + b _081A6BEE + .pool +_081A6BD4: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + bne _081A6BC2 +_081A6BE4: + lsls r0, r4, 24 + lsrs r2, r0, 24 + cmp r2, 0x6 + bls _081A6BAE + movs r0, 0 +_081A6BEE: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81A6BA4 + + thumb_func_start sub_81A6BF4 +sub_81A6BF4: @ 81A6BF4 + push {lr} + movs r2, 0 + ldr r1, =gMapHeader + ldr r3, =0xfffffea5 + adds r0, r3, 0 + ldrh r1, [r1, 0x12] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _081A6C0C + movs r2, 0x1 +_081A6C0C: + adds r0, r2, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A6BF4 + + thumb_func_start sub_81A6C1C +sub_81A6C1C: @ 81A6C1C + push {r4,lr} + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + beq _081A6C48 + ldr r1, =gUnknown_0203BC8C + ldr r0, =gBattleFrontierMons + b _081A6C4C + .pool +_081A6C48: + ldr r1, =gUnknown_0203BC8C + ldr r0, =gSlateportBattleTentMons +_081A6C4C: + str r0, [r1] + movs r4, 0 +_081A6C50: + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gSaveBlock2Ptr + ldr r2, [r1] + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 2 + adds r2, r1 + movs r1, 0xE7 + lsls r1, 4 + adds r2, r1 + ldrh r2, [r2] + ldr r1, =gUnknown_0203BC8C + ldr r1, [r1] + lsls r2, 4 + adds r2, r1 + ldrb r2, [r2, 0xA] + lsls r2, 1 + ldr r1, =gBattleFrontierHeldItems + adds r2, r1 + movs r1, 0xC + bl SetMonData + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _081A6C50 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A6C1C + + thumb_func_start sub_81A6CA8 +sub_81A6CA8: @ 81A6CA8 + push {lr} + lsls r0, 24 + lsls r1, 24 + lsrs r1, 24 + negs r2, r1 + orrs r2, r1 + lsrs r2, 31 + lsrs r1, r0, 24 + cmp r1, 0x8 + bls _081A6CBE + movs r1, 0x7 +_081A6CBE: + ldr r0, =gUnknown_08612184 + lsls r1, 1 + adds r1, r2, r1 + adds r1, r0 + ldrb r0, [r1] + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A6CA8 + + thumb_func_start sub_81A6CD0 +sub_81A6CD0: @ 81A6CD0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x34 + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + str r0, [sp, 0x2C] + ldr r0, =0x000040ce + bl VarGet + lsls r0, 24 + ldr r1, [r4] + ldr r3, [sp, 0x2C] + lsls r2, r3, 1 + lsrs r0, 22 + adds r2, r0 + ldr r7, =0x00000de2 + adds r1, r7 + adds r1, r2 + ldrh r0, [r1] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 24 + lsrs r1, r0, 24 + str r1, [sp, 0x30] + movs r2, 0x80 + lsls r2, 18 + adds r0, r2 + lsrs r0, 24 + movs r1, 0 + bl sub_81A6CA8 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x24] + bl sub_8165C40 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x20] + movs r3, 0 + mov r9, r3 + ldr r1, [r4] + ldrb r4, [r1, 0xA] + ldrb r0, [r1, 0xB] + lsls r0, 8 + orrs r4, r0 + ldrb r0, [r1, 0xC] + lsls r0, 16 + orrs r4, r0 + ldrb r0, [r1, 0xD] + lsls r0, 24 + orrs r4, r0 + str r4, [sp, 0x28] +_081A6D4C: + ldr r0, [sp, 0x2C] + ldr r1, [sp, 0x30] + movs r2, 0 + bl sub_81A6EF0 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r7, =gUnknown_0203BC8C + ldr r1, [r7] + lsls r0, r5, 4 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0xC9 + bne _081A6D6A + b _081A6EB8 +_081A6D6A: + ldr r0, [sp, 0x20] + cmp r0, 0x32 + bne _081A6D78 + ldr r0, =0x00000351 + cmp r5, r0 + bls _081A6D78 + b _081A6EB8 +_081A6D78: + movs r2, 0 + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + movs r3, 0xE7 + lsls r3, 4 + adds r0, r3 + ldrh r0, [r0] + cmp r5, r0 + beq _081A6DA2 + adds r4, r1, 0 + movs r1, 0 +_081A6D8E: + adds r1, 0xC + adds r2, 0x1 + cmp r2, 0x5 + bgt _081A6DA2 + ldr r0, [r4] + adds r0, r1 + adds r0, r3 + ldrh r0, [r0] + cmp r5, r0 + bne _081A6D8E +_081A6DA2: + cmp r2, 0x6 + beq _081A6DA8 + b _081A6EB8 +_081A6DA8: + movs r4, 0 + cmp r4, r9 + bge _081A6DDC + add r2, sp, 0xC + ldr r7, =gUnknown_0203BC8C + ldr r0, [r7] + lsls r1, r5, 4 + adds r0, r1, r0 + ldrh r2, [r2] + adds r7, r1, 0 + ldrh r0, [r0] + cmp r2, r0 + beq _081A6DDC + ldr r6, =gUnknown_0203BC8C + adds r3, r7, 0 + add r2, sp, 0xC +_081A6DC8: + adds r2, 0x2 + adds r4, 0x1 + cmp r4, r9 + bge _081A6DDC + ldr r0, [r6] + adds r0, r3, r0 + ldrh r1, [r2] + ldrh r0, [r0] + cmp r1, r0 + bne _081A6DC8 +_081A6DDC: + cmp r4, r9 + bne _081A6EB8 + movs r4, 0 + cmp r4, r9 + bge _081A6E0C + ldr r7, =gBattleFrontierHeldItems + ldr r6, =gUnknown_0203BC8C + add r2, sp, 0x14 + lsls r3, r5, 4 +_081A6DEE: + ldrh r1, [r2] + cmp r1, 0 + beq _081A6E04 + ldr r0, [r6] + adds r0, r3, r0 + ldrb r0, [r0, 0xA] + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + cmp r1, r0 + beq _081A6E0C +_081A6E04: + adds r2, 0x2 + adds r4, 0x1 + cmp r4, r9 + blt _081A6DEE +_081A6E0C: + cmp r4, r9 + bne _081A6EB8 + mov r0, r9 + lsls r2, r0, 1 + mov r1, sp + adds r1, r2 + adds r1, 0xC + ldr r3, =gUnknown_0203BC8C + ldr r4, [r3] + lsls r5, 4 + mov r8, r5 + add r4, r8 + ldrh r0, [r4] + strh r0, [r1] + add r1, sp, 0x14 + adds r1, r2 + ldr r2, =gBattleFrontierHeldItems + ldrb r0, [r4, 0xA] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + movs r0, 0x64 + mov r5, r9 + muls r5, r0 + ldr r6, =gEnemyParty + adds r0, r5, r6 + ldrh r1, [r4] + ldr r7, [sp, 0x20] + lsls r2, r7, 24 + ldrb r3, [r4, 0xC] + ldr r7, [sp, 0x24] + str r7, [sp] + ldrb r4, [r4, 0xB] + str r4, [sp, 0x4] + ldr r4, [sp, 0x28] + str r4, [sp, 0x8] + lsrs r2, 24 + bl sub_8068634 + add r0, sp, 0x1C + movs r7, 0 + strb r7, [r0] + movs r4, 0 + mov r7, r8 + mov r10, r0 + movs r0, 0x1 + add r0, r9 + mov r8, r0 +_081A6E6E: + ldr r1, =gUnknown_0203BC8C + ldr r0, [r1] + adds r0, r7, r0 + lsls r1, r4, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r1, [r0] + lsls r2, r4, 24 + lsrs r2, 24 + adds r0, r5, r6 + bl sub_81A7024 + adds r4, 0x1 + cmp r4, 0x3 + ble _081A6E6E + movs r0, 0x64 + mov r4, r9 + muls r4, r0 + ldr r0, =gEnemyParty + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x20 + mov r2, r10 + bl SetMonData + ldr r2, =gUnknown_0203BC8C + ldr r0, [r2] + adds r0, r7, r0 + ldrb r2, [r0, 0xA] + lsls r2, 1 + ldr r0, =gBattleFrontierHeldItems + adds r2, r0 + adds r0, r4, 0 + movs r1, 0xC + bl SetMonData + mov r9, r8 +_081A6EB8: + mov r3, r9 + cmp r3, 0x3 + beq _081A6EC0 + b _081A6D4C +_081A6EC0: + add sp, 0x34 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A6CD0 + + thumb_func_start sub_81A6EF0 +sub_81A6EF0: @ 81A6EF0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r3, r1, 24 + lsls r2, 24 + lsrs r2, 24 + movs r4, 0x8 + negs r1, r0 + orrs r1, r0 + asrs r1, 31 + ands r1, r4 + adds r4, r1, 0 + cmp r3, 0x6 + bhi _081A6F2C + cmp r2, 0 + beq _081A6F20 + ldr r2, =gUnknown_08612194 + adds r1, r3 + adds r1, 0x1 + b _081A6F38 + .pool +_081A6F20: + ldr r2, =gUnknown_08612194 + adds r1, r3 + b _081A6F38 + .pool +_081A6F2C: + adds r1, r3, 0 + cmp r1, 0x7 + beq _081A6F34 + movs r1, 0x7 +_081A6F34: + ldr r2, =gUnknown_08612194 + adds r1, r4, r1 +_081A6F38: + lsls r1, 2 + adds r0, r2, 0x2 + adds r0, r1, r0 + adds r1, r2 + ldrh r0, [r0] + ldrh r4, [r1] + subs r0, r4 + adds r0, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + bl Random + lsls r0, 16 + lsrs r0, 16 + adds r1, r5, 0 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + adds r4, r0, r4 + lsls r4, 16 + lsrs r0, r4, 16 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A6EF0 + + thumb_func_start sub_81A6F70 +sub_81A6F70: @ 81A6F70 + push {lr} + lsls r0, 24 + lsls r1, 24 + ldr r2, =gSaveBlock2Ptr + ldr r2, [r2] + lsrs r1, 23 + lsrs r0, 22 + adds r1, r0 + ldr r0, =0x00000df2 + adds r2, r0 + adds r2, r1 + ldrb r1, [r2] + movs r0, 0 + cmp r1, 0xE + bls _081A6FA8 + movs r0, 0x1 + cmp r1, 0x15 + bls _081A6FA8 + movs r0, 0x2 + cmp r1, 0x1C + bls _081A6FA8 + movs r0, 0x3 + cmp r1, 0x23 + bls _081A6FA8 + movs r0, 0x5 + cmp r1, 0x2A + bhi _081A6FA8 + movs r0, 0x4 +_081A6FA8: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A6F70 + + thumb_func_start GetAiScriptsInBattleFactory +GetAiScriptsInBattleFactory: @ 81A6FB4 + push {r4,r5,lr} + ldr r5, =gSaveBlock2Ptr + ldr r0, [r5] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r4, r0, 30 + cmp r4, 0x2 + beq _081A6FF8 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + ldr r1, [r5] + lsls r2, r4, 1 + lsrs r0, 14 + adds r2, r0 + ldr r0, =0x00000de2 + adds r1, r0 + adds r1, r2 + ldrh r0, [r1] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, =gTrainerBattleOpponent_A + ldrh r1, [r0] + ldr r0, =0x000003fe + cmp r1, r0 + beq _081A7018 + cmp r2, 0x1 + bgt _081A7014 +_081A6FF8: + movs r0, 0 + b _081A701E + .pool +_081A7014: + cmp r2, 0x3 + ble _081A701C +_081A7018: + movs r0, 0x7 + b _081A701E +_081A701C: + movs r0, 0x1 +_081A701E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end GetAiScriptsInBattleFactory + + thumb_func_start sub_81A7024 +sub_81A7024: @ 81A7024 + push {lr} + lsls r1, 16 + lsls r2, 24 + lsrs r2, 24 + lsrs r1, 16 + cmp r1, 0xD8 + bne _081A7034 + movs r1, 0xDA +_081A7034: + bl SetMonMoveSlot + pop {r0} + bx r0 + thumb_func_end sub_81A7024 + + thumb_func_start sub_81A703C +sub_81A703C: @ 81A703C + push {lr} + ldr r1, =gUnknown_086125F8 + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A703C + + thumb_func_start sub_81A705C +sub_81A705C: @ 81A705C + push {lr} + bl sub_81A79EC + ldr r1, =gUnknown_0300128C + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A705C + + thumb_func_start sub_81A7070 +sub_81A7070: @ 81A7070 + push {r4-r7,lr} + ldr r0, =0x00004010 + movs r1, 0x1C + bl VarSet + ldr r0, =0x00004011 + movs r1, 0xE2 + bl VarSet + movs r4, 0x1 + movs r6, 0 + movs r5, 0 + movs r7, 0 + ldr r0, =gUnknown_0300128C + ldrb r0, [r0] + cmp r0, 0x8 + bhi _081A7132 + lsls r0, 2 + ldr r1, =_081A70AC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A70AC: + .4byte _081A70D0 + .4byte _081A70DA + .4byte _081A70DE + .4byte _081A70E8 + .4byte _081A70FC + .4byte _081A70D6 + .4byte _081A7100 + .4byte _081A7108 + .4byte _081A710E +_081A70D0: + movs r0, 0 + bl sub_81A82A4 +_081A70D6: + movs r4, 0 + b _081A711A +_081A70DA: + movs r5, 0x1C + b _081A711A +_081A70DE: + bl sub_81A7B58 + lsls r0, 24 + lsrs r5, r0, 24 + b _081A711A +_081A70E8: + movs r5, 0x30 + ldr r0, =gUnknown_0300128D + ldrb r0, [r0] + movs r7, 0xE1 + cmp r0, 0x1 + bne _081A7118 + movs r7, 0xE2 + b _081A7118 + .pool +_081A70FC: + movs r5, 0x30 + b _081A711A +_081A7100: + movs r0, 0x1 + bl sub_81A82A4 + b _081A7114 +_081A7108: + bl sub_81A8374 + b _081A70D6 +_081A710E: + movs r0, 0x5 + bl sub_81A5030 +_081A7114: + movs r7, 0x1C + movs r4, 0 +_081A7118: + movs r6, 0x1 +_081A711A: + cmp r4, 0x1 + bne _081A7126 + ldr r0, =0x00004010 + adds r1, r5, 0 + bl VarSet +_081A7126: + cmp r6, 0x1 + bne _081A7132 + ldr r0, =0x00004011 + adds r1, r7, 0 + bl VarSet +_081A7132: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A7070 + + thumb_func_start sub_81A7140 +sub_81A7140: @ 81A7140 + push {lr} + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r2, =0x00000ca9 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r2, r0, 30 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + adds r3, r1, 0 + cmp r0, 0x4 + bhi _081A723A + lsls r0, 2 + ldr r1, =_081A7174 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A7174: + .4byte _081A7188 + .4byte _081A71A0 + .4byte _081A71C4 + .4byte _081A71E8 + .4byte _081A720C +_081A7188: + ldr r0, =gScriptResult + ldr r1, [r3] + ldr r3, =0x00000e02 + adds r1, r3 + ldrh r1, [r1] + strh r1, [r0] + b _081A723A + .pool +_081A71A0: + ldr r2, =gScriptResult + ldr r1, [r3] + ldr r3, =0x00000ca9 + adds r0, r1, r3 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 29 + ldr r3, =0x00000e04 + adds r1, r3 + adds r1, r0 + ldrh r0, [r1] + b _081A7238 + .pool +_081A71C4: + ldr r2, =gScriptResult + ldr r1, [r3] + ldr r3, =0x00000ca9 + adds r0, r1, r3 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 29 + ldr r3, =0x00000e08 + adds r1, r3 + adds r1, r0 + ldrh r0, [r1] + b _081A7238 + .pool +_081A71E8: + ldr r2, =gScriptResult + ldr r1, [r3] + ldr r3, =0x00000ca9 + adds r0, r1, r3 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 29 + ldr r3, =0x00000e0c + adds r1, r3 + adds r1, r0 + ldrh r0, [r1] + b _081A7238 + .pool +_081A720C: + cmp r2, 0 + beq _081A7228 + ldr r2, =gScriptResult + ldr r0, [r3] + ldr r1, =0x00000cdc + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 4 + b _081A7236 + .pool +_081A7228: + ldr r2, =gScriptResult + ldr r0, [r3] + ldr r3, =0x00000cdc + adds r0, r3 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 3 +_081A7236: + ands r0, r1 +_081A7238: + strh r0, [r2] +_081A723A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A7140 + + thumb_func_start sub_81A7248 +sub_81A7248: @ 81A7248 + push {r4,r5,lr} + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r2, =0x00000ca9 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r3, r0, 30 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + adds r2, r1, 0 + cmp r0, 0x4 + bls _081A7264 + b _081A73AA +_081A7264: + lsls r0, 2 + ldr r1, =_081A7280 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A7280: + .4byte _081A7294 + .4byte _081A72AC + .4byte _081A72D8 + .4byte _081A7314 + .4byte _081A7344 +_081A7294: + ldr r0, [r2] + ldr r1, =gSpecialVar_0x8006 + ldrh r1, [r1] + ldr r5, =0x00000e02 + adds r0, r5 + strh r1, [r0] + b _081A73AA + .pool +_081A72AC: + ldr r0, =gSpecialVar_0x8006 + ldrh r3, [r0] + ldr r0, =0x0000270f + cmp r3, r0 + bls _081A72B8 + b _081A73AA +_081A72B8: + ldr r0, [r2] + ldr r2, =0x00000ca9 + adds r1, r0, r2 + ldrb r1, [r1] + lsls r1, 30 + lsrs r1, 29 + ldr r5, =0x00000e04 + b _081A732C + .pool +_081A72D8: + ldr r0, =gSpecialVar_0x8006 + ldrh r4, [r0] + adds r3, r4, 0 + ldr r0, =0x0000270f + cmp r3, r0 + bhi _081A73AA + ldr r1, [r2] + ldr r2, =0x00000ca9 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r2, r0, 30 + lsrs r0, r2, 29 + ldr r5, =0x00000e08 + adds r1, r5 + adds r0, r1, r0 + ldrh r0, [r0] + cmp r0, r3 + bcs _081A73AA + lsrs r0, r2, 29 + adds r0, r1, r0 + strh r4, [r0] + b _081A73AA + .pool +_081A7314: + ldr r0, =gSpecialVar_0x8006 + ldrh r3, [r0] + ldr r0, =0x0000270f + cmp r3, r0 + bhi _081A73AA + ldr r0, [r2] + ldr r2, =0x00000ca9 + adds r1, r0, r2 + ldrb r1, [r1] + lsls r1, 30 + lsrs r1, 29 + ldr r5, =0x00000e0c +_081A732C: + adds r0, r5 + adds r0, r1 + strh r3, [r0] + b _081A73AA + .pool +_081A7344: + cmp r3, 0 + beq _081A737C + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + cmp r0, 0 + beq _081A7368 + ldr r0, [r2] + ldr r1, =0x00000cdc + adds r0, r1 + ldr r1, [r0] + movs r2, 0x80 + lsls r2, 4 + orrs r1, r2 + b _081A73A8 + .pool +_081A7368: + ldr r0, [r2] + ldr r2, =0x00000cdc + adds r0, r2 + ldr r1, [r0] + ldr r2, =0xfffff7ff + b _081A73A6 + .pool +_081A737C: + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + cmp r0, 0 + beq _081A739C + ldr r0, [r2] + ldr r5, =0x00000cdc + adds r0, r5 + ldr r1, [r0] + movs r2, 0x80 + lsls r2, 3 + orrs r1, r2 + b _081A73A8 + .pool +_081A739C: + ldr r0, [r2] + ldr r1, =0x00000cdc + adds r0, r1 + ldr r1, [r0] + ldr r2, =0xfffffbff +_081A73A6: + ands r1, r2 +_081A73A8: + str r1, [r0] +_081A73AA: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A7248 + + thumb_func_start sub_81A73B8 +sub_81A73B8: @ 81A73B8 + push {lr} + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0xE + bls _081A73DC + ldr r1, =gScriptResult + movs r0, 0x1 + b _081A73E0 + .pool +_081A73DC: + ldr r1, =gScriptResult + movs r0, 0 +_081A73E0: + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A73B8 + + thumb_func_start sub_81A73EC +sub_81A73EC: @ 81A73EC + ldr r0, =gScriptResult + ldr r1, =gUnknown_0300128C + ldrb r1, [r1] + strh r1, [r0] + bx lr + .pool + thumb_func_end sub_81A73EC + + thumb_func_start sub_81A7400 +sub_81A7400: @ 81A7400 + ldr r1, =gUnknown_0300128E + movs r0, 0x1 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_81A7400 + + thumb_func_start sub_81A740C +sub_81A740C: @ 81A740C + ldr r1, =gUnknown_0300128E + movs r0, 0 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_81A740C + + thumb_func_start sub_81A7418 +sub_81A7418: @ 81A7418 + push {r4,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl VarSet + ldr r1, [r4] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl save_serialize_map + movs r0, 0x1 + bl TrySavingData + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A7418 + + thumb_func_start nullsub_76 +nullsub_76: @ 81A7460 + bx lr + thumb_func_end nullsub_76 + + thumb_func_start nullsub_124 +nullsub_124: @ 81A7464 + bx lr + thumb_func_end nullsub_124 + + thumb_func_start sub_81A7468 +sub_81A7468: @ 81A7468 + push {lr} + ldr r0, =gUnknown_03001290 + ldr r0, [r0] + cmp r0, 0x20 + beq _081A748E + cmp r0, 0x20 + bhi _081A7484 + cmp r0, 0x7 + beq _081A74BC + cmp r0, 0x10 + beq _081A7498 + b _081A74C2 + .pool +_081A7484: + cmp r0, 0x40 + beq _081A74B0 + cmp r0, 0x80 + beq _081A74A4 + b _081A74C2 +_081A748E: + ldr r1, =gScriptResult + movs r0, 0 + b _081A74C0 + .pool +_081A7498: + ldr r1, =gScriptResult + movs r0, 0x1 + b _081A74C0 + .pool +_081A74A4: + ldr r1, =gScriptResult + movs r0, 0x2 + b _081A74C0 + .pool +_081A74B0: + ldr r1, =gScriptResult + movs r0, 0x3 + b _081A74C0 + .pool +_081A74BC: + ldr r1, =gScriptResult + movs r0, 0x4 +_081A74C0: + strh r0, [r1] +_081A74C2: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A7468 + + thumb_func_start sub_81A74CC +sub_81A74CC: @ 81A74CC + ldr r0, =gScriptResult + ldr r1, =gUnknown_0300128D + ldrb r1, [r1] + strh r1, [r0] + bx lr + .pool + thumb_func_end sub_81A74CC + + thumb_func_start sub_81A74E0 +sub_81A74E0: @ 81A74E0 + push {r4,lr} + bl Random + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + movs r0, 0x1 + ands r4, r0 + adds r4, 0x1 + adds r0, r4, 0 + bl sub_81A7F38 + ldr r0, =gScriptResult + strh r4, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A74E0 + + thumb_func_start sub_81A7508 +sub_81A7508: @ 81A7508 + push {lr} + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0x4 + bhi _081A7538 + ldr r1, =gUnknown_0861231C + ldr r0, =gUnknown_03001294 + ldrb r0, [r0] + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0x2] + b _081A7560 + .pool +_081A7538: + cmp r0, 0xA + bhi _081A7554 + ldr r1, =gUnknown_0861231C + ldr r0, =gUnknown_03001294 + ldrb r0, [r0] + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0x3] + b _081A7560 + .pool +_081A7554: + ldr r1, =gUnknown_0861231C + ldr r0, =gUnknown_03001294 + ldrb r0, [r0] + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0x4] +_081A7560: + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_086123E4 + adds r0, r1 + bl ConvertBattleFrontierTrainerSpeechToString + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A7508 + + thumb_func_start sub_81A7580 +sub_81A7580: @ 81A7580 + push {lr} + ldr r0, =sub_81A7EE4 + movs r1, 0x2 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A7580 + + thumb_func_start sub_81A7594 +sub_81A7594: @ 81A7594 + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + movs r4, 0 + movs r1, 0 +_081A759E: + mov r2, sp + adds r0, r2, r4 + strb r1, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _081A759E + adds r0, r5, 0 + movs r1, 0x3A + bl GetMonData + lsls r2, r0, 16 + mov r1, sp + strb r0, [r1] + mov r0, sp + lsrs r2, 24 + strb r2, [r0, 0x1] + adds r0, r5, 0 + movs r1, 0x39 + mov r2, sp + bl SetMonData + adds r0, r5, 0 + movs r1, 0x15 + bl GetMonData + lsls r0, 24 + lsrs r6, r0, 24 + movs r4, 0 +_081A75DA: + adds r1, r4, 0 + adds r1, 0xD + adds r0, r5, 0 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + adds r2, r4, 0 + bl CalculatePPWithBonus + mov r1, sp + strb r0, [r1] + adds r1, r4, 0 + adds r1, 0x11 + adds r0, r5, 0 + mov r2, sp + bl SetMonData + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _081A75DA + mov r0, sp + movs r1, 0 + strb r1, [r0] + strb r1, [r0, 0x1] + strb r1, [r0, 0x2] + strb r1, [r0, 0x3] + adds r0, r5, 0 + movs r1, 0x37 + mov r2, sp + bl SetMonData + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81A7594 + + thumb_func_start sub_81A7628 +sub_81A7628: @ 81A7628 + push {r4,lr} + adds r4, r1, 0 + bl GetMonAbility + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + cmp r4, 0x20 + beq _081A7652 + cmp r4, 0x20 + bhi _081A7648 + cmp r4, 0x7 + beq _081A7664 + cmp r4, 0x10 + beq _081A7658 + b _081A7674 +_081A7648: + cmp r4, 0x40 + beq _081A765E + cmp r4, 0x80 + beq _081A766E + b _081A7674 +_081A7652: + cmp r0, 0x28 + bne _081A7674 + b _081A7672 +_081A7658: + cmp r0, 0x29 + bne _081A7674 + b _081A7672 +_081A765E: + cmp r0, 0x7 + bne _081A7674 + b _081A7672 +_081A7664: + cmp r0, 0xF + beq _081A7672 + cmp r0, 0x48 + bne _081A7674 + b _081A7672 +_081A766E: + cmp r0, 0x11 + bne _081A7674 +_081A7672: + movs r1, 0x1 +_081A7674: + adds r0, r1, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81A7628 + + thumb_func_start sub_81A767C +sub_81A767C: @ 81A767C + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + movs r3, 0 + cmp r1, 0x20 + beq _081A76C4 + cmp r1, 0x20 + bhi _081A7696 + cmp r1, 0x7 + beq _081A771C + cmp r1, 0x10 + beq _081A7704 + b _081A771C +_081A7696: + cmp r1, 0x40 + beq _081A76E0 + cmp r1, 0x80 + bne _081A771C + ldr r1, =gBaseStats + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0, 0x6] + cmp r2, 0x8 + beq _081A771A + cmp r2, 0x3 + beq _081A771A + ldrb r0, [r0, 0x7] + cmp r0, 0x8 + beq _081A771A + cmp r0, 0x3 + bne _081A771C + b _081A771A + .pool +_081A76C4: + ldr r0, =gBaseStats + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x6] + cmp r0, 0xF + beq _081A771A + ldrb r0, [r1, 0x7] + cmp r0, 0xF + bne _081A771C + b _081A771A + .pool +_081A76E0: + ldr r1, =gBaseStats + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0, 0x6] + cmp r2, 0x4 + beq _081A771A + cmp r2, 0xD + beq _081A771A + ldrb r0, [r0, 0x7] + cmp r0, 0x4 + beq _081A771A + cmp r0, 0xD + bne _081A771C + b _081A771A + .pool +_081A7704: + ldr r0, =gBaseStats + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x6] + cmp r0, 0xA + beq _081A771A + ldrb r0, [r1, 0x7] + cmp r0, 0xA + bne _081A771C +_081A771A: + movs r3, 0x1 +_081A771C: + adds r0, r3, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A767C + + thumb_func_start sub_81A7728 +sub_81A7728: @ 81A7728 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + movs r6, 0 +_081A7736: + mov r1, sp + adds r0, r1, r6 + strb r6, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x2 + bls _081A7736 + movs r4, 0 + mov r8, r4 +_081A774A: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r6, r0, 24 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + adds r2, r1, r6 + ldrb r3, [r2] + adds r1, r0 + ldrb r0, [r1] + strb r0, [r2] + strb r3, [r1] + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x9 + bls _081A774A + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r4, =0x00000cb2 + adds r0, r4 + ldrh r0, [r0] + movs r1, 0x1 + mov r10, r1 + cmp r0, 0x4 + bls _081A77A8 + movs r4, 0x3 + mov r10, r4 + cmp r0, 0x9 + bhi _081A77A8 + movs r0, 0x2 + mov r10, r0 +_081A77A8: + movs r1, 0 + str r1, [sp, 0x4] + ldr r7, =gUnknown_03001290 +_081A77AE: + movs r4, 0 + mov r9, r4 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x22 + bhi _081A77DC + movs r0, 0x80 + b _081A77FC + .pool +_081A77DC: + cmp r0, 0x3B + bhi _081A77E4 + movs r0, 0x20 + b _081A77FC +_081A77E4: + cmp r0, 0x4F + bhi _081A77EC + movs r0, 0x40 + b _081A77FC +_081A77EC: + cmp r1, 0x59 + bhi _081A77FA + movs r0, 0x7 + b _081A77FC +_081A77F4: + movs r0, 0x1 + mov r9, r0 + b _081A786E +_081A77FA: + movs r0, 0x10 +_081A77FC: + str r0, [r7] + ldr r0, =gUnknown_03001290 + ldr r0, [r0] + ldr r1, [sp, 0x4] + cmp r1, r0 + beq _081A7874 + str r0, [sp, 0x4] + movs r4, 0 + mov r8, r4 + movs r6, 0 +_081A7810: + mov r1, sp + adds r0, r1, r6 + ldrb r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0x37 + bl GetMonData + bl pokemon_ailments_get_primary + lsls r0, 24 + cmp r0, 0 + bne _081A7860 + adds r0, r5, 0 + movs r1, 0x39 + bl GetMonData + cmp r0, 0 + beq _081A7860 + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + adds r0, r5, 0 + movs r1, 0xB + bl GetMonData + lsls r0, 16 + lsrs r4, r0, 16 + ldr r1, [r7] + adds r0, r4, 0 + bl sub_81A767C + lsls r0, 24 + cmp r0, 0 + beq _081A77F4 +_081A7860: + cmp r8, r10 + beq _081A786E + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x2 + bls _081A7810 +_081A786E: + mov r4, r8 + cmp r4, 0 + beq _081A78CC +_081A7874: + mov r0, r9 + cmp r0, 0 + beq _081A77AE + ldr r0, =gUnknown_03001290 + ldr r0, [r0] + cmp r0, 0x20 + beq _081A7898 + cmp r0, 0x20 + bhi _081A78D0 + cmp r0, 0x7 + beq _081A78D0 + cmp r0, 0x10 + beq _081A78A4 + b _081A78D0 + .pool +_081A7898: + ldr r1, =gUnknown_0300128D + movs r0, 0x1 + b _081A78D4 + .pool +_081A78A4: + bl Random + lsls r0, 16 + lsrs r1, r0, 16 + movs r2, 0x1 + ands r1, r2 + cmp r1, 0 + beq _081A78C0 + ldr r0, =gUnknown_0300128D + strb r2, [r0] + b _081A78D6 + .pool +_081A78C0: + ldr r0, =gUnknown_0300128D + strb r1, [r0] + b _081A78D6 + .pool +_081A78CC: + movs r0, 0 + b _081A7956 +_081A78D0: + ldr r1, =gUnknown_0300128D + movs r0, 0 +_081A78D4: + strb r0, [r1] +_081A78D6: + movs r1, 0 + mov r8, r1 + movs r6, 0 +_081A78DC: + mov r4, sp + adds r0, r4, r6 + ldrb r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0x37 + bl GetMonData + bl pokemon_ailments_get_primary + lsls r0, 24 + cmp r0, 0 + bne _081A7946 + adds r0, r5, 0 + movs r1, 0x39 + bl GetMonData + cmp r0, 0 + beq _081A7946 + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + adds r0, r5, 0 + movs r1, 0xB + bl GetMonData + lsls r0, 16 + lsrs r4, r0, 16 + ldr r7, =gUnknown_03001290 + ldr r1, [r7] + adds r0, r5, 0 + bl sub_81A7628 + lsls r0, 24 + cmp r0, 0 + bne _081A7946 + ldr r1, [r7] + adds r0, r4, 0 + bl sub_81A767C + lsls r0, 24 + cmp r0, 0 + bne _081A7946 + adds r0, r5, 0 + movs r1, 0x37 + adds r2, r7, 0 + bl SetMonData +_081A7946: + cmp r8, r10 + beq _081A7954 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x2 + bls _081A78DC +_081A7954: + movs r0, 0x1 +_081A7956: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A7728 + + thumb_func_start sub_81A7974 +sub_81A7974: @ 81A7974 + push {r4-r7,lr} + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r0, [r0] + movs r7, 0x1 + cmp r0, 0x4 + bls _081A798E + movs r7, 0x3 + cmp r0, 0x9 + bhi _081A798E + movs r7, 0x2 +_081A798E: + movs r6, 0 + movs r5, 0 + b _081A79A2 + .pool +_081A799C: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_081A79A2: + cmp r5, 0x2 + bhi _081A79D8 + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =gPlayerParty + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x37 + bl GetMonData + bl pokemon_ailments_get_primary + lsls r0, 24 + cmp r0, 0 + bne _081A79D4 + adds r0, r4, 0 + movs r1, 0x39 + bl GetMonData + cmp r0, 0 + beq _081A79D4 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_081A79D4: + cmp r6, r7 + bne _081A799C +_081A79D8: + cmp r6, 0 + beq _081A79E4 + movs r0, 0x1 + b _081A79E6 + .pool +_081A79E4: + movs r0, 0 +_081A79E6: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81A7974 + + thumb_func_start sub_81A79EC +sub_81A79EC: @ 81A79EC + push {r4-r6,lr} + sub sp, 0x8 + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + movs r4, 0xE1 + lsls r4, 4 + adds r0, r4 + ldrb r2, [r0] + movs r3, 0x78 + ands r3, r2 + adds r5, r1, 0 + cmp r3, 0x40 + bne _081A7A10 + lsls r0, r2, 25 + lsrs r0, 28 + b _081A7B48 + .pool +_081A7A10: + ldr r0, =gSpecialVar_0x8007 + lsls r1, r2, 29 + ldrh r0, [r0] + lsrs r1, 29 + cmp r0, r1 + bne _081A7A34 + cmp r3, 0x18 + bne _081A7A24 + bl sub_81A7728 +_081A7A24: + ldr r0, [r5] + adds r0, r4 + ldrb r0, [r0] + lsls r0, 25 + lsrs r0, 28 + b _081A7B48 + .pool +_081A7A34: + movs r2, 0 + ldr r3, =gUnknown_0861266C + movs r1, 0 +_081A7A3A: + mov r4, sp + adds r0, r4, r2 + strb r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x7 + bls _081A7A3A + movs r4, 0x8 + ldr r0, [r5] + movs r6, 0xE1 + lsls r6, 4 + adds r0, r6 + ldrb r0, [r0] + lsls r0, 25 + lsrs r0, 28 + adds r0, r3 + ldrb r1, [r0] + movs r2, 0 + adds r5, r3, 0 + movs r3, 0x1 +_081A7A64: + adds r0, r2, r5 + ldrb r0, [r0] + cmp r0, r1 + bne _081A7A78 + mov r6, sp + adds r0, r6, r2 + strb r3, [r0] + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081A7A78: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x7 + bls _081A7A64 + mov r0, sp + ldrb r0, [r0, 0x7] + cmp r0, 0x1 + beq _081A7AA0 + bl sub_81A8554 + lsls r0, 24 + cmp r0, 0 + bne _081A7AA0 + mov r1, sp + movs r0, 0x1 + strb r0, [r1, 0x7] + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081A7AA0: + mov r0, sp + ldrb r0, [r0, 0x3] + cmp r0, 0x1 + beq _081A7ABE + bl sub_81A7974 + lsls r0, 24 + cmp r0, 0 + bne _081A7ABE + mov r1, sp + movs r0, 0x1 + strb r0, [r1, 0x3] + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081A7ABE: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + movs r1, 0xE1 + lsls r1, 4 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081A7AFA + mov r0, sp + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + beq _081A7AE6 + mov r1, sp + movs r0, 0x1 + strb r0, [r1, 0x1] + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081A7AE6: + mov r0, sp + ldrb r0, [r0, 0x4] + cmp r0, 0x1 + beq _081A7AFA + mov r1, sp + movs r0, 0x1 + strb r0, [r1, 0x4] + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081A7AFA: + adds r0, r4, 0 + bl AllocZeroed + adds r5, r0, 0 + movs r3, 0 + movs r2, 0 +_081A7B06: + mov r6, sp + adds r0, r6, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _081A7B1C + adds r1, r3, 0 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + adds r1, r5, r1 + strb r2, [r1] +_081A7B1C: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x7 + bls _081A7B06 + bl Random + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl __modsi3 + adds r0, r5, r0 + ldrb r4, [r0] + adds r0, r5, 0 + bl Free + cmp r4, 0x3 + bne _081A7B46 + bl sub_81A7728 +_081A7B46: + adds r0, r4, 0 +_081A7B48: + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A79EC + + thumb_func_start sub_81A7B58 +sub_81A7B58: @ 81A7B58 + push {r4,lr} + ldr r4, =gUnknown_03001294 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x19 + bl __umodsi3 + strb r0, [r4] + ldr r1, =gUnknown_0861231C + ldrb r0, [r4] + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A7B58 + + thumb_func_start sub_81A7B84 +sub_81A7B84: @ 81A7B84 + ldr r0, =gUnknown_0300128E + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_81A7B84 + + thumb_func_start sub_81A7B90 +sub_81A7B90: @ 81A7B90 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + bl sub_81A7D00 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r7, =gSaveBlock2Ptr + ldr r0, [r7] + ldr r4, =0x00000ca9 + adds r0, r4 + ldrb r0, [r0] + lsls r0, 30 + ldr r1, =gUnknown_08612314 + lsrs r0, 28 + adds r0, r1 + ldr r0, [r0] + str r0, [sp, 0x4] + ldr r0, =gEnemyParty + movs r1, 0xB + movs r2, 0 + bl GetMonData + adds r5, r0, 0 + lsls r0, r5, 16 + lsrs r0, 16 + bl sub_81A890C + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, [r7] + adds r0, r4 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081A7C1C + bl sub_8165CB4 + adds r7, r0, 0 + cmp r7, 0x3B + ble _081A7C08 + lsls r0, r6, 2 + ldr r1, [sp, 0x4] + adds r0, r1 + ldr r1, [r0] + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x2] + subs r7, r0 + cmp r7, 0x3B + bgt _081A7C32 +_081A7C08: + movs r7, 0x3C + b _081A7C32 + .pool +_081A7C1C: + lsls r0, r6, 2 + ldr r2, [sp, 0x4] + adds r0, r2 + ldr r1, [r0] + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x2] + movs r0, 0x32 + subs r7, r0, r1 +_081A7C32: + mov r0, r8 + cmp r0, 0x1 + bne _081A7C4A + lsls r0, r7, 24 + lsrs r0, 24 + bl sub_81A88B0 + lsls r0, 24 + cmp r0, 0 + bne _081A7C4A + movs r0, 0 + b _081A7CE2 +_081A7C4A: + ldr r0, =gEnemyParty + ldr r1, =gBaseStats + mov r8, r1 + lsls r6, 2 + mov r9, r6 + ldr r2, [sp, 0x4] + add r2, r9 + mov r10, r2 + ldr r1, [r2] + lsls r6, r5, 1 + adds r4, r6, r5 + lsls r4, 2 + adds r1, r4, r1 + ldrh r2, [r1] + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + add r1, r8 + ldrb r2, [r1, 0x13] + movs r1, 0xCA + lsls r1, 1 + muls r2, r1 + lsls r1, r7, 2 + ldr r3, =gExperienceTables + adds r1, r3 + adds r2, r1 + movs r1, 0x19 + bl SetMonData + mov r1, r10 + ldr r0, [r1] + adds r4, r0 + ldrh r1, [r4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r8 + ldrb r0, [r0, 0x17] + mov r7, r9 + cmp r0, 0 + beq _081A7CA8 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 +_081A7CA8: + str r0, [sp] + ldr r0, =gEnemyParty + movs r1, 0x2E + mov r2, sp + bl SetMonData + movs r4, 0 + adds r0, r6, r5 + lsls r6, r0, 2 +_081A7CBA: + ldr r2, [sp, 0x4] + adds r0, r7, r2 + ldr r0, [r0] + adds r0, r6, r0 + lsls r1, r4, 1 + adds r0, 0x4 + adds r0, r1 + ldrh r1, [r0] + lsls r2, r4, 24 + lsrs r2, 24 + ldr r0, =gEnemyParty + bl SetMonMoveSlot + adds r4, 0x1 + cmp r4, 0x3 + ble _081A7CBA + ldr r0, =gEnemyParty + bl CalculateMonStats + movs r0, 0x1 +_081A7CE2: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A7B90 + + thumb_func_start sub_81A7D00 +sub_81A7D00: @ 81A7D00 + push {lr} + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r2, =0x00000ca9 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 29 + ldr r2, =0x00000e04 + adds r1, r2 + adds r1, r0 + ldrh r1, [r1] + adds r2, r1, 0 + movs r0, 0x8C + lsls r0, 1 + cmp r1, r0 + bhi _081A7D34 + movs r1, 0 + b _081A7D4C + .pool +_081A7D34: + movs r0, 0x8C + lsls r0, 2 + cmp r1, r0 + bhi _081A7D40 + movs r1, 0x1 + b _081A7D4C +_081A7D40: + movs r0, 0xD2 + lsls r0, 2 + movs r1, 0x3 + cmp r2, r0 + bhi _081A7D4C + movs r1, 0x2 +_081A7D4C: + adds r0, r1, 0 + pop {r1} + bx r1 + thumb_func_end sub_81A7D00 + + thumb_func_start sub_81A7D54 +sub_81A7D54: @ 81A7D54 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_08612688 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_081A7D66: + 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 _081A7D66 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A7D54 + + thumb_func_start sub_81A7D8C +sub_81A7D8C: @ 81A7D8C + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x14] + movs r2, 0x14 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _081A7DA4 + subs r0, r1, 0x1 + strh r0, [r4, 0x14] + lsls r0, 16 + cmp r0, 0 + bne _081A7DC8 +_081A7DA4: + ldrh r0, [r4, 0xA] + strh r0, [r4, 0x14] + ldrh r0, [r4, 0x10] + ldrh r1, [r4, 0x16] + adds r0, r1 + strh r0, [r4, 0x16] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + ble _081A7DBC + movs r0, 0x10 + strh r0, [r4, 0x16] +_081A7DBC: + movs r0, 0x1 + negs r0, r0 + ldrb r1, [r4, 0x16] + ldr r2, =0x00002d6b + bl BlendPalettes +_081A7DC8: + movs r2, 0x16 + ldrsh r0, [r4, r2] + cmp r0, 0xF + ble _081A7DDA + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + ldrh r0, [r4, 0xC] + strh r0, [r4, 0x14] +_081A7DDA: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A7D8C + + thumb_func_start sub_81A7DE8 +sub_81A7DE8: @ 81A7DE8 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x14] + movs r2, 0x14 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _081A7E00 + subs r0, r1, 0x1 + strh r0, [r4, 0x14] + lsls r0, 16 + cmp r0, 0 + bne _081A7E22 +_081A7E00: + ldrh r0, [r4, 0xC] + strh r0, [r4, 0x14] + ldrh r0, [r4, 0x16] + ldrh r1, [r4, 0x12] + subs r0, r1 + strh r0, [r4, 0x16] + lsls r0, 16 + cmp r0, 0 + bge _081A7E16 + movs r0, 0 + strh r0, [r4, 0x16] +_081A7E16: + movs r0, 0x1 + negs r0, r0 + ldrb r1, [r4, 0x16] + ldr r2, =0x00002d6b + bl BlendPalettes +_081A7E22: + movs r0, 0x16 + ldrsh r1, [r4, r0] + cmp r1, 0 + bne _081A7E56 + ldrh r0, [r4, 0xE] + subs r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + cmp r0, 0 + bne _081A7E50 + ldr r0, =sub_81A7D54 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + b _081A7E56 + .pool +_081A7E50: + ldrh r0, [r4, 0xA] + strh r0, [r4, 0x14] + strh r1, [r4, 0x8] +_081A7E56: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81A7DE8 + + thumb_func_start sub_81A7E60 +sub_81A7E60: @ 81A7E60 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x4 + mov r8, r0 + adds r4, r1, 0 + adds r5, r2, 0 + adds r6, r3, 0 + ldr r3, [sp, 0x18] + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 16 + lsrs r6, 16 + lsls r3, 16 + lsrs r3, 16 + ldr r0, =sub_81A7D54 + movs r1, 0x3 + str r3, [sp] + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + mov r0, r8 + strh r0, [r1, 0xA] + strh r4, [r1, 0xC] + strh r5, [r1, 0xE] + strh r6, [r1, 0x10] + ldr r3, [sp] + strh r3, [r1, 0x12] + strh r0, [r1, 0x14] + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A7E60 + + thumb_func_start sub_81A7EC4 +sub_81A7EC4: @ 81A7EC4 + push {lr} + ldr r0, =sub_81A7D54 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _081A7EDC + movs r0, 0 + b _081A7EDE + .pool +_081A7EDC: + movs r0, 0x1 +_081A7EDE: + pop {r1} + bx r1 + thumb_func_end sub_81A7EC4 + + thumb_func_start sub_81A7EE4 +sub_81A7EE4: @ 81A7EE4 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r1 + ldrh r2, [r1, 0x8] + movs r3, 0x8 + ldrsh r0, [r1, r3] + cmp r0, 0 + bne _081A7F1C + adds r0, r2, 0x1 + strh r0, [r1, 0x8] + movs r0, 0x2 + str r0, [sp] + movs r0, 0 + movs r1, 0 + movs r2, 0x3 + movs r3, 0x2 + bl sub_81A7E60 + b _081A7F30 + .pool +_081A7F1C: + bl sub_81A7EC4 + lsls r0, 24 + cmp r0, 0 + beq _081A7F30 + bl EnableBothScriptContexts + adds r0, r4, 0 + bl DestroyTask +_081A7F30: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81A7EE4 + + thumb_func_start sub_81A7F38 +sub_81A7F38: @ 81A7F38 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + cmp r0, 0 + bne _081A7F50 + b _081A807A +_081A7F50: + movs r0, 0 + mov r8, r0 +_081A7F54: + mov r0, sp + add r0, r8 + mov r1, r8 + strb r1, [r0] + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x2 + bls _081A7F54 + movs r5, 0 +_081A7F6C: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r4, r0, 24 + mov r2, sp + add r2, r8 + ldrb r3, [r2] + mov r0, sp + adds r1, r0, r4 + ldrb r0, [r1] + strb r0, [r2] + strb r3, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x9 + bls _081A7F6C + movs r1, 0 + mov r8, r1 +_081A7FB0: + movs r0, 0 + mov r10, r0 + mov r4, sp + add r4, r8 + ldrb r1, [r4] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r7, r1, r0 + adds r0, r7, 0 + movs r1, 0x39 + bl GetMonData + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r7, 0 + movs r1, 0x3A + bl GetMonData + lsls r0, 16 + lsrs r6, r0, 16 + str r4, [sp, 0x8] + cmp r5, r6 + bcc _081A8044 + adds r0, r7, 0 + movs r1, 0x37 + bl GetMonData + bl pokemon_ailments_get_primary + lsls r0, 24 + cmp r0, 0 + beq _081A7FFC + movs r0, 0x1 + mov r10, r0 + b _081A8048 + .pool +_081A7FFC: + adds r0, r7, 0 + movs r1, 0x15 + bl GetMonData + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r4, 0 + b _081A8014 +_081A800E: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081A8014: + cmp r4, 0x3 + bhi _081A8048 + adds r1, r4, 0 + adds r1, 0xD + adds r0, r7, 0 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + mov r1, r9 + adds r2, r4, 0 + bl CalculatePPWithBonus + lsls r0, 24 + lsrs r6, r0, 24 + adds r1, r4, 0 + adds r1, 0x11 + adds r0, r7, 0 + bl GetMonData + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, r6 + bcs _081A800E +_081A8044: + movs r1, 0x1 + mov r10, r1 +_081A8048: + mov r0, r10 + cmp r0, 0x1 + bne _081A806C + ldr r0, [sp, 0x8] + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + bl sub_81A7594 + ldr r0, [sp, 0x4] + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + cmp r0, 0 + beq _081A807A +_081A806C: + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x2 + bls _081A7FB0 +_081A807A: + 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_81A7F38 + + thumb_func_start sub_81A8090 +sub_81A8090: @ 81A8090 + push {r4,lr} + ldr r4, =gScriptResult + bl InBattlePike + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A8090 + + thumb_func_start InBattlePike +InBattlePike: @ 81A80A8 + push {lr} + movs r2, 0 + ldr r0, =gMapHeader + ldrh r1, [r0, 0x12] + ldr r3, =0xfffffea1 + adds r0, r1, r3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bls _081A80CA + movs r0, 0xB3 + lsls r0, 1 + cmp r1, r0 + beq _081A80CA + adds r0, 0x1 + cmp r1, r0 + bne _081A80CC +_081A80CA: + movs r2, 0x1 +_081A80CC: + adds r0, r2, 0 + pop {r1} + bx r1 + .pool + thumb_func_end InBattlePike + + thumb_func_start sub_81A80DC +sub_81A80DC: @ 81A80DC + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, =gScriptResult + movs r0, 0 + strh r0, [r4] + movs r0, 0x1 + bl sub_81A8590 + lsls r0, 24 + cmp r0, 0 + beq _081A8138 + movs r0, 0x1 + strh r0, [r4] + bl Random + ldr r5, =gSaveBlock2Ptr + ldr r4, [r5] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x6 + bl __umodsi3 + movs r3, 0xE1 + lsls r3, 4 + adds r4, r3 + movs r1, 0x7 + ands r1, r0 + ldrb r2, [r4] + movs r0, 0x8 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4] + ldr r2, [r5] + adds r2, r3 + ldrb r1, [r2] + movs r0, 0x79 + negs r0, r0 + ands r0, r1 + movs r1, 0x40 + b _081A8248 + .pool +_081A8138: + bl Random + ldr r7, =gSaveBlock2Ptr + ldr r4, [r7] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + movs r3, 0xE1 + lsls r3, 4 + adds r4, r3 + movs r1, 0x7 + ands r1, r0 + ldrb r2, [r4] + movs r0, 0x8 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4] + ldr r0, [r7] + adds r0, r3 + ldrb r1, [r0] + movs r0, 0x80 + ands r0, r1 + movs r6, 0x8 + cmp r0, 0 + beq _081A8172 + movs r6, 0x6 +_081A8172: + adds r0, r6, 0 + bl AllocZeroed + adds r5, r0, 0 + movs r2, 0 + movs r3, 0 + cmp r2, r6 + bcs _081A81BE + adds r4, r7, 0 +_081A8184: + ldr r0, [r4] + movs r1, 0xE1 + lsls r1, 4 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081A81B0 + cmp r2, 0x1 + beq _081A81B4 + cmp r2, 0x4 + beq _081A81B4 + adds r1, r3, 0 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + adds r1, r5, r1 + strb r2, [r1] + b _081A81B4 + .pool +_081A81B0: + adds r0, r5, r2 + strb r2, [r0] +_081A81B4: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r6 + bcc _081A8184 +_081A81BE: + bl Random + ldr r7, =gSaveBlock2Ptr + ldr r4, [r7] + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl __modsi3 + adds r0, r5, r0 + ldrb r0, [r0] + movs r6, 0xE1 + lsls r6, 4 + adds r4, r6 + movs r1, 0xF + ands r1, r0 + lsls r1, 3 + ldrb r2, [r4] + movs r0, 0x79 + negs r0, r0 + mov r8, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4] + adds r0, r5, 0 + bl Free + ldr r0, [r7] + adds r0, r6 + ldrb r1, [r0] + movs r0, 0x78 + ands r0, r1 + cmp r0, 0x18 + bne _081A821C + bl sub_81A7974 + lsls r0, 24 + cmp r0, 0 + bne _081A821C + ldr r2, [r7] + adds r2, r6 + ldrb r1, [r2] + mov r0, r8 + ands r0, r1 + movs r1, 0x10 + orrs r0, r1 + strb r0, [r2] +_081A821C: + ldr r5, =gSaveBlock2Ptr + ldr r0, [r5] + movs r4, 0xE1 + lsls r4, 4 + adds r0, r4 + ldrb r1, [r0] + movs r0, 0x78 + ands r0, r1 + cmp r0, 0x38 + bne _081A824C + bl sub_81A8554 + lsls r0, 24 + cmp r0, 0 + bne _081A824C + ldr r2, [r5] + adds r2, r4 + ldrb r1, [r2] + movs r0, 0x79 + negs r0, r0 + ands r0, r1 + movs r1, 0x10 +_081A8248: + orrs r0, r1 + strb r0, [r2] +_081A824C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A80DC + + thumb_func_start sub_81A825C +sub_81A825C: @ 81A825C + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + movs r2, 0xE1 + lsls r2, 4 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 29 + lsrs r0, 29 + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_81A825C + + thumb_func_start sub_81A827C +sub_81A827C: @ 81A827C + ldr r2, =gScriptResult + ldr r1, =gUnknown_0861266C + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + movs r3, 0xE1 + lsls r3, 4 + adds r0, r3 + ldrb r0, [r0] + lsls r0, 25 + lsrs r0, 28 + adds r0, r1 + ldrb r0, [r0] + strh r0, [r2] + bx lr + .pool + thumb_func_end sub_81A827C + + thumb_func_start sub_81A82A4 +sub_81A82A4: @ 81A82A4 + push {r4-r7,lr} + lsls r0, 24 + movs r7, 0x6 + cmp r0, 0 + bne _081A82B0 + movs r7, 0x1 +_081A82B0: + ldr r4, =gSaveBlock2Ptr + ldr r1, [r4] + ldr r2, =0x00000ca9 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 29 + ldr r2, =0x00000e04 + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + movs r1, 0xE + bl __udivsi3 + lsls r0, 16 + lsrs r6, r0, 16 + adds r5, r4, 0 +_081A82D2: + lsls r0, r6, 24 + lsrs r0, 24 + adds r1, r7, 0 + bl sub_8162548 + lsls r0, 16 + lsrs r4, r0, 16 + movs r3, 0 + ldr r1, [r5] + ldr r2, =0x00000cb2 + adds r0, r1, r2 + ldrh r0, [r0] + subs r2, r0, 0x1 + cmp r3, r2 + bge _081A831A + ldr r0, =0x00000cb4 + adds r1, r0 + b _081A8314 + .pool +_081A830C: + adds r1, 0x2 + adds r3, 0x1 + cmp r3, r2 + bge _081A831A +_081A8314: + ldrh r0, [r1] + cmp r0, r4 + bne _081A830C +_081A831A: + ldr r0, [r5] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r0, [r0] + subs r0, 0x1 + cmp r3, r0 + bne _081A82D2 + ldr r5, =gTrainerBattleOpponent_A + strh r4, [r5] + ldr r1, =gUnknown_0203BC88 + ldr r0, =gBattleFrontierTrainers + str r0, [r1] + ldrh r0, [r5] + movs r1, 0 + bl sub_8162614 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r0, =0x00000cb2 + adds r2, r1, r0 + ldrh r0, [r2] + cmp r0, 0xD + bhi _081A8356 + subs r0, 0x1 + lsls r0, 1 + ldr r2, =0x00000cb4 + adds r1, r2 + adds r1, r0 + ldrh r0, [r5] + strh r0, [r1] +_081A8356: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A82A4 + + thumb_func_start sub_81A8374 +sub_81A8374: @ 81A8374 + push {r4-r7,lr} + ldr r4, =gSaveBlock2Ptr + ldr r1, [r4] + ldr r2, =0x00000ca9 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 29 + ldr r2, =0x00000e04 + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + movs r1, 0xE + bl __udivsi3 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r1, =gUnknown_0203BC88 + ldr r0, =gBattleFrontierTrainers + str r0, [r1] + lsls r7, r5, 24 + adds r6, r4, 0 +_081A83A0: + lsls r0, r5, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_8162548 + lsls r0, 16 + lsrs r4, r0, 16 + movs r3, 0 + ldr r1, [r6] + ldr r2, =0x00000cb2 + adds r0, r1, r2 + ldrh r0, [r0] + subs r2, r0, 0x1 + cmp r3, r2 + bge _081A83EE + ldr r0, =0x00000cb4 + adds r1, r0 + b _081A83E8 + .pool +_081A83E0: + adds r1, 0x2 + adds r3, 0x1 + cmp r3, r2 + bge _081A83EE +_081A83E8: + ldrh r0, [r1] + cmp r0, r4 + bne _081A83E0 +_081A83EE: + ldr r0, [r6] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r0, [r0] + subs r0, 0x1 + cmp r3, r0 + bne _081A83A0 + ldr r5, =gTrainerBattleOpponent_A + strh r4, [r5] + ldrh r0, [r5] + movs r1, 0 + bl sub_8162614 + ldr r3, =gSaveBlock2Ptr + ldr r1, [r3] + ldr r0, =0x00000cb2 + adds r2, r1, r0 + ldrh r0, [r2] + cmp r0, 0xE + bhi _081A8424 + subs r0, 0x1 + lsls r0, 1 + ldr r2, =0x00000cb4 + adds r1, r2 + adds r1, r0 + ldrh r0, [r5] + strh r0, [r1] +_081A8424: + adds r5, r3, 0 +_081A8426: + lsrs r0, r7, 24 + movs r1, 0x1 + bl sub_8162548 + lsls r0, 16 + lsrs r4, r0, 16 + movs r3, 0 + ldr r1, [r5] + ldr r2, =0x00000cb2 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r3, r0 + bge _081A8466 + adds r2, 0x2 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r0, r4 + beq _081A8466 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + subs r2, 0x2 + adds r0, r1, r2 + ldrh r2, [r0] + ldr r0, =0x00000cb4 + adds r1, r0 +_081A8458: + adds r1, 0x2 + adds r3, 0x1 + cmp r3, r2 + bge _081A8466 + ldrh r0, [r1] + cmp r0, r4 + bne _081A8458 +_081A8466: + ldr r0, [r5] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r0, [r0] + cmp r3, r0 + bne _081A8426 + ldr r5, =gTrainerBattleOpponent_B + strh r4, [r5] + ldrh r0, [r5] + movs r1, 0x1 + bl sub_8162614 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r0, =0x00000cb2 + adds r2, r1, r0 + ldrh r0, [r2] + cmp r0, 0xD + bhi _081A849A + subs r0, 0x2 + lsls r0, 1 + ldr r2, =0x00000cb4 + adds r1, r2 + adds r1, r0 + ldrh r0, [r5] + strh r0, [r1] +_081A849A: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A8374 + + thumb_func_start sub_81A84B4 +sub_81A84B4: @ 81A84B4 + push {r4,r5,lr} + movs r2, 0 + ldr r5, =gSaveBlock2Ptr + ldr r4, =0x00000cb4 + ldr r0, =0x0000ffff + adds r3, r0, 0 +_081A84C0: + ldr r1, [r5] + lsls r0, r2, 1 + adds r1, r4 + adds r1, r0 + ldrh r0, [r1] + orrs r0, r3 + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xD + bls _081A84C0 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A84B4 + + thumb_func_start sub_81A84EC +sub_81A84EC: @ 81A84EC + push {lr} + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0 + bne _081A8524 + ldr r3, =gTrainerBattleOpponent_A + ldrh r1, [r3] + ldr r0, =0x0000012b + cmp r1, r0 + bhi _081A8542 + ldr r2, =gUnknown_0203BC88 + movs r0, 0x34 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0xC + bl ConvertBattleFrontierTrainerSpeechToString + b _081A8542 + .pool +_081A8524: + cmp r0, 0x1 + bne _081A8542 + ldr r3, =gTrainerBattleOpponent_B + ldrh r1, [r3] + ldr r0, =0x0000012b + cmp r1, r0 + bhi _081A8542 + ldr r2, =gUnknown_0203BC88 + movs r0, 0x34 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0xC + bl ConvertBattleFrontierTrainerSpeechToString +_081A8542: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A84EC + + thumb_func_start sub_81A8554 +sub_81A8554: @ 81A8554 + push {r4-r6,lr} + ldr r5, =gPlayerParty + movs r6, 0 + movs r4, 0 +_081A855C: + adds r0, r5, 0 + movs r1, 0x39 + bl GetMonData + cmp r0, 0 + bne _081A856E + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_081A856E: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, 0x64 + cmp r4, 0x2 + bls _081A855C + cmp r6, 0x1 + bhi _081A8588 + movs r0, 0x1 + b _081A858A + .pool +_081A8588: + movs r0, 0 +_081A858A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81A8554 + + thumb_func_start sub_81A8590 +sub_81A8590: @ 81A8590 + push {r4-r6,lr} + lsls r0, 24 + movs r6, 0 + ldr r1, =gSaveBlock2Ptr + ldr r2, [r1] + ldr r3, =0x00000ca9 + adds r1, r2, r3 + ldrb r1, [r1] + lsls r1, 30 + lsrs r1, 29 + ldr r3, =0x00000e04 + adds r2, r3 + adds r2, r1 + lsrs r4, r0, 24 + ldrh r2, [r2] + adds r0, r4, r2 + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x5 + bl sub_81A3B30 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + blt _081A85F0 + cmp r2, 0x1 + bgt _081A85F0 + ldr r1, =gUnknown_086125DC + adds r0, r2, 0 + adds r0, 0x14 + adds r0, r1 + ldrb r0, [r0] + ldrb r1, [r1, 0x17] + subs r0, r1 + cmp r4, r0 + bne _081A8634 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + b _081A8634 + .pool +_081A85F0: + ldr r5, =gUnknown_086125DC + movs r0, 0x5 + lsls r3, r0, 2 + adds r0, r3, r5 + ldrb r1, [r0] + adds r0, r5, 0x3 + adds r0, r3, r0 + ldrb r2, [r0] + subs r1, r2 + cmp r4, r1 + bne _081A8610 + movs r6, 0x3 + b _081A8634 + .pool +_081A8610: + adds r0, r5, 0x1 + adds r0, r3, r0 + ldrb r1, [r0] + subs r0, r1, r2 + cmp r4, r0 + beq _081A8632 + cmp r4, r1 + bls _081A8634 + subs r0, r4, r1 + adds r0, r2 + adds r1, r5, 0x2 + adds r1, r3, r1 + ldrb r1, [r1] + bl __modsi3 + cmp r0, 0 + bne _081A8634 +_081A8632: + movs r6, 0x4 +_081A8634: + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81A8590 + + thumb_func_start sub_81A863C +sub_81A863C: @ 81A863C + push {r4,lr} + ldr r4, =gScriptResult + movs r0, 0 + bl sub_81A8590 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A863C + + thumb_func_start sub_81A8658 +sub_81A8658: @ 81A8658 + push {r4,lr} + ldr r3, =gUnknown_08612675 + ldr r2, =gSpecialVar_0x8007 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + movs r1, 0xE1 + lsls r1, 4 + adds r0, r1 + ldrb r1, [r0] + lsls r1, 29 + lsrs r1, 29 + lsls r0, r1, 1 + adds r0, r1 + ldrh r2, [r2] + adds r0, r2 + adds r0, r3 + ldrb r4, [r0] + adds r0, r4, 0 + bl sub_81A7F38 + ldr r0, =gScriptResult + strh r4, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A8658 + + thumb_func_start sub_81A869C +sub_81A869C: @ 81A869C + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r0, =gSpecialVar_0x8005 + ldrb r1, [r0] + movs r0, 0xE1 + lsls r0, 4 + adds r2, r0 + lsls r1, 7 + ldrb r3, [r2] + movs r0, 0x7F + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + bx lr + .pool + thumb_func_end sub_81A869C + + thumb_func_start sub_81A86C0 +sub_81A86C0: @ 81A86C0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r1, =gScriptResult + movs r0, 0x1 + strh r0, [r1] + movs r0, 0 + mov r10, r0 +_081A86D4: + movs r0, 0 + mov r9, r0 + movs r0, 0x64 + mov r1, r10 + muls r1, r0 + ldr r0, =gPlayerParty + adds r7, r1, r0 + adds r0, r7, 0 + movs r1, 0x39 + bl GetMonData + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r7, 0 + movs r1, 0x3A + bl GetMonData + lsls r0, 16 + lsrs r5, r0, 16 + cmp r4, r5 + bcc _081A8762 + adds r0, r7, 0 + movs r1, 0x37 + bl GetMonData + bl pokemon_ailments_get_primary + lsls r0, 24 + cmp r0, 0 + bne _081A8762 + adds r0, r7, 0 + movs r1, 0x15 + bl GetMonData + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r6, 0 + b _081A8732 + .pool +_081A872C: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_081A8732: + cmp r6, 0x3 + bhi _081A8766 + adds r1, r6, 0 + adds r1, 0xD + adds r0, r7, 0 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + mov r1, r8 + adds r2, r6, 0 + bl CalculatePPWithBonus + lsls r0, 24 + lsrs r5, r0, 24 + adds r1, r6, 0 + adds r1, 0x11 + adds r0, r7, 0 + bl GetMonData + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, r5 + bcs _081A872C +_081A8762: + movs r0, 0x1 + mov r9, r0 +_081A8766: + mov r0, r9 + cmp r0, 0x1 + bne _081A8778 + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] + b _081A8786 + .pool +_081A8778: + mov r0, r10 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + cmp r0, 0x2 + bls _081A86D4 +_081A8786: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81A86C0 + + thumb_func_start sub_81A8794 +sub_81A8794: @ 81A8794 + push {r4-r7,lr} + movs r5, 0 + ldr r7, =gSaveBlock1Ptr + ldr r6, =gSaveBlock2Ptr +_081A879C: + ldr r0, [r6] + lsls r4, r5, 1 + ldr r1, =0x00000caa + adds r0, r1 + adds r0, r4 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + movs r2, 0xEA + lsls r2, 1 + adds r1, r2 + ldr r0, [r7] + adds r0, r1 + movs r1, 0xC + bl GetMonData + ldr r1, [r6] + ldr r2, =0x00000e12 + adds r1, r2 + adds r1, r4 + strh r0, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _081A879C + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A8794 + + thumb_func_start sub_81A87E8 +sub_81A87E8: @ 81A87E8 + push {r4,lr} + movs r4, 0 +_081A87EC: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + lsls r3, r4, 1 + ldr r1, =0x00000caa + adds r0, r2, r1 + adds r0, r3 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gBattleScripting + 0x14 + adds r0, r1 + ldr r1, =0x00000e12 + adds r3, r1 + adds r2, r3 + movs r1, 0xC + bl SetMonData + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _081A87EC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A87E8 + + thumb_func_start sub_81A8830 +sub_81A8830: @ 81A8830 + push {r4-r6,lr} + ldr r3, =gSaveBlock2Ptr + ldr r1, [r3] + ldr r2, =0x00000ca9 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + ldr r0, =0x00000ca8 + adds r1, r0 + movs r4, 0 + strb r4, [r1] + ldr r1, [r3] + ldr r6, =0x00000cb2 + adds r0, r1, r6 + strh r4, [r0] + adds r1, r2 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r3, [r3] + ldr r0, =0x00000cdc + adds r2, r3, r0 + ldr r1, =gUnknown_08612690 + lsls r0, r5, 2 + adds r0, r1 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _081A887C + lsls r1, r5, 1 + ldr r2, =0x00000e04 + adds r0, r3, r2 + adds r0, r1 + strh r4, [r0] +_081A887C: + ldr r0, =gTrainerBattleOpponent_A + strh r4, [r0] + ldr r1, =gBattleOutcome + movs r0, 0 + strb r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A8830 + + thumb_func_start sub_81A88B0 +sub_81A88B0: @ 81A88B0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =gPlayerParty + adds r0, r4, 0 + movs r1, 0x6 + bl GetMonData + cmp r0, 0 + bne _081A8904 + adds r0, r4, 0 + bl GetMonAbility + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x33 + beq _081A88D6 + cmp r0, 0x16 + bne _081A8904 +_081A88D6: + adds r0, r4, 0 + movs r1, 0x38 + bl GetMonData + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bls _081A8904 + subs r0, 0x5 + cmp r5, r0 + bgt _081A8904 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081A8904 + movs r0, 0 + b _081A8906 + .pool +_081A8904: + movs r0, 0x1 +_081A8906: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81A88B0 + + thumb_func_start sub_81A890C +sub_81A890C: @ 81A890C + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, =0x0000017b + cmp r2, r0 + bne _081A8920 + movs r1, 0 + b _081A892A + .pool +_081A8920: + ldr r0, =0x00000149 + movs r1, 0x2 + cmp r2, r0 + bne _081A892A + movs r1, 0x1 +_081A892A: + adds r0, r1, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A890C + + thumb_func_start sub_81A8934 +@ void sub_81A8934(u8) +sub_81A8934: @ 81A8934 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =gUnknown_0203CE50 + ldr r0, [r4] + cmp r0, 0 + bne _081A894A + movs r0, 0x44 + bl AllocZeroed + str r0, [r4] +_081A894A: + ldr r0, [r4] + adds r0, 0x41 + strb r5, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A8934 + + thumb_func_start sub_81A895C +sub_81A895C: @ 81A895C + push {r4,lr} + ldr r4, =gUnknown_0203CE50 + ldr r0, [r4] + cmp r0, 0 + beq _081A896E + bl Free + movs r0, 0 + str r0, [r4] +_081A896E: + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + bl GetFieldObjectIdByLocalIdAndMap + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gMapObjects + adds r0, r1 + bl FieldObjectClearAnimIfSpecialAnimFinished + bl sub_80D338C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A895C + + thumb_func_start sub_81A89A0 +sub_81A89A0: @ 81A89A0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0xC7 + lsls r1, 4 + adds r1, r0 + mov r9, r1 + movs r3, 0 + mov r10, r3 + mov r8, r3 +_081A89C4: + mov r0, r8 + lsls r4, r0, 1 + adds r1, r4, r0 + lsls r1, 3 + add r1, r9 + ldrh r0, [r1, 0x4] + adds r0, 0x7 + ldrh r1, [r1, 0x6] + adds r1, 0x7 + lsls r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + bl MapGridGetMetatileIdAt + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, =gUnknown_0203CE50 + ldr r0, [r0] + adds r0, 0x41 + ldrb r0, [r0] + movs r2, 0xA6 + lsls r2, 2 + cmp r0, 0 + bne _081A89F8 + subs r2, 0x48 +_081A89F8: + ldr r0, =0x0000024f + cmp r1, r0 + bls _081A8AD4 + subs r1, r2 + adds r0, r1, 0 + cmp r1, 0 + bge _081A8A08 + adds r0, r1, 0x7 +_081A8A08: + asrs r2, r0, 3 + lsls r0, r2, 24 + lsrs r0, 24 + cmp r0, 0x4 + bhi _081A8AD4 + ldr r3, [sp] + cmp r0, r3 + bne _081A8AD4 + lsls r0, r2, 3 + subs r0, r1, r0 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bhi _081A8AD4 + movs r1, 0 + movs r2, 0 + cmp r5, 0x1 + beq _081A8A58 + cmp r5, 0x1 + bgt _081A8A44 + cmp r5, 0 + beq _081A8A4E + b _081A8AD4 + .pool +_081A8A44: + cmp r5, 0x2 + beq _081A8A64 + cmp r5, 0x3 + beq _081A8A70 + b _081A8AD4 +_081A8A4E: + ldr r7, =gUnknown_08612698 + movs r1, 0x1 + b _081A8A74 + .pool +_081A8A58: + ldr r7, =gUnknown_0861269C + movs r2, 0x1 + b _081A8A74 + .pool +_081A8A64: + ldr r7, =gUnknown_086126A0 + movs r1, 0xFF + b _081A8A74 + .pool +_081A8A70: + ldr r7, =gUnknown_086126A4 + movs r2, 0xFF +_081A8A74: + mov r3, r8 + adds r0, r4, r3 + lsls r0, 3 + mov r3, r9 + adds r4, r0, r3 + lsls r0, r1, 24 + asrs r0, 24 + ldrh r1, [r4, 0x4] + adds r0, r1 + strh r0, [r4, 0x4] + lsls r0, r2, 24 + asrs r0, 24 + ldrh r3, [r4, 0x6] + adds r0, r3 + strh r0, [r4, 0x6] + ldrb r0, [r4] + ldr r6, =gSaveBlock1Ptr + ldr r2, [r6] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl GetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x10 + beq _081A8ACC + mov r0, r8 + adds r1, r5, 0 + bl sub_81A8D60 + ldrb r4, [r4] + mov r10, r4 + mov r0, r10 + ldr r2, [r6] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + adds r3, r7, 0 + bl exec_movement + b _081A8AD4 + .pool +_081A8ACC: + mov r0, r8 + adds r1, r5, 0 + bl sub_81A8D94 +_081A8AD4: + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x3F + bhi _081A8AE4 + b _081A89C4 +_081A8AE4: + mov r0, r10 + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81A89A0 + + thumb_func_start sub_81A8AF8 +sub_81A8AF8: @ 81A8AF8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r1, =gUnknown_0203CE50 + ldr r2, [r1] + cmp r2, 0 + bne _081A8B0C + b _081A8D4A +_081A8B0C: + adds r0, r2, 0 + adds r0, 0x41 + ldrb r0, [r0] + movs r3, 0xA6 + lsls r3, 2 + mov r10, r3 + cmp r0, 0 + bne _081A8B22 + movs r0, 0x94 + lsls r0, 2 + mov r10, r0 +_081A8B22: + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r3, 0xC7 + lsls r3, 4 + adds r7, r0, r3 + movs r0, 0 + mov r9, r0 + adds r0, r2, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r9, r0 + bcc _081A8B3C + b _081A8D4A +_081A8B3C: + mov r8, r1 +_081A8B3E: + mov r1, r8 + ldr r0, [r1] + mov r2, r9 + lsls r4, r2, 2 + adds r0, r4 + ldrb r0, [r0, 0x1] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r7 + ldrh r0, [r1, 0x4] + adds r0, 0x7 + ldrh r1, [r1, 0x6] + adds r1, 0x7 + lsls r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + bl MapGridGetMetatileIdAt + lsls r0, 16 + lsrs r0, 16 + mov r3, r10 + subs r1, r0, r3 + adds r0, r1, 0 + cmp r1, 0 + bge _081A8B76 + adds r0, r1, 0x7 +_081A8B76: + asrs r0, 3 + lsls r0, 3 + subs r0, r1, r0 + lsls r0, 24 + lsrs r0, 24 + mov r2, r8 + ldr r1, [r2] + adds r1, r4 + ldrb r1, [r1] + subs r0, r1 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + blt _081A8B96 + cmp r1, 0x3 + bne _081A8BAC +_081A8B96: + movs r0, 0x3 + negs r0, r0 + movs r6, 0 + cmp r1, r0 + bne _081A8BB4 + b _081A8BB2 + .pool +_081A8BAC: + movs r6, 0x2 + cmp r1, 0 + ble _081A8BB4 +_081A8BB2: + movs r6, 0x1 +_081A8BB4: + ldr r5, =gUnknown_0203CE50 + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + ldrb r0, [r0] + ldr r1, =gSaveBlock1Ptr + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl GetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x10 + bne _081A8BDC + b _081A8D32 +_081A8BDC: + ldr r0, =gMapObjects + lsls r1, r2, 3 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x18] + lsls r0, 28 + lsrs r0, 28 + adds r1, r0, 0 + cmp r6, 0 + bne _081A8C9C + cmp r0, 0x2 + beq _081A8C60 + cmp r0, 0x2 + bgt _081A8C0C + cmp r0, 0x1 + beq _081A8C30 + b _081A8D32 + .pool +_081A8C0C: + cmp r0, 0x3 + beq _081A8C48 + cmp r0, 0x4 + beq _081A8C16 + b _081A8D32 +_081A8C16: + ldr r3, =gUnknown_086126AE + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + movs r1, 0x7 + b _081A8C72 + .pool +_081A8C30: + ldr r3, =gUnknown_086126A8 + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + movs r1, 0xA + b _081A8C72 + .pool +_081A8C48: + ldr r3, =gUnknown_086126AA + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + movs r1, 0x8 + b _081A8C72 + .pool +_081A8C60: + ldr r3, =gUnknown_086126AC + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + movs r1, 0x9 +_081A8C72: + strb r1, [r0, 0x9] + mov r1, r8 + ldr r0, [r1] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + ldrb r0, [r0] + ldr r1, =gSaveBlock1Ptr + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl exec_movement + b _081A8D32 + .pool +_081A8C9C: + cmp r6, 0x1 + bne _081A8D32 + cmp r0, 0x2 + beq _081A8D00 + cmp r0, 0x2 + bgt _081A8CAE + cmp r0, 0x1 + beq _081A8CD0 + b _081A8D32 +_081A8CAE: + cmp r1, 0x3 + beq _081A8CE8 + cmp r1, 0x4 + bne _081A8D32 + ldr r3, =gUnknown_086126AA + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + movs r1, 0x8 + b _081A8D12 + .pool +_081A8CD0: + ldr r3, =gUnknown_086126AC + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + movs r1, 0x9 + b _081A8D12 + .pool +_081A8CE8: + ldr r3, =gUnknown_086126AE + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + movs r1, 0x7 + b _081A8D12 + .pool +_081A8D00: + ldr r3, =gUnknown_086126A8 + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + movs r1, 0xA +_081A8D12: + strb r1, [r0, 0x9] + mov r2, r8 + ldr r0, [r2] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + ldrb r0, [r0] + ldr r1, =gSaveBlock1Ptr + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl exec_movement +_081A8D32: + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + mov r3, r8 + ldr r0, [r3] + adds r0, 0x40 + ldrb r0, [r0] + cmp r9, r0 + bcs _081A8D4A + b _081A8B3E +_081A8D4A: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A8AF8 + + thumb_func_start sub_81A8D60 +sub_81A8D60: @ 81A8D60 + push {r4,lr} + ldr r4, =gUnknown_0203CE50 + ldr r3, [r4] + adds r2, r3, 0 + adds r2, 0x40 + ldrb r2, [r2] + lsls r2, 2 + adds r3, r2 + strb r0, [r3, 0x1] + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0x40 + ldrb r0, [r0] + lsls r0, 2 + adds r2, r0 + strb r1, [r2] + ldr r1, [r4] + adds r1, 0x40 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A8D60 + + thumb_func_start sub_81A8D94 +sub_81A8D94: @ 81A8D94 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0xC7 + lsls r1, 4 + adds r5, r0, r1 + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 3 + adds r1, r5 + ldrh r0, [r1, 0x4] + adds r0, 0x7 + ldrh r1, [r1, 0x6] + adds r1, 0x7 + lsls r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + bl MapGridGetMetatileIdAt + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, =gUnknown_0203CE50 + ldr r0, [r0] + adds r0, 0x41 + ldrb r0, [r0] + movs r1, 0xA6 + lsls r1, 2 + cmp r0, 0 + bne _081A8DDA + subs r1, 0x48 +_081A8DDA: + subs r1, r2, r1 + adds r0, r1, 0 + cmp r1, 0 + bge _081A8DE4 + adds r0, r1, 0x7 +_081A8DE4: + asrs r0, 3 + lsls r0, 3 + subs r0, r1, r0 + lsls r0, 24 + lsrs r0, 24 + subs r0, r6 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + blt _081A8DFC + cmp r1, 0x3 + bne _081A8E08 +_081A8DFC: + movs r2, 0 + b _081A8E1A + .pool +_081A8E08: + cmp r1, 0 + bgt _081A8E14 + movs r0, 0x3 + negs r0, r0 + cmp r1, r0 + bne _081A8E18 +_081A8E14: + movs r2, 0x1 + b _081A8E1A +_081A8E18: + movs r2, 0x2 +_081A8E1A: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r5 + ldrb r0, [r1, 0x9] + adds r3, r0, 0 + cmp r2, 0 + bne _081A8E4C + cmp r0, 0x8 + beq _081A8E72 + cmp r0, 0x8 + bgt _081A8E38 + cmp r0, 0x7 + beq _081A8E48 + b _081A8E76 +_081A8E38: + cmp r0, 0x9 + beq _081A8E44 + cmp r0, 0xA + bne _081A8E76 + movs r0, 0x7 + b _081A8E74 +_081A8E44: + movs r0, 0x8 + b _081A8E74 +_081A8E48: + movs r0, 0x9 + b _081A8E74 +_081A8E4C: + cmp r2, 0x1 + bne _081A8E76 + cmp r0, 0x8 + beq _081A8E6A + cmp r0, 0x8 + bgt _081A8E5E + cmp r0, 0x7 + beq _081A8E72 + b _081A8E76 +_081A8E5E: + cmp r3, 0x9 + beq _081A8E6E + cmp r3, 0xA + bne _081A8E76 + movs r0, 0x8 + b _081A8E74 +_081A8E6A: + movs r0, 0x9 + b _081A8E74 +_081A8E6E: + movs r0, 0x7 + b _081A8E74 +_081A8E72: + movs r0, 0xA +_081A8E74: + strb r0, [r1, 0x9] +_081A8E76: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81A8D94 + + thumb_func_start sub_81A8E7C +sub_81A8E7C: @ 81A8E7C + push {lr} + ldr r1, =gUnknown_08613EE0 + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A8E7C + + thumb_func_start sub_81A8E9C +sub_81A8E9C: @ 81A8E9C + push {r4-r6,lr} + ldr r3, =gSaveBlock2Ptr + ldr r1, [r3] + ldr r4, =0x00000ca9 + adds r0, r1, r4 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + ldr r0, =0x00000ca8 + adds r1, r0 + movs r2, 0 + strb r2, [r1] + ldr r1, [r3] + ldr r6, =0x00000cb2 + adds r0, r1, r6 + strh r2, [r0] + adds r1, r4 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + cmp r5, 0 + beq _081A8EF0 + ldr r0, [r3] + ldr r1, =0x00000cdc + adds r0, r1 + ldr r2, [r0] + movs r0, 0x80 + lsls r0, 6 + b _081A8EFC + .pool +_081A8EF0: + ldr r0, [r3] + ldr r6, =0x00000cdc + adds r0, r6 + ldr r2, [r0] + movs r0, 0x80 + lsls r0, 5 +_081A8EFC: + ands r2, r0 + cmp r2, 0 + bne _081A8F14 + ldr r0, [r3] + lsls r1, r5, 1 + ldr r3, =0x00000e1a + adds r0, r3 + adds r0, r1 + strh r2, [r0] + adds r0, r5, 0 + bl sub_81AAA7C +_081A8F14: + bl sub_81C4EEC + ldr r0, =gTrainerBattleOpponent_A + movs r1, 0 + strh r1, [r0] + ldr r0, =gBattleOutcome + strb r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A8E9C + + thumb_func_start sub_81A8F38 +sub_81A8F38: @ 81A8F38 + push {r4,lr} + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r2, =0x00000ca9 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r4, r0, 30 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + adds r3, r1, 0 + cmp r0, 0x6 + bls _081A8F54 + b _081A903A +_081A8F54: + lsls r0, 2 + ldr r1, =_081A8F70 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A8F70: + .4byte _081A8F8C + .4byte _081A8F9C + .4byte _081A8FB4 + .4byte _081A8FE4 + .4byte _081A8FF8 + .4byte _081A9010 + .4byte _081A9028 +_081A8F8C: + ldr r0, =gScriptResult + ldr r1, [r3] + ldr r3, =0x00000e18 + b _081A8FFE + .pool +_081A8F9C: + ldr r2, =gScriptResult + ldr r0, [r3] + lsls r1, r4, 1 + ldr r3, =0x00000e1a + adds r0, r3 + adds r0, r1 + ldrh r0, [r0] + b _081A9038 + .pool +_081A8FB4: + cmp r4, 0 + beq _081A8FCC + ldr r2, =gScriptResult + ldr r0, [r3] + ldr r1, =0x00000cdc + adds r0, r1 + b _081A9030 + .pool +_081A8FCC: + ldr r2, =gScriptResult + ldr r0, [r3] + ldr r3, =0x00000cdc + adds r0, r3 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 5 + b _081A9036 + .pool +_081A8FE4: + ldr r0, =gScriptResult + ldr r1, [r3] + ldr r2, =0x00000e1a + adds r1, r2 + b _081A9000 + .pool +_081A8FF8: + ldr r0, =gScriptResult + ldr r1, [r3] + ldr r3, =0x00000e1c +_081A8FFE: + adds r1, r3 +_081A9000: + ldrh r1, [r1] + strh r1, [r0] + b _081A903A + .pool +_081A9010: + ldr r2, =gScriptResult + ldr r0, [r3] + ldr r1, =0x00000cdc + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 5 + b _081A9036 + .pool +_081A9028: + ldr r2, =gScriptResult + ldr r0, [r3] + ldr r3, =0x00000cdc + adds r0, r3 +_081A9030: + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 6 +_081A9036: + ands r0, r1 +_081A9038: + strh r0, [r2] +_081A903A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A8F38 + + thumb_func_start sub_81A9048 +sub_81A9048: @ 81A9048 + push {lr} + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r1, =0x00000ca9 + adds r0, r2, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r1, r0, 30 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x1 + beq _081A9098 + cmp r0, 0x1 + bgt _081A9078 + cmp r0, 0 + beq _081A9082 + b _081A9126 + .pool +_081A9078: + cmp r0, 0x2 + beq _081A90B0 + cmp r0, 0x7 + beq _081A911C + b _081A9126 +_081A9082: + ldr r0, =gSpecialVar_0x8006 + ldrh r1, [r0] + ldr r3, =0x00000e18 + adds r0, r2, r3 + strh r1, [r0] + b _081A9126 + .pool +_081A9098: + lsls r1, 1 + ldr r3, =0x00000e1a + adds r0, r2, r3 + adds r0, r1 + ldr r1, =gSpecialVar_0x8006 + ldrh r1, [r1] + strh r1, [r0] + b _081A9126 + .pool +_081A90B0: + cmp r1, 0 + beq _081A90E4 + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + cmp r0, 0 + beq _081A90D0 + ldr r1, =0x00000cdc + adds r0, r2, r1 + ldr r1, [r0] + movs r2, 0x80 + lsls r2, 6 + b _081A90F6 + .pool +_081A90D0: + ldr r3, =0x00000cdc + adds r0, r2, r3 + ldr r1, [r0] + ldr r2, =0xffffdfff + b _081A910C + .pool +_081A90E4: + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + cmp r0, 0 + beq _081A9104 + ldr r1, =0x00000cdc + adds r0, r2, r1 + ldr r1, [r0] + movs r2, 0x80 + lsls r2, 5 +_081A90F6: + orrs r1, r2 + str r1, [r0] + b _081A9126 + .pool +_081A9104: + ldr r3, =0x00000cdc + adds r0, r2, r3 + ldr r1, [r0] + ldr r2, =0xffffefff +_081A910C: + ands r1, r2 + str r1, [r0] + b _081A9126 + .pool +_081A911C: + ldr r0, =gSpecialVar_0x8006 + ldrh r1, [r0] + ldr r3, =0x00000e2a + adds r0, r2, r3 + strb r1, [r0] +_081A9126: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9048 + + thumb_func_start sub_81A9134 +sub_81A9134: @ 81A9134 + push {r4,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl VarSet + ldr r1, [r4] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl save_serialize_map + movs r0, 0x1 + bl TrySavingData + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9134 + + thumb_func_start sub_81A917C +sub_81A917C: @ 81A917C + push {r4,r5,lr} + ldr r4, =gSaveBlock2Ptr + ldr r1, [r4] + ldr r2, =0x00000ca9 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 29 + ldr r2, =0x00000e1a + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0x29 + bls _081A91CC + bl Random + ldr r4, [r4] + ldr r5, =gUnknown_08613F34 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x9 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 15 + adds r0, r5 + ldrh r0, [r0] + ldr r1, =0x00000e18 + adds r4, r1 + b _081A91EA + .pool +_081A91CC: + bl Random + ldr r4, [r4] + ldr r5, =gUnknown_08613F28 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x6 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 15 + adds r0, r5 + ldrh r0, [r0] + ldr r2, =0x00000e18 + adds r4, r2 +_081A91EA: + strh r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A917C + + thumb_func_start sub_81A91FC +sub_81A91FC: @ 81A91FC + push {r4,r5,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000e18 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x1 + bl AddBagItem + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bne _081A9244 + ldr r0, [r4] + ldr r1, =0x00000e18 + adds r0, r1 + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r0, [r4] + ldr r1, =0x00000e18 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + ldr r0, =gScriptResult + strh r5, [r0] + b _081A924A + .pool +_081A9244: + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] +_081A924A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A91FC + + thumb_func_start sub_81A9254 +sub_81A9254: @ 81A9254 + push {r4,r5,lr} + movs r4, 0 + ldr r5, =gSaveBlock2Ptr +_081A925A: + bl Random + ldr r1, [r5] + lsls r2, r4, 1 + ldr r3, =0x00000e22 + adds r1, r3 + adds r1, r2 + strh r0, [r1] + adds r4, 0x1 + cmp r4, 0x3 + ble _081A925A + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000e2a + adds r0, r1 + movs r1, 0 + strb r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9254 + + thumb_func_start CalculateBattlePyramidItemBallItemId +CalculateBattlePyramidItemBallItemId: @ 81A9290 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r5, =gSaveBlock2Ptr + ldr r1, [r5] + ldr r2, =0x00000ca9 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + mov r10, r0 + adds r2, 0x9 + adds r0, r1, r2 + ldrh r0, [r0] + str r0, [sp] + mov r2, r10 + lsls r0, r2, 1 + ldr r2, =0x00000e1a + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x14 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + cmp r0, 0x13 + bls _081A92DE + movs r0, 0x13 + mov r8, r0 +_081A92DE: + bl sub_81AA9E4 + lsls r0, 24 + ldr r1, =gScriptLastTalked + ldrh r4, [r1] + ldr r1, =gUnknown_08613650 + lsrs r0, 20 + adds r0, r1 + ldrb r0, [r0, 0x1] + subs r4, r0 + subs r7, r4, 0x1 + ldr r1, [r5] + lsrs r0, r7, 31 + adds r0, r7, r0 + asrs r0, 1 + lsls r0, 1 + ldr r2, =0x00000e22 + adds r1, r2 + adds r1, r0 + ldrh r6, [r1] + adds r0, r6, 0 + bl SeedRng2 + movs r5, 0 + mov r0, r8 + lsls r0, 2 + mov r9, r0 + cmp r5, r4 + bge _081A9332 +_081A9318: + bl Random2 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r6, r0, 16 + adds r5, 0x1 + adds r0, r7, 0x1 + cmp r5, r0 + blt _081A9318 +_081A9332: + ldr r0, =gUnknown_08613B3A + ldr r1, [sp] + adds r0, r1, r0 + ldrb r5, [r0] + ldr r1, =gUnknown_08613ABC + ldr r3, =gSpecialVar_0x8000 + ldr r4, =gSpecialVar_0x8001 + cmp r5, 0x3E + bhi _081A935E + lsls r2, r5, 1 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r6, r0 + blt _081A935E + adds r0, r2, r1 +_081A9350: + adds r0, 0x2 + adds r5, 0x1 + cmp r5, 0x3E + bhi _081A935E + ldrb r2, [r0] + cmp r6, r2 + bge _081A9350 +_081A935E: + mov r0, r10 + cmp r0, 0 + beq _081A9394 + ldr r2, =gUnknown_0861392C + b _081A9396 + .pool +_081A9394: + ldr r2, =gUnknown_0861379C +_081A9396: + lsls r0, r5, 1 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 1 + mov r1, r9 + add r1, r8 + lsls r1, 2 + adds r0, r1 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r3] + movs r0, 0x1 + strh r0, [r4] + 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 CalculateBattlePyramidItemBallItemId + + thumb_func_start sub_81A93C8 +sub_81A93C8: @ 81A93C8 + push {r4,r5,lr} + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0xC7 + lsls r1, 4 + adds r3, r0, r1 + movs r2, 0 + ldr r4, =gScriptLastTalked + b _081A93F4 + .pool +_081A93E4: + adds r2, 0x1 + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0 + beq _081A940A +_081A93F4: + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0, r3 + ldrb r0, [r1] + ldrh r5, [r4] + cmp r0, r5 + bne _081A93E4 + ldr r0, =0x00007fff + strh r0, [r1, 0x4] + strh r0, [r1, 0x6] +_081A940A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A93C8 + + thumb_func_start sub_81A9414 +sub_81A9414: @ 81A9414 + ldr r1, =gUnknown_0203BC88 + ldr r0, =gBattleFrontierTrainers + str r0, [r1] + bx lr + .pool + thumb_func_end sub_81A9414 + + thumb_func_start sub_81A9424 +sub_81A9424: @ 81A9424 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + movs r0, 0 + mov r9, r0 + movs r7, 0 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0xC7 + lsls r1, 4 + adds r1, r0 + mov r8, r1 + ldr r2, =gMapObjects + ldr r0, =gSelectedMapObject + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x8] + bl sub_81A9AA8 + lsls r0, 16 + lsrs r5, r0, 16 + movs r6, 0 + ldr r2, =gUnknown_08613C1C + ldr r0, =gUnknown_0203BC88 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r5 + adds r0, r1 + ldrb r1, [r2] + ldrb r0, [r0] + cmp r1, r0 + bne _081A9488 + ldrb r2, [r2, 0x1] + mov r9, r2 + b _081A94AE + .pool +_081A9488: + adds r6, 0x1 + cmp r6, 0x31 + bhi _081A94AE + ldr r4, =gUnknown_08613C1C + lsls r3, r6, 1 + adds r2, r3, r4 + ldr r0, =gUnknown_0203BC88 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r5 + adds r0, r1 + ldrb r1, [r2] + ldrb r0, [r0] + cmp r1, r0 + bne _081A9488 + adds r0, r4, 0x1 + adds r0, r3, r0 + ldrb r0, [r0] + mov r9, r0 +_081A94AE: + ldr r3, =gUnknown_08613ED8 + ldr r2, =gMapObjects + ldr r0, =gSelectedMapObject + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x8] + subs r0, 0x1 + adds r0, r3 + ldrb r0, [r0] + str r0, [sp] + movs r6, 0 + mov r3, r9 + lsls r3, 2 + mov r9, r3 +_081A94D0: + ldr r0, [sp] + cmp r0, 0x8 + bls _081A94D8 + b _081A95E8 +_081A94D8: + lsls r0, 2 + ldr r1, =_081A94FC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A94FC: + .4byte _081A9520 + .4byte _081A9530 + .4byte _081A9572 + .4byte _081A95B4 + .4byte _081A95BA + .4byte _081A95C0 + .4byte _081A95C6 + .4byte _081A95D2 + .4byte _081A95DE +_081A9520: + mov r0, sp + movs r1, 0x8 + movs r2, 0 + bl sub_81A9998 + lsls r0, 24 + lsrs r7, r0, 24 + b _081A95EE +_081A9530: + movs r6, 0 + ldr r2, =0x7fff0000 + mov r4, r8 + adds r4, 0x4 + mov r5, r8 + b _081A9560 + .pool +_081A9540: + ldrb r0, [r5, 0x1] + cmp r0, 0x3B + bne _081A955A + movs r1, 0 + ldrsh r0, [r4, r1] + asrs r1, r2, 16 + cmp r0, r1 + beq _081A955A + movs r3, 0x2 + ldrsh r0, [r4, r3] + cmp r0, r1 + beq _081A955A + adds r7, 0x1 +_081A955A: + adds r4, 0x18 + adds r5, 0x18 + adds r6, 0x1 +_081A9560: + str r2, [sp, 0x4] + bl sub_81AAA40 + lsls r0, 24 + lsrs r0, 24 + ldr r2, [sp, 0x4] + cmp r6, r0 + blt _081A9540 + b _081A95EE +_081A9572: + bl sub_81AA9E4 + lsls r0, 24 + ldr r1, =gUnknown_08613650 + lsrs r0, 20 + adds r0, r1 + ldrb r7, [r0, 0x1] + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000e2a + adds r0, r1 + ldrb r2, [r0] + ldr r1, =gBitTable + movs r6, 0x7 +_081A958E: + ldr r0, [r1] + ands r0, r2 + cmp r0, 0 + beq _081A9598 + subs r7, 0x1 +_081A9598: + adds r1, 0x4 + subs r6, 0x1 + cmp r6, 0 + bge _081A958E + b _081A95EE + .pool +_081A95B4: + mov r0, sp + movs r1, 0x8 + b _081A95D6 +_081A95BA: + mov r0, sp + movs r1, 0x8 + b _081A95CA +_081A95C0: + mov r0, sp + movs r1, 0x10 + b _081A95D6 +_081A95C6: + mov r0, sp + movs r1, 0x10 +_081A95CA: + movs r2, 0x1 + bl sub_81A9998 + b _081A95E8 +_081A95D2: + mov r0, sp + movs r1, 0x18 +_081A95D6: + movs r2, 0x2 + bl sub_81A9998 + b _081A95E8 +_081A95DE: + mov r0, sp + movs r1, 0x18 + movs r2, 0x1 + bl sub_81A9998 +_081A95E8: + cmp r6, 0 + bne _081A95EE + b _081A94D0 +_081A95EE: + ldr r1, =gUnknown_08613EC0 + add r1, r9 + ldr r0, [sp] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + lsls r0, r7, 2 + adds r0, r1 + ldr r0, [r0] + bl box_related_two__2 + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9424 + + thumb_func_start sub_81A9618 +sub_81A9618: @ 81A9618 + push {r4,r5,lr} + ldr r5, =gSaveBlock2Ptr + ldr r1, [r5] + ldr r2, =0x00000ca9 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r2, r0, 29 + ldr r4, =0x00000e1a + adds r1, r4 + adds r1, r2 + ldrh r3, [r1] + ldr r0, =0x000003e6 + cmp r3, r0 + bhi _081A963A + adds r0, r3, 0x1 + strh r0, [r1] +_081A963A: + ldr r0, [r5] + adds r1, r0, r4 + adds r1, r2 + ldr r3, =0x00000e1e + adds r0, r3 + adds r0, r2 + ldrh r1, [r1] + ldrh r2, [r0] + cmp r1, r2 + bls _081A9650 + strh r1, [r0] +_081A9650: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9618 + + thumb_func_start sub_81A966C +sub_81A966C: @ 81A966C + push {r4,lr} + ldr r4, =gScriptResult + bl InBattlePyramid + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A966C + + thumb_func_start sub_81A9684 +sub_81A9684: @ 81A9684 + push {r4,lr} + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + cmp r0, 0 + beq _081A9698 + cmp r0, 0x1 + beq _081A96B4 + b _081A9754 + .pool +_081A9698: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + ldr r2, =0x00000e68 + adds r0, r2 + strb r1, [r0] + b _081A9754 + .pool +_081A96B4: + ldr r4, =gScriptResult + ldrh r0, [r4] + cmp r0, 0x1 + beq _081A9710 + cmp r0, 0x1 + bgt _081A9754 + cmp r0, 0 + bne _081A9754 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081A9754 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000e68 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0x77 + bls _081A96F4 + movs r0, 0x78 + strb r0, [r1] + b _081A96FC + .pool +_081A96F4: + ldr r0, =gSpecialVar_0x8007 + ldrh r0, [r0] + bl PlaySE +_081A96FC: + ldr r1, =gScriptResult + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _081A9754 + .pool +_081A9710: + ldr r1, =gSpecialVar_0x8005 + ldrh r0, [r1] + cmp r0, 0 + beq _081A9750 + subs r0, 0x1 + strh r0, [r1] + ldr r3, =gSaveBlock2Ptr + ldr r1, [r3] + ldr r2, =0x00000e68 + adds r1, r2 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r3] + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0x78 + bls _081A973E + movs r0, 0x78 + strb r0, [r1] + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_081A973E: + bl door_upload_tiles + b _081A9754 + .pool +_081A9750: + movs r0, 0x2 + strh r0, [r4] +_081A9754: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81A9684 + + thumb_func_start sub_81A975C +sub_81A975C: @ 81A975C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + movs r1, 0 + mov r0, sp + strh r1, [r0] + movs r5, 0 + movs r0, 0x64 + mov r9, r0 + ldr r1, =gPlayerParty + mov r8, r1 +_081A9776: + movs r4, 0 + adds r7, r5, 0x1 + mov r6, r9 + muls r6, r5 +_081A977E: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000caa + adds r0, r2 + adds r1, r0, r1 + ldrh r0, [r1] + cmp r0, 0 + beq _081A97A2 + subs r0, 0x1 + cmp r0, r5 + bne _081A97A2 + mov r1, r8 + adds r0, r6, r1 + movs r1, 0xC + mov r2, sp + bl SetMonData +_081A97A2: + adds r4, 0x1 + cmp r4, 0x3 + ble _081A977E + adds r5, r7, 0 + cmp r5, 0x5 + ble _081A9776 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A975C + + thumb_func_start sub_81A97C8 +sub_81A97C8: @ 81A97C8 + push {lr} + ldr r0, =sub_81A97DC + movs r1, 0 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A97C8 + + thumb_func_start sub_81A97DC +sub_81A97DC: @ 81A97DC + 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 + beq _081A980C + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 5 + ldr r1, =gUnknown_08D856C8 + adds r0, r1 + ldr r1, =gPlttBufferUnfaded + 0xC0 + movs r2, 0x10 + bl CpuSet + adds r0, r4, 0 + bl DestroyTask +_081A980C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A97DC + + thumb_func_start sub_81A9828 +sub_81A9828: @ 81A9828 + push {lr} + bl sub_809FDD4 + pop {r0} + bx r0 + thumb_func_end sub_81A9828 + + thumb_func_start sub_81A9834 +sub_81A9834: @ 81A9834 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + movs r0, 0 + str r0, [sp] +_081A9844: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, [sp] + lsls r1, r2, 1 + ldr r5, =0x00000caa + adds r0, r5 + adds r0, r1 + ldrh r0, [r0] + subs r5, r0, 0x1 + movs r0, 0 + str r0, [sp, 0x4] + movs r2, 0x64 + adds r1, r5, 0 + muls r1, r2 + str r1, [sp, 0x8] + movs r0, 0x8E + lsls r0, 2 + adds r6, r1, r0 + movs r1, 0 + str r1, [sp, 0x10] +_081A986C: + ldr r2, =gSaveBlock1Ptr + ldr r0, [r2] + adds r0, r6 + movs r1, 0xB + movs r2, 0 + bl GetMonData + adds r4, r0, 0 + ldr r3, =gPlayerParty + ldr r1, [sp, 0x10] + adds r0, r1, r3 + movs r1, 0xB + movs r2, 0 + str r3, [sp, 0x14] + bl GetMonData + ldr r3, [sp, 0x14] + cmp r4, r0 + bne _081A993C + movs r6, 0 + adds r2, r5, 0x1 + str r2, [sp, 0xC] + movs r1, 0x64 + adds r0, r5, 0 + muls r0, r1 + movs r5, 0x8E + lsls r5, 2 + adds r5, r0 + mov r9, r5 + ldr r7, [sp, 0x4] + muls r7, r1 + mov r10, r3 +_081A98AC: + movs r5, 0 + adds r0, r6, 0x1 + mov r8, r0 + b _081A98C6 + .pool +_081A98C4: + adds r5, 0x1 +_081A98C6: + cmp r5, 0x3 + bgt _081A98EE + ldr r1, =gSaveBlock1Ptr + ldr r0, [r1] + add r0, r9 + adds r1, r5, 0 + adds r1, 0xD + movs r2, 0 + bl GetMonData + adds r4, r0, 0 + adds r1, r6, 0 + adds r1, 0xD + mov r2, r10 + adds r0, r7, r2 + movs r2, 0 + bl GetMonData + cmp r4, r0 + bne _081A98C4 +_081A98EE: + cmp r5, 0x4 + bne _081A9900 + lsls r2, r6, 24 + lsrs r2, 24 + mov r5, r10 + adds r0, r7, r5 + movs r1, 0xA6 + bl SetMonMoveSlot +_081A9900: + mov r6, r8 + cmp r6, 0x3 + ble _081A98AC + ldr r1, =gSaveBlock1Ptr + ldr r0, [r1] + ldr r2, [sp, 0x8] + adds r0, r2 + movs r5, 0x8E + lsls r5, 2 + adds r0, r5 + ldr r1, =gPlayerParty + ldr r2, [sp, 0x10] + adds r1, r2, r1 + movs r2, 0x64 + bl memcpy + ldr r0, =gUnknown_0203CEF8 + ldr r5, [sp, 0x4] + adds r0, r5, r0 + mov r1, sp + ldrb r1, [r1, 0xC] + strb r1, [r0] + b _081A994C + .pool +_081A993C: + ldr r2, [sp, 0x10] + adds r2, 0x64 + str r2, [sp, 0x10] + ldr r0, [sp, 0x4] + adds r0, 0x1 + str r0, [sp, 0x4] + cmp r0, 0x2 + ble _081A986C +_081A994C: + ldr r1, [sp] + adds r1, 0x1 + str r1, [sp] + cmp r1, 0x2 + bgt _081A9958 + b _081A9844 +_081A9958: + movs r2, 0 + str r2, [sp] + ldr r4, =gSaveBlock2Ptr + ldr r3, =0x00000caa + ldr r2, =gUnknown_0203CEF8 +_081A9962: + ldr r1, [r4] + ldr r5, [sp] + lsls r0, r5, 1 + adds r1, r3 + adds r1, r0 + adds r0, r5, r2 + ldrb r0, [r0] + strh r0, [r1] + adds r5, 0x1 + str r5, [sp] + cmp r5, 0x2 + ble _081A9962 + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9834 + + thumb_func_start sub_81A9998 +sub_81A9998: @ 81A9998 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r10, r0 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r7, r2, 24 + movs r4, 0 + ldr r0, =gUnknown_03005DC0 + ldr r5, [r0, 0x8] + ldr r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 1 + adds r0, 0xE + adds r5, r0 + movs r3, 0 + ldr r0, =0x000003ff + mov r8, r0 + ldr r1, =0x0000028e + mov r12, r1 + ldr r0, =gMapObjects + mov r9, r0 +_081A99CC: + movs r2, 0 +_081A99CE: + lsls r0, r2, 1 + adds r0, r5 + ldrh r1, [r0] + mov r0, r8 + ands r0, r1 + cmp r0, r12 + bne _081A9A8A + adds r2, 0x7 + ldr r0, =gSelectedMapObject + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + add r0, r9 + movs r5, 0xC + ldrsh r1, [r0, r5] + subs r2, r1 + adds r1, r3, 0x7 + movs r3, 0xE + ldrsh r0, [r0, r3] + subs r3, r1, r0 + cmp r2, r6 + bge _081A9A0E + negs r0, r6 + cmp r2, r0 + ble _081A9A0E + cmp r3, r6 + bge _081A9A0E + cmp r3, r0 + ble _081A9A0E + cmp r7, 0 + bne _081A9A84 +_081A9A0E: + cmp r2, 0 + ble _081A9A34 + cmp r3, 0 + ble _081A9A34 + movs r4, 0x3 + cmp r2, r3 + blt _081A9A7C + movs r4, 0x2 + b _081A9A7C + .pool +_081A9A34: + cmp r2, 0 + bge _081A9A46 + cmp r3, 0 + bge _081A9A46 + movs r4, 0x1 + cmp r2, r3 + ble _081A9A7C + movs r4, 0 + b _081A9A7C +_081A9A46: + cmp r2, 0 + bne _081A9A54 + movs r4, 0 + cmp r3, 0 + ble _081A9A7C + movs r4, 0x3 + b _081A9A7C +_081A9A54: + cmp r3, 0 + bne _081A9A62 + movs r4, 0x1 + cmp r2, 0 + ble _081A9A7C + movs r4, 0x2 + b _081A9A7C +_081A9A62: + cmp r2, 0 + bge _081A9A72 + adds r0, r2, r3 + movs r4, 0x1 + cmp r0, 0 + ble _081A9A7C + movs r4, 0x3 + b _081A9A7C +_081A9A72: + adds r0, r2, r3 + mvns r0, r0 + asrs r4, r0, 31 + movs r0, 0x2 + ands r4, r0 +_081A9A7C: + movs r0, 0 + mov r5, r10 + str r0, [r5] + b _081A9A98 +_081A9A84: + mov r0, r10 + str r7, [r0] + b _081A9A98 +_081A9A8A: + adds r2, 0x1 + cmp r2, 0x1F + ble _081A99CE + adds r5, 0x5E + adds r3, 0x1 + cmp r3, 0x1F + ble _081A99CC +_081A9A98: + adds r0, r4, 0 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81A9998 + + thumb_func_start sub_81A9AA8 +sub_81A9AA8: @ 81A9AA8 + lsls r0, 24 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + lsrs r0, 23 + adds r1, r0 + ldr r0, =0x00000cb2 + adds r1, r0 + ldrh r0, [r1] + bx lr + .pool + thumb_func_end sub_81A9AA8 + + thumb_func_start GetBattlePyramidTrainerFlag +GetBattlePyramidTrainerFlag: @ 81A9AC4 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gSaveBlock2Ptr + ldr r2, [r1] + ldr r1, =0x00000e2a + adds r2, r1 + ldr r4, =gBitTable + ldr r3, =gMapObjects + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r1, 0x8] + subs r0, 0x1 + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + ldrb r1, [r2] + ands r0, r1 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end GetBattlePyramidTrainerFlag + + thumb_func_start sub_81A9B04 +sub_81A9B04: @ 81A9B04 + push {lr} + ldr r0, =gTrainerBattleOpponent_A + ldrh r0, [r0] + bl sub_81A9B44 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _081A9B2E + movs r0, 0x1 + bl sub_80B47E0 + ldr r1, =gSelectedMapObject + strb r0, [r1] + ldr r0, =gTrainerBattleOpponent_B + ldrh r0, [r0] + bl sub_81A9B44 +_081A9B2E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9B04 + + thumb_func_start sub_81A9B44 +sub_81A9B44: @ 81A9B44 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 16 + lsrs r5, r0, 16 + movs r3, 0 + ldr r0, =gMapObjects + mov r12, r0 + ldr r6, =gSelectedMapObject + ldr r1, =gSaveBlock1Ptr + mov r10, r1 + ldr r7, =gSaveBlock2Ptr + mov r9, r7 + ldr r0, =0x00000cb4 + mov r8, r0 + ldr r4, =gBitTable +_081A9B68: + mov r1, r9 + ldr r2, [r1] + lsls r0, r3, 1 + mov r7, r8 + adds r1, r2, r7 + adds r1, r0 + ldrh r0, [r1] + cmp r0, r5 + bne _081A9B86 + ldr r1, =0x00000e2a + adds r0, r2, r1 + ldr r1, [r4] + ldrb r2, [r0] + orrs r1, r2 + strb r1, [r0] +_081A9B86: + adds r4, 0x4 + adds r3, 0x1 + cmp r3, 0x7 + ble _081A9B68 + ldrb r1, [r6] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + add r0, r12 + movs r3, 0x2 + strb r3, [r0, 0x6] + mov r7, r10 + ldr r2, [r7] + ldr r0, =gScriptLastTalked + ldrh r1, [r0] + subs r1, 0x1 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r2, r0 + ldr r1, =0x00000c79 + adds r2, r1 + strb r3, [r2] + ldrb r1, [r6] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + add r0, r12 + ldrh r1, [r0, 0x10] + strh r1, [r0, 0xC] + ldrb r1, [r6] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + add r0, r12 + ldrh r1, [r0, 0x12] + strh r1, [r0, 0xE] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9B44 + + thumb_func_start sub_81A9C04 +sub_81A9C04: @ 81A9C04 + push {r4-r6,lr} + sub sp, 0x14 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r2, =0x00000ca9 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + lsls r0, r5, 1 + ldr r2, =0x00000e1a + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x14 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x13 + bls _081A9C3A + movs r0, 0x13 +_081A9C3A: + cmp r5, 0 + beq _081A9C54 + ldr r1, =gBattlePyramidOpenLevelWildMonPointers + b _081A9C56 + .pool +_081A9C54: + ldr r1, =gBattlePyramidLevel50WildMonPointers +_081A9C56: + lsls r0, 2 + adds r0, r1 + ldr r6, [r0] + ldr r4, =gEnemyParty + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl GetMonData + subs r0, 0x1 + str r0, [sp, 0x10] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + adds r2, r6, r2 + adds r0, r4, 0 + movs r1, 0xB + bl SetMonData + ldr r1, [sp, 0x10] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrh r1, [r0] + mov r0, sp + bl GetSpeciesName + adds r0, r4, 0 + movs r1, 0x2 + mov r2, sp + bl SetMonData + cmp r5, 0 + beq _081A9CD4 + bl sub_8165C40 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, [sp, 0x10] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x2] + subs r5, r0 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xB + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + subs r0, 0x5 + adds r5, r0 + b _081A9CF6 + .pool +_081A9CD4: + bl Random + ldr r2, [sp, 0x10] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r6 + ldrb r4, [r1, 0x2] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xB + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + subs r0, 0x5 + adds r5, r4, r0 +_081A9CF6: + ldr r4, =gEnemyParty + ldr r2, =gBaseStats + ldr r1, [sp, 0x10] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrh r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x13] + movs r0, 0xCA + lsls r0, 1 + adds r2, r1, 0 + muls r2, r0 + lsls r0, r5, 2 + ldr r1, =gExperienceTables + adds r0, r1 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x19 + bl SetMonData + ldr r1, [sp, 0x10] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r1, [r0, 0x3] + cmp r1, 0 + blt _081A9D4C + cmp r1, 0x1 + bgt _081A9D4C + adds r2, r0, 0x3 + b _081A9D7C + .pool +_081A9D4C: + ldr r2, =gBaseStats + ldr r1, [sp, 0x10] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrh r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x17] + cmp r0, 0 + beq _081A9D90 + ldr r4, =gEnemyParty + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl GetMonData + movs r1, 0x1 + ands r1, r0 + str r1, [sp, 0xC] + add r2, sp, 0xC +_081A9D7C: + adds r0, r4, 0 + movs r1, 0x2E + bl SetMonData + b _081A9D9C + .pool +_081A9D90: + str r0, [sp, 0xC] + ldr r0, =gEnemyParty + add r2, sp, 0xC + movs r1, 0x2E + bl SetMonData +_081A9D9C: + movs r0, 0 + str r0, [sp, 0xC] + movs r2, 0 + lsls r4, r5, 1 +_081A9DA4: + ldr r1, [sp, 0x10] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + lsls r1, r2, 1 + adds r0, 0x4 + adds r0, r1 + ldrh r1, [r0] + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gEnemyParty + bl SetMonMoveSlot + ldr r0, [sp, 0xC] + adds r0, 0x1 + str r0, [sp, 0xC] + adds r2, r0, 0 + cmp r2, 0x3 + ble _081A9DA4 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000e1a + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + cmp r0, 0x8B + bls _081A9E0C + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x11 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + adds r0, 0xF + str r0, [sp, 0x10] + movs r0, 0 + str r0, [sp, 0xC] +_081A9DF6: + adds r1, r0, 0 + adds r1, 0x27 + ldr r0, =gEnemyParty + add r2, sp, 0x10 + bl SetMonData + ldr r0, [sp, 0xC] + adds r0, 0x1 + str r0, [sp, 0xC] + cmp r0, 0x5 + ble _081A9DF6 +_081A9E0C: + ldr r0, =gEnemyParty + bl CalculateMonStats + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9C04 + + thumb_func_start sub_81A9E28 +sub_81A9E28: @ 81A9E28 + push {lr} + bl sub_81AA9E4 + lsls r0, 24 + ldr r1, =gUnknown_08613650 + lsrs r0, 20 + adds r0, r1 + ldrb r0, [r0, 0x4] + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A9E28 + + thumb_func_start InBattlePyramid +InBattlePyramid: @ 81A9E40 + push {lr} + ldr r0, =gMapHeader + ldrh r1, [r0, 0x12] + ldr r0, =0x00000169 + cmp r1, r0 + bne _081A9E58 + movs r0, 0x1 + b _081A9E66 + .pool +_081A9E58: + movs r0, 0xBD + lsls r0, 1 + cmp r1, r0 + beq _081A9E64 + movs r0, 0 + b _081A9E66 +_081A9E64: + movs r0, 0x2 +_081A9E66: + pop {r1} + bx r1 + thumb_func_end InBattlePyramid + + thumb_func_start sub_81A9E6C +sub_81A9E6C: @ 81A9E6C + push {lr} + movs r2, 0 + ldr r0, =gMapHeader + ldrh r1, [r0, 0x12] + ldr r0, =0x00000169 + cmp r1, r0 + beq _081A9E80 + adds r0, 0x11 + cmp r1, r0 + bne _081A9E82 +_081A9E80: + movs r2, 0x1 +_081A9E82: + adds r0, r2, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A9E6C + + thumb_func_start sub_81A9E90 +sub_81A9E90: @ 81A9E90 + push {lr} + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _081A9EB8 + bl sub_81A9834 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca8 + adds r0, r1 + movs r1, 0x2 + strb r1, [r0] + ldr r0, =0x0000400e + movs r1, 0 + bl VarSet + bl copy_player_party_from_sav1 +_081A9EB8: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9E90 + + thumb_func_start sub_81A9EC8 +sub_81A9EC8: @ 81A9EC8 + push {lr} + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _081A9ED8 + bl DoSoftReset +_081A9ED8: + pop {r0} + bx r0 + thumb_func_end sub_81A9EC8 + + thumb_func_start sub_81A9EDC +sub_81A9EDC: @ 81A9EDC + push {lr} + lsls r0, 16 + lsrs r0, 16 + ldr r2, =gUnknown_0203BC88 + movs r1, 0x34 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0xC + bl ConvertBattleFrontierTrainerSpeechToString + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9EDC + + thumb_func_start sub_81A9EFC +sub_81A9EFC: @ 81A9EFC + push {lr} + lsls r0, 16 + lsrs r0, 16 + ldr r2, =gUnknown_0203BC88 + movs r1, 0x34 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0x18 + bl ConvertBattleFrontierTrainerSpeechToString + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9EFC + + thumb_func_start sub_81A9F1C +sub_81A9F1C: @ 81A9F1C + push {lr} + lsls r0, 16 + lsrs r0, 16 + ldr r2, =gUnknown_0203BC88 + movs r1, 0x34 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0x24 + bl ConvertBattleFrontierTrainerSpeechToString + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9F1C + + thumb_func_start GetTrainerEncounterMusicIdInBattlePyramind +GetTrainerEncounterMusicIdInBattlePyramind: @ 81A9F3C + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + movs r4, 0 + ldr r3, =gTrainerClassToNameIndex + ldr r1, =gUnknown_0203BC88 + ldr r2, [r1] + movs r1, 0x34 + muls r0, r1 + adds r0, r2 + ldrb r0, [r0] + adds r0, r3 + ldrb r2, [r0] + ldr r1, =gUnknown_08613B44 +_081A9F58: + ldrb r0, [r1] + cmp r0, r2 + bne _081A9F70 + ldrb r0, [r1, 0x1] + b _081A9F7A + .pool +_081A9F70: + adds r1, 0x4 + adds r4, 0x1 + cmp r4, 0x35 + bls _081A9F58 + movs r0, 0 +_081A9F7A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end GetTrainerEncounterMusicIdInBattlePyramind + + thumb_func_start sub_81A9F80 +sub_81A9F80: @ 81A9F80 + push {lr} + ldr r0, =gUnknown_08252C88 + bl ScriptContext1_SetupScript + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9F80 + + thumb_func_start sub_81A9F90 +sub_81A9F90: @ 81A9F90 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gSaveBlock2Ptr + ldr r4, [r0] + ldr r1, =0x00000ca9 + adds r0, r4, r1 + ldrb r1, [r0] + lsls r1, 30 + lsrs r1, 29 + ldr r2, =0x00000e1a + adds r0, r4, r2 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x00000cb2 + adds r4, r1 + ldrh r1, [r4] + cmp r1, 0x7 + bne _081AA020 + adds r0, 0x1 + lsls r7, r0, 24 + lsls r1, 24 + mov r8, r1 +_081A9FCC: + lsrs r0, r7, 24 + mov r2, r8 + lsrs r1, r2, 24 + bl sub_8162548 + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + cmp r2, r5 + bge _081AA004 + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r4, =0x00000cb4 + adds r0, r4 + ldrh r0, [r0] + cmp r0, r3 + beq _081AA004 + adds r6, r1, 0 +_081A9FF0: + adds r2, 0x1 + cmp r2, r5 + bge _081AA004 + ldr r0, [r6] + lsls r1, r2, 1 + adds r0, r4 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r3 + bne _081A9FF0 +_081AA004: + cmp r2, r5 + bne _081A9FCC + b _081AA062 + .pool +_081AA020: + lsls r1, 24 + mov r8, r1 + lsls r7, r0, 24 +_081AA026: + lsrs r0, r7, 24 + mov r2, r8 + lsrs r1, r2, 24 + bl sub_8162548 + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + cmp r2, r5 + bge _081AA05E + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r4, =0x00000cb4 + adds r0, r4 + ldrh r0, [r0] + cmp r0, r3 + beq _081AA05E + adds r6, r1, 0 +_081AA04A: + adds r2, 0x1 + cmp r2, r5 + bge _081AA05E + ldr r0, [r6] + lsls r1, r2, 1 + adds r0, r4 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r3 + bne _081AA04A +_081AA05E: + cmp r2, r5 + bne _081AA026 +_081AA062: + adds r0, r3, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A9F90 + + thumb_func_start sub_81AA078 +sub_81AA078: @ 81AA078 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + str r0, [sp, 0x4] + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x8] + movs r0, 0x10 + bl AllocZeroed + str r0, [sp, 0xC] + bl sub_81AA96C + mov r4, sp + adds r4, 0x1 + mov r0, sp + adds r1, r4, 0 + bl sub_81AA33C + movs r7, 0 +_081AA0A6: + ldr r1, [sp, 0xC] + adds r0, r1, r7 + ldrb r0, [r0] + ldr r2, =0x00000169 + adds r0, r2 + lsls r0, 2 + ldr r1, =gUnknown_08481DD4 + adds r0, r1 + ldr r6, [r0] + ldr r2, [r6, 0xC] + mov r10, r2 + ldr r0, [sp, 0x4] + ldr r1, =gUnknown_03005DC0 + str r0, [r1, 0x8] + ldr r0, [r6] + lsls r0, 2 + adds r2, r0, 0 + adds r2, 0xF + str r2, [r1] + ldr r0, [r6, 0x4] + lsls r0, 2 + adds r0, 0xE + str r0, [r1, 0x4] + ldr r0, [sp, 0x4] + mov r9, r0 + adds r1, r7, 0 + cmp r7, 0 + bge _081AA0E0 + adds r1, r7, 0x3 +_081AA0E0: + asrs r1, 2 + ldr r4, [r6, 0x4] + adds r0, r1, 0 + muls r0, r4 + adds r0, 0x7 + muls r2, r0 + lsls r1, 2 + subs r1, r7, r1 + ldr r3, [r6] + adds r0, r1, 0 + muls r0, r3 + adds r0, 0x7 + adds r2, r0 + lsls r2, 1 + add r9, r2 + movs r1, 0 + mov r8, r1 + adds r2, r7, 0x1 + str r2, [sp, 0x10] + cmp r8, r4 + bge _081AA1B6 +_081AA10A: + movs r0, 0 + mov r12, r0 + mov r1, r8 + adds r1, 0x1 + str r1, [sp, 0x14] + cmp r12, r3 + bge _081AA1A2 + ldr r2, =gSaveBlock1Ptr + str r2, [sp, 0x18] + mov r4, r9 + mov r5, r10 +_081AA120: + ldrh r1, [r5] + ldr r0, =0x000003ff + ands r0, r1 + ldr r2, =0x0000028e + cmp r0, r2 + bne _081AA194 + mov r0, sp + ldrb r0, [r0, 0x1] + cmp r7, r0 + beq _081AA194 + mov r0, sp + ldrb r0, [r0] + cmp r7, r0 + bne _081AA164 + ldr r1, [sp, 0x8] + cmp r1, 0 + bne _081AA164 + ldr r2, [sp, 0x18] + ldr r3, [r2] + adds r2, r7, 0 + cmp r7, 0 + bge _081AA14E + adds r2, r7, 0x3 +_081AA14E: + asrs r2, 2 + lsls r1, r2, 2 + subs r1, r7, r1 + ldr r0, [r6] + muls r0, r1 + add r0, r12 + strh r0, [r3] + ldr r0, [r6, 0x4] + muls r0, r2 + add r0, r8 + strh r0, [r3, 0x2] +_081AA164: + ldrh r0, [r5] + movs r1, 0xFC + lsls r1, 8 + ands r1, r0 + ldr r2, =0x0000028d + adds r0, r2, 0 + orrs r1, r0 + strh r1, [r4] + ldr r3, [r6] + b _081AA196 + .pool +_081AA194: + strh r1, [r4] +_081AA196: + adds r4, 0x2 + adds r5, 0x2 + movs r0, 0x1 + add r12, r0 + cmp r12, r3 + blt _081AA120 +_081AA1A2: + lsls r0, r3, 3 + adds r0, 0x1E + add r9, r0 + lsls r0, r3, 1 + add r10, r0 + ldr r1, [sp, 0x14] + mov r8, r1 + ldr r0, [r6, 0x4] + cmp r8, r0 + blt _081AA10A +_081AA1B6: + ldr r7, [sp, 0x10] + cmp r7, 0xF + bgt _081AA1BE + b _081AA0A6 +_081AA1BE: + bl mapheader_run_script_with_tag_x1 + ldr r0, [sp, 0xC] + bl Free + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81AA078 + + thumb_func_start sub_81AA1D8 +sub_81AA1D8: @ 81AA1D8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + movs r5, 0 + mov r6, sp + adds r6, 0x1 + add r0, sp, 0x4 + mov r8, r0 + ldr r4, =gSaveBlock2Ptr + ldr r3, =0x00000cb4 + ldr r0, =0x0000ffff + adds r2, r0, 0 +_081AA1F2: + ldr r0, [r4] + lsls r1, r5, 1 + adds r0, r3 + adds r0, r1 + ldrh r1, [r0] + orrs r1, r2 + strh r1, [r0] + adds r5, 0x1 + cmp r5, 0x7 + ble _081AA1F2 + bl sub_81AA9E4 + lsls r0, 24 + lsrs r7, r0, 24 + mov r0, sp + adds r1, r6, 0 + bl sub_81AA33C + movs r0, 0 + str r0, [sp, 0x4] + ldr r0, =gSaveBlock1Ptr + ldr r1, [r0] + movs r0, 0xC7 + lsls r0, 4 + adds r1, r0 + ldr r2, =0x05000180 + mov r0, r8 + bl CpuSet + movs r5, 0 +_081AA22E: + cmp r5, 0 + bne _081AA254 + ldr r1, =gUnknown_08613650 + lsls r0, r7, 4 + adds r0, r1 + ldrb r0, [r0, 0x3] + b _081AA25C + .pool +_081AA254: + ldr r1, =gUnknown_08613650 + lsls r0, r7, 4 + adds r0, r1 + ldrb r0, [r0, 0x2] +_081AA25C: + cmp r0, 0x4 + bhi _081AA2E4 + lsls r0, 2 + ldr r1, =_081AA274 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081AA274: + .4byte _081AA288 + .4byte _081AA292 + .4byte _081AA2A2 + .4byte _081AA2B0 + .4byte _081AA2CC +_081AA288: + lsls r0, r5, 24 + lsrs r0, 24 + bl sub_81AA398 + b _081AA2E4 +_081AA292: + lsls r0, r5, 24 + lsrs r4, r0, 24 + mov r0, sp + ldrb r1, [r0] + adds r0, r4, 0 + bl sub_81AA4D8 + b _081AA2BE +_081AA2A2: + lsls r0, r5, 24 + lsrs r4, r0, 24 + ldrb r1, [r6] + adds r0, r4, 0 + bl sub_81AA4D8 + b _081AA2BE +_081AA2B0: + lsls r0, r5, 24 + lsrs r4, r0, 24 + mov r0, sp + ldrb r1, [r0] + adds r0, r4, 0 + bl sub_81AA648 +_081AA2BE: + lsls r0, 24 + cmp r0, 0 + beq _081AA2E4 + adds r0, r4, 0 + bl sub_81AA398 + b _081AA2E4 +_081AA2CC: + lsls r0, r5, 24 + lsrs r4, r0, 24 + ldrb r1, [r6] + adds r0, r4, 0 + bl sub_81AA648 + lsls r0, 24 + cmp r0, 0 + beq _081AA2E4 + adds r0, r4, 0 + bl sub_81AA398 +_081AA2E4: + adds r5, 0x1 + cmp r5, 0x1 + ble _081AA22E + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81AA1D8 + + thumb_func_start sub_81AA2F8 +sub_81AA2F8: @ 81AA2F8 + push {r4,r5,lr} + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r5, =gUnknown_08252C4F + ldr r4, =gUnknown_08252C6A + movs r2, 0xC8 + lsls r2, 4 + adds r1, r0, r2 + movs r3, 0xC7 + lsls r3, 4 + adds r2, r0, r3 + movs r3, 0x3F +_081AA310: + ldrb r0, [r2, 0x1] + cmp r0, 0x3B + beq _081AA328 + str r5, [r1] + b _081AA32A + .pool +_081AA328: + str r4, [r1] +_081AA32A: + adds r1, 0x18 + adds r2, 0x18 + subs r3, 0x1 + cmp r3, 0 + bge _081AA310 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81AA2F8 + + thumb_func_start sub_81AA33C +sub_81AA33C: @ 81AA33C + push {r4-r7,lr} + adds r4, r0, 0 + adds r6, r1, 0 + ldr r5, =gSaveBlock2Ptr + ldr r1, [r5] + ldr r2, =0x00000e28 + adds r0, r1, r2 + ldrh r2, [r0] + movs r3, 0xF + ands r2, r3 + strb r2, [r4] + ldr r7, =0x00000e22 + adds r1, r7 + ldrh r0, [r1] + ands r0, r3 + strb r0, [r6] + cmp r2, r0 + bne _081AA386 + ldr r1, [r5] + ldr r2, =0x00000e28 + adds r0, r1, r2 + ldrh r2, [r0] + adds r3, r2, 0x1 + adds r0, r3, 0 + asrs r0, 4 + lsls r0, 4 + subs r0, r3, r0 + strb r0, [r4] + adds r0, r1, r7 + ldrh r1, [r0] + adds r2, r1, 0 + adds r2, 0xF + adds r0, r2, 0 + asrs r0, 4 + lsls r0, 4 + subs r0, r2, r0 + strb r0, [r6] +_081AA386: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AA33C + + thumb_func_start sub_81AA398 +sub_81AA398: @ 81AA398 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r5, 0 + bl sub_81AA9E4 + lsls r0, 24 + lsrs r6, r0, 24 + movs r0, 0x10 + bl AllocZeroed + str r0, [sp, 0x8] + bl sub_81AA96C + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000e26 + adds r0, r1 + ldrh r4, [r0] + movs r0, 0xF + ands r4, r0 + ldr r0, [sp] + cmp r0, 0 + bne _081AA3F0 + ldr r1, =gUnknown_08613650 + lsls r0, r6, 4 + adds r0, r1 + ldrb r0, [r0, 0x1] + mov r10, r0 + movs r1, 0 + str r1, [sp, 0x4] + b _081AA3FE + .pool +_081AA3F0: + ldr r1, =gUnknown_08613650 + lsls r0, r6, 4 + adds r0, r1 + ldrb r1, [r0] + mov r10, r1 + ldrb r0, [r0, 0x1] + str r0, [sp, 0x4] +_081AA3FE: + movs r0, 0 + mov r8, r0 + cmp r8, r10 + bge _081AA4C0 +_081AA406: + movs r1, 0x1 + add r1, r8 + mov r9, r1 + b _081AA42E + .pool +_081AA414: + lsls r2, r4, 24 + lsrs r2, 24 + ldr r3, [sp, 0x4] + add r3, r8 + lsls r3, 24 + lsrs r3, 24 + ldr r0, [sp] + ldr r1, [sp, 0x8] + bl sub_81AA760 + lsls r0, 24 + cmp r0, 0 + beq _081AA4B6 +_081AA42E: + ldr r0, =gBitTable + mov r12, r0 + ldr r6, =gSaveBlock2Ptr + ldr r7, =0x00000e28 + movs r3, 0x2 + lsls r0, r4, 2 + mov r1, r12 + adds r2, r0, r1 +_081AA43E: + movs r0, 0x1 + ands r0, r5 + cmp r0, 0 + beq _081AA464 + ldr r0, [r6] + adds r0, r7 + ldrh r1, [r0] + ldr r0, [r2] + ands r0, r1 + cmp r0, 0 + bne _081AA474 + b _081AA472 + .pool +_081AA464: + ldr r0, [r6] + adds r0, r7 + ldrh r1, [r0] + ldr r0, [r2] + ands r0, r1 + cmp r0, 0 + beq _081AA474 +_081AA472: + orrs r5, r3 +_081AA474: + adds r2, 0x4 + adds r4, 0x1 + cmp r4, 0xF + ble _081AA480 + mov r2, r12 + movs r4, 0 +_081AA480: + ldr r0, [r6] + ldr r1, =0x00000e26 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0xF + ands r1, r0 + cmp r4, r1 + bne _081AA4A6 + movs r1, 0x1 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _081AA4A4 + movs r0, 0x6 + orrs r5, r0 + b _081AA4A6 + .pool +_081AA4A4: + orrs r5, r1 +_081AA4A6: + adds r0, r5, 0 + ands r0, r3 + cmp r0, 0 + beq _081AA43E + movs r0, 0x4 + ands r0, r5 + cmp r0, 0 + beq _081AA414 +_081AA4B6: + movs r0, 0x1 + ands r5, r0 + mov r8, r9 + cmp r8, r10 + blt _081AA406 +_081AA4C0: + ldr r0, [sp, 0x8] + bl Free + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81AA398 + + thumb_func_start sub_81AA4D8 +sub_81AA4D8: @ 81AA4D8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x4] + movs r6, 0 + movs r7, 0 + movs r0, 0 + str r0, [sp, 0xC] + bl sub_81AA9E4 + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x10 + bl AllocZeroed + str r0, [sp, 0x14] + bl sub_81AA96C + ldr r1, [sp] + cmp r1, 0 + bne _081AA524 + ldr r1, =gUnknown_08613650 + lsls r0, r4, 4 + adds r0, r1 + ldrb r0, [r0, 0x1] + str r0, [sp, 0x10] + movs r0, 0 + b _081AA530 + .pool +_081AA524: + ldr r1, =gUnknown_08613650 + lsls r0, r4, 4 + adds r0, r1 + ldrb r2, [r0] + str r2, [sp, 0x10] + ldrb r0, [r0, 0x1] +_081AA530: + movs r3, 0 + str r3, [sp, 0x8] + ldr r1, [sp, 0x10] + asrs r1, 31 + str r1, [sp, 0x18] + ldr r2, [sp, 0x10] + cmp r3, r2 + bge _081AA622 + str r0, [sp, 0x1C] + adds r3, r0, 0 + lsls r3, 24 + mov r9, r3 +_081AA548: + cmp r7, 0 + bne _081AA56E + mov r0, r9 + lsrs r3, r0, 24 + ldr r0, [sp] + ldr r1, [sp, 0x14] + ldr r2, [sp, 0x4] + bl sub_81AA760 + lsls r0, 24 + cmp r0, 0 + beq _081AA568 + movs r7, 0x1 + b _081AA56E + .pool +_081AA568: + ldr r1, [sp, 0xC] + adds r1, 0x1 + str r1, [sp, 0xC] +_081AA56E: + movs r0, 0x1 + ands r0, r7 + cmp r0, 0 + beq _081AA600 + ldr r2, =gUnknown_08613F46 + mov r8, r2 + ldr r3, [sp, 0x4] + lsls r4, r3, 2 + adds r0, r6, r4 + add r0, r8 + ldrb r2, [r0] + mov r0, r9 + lsrs r3, r0, 24 + ldr r0, [sp] + ldr r1, [sp, 0x14] + bl sub_81AA760 + lsls r0, 24 + ldr r1, [sp, 0x1C] + mov r10, r1 + adds r5, r4, 0 + cmp r0, 0 + beq _081AA5E8 + ldr r4, [sp, 0xC] + adds r4, 0x1 + b _081AA5C2 + .pool +_081AA5A8: + adds r0, r6, r5 + adds r0, r2 + ldrb r2, [r0] + mov r0, r10 + lsls r3, r0, 24 + lsrs r3, 24 + ldr r0, [sp] + ldr r1, [sp, 0x14] + bl sub_81AA760 + lsls r0, 24 + cmp r0, 0 + beq _081AA5E0 +_081AA5C2: + adds r6, 0x1 + ldr r0, =gUnknown_08613F46 + adds r1, r6, r5 + adds r1, r0 + ldrb r1, [r1] + adds r2, r0, 0 + cmp r1, 0xFF + beq _081AA5D6 + cmp r6, 0x3 + ble _081AA5D8 +_081AA5D6: + movs r6, 0 +_081AA5D8: + adds r7, 0x2 + asrs r0, r7, 1 + cmp r0, 0x4 + bne _081AA5A8 +_081AA5E0: + str r4, [sp, 0xC] + b _081AA600 + .pool +_081AA5E8: + adds r6, 0x1 + adds r0, r6, r4 + add r0, r8 + ldrb r0, [r0] + cmp r0, 0xFF + beq _081AA5F8 + cmp r6, 0x3 + ble _081AA5FA +_081AA5F8: + movs r6, 0 +_081AA5FA: + ldr r1, [sp, 0xC] + adds r1, 0x1 + str r1, [sp, 0xC] +_081AA600: + asrs r0, r7, 1 + cmp r0, 0x4 + beq _081AA622 + movs r0, 0x1 + ands r7, r0 + ldr r2, [sp, 0x1C] + adds r2, 0x1 + str r2, [sp, 0x1C] + movs r3, 0x80 + lsls r3, 17 + add r9, r3 + ldr r0, [sp, 0x8] + adds r0, 0x1 + str r0, [sp, 0x8] + ldr r1, [sp, 0x10] + cmp r0, r1 + blt _081AA548 +_081AA622: + movs r1, 0 + ldr r2, [sp, 0x10] + ldr r3, [sp, 0x18] + subs r0, r2, r3 + asrs r0, 1 + ldr r2, [sp, 0xC] + cmp r0, r2 + ble _081AA634 + movs r1, 0x1 +_081AA634: + adds r0, r1, 0 + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81AA4D8 + + thumb_func_start sub_81AA648 +sub_81AA648: @ 81AA648 + 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 + str r0, [sp] + lsls r1, 24 + lsrs r6, r1, 24 + movs r4, 0 + movs r7, 0 + movs r0, 0 + mov r8, r0 + bl sub_81AA9E4 + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x10 + bl AllocZeroed + str r0, [sp, 0x8] + bl sub_81AA96C + ldr r1, [sp] + cmp r1, 0 + bne _081AA694 + ldr r1, =gUnknown_08613650 + lsls r0, r5, 4 + adds r0, r1 + ldrb r0, [r0, 0x1] + mov r10, r0 + movs r0, 0 + b _081AA6A0 + .pool +_081AA694: + ldr r1, =gUnknown_08613650 + lsls r0, r5, 4 + adds r0, r1 + ldrb r2, [r0] + mov r10, r2 + ldrb r0, [r0, 0x1] +_081AA6A0: + movs r3, 0 + str r3, [sp, 0x4] + mov r1, r10 + asrs r1, 31 + str r1, [sp, 0xC] + cmp r3, r10 + bge _081AA73E + ldr r2, =gUnknown_08613F46 + mov r9, r2 + lsls r5, r6, 2 + lsls r6, r0, 24 +_081AA6B6: + adds r0, r4, r5 + add r0, r9 + ldrb r2, [r0] + lsrs r3, r6, 24 + ldr r0, [sp] + ldr r1, [sp, 0x8] + bl sub_81AA760 + lsls r0, 24 + cmp r0, 0 + beq _081AA714 + adds r7, 0x1 + b _081AA6EE + .pool +_081AA6D8: + adds r0, r4, r5 + adds r0, r1 + ldrb r2, [r0] + lsrs r3, r6, 24 + ldr r0, [sp] + ldr r1, [sp, 0x8] + bl sub_81AA760 + lsls r0, 24 + cmp r0, 0 + beq _081AA728 +_081AA6EE: + adds r4, 0x1 + adds r0, r4, r5 + add r0, r9 + ldrb r0, [r0] + ldr r1, =gUnknown_08613F46 + cmp r0, 0xFF + beq _081AA700 + cmp r4, 0x3 + ble _081AA702 +_081AA700: + movs r4, 0 +_081AA702: + movs r3, 0x1 + add r8, r3 + mov r0, r8 + cmp r0, 0x4 + bne _081AA6D8 + b _081AA728 + .pool +_081AA714: + adds r4, 0x1 + adds r0, r4, r5 + add r0, r9 + ldrb r0, [r0] + cmp r0, 0xFF + beq _081AA724 + cmp r4, 0x3 + ble _081AA726 +_081AA724: + movs r4, 0 +_081AA726: + adds r7, 0x1 +_081AA728: + mov r1, r8 + cmp r1, 0x4 + beq _081AA73E + movs r2, 0x80 + lsls r2, 17 + adds r6, r2 + ldr r3, [sp, 0x4] + adds r3, 0x1 + str r3, [sp, 0x4] + cmp r3, r10 + blt _081AA6B6 +_081AA73E: + movs r1, 0 + mov r2, r10 + ldr r3, [sp, 0xC] + subs r0, r2, r3 + asrs r0, 1 + cmp r0, r7 + ble _081AA74E + movs r1, 0x1 +_081AA74E: + adds r0, r1, 0 + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81AA648 + + thumb_func_start sub_81AA760 +sub_81AA760: @ 81AA760 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + mov r10, r1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r7, r3, 24 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000e22 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081AA7D0 + movs r6, 0x7 +_081AA792: + movs r4, 0x7 + lsls r5, r6, 24 +_081AA796: + lsls r1, r4, 24 + lsrs r1, 24 + mov r0, r8 + str r0, [sp] + str r7, [sp, 0x4] + mov r0, r9 + lsrs r2, r5, 24 + mov r3, r10 + bl sub_81AA810 + lsls r0, 24 + cmp r0, 0 + beq _081AA7CC + subs r4, 0x1 + cmp r4, 0 + bge _081AA796 + subs r6, 0x1 + movs r1, 0x1 + negs r1, r1 + cmp r6, r1 + bgt _081AA792 + b _081AA7FC + .pool +_081AA7CC: + movs r0, 0 + b _081AA7FE +_081AA7D0: + movs r6, 0 +_081AA7D2: + movs r4, 0 + lsls r5, r6, 24 +_081AA7D6: + lsls r1, r4, 24 + lsrs r1, 24 + mov r0, r8 + str r0, [sp] + str r7, [sp, 0x4] + mov r0, r9 + lsrs r2, r5, 24 + mov r3, r10 + bl sub_81AA810 + lsls r0, 24 + cmp r0, 0 + beq _081AA7CC + adds r4, 0x1 + cmp r4, 0x7 + ble _081AA7D6 + adds r6, 0x1 + cmp r6, 0x7 + ble _081AA7D2 +_081AA7FC: + movs r0, 0x1 +_081AA7FE: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81AA760 + + thumb_func_start sub_81AA810 +sub_81AA810: @ 81AA810 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + ldr r4, [sp, 0x34] + ldr r5, [sp, 0x38] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x4] + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r4, 24 + lsrs r4, 24 + mov r10, r4 + lsls r5, 24 + lsrs r6, r5, 24 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0xC7 + lsls r1, 4 + adds r1, r0, r1 + str r1, [sp, 0x8] + add r3, r10 + ldrb r1, [r3] + adds r1, 0x2C + movs r0, 0x19 + bl get_mapheader_by_bank_and_number + adds r5, r0, 0 + movs r7, 0 + ldr r1, [r5, 0x4] + ldrb r2, [r1] + cmp r7, r2 + bge _081AA95A + movs r0, 0x3 + ands r0, r4 + lsls r0, 3 + str r0, [sp, 0xC] +_081AA868: + ldr r1, [r1, 0x4] + lsls r2, r7, 1 + adds r0, r2, r7 + lsls r0, 3 + adds r3, r0, r1 + movs r4, 0x4 + ldrsh r0, [r3, r4] + ldr r1, [r5, 0x4] + mov r12, r1 + mov r9, r2 + ldr r2, [sp, 0x4] + cmp r0, r2 + bne _081AA950 + movs r4, 0x6 + ldrsh r0, [r3, r4] + cmp r0, r8 + bne _081AA950 + ldr r0, [sp] + cmp r0, 0 + bne _081AA896 + ldrb r0, [r3, 0x1] + cmp r0, 0x3B + bne _081AA8A2 +_081AA896: + ldr r1, [sp] + cmp r1, 0x1 + bne _081AA950 + ldrb r0, [r3, 0x1] + cmp r0, 0x3B + bne _081AA950 +_081AA8A2: + movs r3, 0 + ldr r2, [r5, 0x4] + mov r12, r2 + cmp r3, r6 + bge _081AA8DC + ldr r4, [sp, 0x4] + ldr r0, [sp, 0xC] + adds r4, r0 + str r4, [sp, 0x10] + mov r1, r10 + lsrs r0, r1, 2 + lsls r0, 3 + mov r2, r8 + adds r1, r2, r0 + ldr r2, [sp, 0x8] + adds r2, 0x4 +_081AA8C2: + movs r4, 0 + ldrsh r0, [r2, r4] + ldr r4, [sp, 0x10] + cmp r0, r4 + bne _081AA8D4 + movs r4, 0x2 + ldrsh r0, [r2, r4] + cmp r0, r1 + beq _081AA8DC +_081AA8D4: + adds r2, 0x18 + adds r3, 0x1 + cmp r3, r6 + blt _081AA8C2 +_081AA8DC: + cmp r3, r6 + bne _081AA950 + lsls r0, r6, 1 + mov r8, r0 + adds r0, r6 + lsls r0, 3 + ldr r1, [sp, 0x8] + adds r5, r0, r1 + mov r3, r12 + ldr r2, [r3, 0x4] + mov r4, r9 + adds r1, r4, r7 + lsls r1, 3 + adds r0, r5, 0 + adds r1, r2 + ldm r1!, {r2-r4} + stm r0!, {r2-r4} + ldm r1!, {r2-r4} + stm r0!, {r2-r4} + ldrh r0, [r5, 0x4] + ldr r1, [sp, 0xC] + adds r0, r1 + strh r0, [r5, 0x4] + mov r2, r10 + lsrs r0, r2, 2 + lsls r0, 3 + ldrh r3, [r5, 0x6] + adds r0, r3 + strh r0, [r5, 0x6] + adds r0, r6, 0x1 + strb r0, [r5] + ldrb r0, [r5, 0x1] + cmp r0, 0x3B + beq _081AA940 + adds r0, r6, 0 + bl sub_81A9F90 + lsls r0, 16 + lsrs r7, r0, 16 + adds r4, r7, 0 + adds r0, r4, 0 + bl sub_81627A4 + strb r0, [r5, 0x1] + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000cb4 + adds r0, r1 + add r0, r8 + strh r4, [r0] +_081AA940: + movs r0, 0 + b _081AA95C + .pool +_081AA950: + adds r7, 0x1 + mov r1, r12 + ldrb r2, [r1] + cmp r7, r2 + blt _081AA868 +_081AA95A: + movs r0, 0x1 +_081AA95C: + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81AA810 + + thumb_func_start sub_81AA96C +sub_81AA96C: @ 81AA96C + push {r4-r7,lr} + adds r6, r0, 0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000e22 + adds r1, r0, r2 + ldrh r4, [r1] + ldr r1, =0x00000e24 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 16 + orrs r4, r0 + bl sub_81AA9E4 + lsls r0, 24 + lsrs r5, r0, 24 + movs r3, 0 + ldr r2, =gUnknown_08613655 + mov r12, r2 + movs r7, 0x7 +_081AA994: + adds r2, r6, r3 + adds r0, r4, 0 + ands r0, r7 + lsls r1, r5, 4 + adds r0, r1 + add r0, r12 + ldrb r0, [r0] + strb r0, [r2] + asrs r4, 3 + cmp r3, 0x7 + bne _081AA9C0 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r2, =0x00000e26 + adds r0, r1, r2 + ldrh r4, [r0] + ldr r0, =0x00000e28 + adds r1, r0 + ldrh r0, [r1] + lsls r0, 16 + orrs r4, r0 + asrs r4, 8 +_081AA9C0: + adds r3, 0x1 + cmp r3, 0xF + ble _081AA994 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AA96C + + thumb_func_start sub_81AA9E4 +sub_81AA9E4: @ 81AA9E4 + push {r4,lr} + ldr r0, =gSaveBlock2Ptr + ldr r4, [r0] + ldr r1, =0x00000e28 + adds r0, r4, r1 + ldrh r0, [r0] + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r3, r0, 16 + ldr r0, =0x00000cb2 + adds r4, r0 + ldrh r0, [r4] + ldr r1, =gUnknown_08613794 + adds r0, r1 + ldrb r2, [r0] + cmp r2, 0x21 + bhi _081AAA38 + ldr r1, =gUnknown_08613750 + lsls r0, r2, 1 + adds r0, r1 +_081AAA10: + ldrb r1, [r0] + cmp r3, r1 + bge _081AAA30 + ldrb r0, [r0, 0x1] + b _081AAA3A + .pool +_081AAA30: + adds r0, 0x2 + adds r2, 0x1 + cmp r2, 0x21 + bls _081AAA10 +_081AAA38: + movs r0, 0 +_081AAA3A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81AA9E4 + + thumb_func_start sub_81AAA40 +sub_81AAA40: @ 81AAA40 + push {lr} + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0xC7 + lsls r1, 4 + adds r2, r0, r1 + movs r1, 0 + movs r3, 0xC7 + lsls r3, 4 + adds r0, r3 + b _081AAA6E + .pool +_081AAA5C: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xF + bhi _081AAA74 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r2 +_081AAA6E: + ldrb r0, [r0] + cmp r0, 0 + bne _081AAA5C +_081AAA74: + adds r0, r1, 0 + pop {r1} + bx r1 + thumb_func_end sub_81AAA40 + + thumb_func_start sub_81AAA7C +sub_81AAA7C: @ 81AAA7C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + movs r3, 0 + ldr r1, =gSaveBlock2Ptr + mov r8, r1 + lsls r1, r0, 2 + adds r1, r0 + movs r0, 0 + mov r12, r0 + lsls r4, r1, 1 + ldr r7, =0x00000e2c + movs r6, 0 + ldr r5, =0x00000e54 + lsls r2, r1, 2 +_081AAA9E: + mov r1, r8 + ldr r0, [r1] + adds r1, r0, r7 + adds r1, r2 + strh r6, [r1] + adds r1, r3, r4 + adds r0, r5 + adds r0, r1 + mov r1, r12 + strb r1, [r0] + adds r2, 0x2 + adds r3, 0x1 + cmp r3, 0x9 + ble _081AAA9E + movs r0, 0x15 + movs r1, 0x1 + bl AddPyramidBagItem + movs r0, 0x22 + movs r1, 0x1 + bl AddPyramidBagItem + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AAA7C + + thumb_func_start CalculateBattlePyramidPickupItemId +CalculateBattlePyramidPickupItemId: @ 81AAAE0 + push {r4-r6,lr} + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r2, =0x00000ca9 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r6, r0, 30 + lsls r0, r6, 1 + ldr r2, =0x00000e1a + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x13 + ble _081AAB0A + movs r4, 0x13 +_081AAB0A: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r2, r0, 16 + movs r1, 0 + ldr r3, =gUnknown_08613F86 + ldrb r0, [r3] + lsls r5, r4, 2 + cmp r0, r2 + bgt _081AAB36 +_081AAB28: + adds r1, 0x1 + cmp r1, 0x9 + bhi _081AAB3A + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + ble _081AAB28 +_081AAB36: + cmp r1, 0x9 + bls _081AAB3C +_081AAB3A: + movs r1, 0x9 +_081AAB3C: + cmp r6, 0 + bne _081AAB58 + ldr r2, =gUnknown_0861379C + b _081AAB5A + .pool +_081AAB58: + ldr r2, =gUnknown_0861392C +_081AAB5A: + lsls r1, 1 + adds r0, r5, r4 + lsls r0, 2 + adds r1, r0 + adds r1, r2 + ldrh r0, [r1] + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end CalculateBattlePyramidPickupItemId + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_8072304.s b/asm/battle_interface.s old mode 100644 new mode 100755 similarity index 64% rename from asm/rom_8072304.s rename to asm/battle_interface.s index 4b93d3a0e..fb6a48194 --- a/asm/rom_8072304.s +++ b/asm/battle_interface.s @@ -5731,3063 +5731,4 @@ sub_80751E4: @ 80751E4 .pool thumb_func_end sub_80751E4 - 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 - - thumb_func_start sub_80753E8 -sub_80753E8: @ 80753E8 - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 24 - lsrs r5, 24 - ldr r1, =gDoingBattleAnim - movs r0, 0x1 - strb r0, [r1] - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r6, =gActiveBank - ldrb r1, [r6] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x8 - orrs r1, r2 - strb r1, [r0] - ldr r0, =sub_8075450 - movs r1, 0x5 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0xA] - strh r5, [r1, 0xC] - ldrb r0, [r6] - strh r0, [r1, 0xE] - movs r0, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80753E8 - - thumb_func_start sub_8075450 -sub_8075450: @ 8075450 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - movs r0, 0 - str r0, [sp] - ldr r1, =gTasks - mov r2, r10 - lsls r0, r2, 2 - add r0, r10 - lsls r0, 3 - adds r1, r0, r1 - ldrh r2, [r1, 0x8] - movs r3, 0x8 - ldrsh r0, [r1, r3] - cmp r0, 0 - bne _08075488 - adds r0, r2, 0x1 - strh r0, [r1, 0x8] - b _08075602 - .pool -_08075488: - ldrh r0, [r1, 0xC] - mov r8, r0 - ldrb r5, [r1, 0xE] - adds r0, r5, 0 - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - beq _080754B4 - ldr r1, =gBattlePartyID - lsls r0, r5, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gEnemyParty - b _080754C2 - .pool -_080754B4: - ldr r1, =gBattlePartyID - lsls r0, r5, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty -_080754C2: - adds r0, r1 - movs r1, 0x26 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - bl ball_number_to_ball_processing_index - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl sub_8076A78 - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 3 - ldr r1, =gUnknown_0832C588 - adds r0, r1 - movs r1, 0x20 - movs r2, 0x50 - movs r3, 0x1D - bl CreateSprite - lsls r0, 24 - lsrs r7, r0, 24 - ldr r2, =gSprites - mov r9, r2 - lsls r0, r7, 4 - adds r0, r7 - lsls r6, r0, 2 - adds r4, r6, r2 - movs r0, 0x80 - strh r0, [r4, 0x2E] - movs r3, 0 - strh r3, [r4, 0x30] - mov r0, r8 - strh r0, [r4, 0x3C] - mov r2, r8 - cmp r2, 0xFE - beq _08075548 - cmp r2, 0xFF - bne _08075584 - ldr r0, =gBankTarget - strb r5, [r0] - movs r0, 0x18 - strh r0, [r4, 0x20] - movs r0, 0x44 - strh r0, [r4, 0x22] - mov r0, r9 - adds r0, 0x1C - adds r0, r6, r0 - ldr r1, =sub_80761B4 - str r1, [r0] - b _08075592 - .pool -_08075548: - adds r0, r5, 0 - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x20] - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x18 - strh r0, [r4, 0x22] - ldr r0, =gBankTarget - strb r5, [r0] - movs r3, 0 - strh r3, [r4, 0x2E] - mov r0, r9 - adds r0, 0x1C - adds r0, r6, r0 - ldr r1, =sub_8076398 - str r1, [r0] - b _08075592 - .pool -_08075584: - movs r0, 0x1 - bl GetBankByPlayerAI - ldr r1, =gBankTarget - strb r0, [r1] - movs r0, 0x1 - str r0, [sp] -_08075592: - ldr r0, =gSprites - lsls r1, r7, 4 - adds r1, r7 - lsls r1, 2 - adds r4, r1, r0 - ldr r5, =gBankTarget - ldrb r0, [r5] - strh r0, [r4, 0x3A] - ldr r2, [sp] - cmp r2, 0 - bne _080755B8 - mov r0, r10 - bl DestroyTask - b _08075602 - .pool -_080755B8: - movs r0, 0x22 - strh r0, [r4, 0x2E] - ldrb r0, [r5] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x32] - ldrb r0, [r5] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x10 - strh r0, [r4, 0x36] - ldr r0, =0x0000ffd8 - strh r0, [r4, 0x38] - adds r0, r4, 0 - bl sub_80A68D4 - mov r3, r10 - strh r3, [r4, 0x6] - ldr r1, =gTasks - mov r2, r10 - lsls r0, r2, 2 - add r0, r10 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r5] - strh r1, [r0, 0x10] - ldr r1, =TaskDummy - str r1, [r0] - movs r0, 0x3D - bl PlaySE -_08075602: - 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_8075450 - - thumb_func_start objc_0804ABD4 -objc_0804ABD4: @ 8075620 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r7, r0, 0 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - beq _080756C0 - ldrb r6, [r7, 0x6] - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldrb r5, [r0, 0x10] - ldrb r0, [r0, 0xC] - mov r8, r0 - adds r0, r7, 0 - movs r1, 0x1 - bl StartSpriteAnim - adds r2, r7, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - ldrh r0, [r7, 0x24] - ldrh r1, [r7, 0x20] - adds r0, r1 - movs r1, 0 - strh r0, [r7, 0x20] - ldrh r0, [r7, 0x26] - ldrh r2, [r7, 0x22] - adds r0, r2 - strh r0, [r7, 0x22] - strh r1, [r7, 0x24] - strh r1, [r7, 0x26] - strh r1, [r7, 0x38] - adds r0, r5, 0 - bl sub_8076B14 - lsls r0, 16 - lsrs r0, 16 - bl ball_number_to_ball_processing_index - adds r4, r0, 0 - ldrh r0, [r7, 0x20] - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r7, 0x22] - subs r1, 0x5 - lsls r1, 24 - lsrs r1, 24 - lsls r4, 24 - lsrs r4, 24 - str r4, [sp] - movs r2, 0x1 - movs r3, 0x1C - bl sub_8171D98 - movs r0, 0 - adds r1, r5, 0 - movs r2, 0xE - adds r3, r4, 0 - bl sub_81729E8 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7, 0x2E] - strh r5, [r7, 0x3A] - mov r0, r8 - strh r0, [r7, 0x3C] - adds r0, r6, 0 - bl DestroyTask - ldr r0, =sub_80756D4 - str r0, [r7, 0x1C] -_080756C0: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end objc_0804ABD4 - - thumb_func_start sub_80756D4 -sub_80756D4: @ 80756D4 - ldr r1, =sub_80756E0 - str r1, [r0, 0x1C] - bx lr - .pool - thumb_func_end sub_80756D4 - - thumb_func_start sub_80756E0 -sub_80756E0: @ 80756E0 - push {r4-r7,lr} - adds r6, r0, 0 - ldrh r0, [r6, 0x38] - adds r0, 0x1 - movs r7, 0 - strh r0, [r6, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA - bne _0807573A - strh r7, [r6, 0x38] - ldr r0, =sub_807574C - str r0, [r6, 0x1C] - ldr r5, =gBankSpriteIds - movs r1, 0x3A - ldrsh r0, [r6, r1] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =gSprites - adds r0, r4 - movs r1, 0x2 - bl StartSpriteAffineAnim - movs r1, 0x3A - ldrsh r0, [r6, r1] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl AnimateSprite - movs r1, 0x3A - ldrsh r0, [r6, r1] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r7, [r0, 0x30] -_0807573A: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80756E0 - - thumb_func_start sub_807574C -sub_807574C: @ 807574C - push {r4-r6,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xB - bne _08075764 - movs r0, 0x3C - bl PlaySE -_08075764: - ldr r6, =gSprites - ldr r5, =gBankSpriteIds - movs r1, 0x3A - ldrsh r0, [r4, r1] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r6 - adds r0, r1, 0 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 26 - cmp r0, 0 - bge _080757BC - adds r0, r4, 0 - movs r1, 0x2 - bl StartSpriteAnim - movs r2, 0x3A - ldrsh r0, [r4, r2] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - movs r0, 0 - strh r0, [r4, 0x38] - ldr r0, =sub_80757E4 - str r0, [r4, 0x1C] - b _080757DC - .pool -_080757BC: - ldrh r0, [r1, 0x30] - adds r0, 0x60 - strh r0, [r1, 0x30] - movs r1, 0x3A - ldrsh r0, [r4, r1] - adds r0, r5 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - movs r2, 0x30 - ldrsh r0, [r1, r2] - negs r0, r0 - asrs r0, 8 - strh r0, [r1, 0x26] -_080757DC: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_807574C - - thumb_func_start sub_80757E4 -sub_80757E4: @ 80757E4 - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0807582C - ldrh r0, [r4, 0x38] - adds r0, 0x1 - movs r1, 0 - strh r0, [r4, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bne _0807582C - strh r1, [r4, 0x34] - movs r0, 0x20 - strh r0, [r4, 0x36] - strh r1, [r4, 0x38] - movs r0, 0 - movs r1, 0x20 - bl Cos - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - movs r0, 0x36 - ldrsh r1, [r4, r0] - movs r0, 0 - bl Cos - negs r0, r0 - strh r0, [r4, 0x26] - ldr r0, =sub_8075838 - str r0, [r4, 0x1C] -_0807582C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80757E4 - - thumb_func_start sub_8075838 -sub_8075838: @ 8075838 - push {r4,r5,lr} - adds r4, r0, 0 - movs r5, 0 - ldrh r0, [r4, 0x34] - movs r1, 0xFF - ands r1, r0 - cmp r1, 0 - beq _0807584E - cmp r1, 0x1 - beq _080758C2 - b _080758EE -_0807584E: - movs r1, 0x38 - ldrsh r0, [r4, r1] - movs r2, 0x36 - ldrsh r1, [r4, r2] - bl Cos - negs r0, r0 - strh r0, [r4, 0x26] - ldrh r1, [r4, 0x38] - adds r1, 0x4 - ldrh r2, [r4, 0x34] - lsls r0, r2, 16 - asrs r0, 24 - adds r1, r0 - strh r1, [r4, 0x38] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x3F - ble _080758EE - ldrh r0, [r4, 0x36] - subs r0, 0xA - strh r0, [r4, 0x36] - ldr r1, =0x00000101 - adds r0, r2, r1 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r0, 24 - cmp r0, 0x4 - bne _0807588A - movs r5, 0x1 -_0807588A: - cmp r0, 0x2 - beq _080758AA - cmp r0, 0x2 - bgt _0807589C - cmp r0, 0x1 - beq _080758A2 - b _080758BA - .pool -_0807589C: - cmp r0, 0x3 - beq _080758B2 - b _080758BA -_080758A2: - movs r0, 0x38 - bl PlaySE - b _080758EE -_080758AA: - movs r0, 0x39 - bl PlaySE - b _080758EE -_080758B2: - movs r0, 0x3A - bl PlaySE - b _080758EE -_080758BA: - movs r0, 0x3B - bl PlaySE - b _080758EE -_080758C2: - movs r2, 0x38 - ldrsh r0, [r4, r2] - movs r2, 0x36 - ldrsh r1, [r4, r2] - bl Cos - negs r0, r0 - strh r0, [r4, 0x26] - ldrh r1, [r4, 0x38] - subs r1, 0x4 - ldrh r2, [r4, 0x34] - lsls r0, r2, 16 - asrs r0, 24 - subs r1, r0 - strh r1, [r4, 0x38] - lsls r1, 16 - cmp r1, 0 - bgt _080758EE - strh r5, [r4, 0x38] - ldr r0, =0xffffff00 - ands r0, r2 - strh r0, [r4, 0x34] -_080758EE: - cmp r5, 0 - beq _08075926 - movs r5, 0 - strh r5, [r4, 0x34] - movs r0, 0x40 - movs r1, 0x20 - bl Cos - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - strh r5, [r4, 0x26] - movs r2, 0x3C - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _0807591C - ldr r0, =sub_8075D14 - str r0, [r4, 0x1C] - b _08075926 - .pool -_0807591C: - ldr r0, =sub_8075930 - str r0, [r4, 0x1C] - movs r0, 0x1 - strh r0, [r4, 0x36] - strh r5, [r4, 0x38] -_08075926: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8075838 - - thumb_func_start sub_8075930 -sub_8075930: @ 8075930 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1F - bne _08075964 - movs r0, 0 - strh r0, [r4, 0x34] - adds r2, r4, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - adds r0, r4, 0 - movs r1, 0x1 - bl StartSpriteAffineAnim - ldr r0, =sub_8075970 - str r0, [r4, 0x1C] - movs r0, 0x17 - bl PlaySE -_08075964: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8075930 - - thumb_func_start sub_8075970 -sub_8075970: @ 8075970 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x34] - movs r1, 0xFF - ands r1, r0 - cmp r1, 0x4 - bhi _08075A70 - lsls r0, r1, 2 - ldr r1, =_0807598C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0807598C: - .4byte _080759A0 - .4byte _080759D2 - .4byte _080759A0 - .4byte _08075A26 - .4byte _08075A70 -_080759A0: - ldrh r0, [r4, 0x36] - ldrh r2, [r4, 0x24] - adds r1, r0, r2 - strh r1, [r4, 0x24] - ldrh r1, [r4, 0x38] - adds r0, r1 - strh r0, [r4, 0x38] - adds r2, r4, 0 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - ldrh r0, [r4, 0x38] - adds r0, 0x3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x6 - bls _08075AB6 - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] - movs r0, 0 - strh r0, [r4, 0x38] - b _08075AB6 -_080759D2: - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bne _08075A18 - movs r0, 0 - strh r0, [r4, 0x38] - ldrh r0, [r4, 0x36] - negs r0, r0 - strh r0, [r4, 0x36] - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] - adds r2, r4, 0 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - movs r2, 0x36 - ldrsh r0, [r4, r2] - cmp r0, 0 - bge _08075A0E - adds r0, r4, 0 - movs r1, 0x2 - bl ChangeSpriteAffineAnim - b _08075AB6 -_08075A0E: - adds r0, r4, 0 - movs r1, 0x1 - bl ChangeSpriteAffineAnim - b _08075AB6 -_08075A18: - adds r0, r4, 0 - adds r0, 0x2C - ldrb r1, [r0] - movs r2, 0x80 - orrs r1, r2 - strb r1, [r0] - b _08075AB6 -_08075A26: - movs r1, 0x80 - lsls r1, 1 - adds r0, r1, 0 - ldrh r2, [r4, 0x34] - adds r0, r2 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r0, 24 - movs r2, 0x3C - ldrsh r1, [r4, r2] - cmp r0, r1 - bne _08075A48 - ldr r0, =sub_8075D14 - str r0, [r4, 0x1C] - b _08075AB6 - .pool -_08075A48: - cmp r1, 0x4 - bne _08075A5C - cmp r0, 0x3 - bne _08075A5C - ldr r0, =sub_8075FB4 - str r0, [r4, 0x1C] - b _08075A62 - .pool -_08075A5C: - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] -_08075A62: - adds r2, r4, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - b _08075AB6 -_08075A70: - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1F - bne _08075AB6 - movs r0, 0 - strh r0, [r4, 0x38] - ldrh r1, [r4, 0x34] - ldr r0, =0xffffff00 - ands r0, r1 - strh r0, [r4, 0x34] - adds r0, r4, 0 - movs r1, 0x3 - bl StartSpriteAffineAnim - movs r1, 0x36 - ldrsh r0, [r4, r1] - cmp r0, 0 - bge _08075AA8 - adds r0, r4, 0 - movs r1, 0x2 - bl StartSpriteAffineAnim - b _08075AB0 - .pool -_08075AA8: - adds r0, r4, 0 - movs r1, 0x1 - bl StartSpriteAffineAnim -_08075AB0: - movs r0, 0x17 - bl PlaySE -_08075AB6: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8075970 - - thumb_func_start c3_0804B070 -c3_0804B070: @ 8075ABC - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r2, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r2 - ldrb r1, [r0, 0xC] - mov r12, r1 - ldrb r5, [r0, 0xA] - ldrh r6, [r0, 0x8] - ldrb r3, [r0, 0xE] - mov r8, r3 - ldrb r7, [r0, 0x10] - movs r3, 0x12 - ldrsh r1, [r0, r3] - lsls r3, r1, 16 - ldrh r1, [r0, 0x14] - orrs r3, r1 - movs r1, 0x26 - ldrsh r0, [r0, r1] - cmp r0, 0x20 - bhi _08075B88 - lsls r0, 2 - ldr r1, =_08075B04 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08075B04: - .4byte _08075B88 - .4byte _08075BB4 - .4byte _08075BDA - .4byte _08075C54 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075BF8 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075C66 - .4byte _08075C7E - .4byte _08075CA8 -_08075B88: - ldr r0, =gSprites - lsls r1, r7, 4 - adds r1, r7 - lsls r1, 2 - adds r1, r0 - adds r1, 0x3F - ldrb r0, [r1] - lsls r0, 26 - cmp r0, 0 - blt _08075B9E - b _08075D04 -_08075B9E: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r2 - mov r1, r12 - adds r1, 0x1 - strh r1, [r0, 0x26] - b _08075D04 - .pool -_08075BB4: - adds r0, r3, 0 - bl sub_805F110 - cmp r0, 0x1 - bne _08075BCC - lsls r1, r5, 24 - asrs r1, 24 - adds r0, r6, 0 - movs r2, 0 - bl PlayCry3 - b _08075C2E -_08075BCC: - lsls r1, r5, 24 - asrs r1, 24 - adds r0, r6, 0 - movs r2, 0xB - bl PlayCry3 - b _08075C2E -_08075BDA: - bl StopCryAndClearCrySongs - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0x3 - strh r1, [r0, 0x1C] - movs r1, 0x14 - strh r1, [r0, 0x26] - b _08075D04 - .pool -_08075BF8: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r2 - ldrh r2, [r1, 0x1C] - movs r7, 0x1C - ldrsh r0, [r1, r7] - cmp r0, 0 - bne _08075CBA - adds r0, r3, 0 - bl sub_805F110 - cmp r0, 0x1 - bne _08075C22 - lsls r1, r5, 24 - asrs r1, 24 - adds r0, r6, 0 - movs r2, 0x1 - bl PlayCry4 - b _08075C2E -_08075C22: - lsls r1, r5, 24 - asrs r1, 24 - adds r0, r6, 0 - movs r2, 0xC - bl PlayCry4 -_08075C2E: - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r0, [r0, 0x4] - mov r2, r8 - lsls r1, r2, 1 - add r1, r8 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x1] - movs r0, 0x41 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x1] - adds r0, r4, 0 - bl DestroyTask - b _08075D04 - .pool -_08075C54: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r2 - movs r1, 0x6 - strh r1, [r0, 0x1C] - movs r1, 0x1E - strh r1, [r0, 0x26] - b _08075D04 -_08075C66: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r2 - ldrh r2, [r1, 0x1C] - movs r3, 0x1C - ldrsh r0, [r1, r3] - cmp r0, 0 - bne _08075CBA - ldrh r0, [r1, 0x26] - adds r0, 0x1 - strh r0, [r1, 0x26] -_08075C7E: - bl IsCryPlayingOrClearCrySongs - lsls r0, 24 - cmp r0, 0 - bne _08075D04 - bl StopCryAndClearCrySongs - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - movs r0, 0x3 - strh r0, [r1, 0x1C] - ldrh r0, [r1, 0x26] - adds r0, 0x1 - strh r0, [r1, 0x26] - b _08075D04 - .pool -_08075CA8: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r2 - ldrh r2, [r1, 0x1C] - movs r7, 0x1C - ldrsh r0, [r1, r7] - cmp r0, 0 - beq _08075CC0 -_08075CBA: - subs r0, r2, 0x1 - strh r0, [r1, 0x1C] - b _08075D04 -_08075CC0: - adds r0, r3, 0 - bl sub_805F110 - cmp r0, 0x1 - bne _08075CD8 - lsls r1, r5, 24 - asrs r1, 24 - adds r0, r6, 0 - movs r2, 0 - bl PlayCry4 - b _08075CE4 -_08075CD8: - lsls r1, r5, 24 - asrs r1, 24 - adds r0, r6, 0 - movs r2, 0xB - bl PlayCry4 -_08075CE4: - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r0, [r0, 0x4] - mov r2, r8 - lsls r1, r2, 1 - add r1, r8 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x1] - movs r0, 0x41 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x1] - adds r0, r4, 0 - bl DestroyTask -_08075D04: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end c3_0804B070 - - thumb_func_start sub_8075D14 -sub_8075D14: @ 8075D14 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r6, r0, 0 - ldrh r0, [r6, 0x3A] - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r6, 0 - movs r1, 0x1 - bl StartSpriteAnim - adds r0, r5, 0 - bl sub_8076B14 - lsls r0, 16 - lsrs r0, 16 - bl ball_number_to_ball_processing_index - adds r4, r0, 0 - ldrh r0, [r6, 0x20] - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r6, 0x22] - subs r1, 0x5 - lsls r1, 24 - lsrs r1, 24 - lsls r4, 24 - lsrs r4, 24 - str r4, [sp] - movs r2, 0x1 - movs r3, 0x1C - bl sub_8171D98 - ldrh r1, [r6, 0x3A] - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x1 - movs r2, 0xE - adds r3, r4, 0 - bl sub_81729E8 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x2E] - ldr r0, =sub_8075FD4 - str r0, [r6, 0x1C] - ldr r0, =gMain - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08075D88 - b _08075EF4 -_08075D88: - adds r0, r5, 0 - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - beq _08075DC0 - ldr r0, =gBattlePartyID - lsls r2, r5, 1 - adds r0, r2, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gEnemyParty - adds r7, r1, r0 - movs r4, 0x19 - mov r10, r4 - b _08075DD4 - .pool -_08075DC0: - ldr r0, =gBattlePartyID - lsls r2, r5, 1 - adds r0, r2, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r7, r1, r0 - movs r0, 0xE7 - mov r10, r0 -_08075DD4: - mov r8, r2 - adds r0, r7, 0 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - movs r0, 0 - bl GetBankByPlayerAI - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - beq _08075E00 - movs r0, 0x1 - bl GetBankByPlayerAI - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - bne _08075E56 -_08075E00: - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08075E56 - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r1, [r0, 0x9] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08075E56 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x42 - ands r0, r1 - cmp r0, 0x42 - bne _08075E4C - bl IsBGMPlaying - lsls r0, 24 - cmp r0, 0 - beq _08075E56 - ldr r0, =gMPlay_BGM - bl m4aMPlayStop - b _08075E56 - .pool -_08075E4C: - ldr r0, =gMPlay_BGM - ldr r1, =0x0000ffff - movs r2, 0x80 - bl m4aMPlayVolumeControl -_08075E56: - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08075E70 - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r1, [r0, 0x9] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08075E80 -_08075E70: - movs r4, 0 - b _08075EA2 - .pool -_08075E80: - movs r0, 0 - bl GetBankByPlayerAI - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - beq _08075E9C - movs r0, 0x1 - bl GetBankByPlayerAI - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - bne _08075EA0 -_08075E9C: - movs r4, 0x1 - b _08075EA2 -_08075EA0: - movs r4, 0x2 -_08075EA2: - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r0, [r0, 0x4] - mov r2, r8 - adds r1, r2, r5 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - movs r2, 0x40 - orrs r0, r2 - strb r0, [r1, 0x1] - ldr r0, =c3_0804B070 - movs r1, 0x3 - 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 r3, 0 - mov r0, r9 - strh r0, [r1, 0x8] - mov r2, r10 - lsls r0, r2, 24 - asrs r0, 24 - strh r0, [r1, 0xA] - strh r4, [r1, 0xC] - strh r5, [r1, 0xE] - ldr r2, =gBankSpriteIds - movs r4, 0x3A - ldrsh r0, [r6, r4] - adds r0, r2 - ldrb r0, [r0] - strh r0, [r1, 0x10] - lsrs r0, r7, 16 - strh r0, [r1, 0x12] - strh r7, [r1, 0x14] - strh r3, [r1, 0x26] -_08075EF4: - ldr r4, =gBankSpriteIds - movs r1, 0x3A - ldrsh r0, [r6, r1] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r5, =gSprites - adds r0, r5 - movs r1, 0x1 - bl StartSpriteAffineAnim - ldrh r0, [r6, 0x3A] - lsls r0, 24 - lsrs r0, 24 - bl GetBankSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08075F50 - movs r2, 0x3A - ldrsh r0, [r6, r2] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r5, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_8039B58 - b _08075F66 - .pool -_08075F50: - movs r1, 0x3A - ldrsh r0, [r6, r1] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r5, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_8039E44 -_08075F66: - str r1, [r0] - ldr r5, =gBankSpriteIds - movs r2, 0x3A - ldrsh r0, [r6, r2] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =gSprites - adds r0, r4 - bl AnimateSprite - movs r1, 0x3A - ldrsh r0, [r6, r1] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x80 - lsls r1, 5 - strh r1, [r0, 0x30] - 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_8075D14 - - thumb_func_start sub_8075FB4 -sub_8075FB4: @ 8075FB4 - adds r3, r0, 0 - adds r3, 0x2C - ldrb r1, [r3] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r3] - ldr r1, =sub_80760F8 - str r1, [r0, 0x1C] - movs r1, 0 - strh r1, [r0, 0x34] - strh r1, [r0, 0x36] - strh r1, [r0, 0x38] - bx lr - .pool - thumb_func_end sub_8075FB4 - - thumb_func_start sub_8075FD4 -sub_8075FD4: @ 8075FD4 - push {r4-r7,lr} - adds r5, r0, 0 - movs r7, 0 - ldrh r0, [r5, 0x3A] - lsls r0, 24 - lsrs r6, r0, 24 - ldr r4, =gSprites - ldr r0, =gBankSpriteIds - adds r3, r6, r0 - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - adds r0, r5, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08076016 - adds r2, r5, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] -_08076016: - ldrb r0, [r3] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - adds r0, r1, 0 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 26 - cmp r0, 0 - bge _08076040 - adds r0, r1, 0 - movs r1, 0 - bl StartSpriteAffineAnim - movs r7, 0x1 - b _0807605C - .pool -_08076040: - ldr r2, =0xfffffee0 - adds r0, r2, 0 - ldrh r2, [r1, 0x30] - adds r0, r2 - strh r0, [r1, 0x30] - ldrb r0, [r3] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrh r0, [r1, 0x30] - lsls r0, 16 - asrs r0, 24 - strh r0, [r1, 0x26] -_0807605C: - adds r0, r5, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080760DE - cmp r7, 0 - beq _080760DE - ldr r2, =gSprites - ldr r0, =gBankSpriteIds - adds r0, r6, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r2, 0 - movs r1, 0 - strh r1, [r0, 0x26] - ldr r0, =gDoingBattleAnim - strb r2, [r0] - ldr r4, =gUnknown_020244D0 - ldr r0, [r4] - ldr r0, [r0, 0x4] - lsls r1, r6, 1 - adds r1, r6 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - adds r0, r5, 0 - bl FreeSpriteOamMatrix - adds r0, r5, 0 - bl DestroySprite - movs r3, 0 - ldr r0, [r4] - ldr r2, [r0, 0x4] - movs r5, 0x8 - movs r4, 0x3 -_080760B6: - ldrb r1, [r2] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - bne _080760C2 - adds r3, 0x1 -_080760C2: - adds r2, 0xC - subs r4, 0x1 - cmp r4, 0 - bge _080760B6 - cmp r3, 0x4 - bne _080760DE - movs r4, 0 -_080760D0: - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_8076AE8 - adds r4, 0x1 - cmp r4, 0xB - ble _080760D0 -_080760DE: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8075FD4 - - thumb_func_start sub_80760F8 -sub_80760F8: @ 80760F8 - push {r4-r7,lr} - adds r6, r0, 0 - ldrh r0, [r6, 0x3A] - lsls r0, 24 - lsrs r7, r0, 24 - ldrh r0, [r6, 0x36] - adds r0, 0x1 - strh r0, [r6, 0x36] - lsls r0, 16 - asrs r1, r0, 16 - cmp r1, 0x28 - beq _08076196 - cmp r1, 0x5F - bne _08076130 - ldr r0, =gDoingBattleAnim - movs r1, 0 - strb r1, [r0] - bl m4aMPlayAllStop - ldr r0, =0x00000173 - bl PlaySE - b _08076196 - .pool -_08076130: - ldr r0, =0x0000013b - cmp r1, r0 - bne _08076196 - ldr r5, =gSprites - ldr r4, =gBankSpriteIds - movs r1, 0x3A - ldrsh r0, [r6, r1] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r0, [r0, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl FreeOamMatrix - movs r1, 0x3A - ldrsh r0, [r6, r1] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl DestroySprite - adds r0, r6, 0 - bl DestroySpriteAndFreeResources - ldr r0, =gMain - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08076196 - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r0, [r0, 0x4] - lsls r1, r7, 1 - adds r1, r7 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - strb r0, [r1] -_08076196: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80760F8 - - thumb_func_start sub_80761B4 -sub_80761B4: @ 80761B4 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x19 - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x3A] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x3A] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x18 - strh r0, [r4, 0x36] - ldr r0, =0x0000ffe2 - strh r0, [r4, 0x38] - ldrh r0, [r4, 0x3A] - strh r0, [r4, 0x6] - adds r0, r4, 0 - bl sub_80A68D4 - ldr r0, =sub_8076204 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80761B4 - - thumb_func_start sub_8076204 -sub_8076204: @ 8076204 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - ldrh r0, [r5, 0x3C] - movs r1, 0xFF - mov r8, r1 - lsrs r0, 8 - subs r0, 0x23 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2C - bhi _080762F8 - ldrh r1, [r5, 0x6] - movs r0, 0xFF - lsls r0, 8 - ands r0, r1 - cmp r0, 0 - bne _08076266 - ldrh r0, [r5, 0x30] - movs r1, 0x1 - adds r6, r1, 0 - ands r6, r0 - ldrh r0, [r5, 0x32] - adds r7, r1, 0 - ands r7, r0 - movs r2, 0x30 - ldrsh r0, [r5, r2] - movs r1, 0x3 - bl __divsi3 - movs r1, 0x2 - negs r1, r1 - adds r4, r1, 0 - ands r0, r4 - orrs r6, r0 - strh r6, [r5, 0x30] - movs r2, 0x32 - ldrsh r0, [r5, r2] - movs r1, 0x3 - bl __divsi3 - ands r0, r4 - orrs r7, r0 - strh r7, [r5, 0x32] - adds r0, r5, 0 - movs r1, 0x4 - bl StartSpriteAffineAnim -_08076266: - ldrh r4, [r5, 0x2E] - adds r0, r5, 0 - bl sub_80A6F3C - movs r1, 0x3A - ldrsh r0, [r5, r1] - movs r1, 0x3 - bl __divsi3 - adds r1, r0, 0 - ldrh r0, [r5, 0x3C] - adds r0, r1 - strh r0, [r5, 0x3C] - lsls r0, 16 - asrs r0, 24 - mov r2, r8 - ands r0, r2 - movs r2, 0x38 - ldrsh r1, [r5, r2] - bl Sin - ldrh r1, [r5, 0x26] - adds r0, r1 - strh r0, [r5, 0x26] - movs r2, 0x80 - lsls r2, 1 - adds r0, r2, 0 - ldrh r1, [r5, 0x6] - adds r0, r1 - strh r0, [r5, 0x6] - lsls r0, 16 - lsrs r0, 24 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - beq _080762B6 - strh r4, [r5, 0x2E] - b _080762BE -_080762B6: - lsls r0, r4, 16 - asrs r0, 16 - subs r0, 0x1 - strh r0, [r5, 0x2E] -_080762BE: - ldrh r0, [r5, 0x3C] - lsrs r0, 8 - cmp r0, 0x4F - ble _08076364 - ldrh r0, [r5, 0x30] - movs r1, 0x1 - adds r6, r1, 0 - ands r6, r0 - ldrh r0, [r5, 0x32] - adds r7, r1, 0 - ands r7, r0 - movs r2, 0x30 - ldrsh r1, [r5, r2] - lsls r0, r1, 1 - adds r0, r1 - movs r1, 0x2 - negs r1, r1 - adds r2, r1, 0 - ands r0, r2 - orrs r0, r6 - strh r0, [r5, 0x30] - movs r0, 0x32 - ldrsh r1, [r5, r0] - lsls r0, r1, 1 - adds r0, r1 - ands r0, r2 - orrs r0, r7 - strh r0, [r5, 0x32] - b _08076364 -_080762F8: - adds r0, r5, 0 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - beq _08076364 - ldrh r0, [r5, 0x24] - ldrh r1, [r5, 0x20] - adds r0, r1 - movs r1, 0 - strh r0, [r5, 0x20] - ldrh r0, [r5, 0x26] - ldrh r2, [r5, 0x22] - adds r0, r2 - strh r0, [r5, 0x22] - strh r1, [r5, 0x26] - strh r1, [r5, 0x24] - ldrb r0, [r5, 0x6] - strh r0, [r5, 0x3A] - strh r1, [r5, 0x2E] - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08076358 - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r1, [r0, 0x9] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08076358 - movs r0, 0x3A - ldrsh r4, [r5, r0] - movs r0, 0x2 - bl GetBankByPlayerAI - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bne _08076358 - ldr r0, =sub_8076374 - b _0807635A - .pool -_08076358: - ldr r0, =sub_8075D14 -_0807635A: - str r0, [r5, 0x1C] - adds r0, r5, 0 - movs r1, 0 - bl StartSpriteAffineAnim -_08076364: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8076204 - - thumb_func_start sub_8076374 -sub_8076374: @ 8076374 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x2E] - adds r1, r0, 0x1 - strh r1, [r2, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x18 - ble _0807638E - movs r0, 0 - strh r0, [r2, 0x2E] - ldr r0, =sub_8075D14 - str r0, [r2, 0x1C] -_0807638E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8076374 - - thumb_func_start sub_8076398 -sub_8076398: @ 8076398 - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xF - ble _080763EC - movs r0, 0 - strh r0, [r5, 0x2E] - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _080763E8 - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r1, [r0, 0x9] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080763E8 - movs r0, 0x3A - ldrsh r4, [r5, r0] - movs r0, 0x3 - bl GetBankByPlayerAI - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bne _080763E8 - ldr r0, =sub_8076374 - b _080763EA - .pool -_080763E8: - ldr r0, =sub_8075D14 -_080763EA: - str r0, [r5, 0x1C] -_080763EC: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8076398 - - thumb_func_start sub_80763F8 -sub_80763F8: @ 80763F8 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - movs r4, 0 - str r4, [sp] - bl sub_8171D98 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80763F8 - - thumb_func_start sub_8076420 -sub_8076420: @ 8076420 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - movs r3, 0 - bl sub_81729E8 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_8076420 - - thumb_func_start sub_8076438 -sub_8076438: @ 8076438 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - adds r5, r0, 0 - mov r9, r2 - mov r10, r3 - ldr r6, [sp, 0x28] - ldr r4, [sp, 0x2C] - ldr r0, [sp, 0x30] - ldr r2, [sp, 0x38] - lsls r5, 24 - lsrs r5, 24 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp] - mov r1, r9 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - lsls r3, 24 - lsrs r3, 24 - mov r10, r3 - lsls r6, 24 - lsrs r6, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - lsls r0, r2, 16 - lsrs r7, r0, 16 - ldr r0, =gUnknown_0832C400 - bl LoadCompressedObjectPicUsingHeap - ldr r0, =gUnknown_0832C460 - bl LoadCompressedObjectPaletteUsingHeap - ldr r0, =gUnknown_0832C588 - mov r1, r9 - mov r2, r10 - adds r3, r4, 0 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gSprites - mov r8, r1 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - adds r2, r4, r1 - strh r5, [r2, 0x2E] - lsls r1, r5, 4 - adds r1, r5 - lsls r1, 2 - add r1, r8 - ldrh r0, [r1, 0x20] - strh r0, [r2, 0x38] - ldrh r0, [r1, 0x22] - strh r0, [r2, 0x3A] - mov r3, r9 - strh r3, [r1, 0x20] - mov r0, r10 - strh r0, [r1, 0x22] - strh r7, [r1, 0x3C] - mov r3, sp - ldrh r3, [r3, 0x4] - strh r3, [r2, 0x30] - mov r0, sp - ldrh r0, [r0] - strh r0, [r2, 0x32] - mov r3, sp - ldrh r3, [r3, 0x34] - strh r3, [r2, 0x34] - ldr r3, [sp, 0x34] - lsrs r0, r3, 16 - strh r0, [r2, 0x36] - movs r0, 0x3 - ands r6, r0 - lsls r6, 2 - ldrb r3, [r2, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r3 - orrs r0, r6 - strb r0, [r2, 0x5] - movs r0, 0x1C - add r8, r0 - add r4, r8 - ldr r0, =sub_8076524 - str r0, [r4] - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [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_8076438 - - thumb_func_start sub_8076524 -sub_8076524: @ 8076524 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - ldrh r1, [r6, 0x30] - movs r2, 0x30 - ldrsh r0, [r6, r2] - cmp r0, 0 - bne _080765D0 - ldrh r0, [r6, 0x2E] - lsls r0, 24 - lsrs r7, r0, 24 - ldrh r0, [r6, 0x32] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldrh r4, [r6, 0x34] - ldrh r0, [r6, 0x36] - lsls r0, 16 - orrs r4, r0 - adds r0, r6, 0 - adds r0, 0x43 - ldrb r0, [r0] - cmp r0, 0 - beq _0807655E - subs r0, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - b _08076560 -_0807655E: - movs r5, 0 -_08076560: - adds r0, r6, 0 - movs r1, 0x1 - bl StartSpriteAnim - ldrh r0, [r6, 0x20] - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r6, 0x22] - subs r1, 0x5 - lsls r1, 24 - lsrs r1, 24 - ldrb r2, [r6, 0x5] - lsls r2, 28 - lsrs r2, 30 - adds r3, r5, 0 - bl sub_80763F8 - movs r0, 0x1 - mov r1, r8 - adds r2, r4, 0 - bl sub_8076420 - lsls r0, 24 - lsrs r0, 24 - movs r5, 0 - strh r0, [r6, 0x30] - ldr r0, =sub_80765E0 - str r0, [r6, 0x1C] - ldr r0, =gSprites - lsls r4, r7, 4 - adds r4, r7 - lsls r4, 2 - adds r4, r0 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r0, r4, 0 - movs r1, 0x1 - bl StartSpriteAffineAnim - adds r0, r4, 0 - bl AnimateSprite - movs r0, 0x80 - lsls r0, 5 - strh r0, [r4, 0x30] - strh r5, [r6, 0x3C] - b _080765D4 - .pool -_080765D0: - subs r0, r1, 0x1 - strh r0, [r6, 0x30] -_080765D4: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8076524 - - thumb_func_start sub_80765E0 -sub_80765E0: @ 80765E0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r4, r0, 0 - movs r0, 0 - mov r12, r0 - movs r7, 0 - ldrh r0, [r4, 0x2E] - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08076610 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] -_08076610: - ldr r1, =gSprites - lsls r2, r6, 4 - adds r0, r2, r6 - lsls r0, 2 - adds r5, r0, r1 - adds r0, r5, 0 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 26 - mov r8, r2 - cmp r0, 0 - bge _08076634 - adds r0, r5, 0 - movs r1, 0 - bl StartSpriteAffineAnim - movs r1, 0x1 - mov r12, r1 -_08076634: - movs r2, 0x38 - ldrsh r0, [r4, r2] - movs r3, 0x20 - ldrsh r1, [r4, r3] - subs r0, r1 - movs r1, 0x3C - ldrsh r2, [r4, r1] - muls r0, r2 - cmp r0, 0 - bge _0807664A - adds r0, 0x7F -_0807664A: - asrs r0, 7 - ldrh r3, [r4, 0x20] - adds r0, r3 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - movs r1, 0x3A - ldrsh r0, [r4, r1] - movs r3, 0x22 - ldrsh r1, [r4, r3] - subs r0, r1 - muls r0, r2 - cmp r0, 0 - bge _08076668 - adds r0, 0x7F -_08076668: - asrs r0, 7 - ldrh r1, [r4, 0x22] - adds r0, r1 - mov r2, r9 - strh r2, [r5, 0x20] - strh r0, [r5, 0x22] - ldrh r2, [r4, 0x3C] - movs r3, 0x3C - ldrsh r0, [r4, r3] - cmp r0, 0x7F - bgt _080766AC - ldr r1, =gSineTable - lsls r0, r2, 24 - lsrs r0, 23 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bge _08076690 - adds r0, 0x7 -_08076690: - asrs r0, 3 - negs r0, r0 - lsls r0, 16 - lsrs r0, 16 - adds r1, r2, 0x4 - strh r1, [r4, 0x3C] - strh r0, [r5, 0x24] - strh r0, [r5, 0x26] - b _080766BA - .pool -_080766AC: - ldrh r0, [r4, 0x38] - strh r0, [r5, 0x20] - ldrh r0, [r4, 0x3A] - strh r0, [r5, 0x22] - strh r7, [r5, 0x24] - strh r7, [r5, 0x26] - movs r7, 0x1 -_080766BA: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0807670E - mov r2, r12 - cmp r2, 0 - beq _0807670E - cmp r7, 0 - beq _0807670E - ldr r1, =gSprites - mov r3, r8 - adds r0, r3, r6 - lsls r0, 2 - adds r2, r0, r1 - movs r0, 0x3C - ldrsh r1, [r2, r0] - movs r0, 0xCE - lsls r0, 1 - cmp r1, r0 - bne _080766FC - ldrh r1, [r2, 0x3C] - adds r0, r2, 0 - movs r2, 0x1 - movs r3, 0 - bl DoMonFrontSpriteAnimation - b _08076708 - .pool -_080766FC: - ldrh r1, [r2, 0x3C] - adds r0, r2, 0 - movs r2, 0 - movs r3, 0 - bl DoMonFrontSpriteAnimation -_08076708: - adds r0, r4, 0 - bl DestroySpriteAndFreeResources -_0807670E: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80765E0 - - thumb_func_start sub_807671C -sub_807671C: @ 807671C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r10, r0 - adds r6, r2, 0 - mov r8, r3 - ldr r5, [sp, 0x20] - ldr r4, [sp, 0x24] - ldr r0, [sp, 0x28] - mov r9, r0 - mov r0, r10 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r6, 24 - lsrs r6, 24 - mov r1, r8 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - lsls r5, 24 - lsrs r5, 24 - lsls r4, 24 - lsrs r4, 24 - mov r0, r9 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldr r0, =gUnknown_0832C400 - bl LoadCompressedObjectPicUsingHeap - ldr r0, =gUnknown_0832C460 - bl LoadCompressedObjectPaletteUsingHeap - ldr r0, =gUnknown_0832C588 - adds r1, r6, 0 - mov r2, r8 - adds r3, r4, 0 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - ldr r6, =gSprites - lsls r3, r0, 4 - adds r3, r0 - lsls r3, 2 - adds r2, r3, r6 - mov r1, r10 - strh r1, [r2, 0x2E] - mov r4, r9 - strh r4, [r2, 0x30] - strh r7, [r2, 0x32] - mov r1, sp - ldrh r1, [r1, 0x2C] - strh r1, [r2, 0x34] - ldr r4, [sp, 0x2C] - lsrs r1, r4, 16 - strh r1, [r2, 0x36] - movs r1, 0x3 - ands r5, r1 - lsls r5, 2 - ldrb r4, [r2, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r4 - orrs r1, r5 - strb r1, [r2, 0x5] - adds r6, 0x1C - adds r3, r6 - ldr r1, =sub_80767D4 - str r1, [r3] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_807671C - - thumb_func_start sub_80767D4 -sub_80767D4: @ 80767D4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r0, 0 - ldrh r1, [r4, 0x30] - movs r2, 0x30 - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _0807686C - ldrh r0, [r4, 0x2E] - lsls r0, 24 - lsrs r7, r0, 24 - ldrh r0, [r4, 0x32] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldrh r5, [r4, 0x34] - ldrh r0, [r4, 0x36] - lsls r0, 16 - orrs r5, r0 - adds r0, r4, 0 - adds r0, 0x43 - ldrb r0, [r0] - cmp r0, 0 - beq _0807680E - subs r0, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - b _08076810 -_0807680E: - movs r6, 0 -_08076810: - adds r0, r4, 0 - movs r1, 0x1 - bl StartSpriteAnim - ldrh r0, [r4, 0x20] - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x22] - subs r1, 0x5 - lsls r1, 24 - lsrs r1, 24 - ldrb r2, [r4, 0x5] - lsls r2, 28 - lsrs r2, 30 - adds r3, r6, 0 - bl sub_80763F8 - movs r0, 0x1 - mov r1, r8 - adds r2, r5, 0 - bl sub_8076420 - lsls r0, 24 - lsrs r0, 24 - movs r5, 0 - strh r0, [r4, 0x30] - ldr r0, =sub_807687C - str r0, [r4, 0x1C] - lsls r4, r7, 4 - adds r4, r7 - lsls r4, 2 - ldr r0, =gSprites - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x2 - bl StartSpriteAffineAnim - adds r0, r4, 0 - bl AnimateSprite - strh r5, [r4, 0x30] - b _08076870 - .pool -_0807686C: - subs r0, r1, 0x1 - strh r0, [r4, 0x30] -_08076870: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80767D4 - - thumb_func_start sub_807687C -sub_807687C: @ 807687C - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r0, [r5, 0x38] - adds r0, 0x1 - strh r0, [r5, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xB - bne _08076894 - movs r0, 0x3C - bl PlaySE -_08076894: - ldrh r1, [r5, 0x2E] - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gSprites - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, r0, r2 - adds r0, r4, 0 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 26 - cmp r0, 0 - bge _080768D8 - adds r0, r5, 0 - movs r1, 0x2 - bl StartSpriteAnim - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - movs r0, 0 - strh r0, [r5, 0x38] - ldr r0, =sub_80768F0 - str r0, [r5, 0x1C] - b _080768E8 - .pool -_080768D8: - ldrh r0, [r4, 0x30] - adds r0, 0x60 - strh r0, [r4, 0x30] - movs r1, 0x30 - ldrsh r0, [r4, r1] - negs r0, r0 - asrs r0, 8 - strh r0, [r4, 0x26] -_080768E8: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_807687C - - thumb_func_start sub_80768F0 -sub_80768F0: @ 80768F0 - push {lr} - adds r2, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08076904 - ldr r0, =SpriteCallbackDummy - str r0, [r2, 0x1C] -_08076904: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80768F0 - - thumb_func_start obj_delete_and_free_associated_resources_ -obj_delete_and_free_associated_resources_: @ 807690C - push {lr} - bl DestroySpriteAndFreeResources - pop {r0} - bx r0 - thumb_func_end obj_delete_and_free_associated_resources_ - - thumb_func_start sub_8076918 -sub_8076918: @ 8076918 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r0, =gHealthBoxesIds - adds r0, r5, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r6, =gSprites - adds r4, r0, r6 - movs r1, 0 - movs r0, 0x5 - strh r0, [r4, 0x2E] - strh r1, [r4, 0x30] - movs r0, 0x73 - strh r0, [r4, 0x24] - strh r1, [r4, 0x26] - ldr r0, =sub_80769CC - str r0, [r4, 0x1C] - adds r0, r5, 0 - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - beq _08076966 - ldrh r0, [r4, 0x2E] - negs r0, r0 - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x30] - negs r0, r0 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x24] - negs r0, r0 - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x26] - negs r0, r0 - strh r0, [r4, 0x26] -_08076966: - movs r0, 0x38 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r6, 0 - adds r1, 0x1C - adds r1, r0, r1 - adds r0, r6 - ldr r1, [r1] - bl _call_via_r1 - adds r0, r5, 0 - bl GetBankIdentity - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08076990 - ldr r0, =sub_80769A8 - str r0, [r4, 0x1C] -_08076990: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8076918 - - thumb_func_start sub_80769A8 -sub_80769A8: @ 80769A8 - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x30] - adds r0, 0x1 - strh r0, [r1, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - bne _080769C2 - movs r0, 0 - strh r0, [r1, 0x30] - ldr r0, =sub_80769CC - str r0, [r1, 0x1C] -_080769C2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80769A8 - - thumb_func_start sub_80769CC -sub_80769CC: @ 80769CC - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x24] - ldrh r1, [r2, 0x2E] - subs r0, r1 - strh r0, [r2, 0x24] - ldrh r0, [r2, 0x26] - ldrh r1, [r2, 0x30] - subs r0, r1 - strh r0, [r2, 0x26] - ldr r0, [r2, 0x24] - cmp r0, 0 - bne _080769EA - ldr r0, =SpriteCallbackDummy - str r0, [r2, 0x1C] -_080769EA: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80769CC - - thumb_func_start sub_80769F4 -sub_80769F4: @ 80769F4 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =oamc_804BEB4 - adds r0, r5, 0 - bl CreateInvisibleSpriteWithCallback - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gSprites - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r3, r1, r2 - movs r0, 0x1 - strh r0, [r3, 0x2E] - ldr r0, =gHealthBoxesIds - adds r4, r0 - ldrb r0, [r4] - strh r0, [r3, 0x30] - adds r2, 0x1C - adds r1, r2 - str r5, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80769F4 - - thumb_func_start oamc_804BEB4 -oamc_804BEB4: @ 8076A38 - push {lr} - adds r3, r0, 0 - ldrh r1, [r3, 0x30] - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gSprites - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r2 - ldrh r0, [r3, 0x2E] - movs r2, 0 - strh r0, [r1, 0x26] - ldrh r0, [r3, 0x2E] - negs r0, r0 - strh r0, [r3, 0x2E] - ldrh r0, [r3, 0x32] - adds r0, 0x1 - strh r0, [r3, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x15 - bne _08076A70 - strh r2, [r1, 0x24] - strh r2, [r1, 0x26] - adds r0, r3, 0 - bl DestroySprite -_08076A70: - pop {r0} - bx r0 - .pool - thumb_func_end oamc_804BEB4 - - thumb_func_start sub_8076A78 -sub_8076A78: @ 8076A78 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gUnknown_0832C400 - lsls r6, r4, 3 - adds r5, r6, r0 - ldrh r0, [r5, 0x6] - bl GetSpriteTileStartByTag - lsls r0, 16 - ldr r1, =0xffff0000 - cmp r0, r1 - bne _08076AA0 - adds r0, r5, 0 - bl LoadCompressedObjectPicUsingHeap - ldr r0, =gUnknown_0832C460 - adds r0, r6, r0 - bl LoadCompressedObjectPaletteUsingHeap -_08076AA0: - cmp r4, 0x6 - beq _08076ACC - cmp r4, 0x6 - blt _08076AB0 - cmp r4, 0xB - bgt _08076AB0 - cmp r4, 0xA - bge _08076ACC -_08076AB0: - ldr r1, =gUnknown_0832C400 - lsls r0, r4, 3 - adds r0, r1 - ldrh r0, [r0, 0x6] - bl GetSpriteTileStartByTag - adds r1, r0, 0 - lsls r1, 16 - ldr r0, =gUnknown_08C02300 - lsrs r1, 11 - ldr r2, =0x06010100 - adds r1, r2 - bl LZDecompressVram -_08076ACC: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8076A78 - - thumb_func_start sub_8076AE8 -sub_8076AE8: @ 8076AE8 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - ldr r0, =gUnknown_0832C400 - lsrs r4, 21 - adds r0, r4, r0 - ldrh r0, [r0, 0x6] - bl FreeSpriteTilesByTag - ldr r0, =gUnknown_0832C460 - adds r4, r0 - ldrh r0, [r4, 0x4] - bl FreeSpritePaletteByTag - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8076AE8 - - thumb_func_start sub_8076B14 -sub_8076B14: @ 8076B14 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - beq _08076B40 - ldr r1, =gBattlePartyID - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gEnemyParty - b _08076B4E - .pool -_08076B40: - ldr r1, =gBattlePartyID - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty -_08076B4E: - adds r0, r1 - movs r1, 0x26 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8076B14 - .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_817C95C.s b/asm/battle_link_817C95C.s similarity index 100% rename from asm/rom_817C95C.s rename to asm/battle_link_817C95C.s diff --git a/asm/battle_records.s b/asm/battle_records.s index e386b14c7..2c7b1d830 100644 --- a/asm/battle_records.s +++ b/asm/battle_records.s @@ -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. diff --git a/asm/battle_tent.s b/asm/battle_tent.s new file mode 100755 index 000000000..5cb92dbed --- /dev/null +++ b/asm/battle_tent.s @@ -0,0 +1,1028 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_81B99B4 +sub_81B99B4: @ 81B99B4 + push {lr} + ldr r1, =gUnknown_086160B4 + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B99B4 + + thumb_func_start sub_81B99D4 +sub_81B99D4: @ 81B99D4 + push {lr} + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + movs r2, 0 + strb r2, [r0] + ldr r1, [r1] + ldr r3, =0x00000cb2 + adds r0, r1, r3 + strh r2, [r0] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0x4 + ldrsb r1, [r0, r1] + movs r2, 0x5 + ldrsb r2, [r0, r2] + movs r3, 0x1 + negs r3, r3 + movs r0, 0 + bl saved_warp2_set + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B99D4 + + thumb_func_start sub_81B9A28 +sub_81B9A28: @ 81B9A28 + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000e6a + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_81B9A28 + + thumb_func_start sub_81B9A44 +sub_81B9A44: @ 81B9A44 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =gSpecialVar_0x8006 + ldrh r1, [r1] + ldr r2, =0x00000e6a + adds r0, r2 + strh r1, [r0] + bx lr + .pool + thumb_func_end sub_81B9A44 + + thumb_func_start sub_81B9A60 +sub_81B9A60: @ 81B9A60 + push {r4,lr} + ldr r4, =gTrainerBattleOpponent_A + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xFF + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + lsls r1, r0, 2 + adds r1, r0 + lsrs r1, 6 + strh r1, [r4] + ldrh r0, [r4] + movs r1, 0 + bl sub_8162614 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9A60 + + thumb_func_start sub_81B9A90 +sub_81B9A90: @ 81B9A90 + push {lr} + ldr r3, =gTrainerBattleOpponent_A + ldrh r1, [r3] + ldr r0, =0x0000012b + cmp r1, r0 + bhi _081B9AAC + ldr r2, =gUnknown_0203BC88 + movs r0, 0x34 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0xC + bl ConvertBattleFrontierTrainerSpeechToString +_081B9AAC: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9A90 + + thumb_func_start sub_81B9ABC +sub_81B9ABC: @ 81B9ABC + push {r4,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl VarSet + ldr r1, [r4] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl sub_81A4C30 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9ABC + + thumb_func_start sub_81B9B00 +sub_81B9B00: @ 81B9B00 + push {r4,r5,lr} + ldr r0, =gSaveBlock2Ptr + ldr r4, [r0] + ldr r5, =gUnknown_086160D4 + bl Random + ldrh r0, [r5] + ldr r1, =0x00000e6a + adds r4, r1 + strh r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9B00 + + thumb_func_start sub_81B9B28 +sub_81B9B28: @ 81B9B28 + push {r4,r5,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000e6a + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x1 + bl AddBagItem + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bne _081B9B70 + ldr r0, [r4] + ldr r1, =0x00000e6a + adds r0, r1 + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r0, [r4] + ldr r1, =0x00000e6a + adds r0, r1 + movs r1, 0 + strh r1, [r0] + ldr r0, =gScriptResult + strh r5, [r0] + b _081B9B76 + .pool +_081B9B70: + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] +_081B9B76: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9B28 + + thumb_func_start sub_81B9B80 +sub_81B9B80: @ 81B9B80 + push {lr} + ldr r1, =gUnknown_086160D8 + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9B80 + + thumb_func_start sub_81B9BA0 +sub_81B9BA0: @ 81B9BA0 + push {lr} + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + movs r2, 0 + strb r2, [r0] + ldr r1, [r1] + ldr r3, =0x00000cb2 + adds r0, r1, r3 + strh r2, [r0] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0x4 + ldrsb r1, [r0, r1] + movs r2, 0x5 + ldrsb r2, [r0, r2] + movs r3, 0x1 + negs r3, r3 + movs r0, 0 + bl saved_warp2_set + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9BA0 + + thumb_func_start sub_81B9BF4 +sub_81B9BF4: @ 81B9BF4 + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000e6c + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_81B9BF4 + + thumb_func_start sub_81B9C10 +sub_81B9C10: @ 81B9C10 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =gSpecialVar_0x8006 + ldrh r1, [r1] + ldr r2, =0x00000e6c + adds r0, r2 + strh r1, [r0] + bx lr + .pool + thumb_func_end sub_81B9C10 + + thumb_func_start sub_81B9C2C +sub_81B9C2C: @ 81B9C2C + push {r4,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl VarSet + ldr r1, [r4] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl sub_81A4C30 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9C2C + + thumb_func_start sub_81B9C70 +sub_81B9C70: @ 81B9C70 + push {r4,r5,lr} + ldr r0, =gSaveBlock2Ptr + ldr r4, [r0] + ldr r5, =gUnknown_086160F4 + bl Random + ldrh r0, [r5] + ldr r1, =0x00000e6c + adds r4, r1 + strh r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9C70 + + thumb_func_start sub_81B9C98 +sub_81B9C98: @ 81B9C98 + push {r4,r5,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000e6c + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x1 + bl AddBagItem + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bne _081B9CE0 + ldr r0, [r4] + ldr r1, =0x00000e6c + adds r0, r1 + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r0, [r4] + ldr r1, =0x00000e6c + adds r0, r1 + movs r1, 0 + strh r1, [r0] + ldr r0, =gScriptResult + strh r5, [r0] + b _081B9CE6 + .pool +_081B9CE0: + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] +_081B9CE6: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9C98 + + thumb_func_start sub_81B9CF0 +sub_81B9CF0: @ 81B9CF0 + push {lr} + ldr r0, =gStringVar1 + ldr r1, =gTrainerBattleOpponent_A + ldrh r1, [r1] + bl GetFrontierTrainerName + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9CF0 + + thumb_func_start sub_81B9D08 +sub_81B9D08: @ 81B9D08 + push {lr} + ldr r1, =gUnknown_086160F8 + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9D08 + + thumb_func_start sub_81B9D28 +sub_81B9D28: @ 81B9D28 + push {lr} + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + movs r2, 0 + strb r2, [r0] + ldr r1, [r1] + ldr r3, =0x00000cb2 + adds r0, r1, r3 + strh r2, [r0] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0x4 + ldrsb r1, [r0, r1] + movs r2, 0x5 + ldrsb r2, [r0, r2] + movs r3, 0x1 + negs r3, r3 + movs r0, 0 + bl saved_warp2_set + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9D28 + + thumb_func_start sub_81B9D7C +sub_81B9D7C: @ 81B9D7C + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000e6e + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_81B9D7C + + thumb_func_start sub_81B9D98 +sub_81B9D98: @ 81B9D98 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =gSpecialVar_0x8006 + ldrh r1, [r1] + ldr r2, =0x00000e6e + adds r0, r2 + strh r1, [r0] + bx lr + .pool + thumb_func_end sub_81B9D98 + + thumb_func_start sub_81B9DB4 +sub_81B9DB4: @ 81B9DB4 + push {r4,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl VarSet + ldr r1, [r4] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl sub_81A4C30 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9DB4 + + thumb_func_start sub_81B9DF8 +sub_81B9DF8: @ 81B9DF8 + push {r4,r5,lr} + ldr r0, =gSaveBlock2Ptr + ldr r4, [r0] + ldr r5, =gUnknown_08616120 + bl Random + ldrh r0, [r5] + ldr r1, =0x00000e6e + adds r4, r1 + strh r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9DF8 + + thumb_func_start sub_81B9E20 +sub_81B9E20: @ 81B9E20 + push {r4,r5,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000e6e + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x1 + bl AddBagItem + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bne _081B9E68 + ldr r0, [r4] + ldr r1, =0x00000e6e + adds r0, r1 + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r0, [r4] + ldr r1, =0x00000e6e + adds r0, r1 + movs r1, 0 + strh r1, [r0] + ldr r0, =gScriptResult + strh r5, [r0] + b _081B9E6E + .pool +_081B9E68: + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] +_081B9E6E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9E20 + + thumb_func_start sub_81B9E78 +sub_81B9E78: @ 81B9E78 + push {lr} + bl ZeroPlayerPartyMons + bl sub_819A4F8 + pop {r0} + bx r0 + thumb_func_end sub_81B9E78 + + thumb_func_start sub_81B9E88 +sub_81B9E88: @ 81B9E88 + push {lr} + bl sub_819DC00 + pop {r0} + bx r0 + thumb_func_end sub_81B9E88 + + thumb_func_start sub_81B9E94 +sub_81B9E94: @ 81B9E94 + push {lr} + movs r2, 0 + ldr r1, =gMapHeader + ldrb r0, [r1, 0x14] + cmp r0, 0x8 + bne _081B9EB2 + ldr r3, =0xfffffe7f + adds r0, r3, 0 + ldrh r1, [r1, 0x12] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _081B9EB2 + movs r2, 0x1 +_081B9EB2: + adds r0, r2, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B9E94 + + thumb_func_start sub_81B9EC0 +sub_81B9EC0: @ 81B9EC0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x3C + ldr r1, =gUnknown_0203BC88 + ldr r0, =gSlateportBattleTentTrainers + str r0, [r1] + add r0, sp, 0xC + mov r9, r0 + mov r1, sp + adds r1, 0x18 + str r1, [sp, 0x2C] + ldr r5, =gUnknown_0203BC8C + ldr r4, =gSlateportBattleTentMons + movs r2, 0 + adds r3, r1, 0 + mov r1, r9 + mov r0, sp + movs r6, 0x5 + mov r8, r6 +_081B9EEC: + strh r2, [r0] + strh r2, [r1] + strh r2, [r3] + adds r3, 0x2 + adds r1, 0x2 + adds r0, 0x2 + movs r7, 0x1 + negs r7, r7 + add r8, r7 + mov r6, r8 + cmp r6, 0 + bge _081B9EEC + str r4, [r5] + movs r7, 0 + mov r10, r7 + movs r0, 0 + mov r8, r0 + ldr r1, [sp, 0x2C] + str r1, [sp, 0x30] + mov r2, sp + str r2, [sp, 0x34] + lsls r6, r0, 1 + str r6, [sp, 0x24] + add r6, r9 + str r6, [sp, 0x28] +_081B9F1E: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x46 + bl __umodsi3 + lsls r0, 16 + lsrs r5, r0, 16 + movs r2, 0 + mov r7, r8 + adds r6, r2, r7 + cmp r2, r6 + bge _081B9F7C + ldr r1, [sp, 0x28] + ldrh r0, [r1] + cmp r0, r5 + beq _081B9F7C + ldr r0, =gUnknown_0203BC8C + ldr r1, [r0] + lsls r0, r5, 4 + adds r4, r0, r1 + ldrh r7, [r4] + mov r12, r7 + lsls r3, r2, 1 + ldr r1, [sp, 0x24] + add r1, sp + str r6, [sp, 0x38] +_081B9F56: + ldrh r0, [r1] + cmp r0, r12 + bne _081B9F66 + mov r0, r10 + cmp r0, 0 + bne _081B9F7C + ldrh r7, [r4] + mov r10, r7 +_081B9F66: + adds r3, 0x2 + adds r1, 0x2 + adds r2, 0x1 + ldr r0, [sp, 0x38] + cmp r2, r0 + bge _081B9F7C + mov r7, r9 + adds r0, r7, r3 + ldrh r0, [r0] + cmp r0, r5 + bne _081B9F56 +_081B9F7C: + cmp r2, r6 + bne _081BA01C + movs r2, 0 + cmp r2, r6 + bge _081B9FD4 + ldr r0, =gBattleFrontierHeldItems + mov r12, r0 + ldr r7, =gUnknown_0203BC8C + ldr r1, [sp, 0x24] + ldr r0, [sp, 0x2C] + adds r4, r1, r0 +_081B9F92: + ldrh r3, [r4] + cmp r3, 0 + beq _081B9FCC + ldr r1, [r7] + lsls r0, r5, 4 + adds r1, r0, r1 + ldrb r0, [r1, 0xA] + lsls r0, 1 + add r0, r12 + ldrh r0, [r0] + cmp r3, r0 + bne _081B9FCC + ldrh r0, [r1] + cmp r0, r10 + bne _081B9FD4 + movs r1, 0 + mov r10, r1 + b _081B9FD4 + .pool +_081B9FCC: + adds r4, 0x2 + adds r2, 0x1 + cmp r2, r6 + blt _081B9F92 +_081B9FD4: + cmp r2, r6 + bne _081BA01C + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + mov r2, r8 + lsls r3, r2, 1 + adds r0, r3, r2 + lsls r0, 2 + adds r1, r0 + movs r6, 0xE7 + lsls r6, 4 + adds r1, r6 + strh r5, [r1] + ldr r0, =gUnknown_0203BC8C + ldr r0, [r0] + lsls r1, r5, 4 + adds r1, r0 + ldrh r0, [r1] + ldr r7, [sp, 0x34] + strh r0, [r7] + ldr r2, =gBattleFrontierHeldItems + ldrb r0, [r1, 0xA] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + ldr r1, [sp, 0x30] + strh r0, [r1] + add r3, r9 + strh r5, [r3] + adds r1, 0x2 + str r1, [sp, 0x30] + adds r2, r7, 0 + adds r2, 0x2 + str r2, [sp, 0x34] + movs r6, 0x1 + add r8, r6 +_081BA01C: + mov r7, r8 + cmp r7, 0x6 + beq _081BA024 + b _081B9F1E +_081BA024: + add sp, 0x3C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9EC0 + + thumb_func_start sub_81BA040 +sub_81BA040: @ 81BA040 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + movs r0, 0 + mov r10, r0 + ldr r1, =gUnknown_0203BC88 + ldr r0, =gSlateportBattleTentTrainers + str r0, [r1] + ldr r1, =gUnknown_0203BC8C + ldr r0, =gSlateportBattleTentMons + str r0, [r1] + ldr r7, =gSaveBlock2Ptr + ldr r1, =0x0000ffff + mov r8, r1 +_081BA062: + mov r2, r10 + lsls r6, r2, 1 +_081BA066: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1E + bl __umodsi3 + lsls r0, 16 + lsrs r3, r0, 16 + movs r5, 0 + ldr r1, [r7] + ldr r4, =0x00000cb2 + adds r0, r1, r4 + ldrh r0, [r0] + cmp r5, r0 + bge _081BA0AA + ldr r2, =0x00000cb4 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r0, r3 + beq _081BA0AA + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + adds r0, r1, r4 + ldrh r2, [r0] + adds r4, 0x2 + adds r1, r4 +_081BA09C: + adds r1, 0x2 + adds r5, 0x1 + cmp r5, r2 + bge _081BA0AA + ldrh r0, [r1] + cmp r0, r3 + bne _081BA09C +_081BA0AA: + ldr r0, [r7] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r0, [r0] + cmp r5, r0 + bne _081BA066 + ldr r2, =gTrainerBattleOpponent_A + strh r3, [r2] + ldrh r3, [r2] + ldr r4, =gUnknown_0203BC88 + ldr r1, [r4] + movs r0, 0x34 + muls r0, r3 + adds r0, r1 + ldr r0, [r0, 0x30] + adds r1, r6, r0 + ldrh r0, [r1] + cmp r0, r8 + beq _081BA0DE + ldr r3, =0x0000ffff +_081BA0D2: + adds r1, 0x2 + movs r6, 0x1 + add r10, r6 + ldrh r0, [r1] + cmp r0, r3 + bne _081BA0D2 +_081BA0DE: + mov r0, r10 + cmp r0, 0x8 + bgt _081BA110 + movs r1, 0 + mov r10, r1 + b _081BA062 + .pool +_081BA110: + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r6, =0x00000cb2 + adds r3, r1, r6 + ldrh r0, [r3] + cmp r0, 0x1 + bhi _081BA12A + lsls r0, 1 + ldr r3, =0x00000cb4 + adds r1, r3 + adds r1, r0 + ldrh r0, [r2] + strh r0, [r1] +_081BA12A: + ldrh r1, [r2] + ldr r2, [r4] + movs r0, 0x34 + muls r0, r1 + adds r0, r2 + ldr r0, [r0, 0x30] + mov r9, r0 + movs r5, 0 + ldr r7, =gUnknown_03001298 + mov r8, sp +_081BA13E: + bl Random + lsls r0, 16 + lsrs r0, 16 + mov r1, r10 + bl __modsi3 + lsls r0, 1 + add r0, r9 + ldrh r0, [r0] + strh r0, [r7] + movs r2, 0 + ldrh r0, [r7] + ldr r4, =gUnknown_0203BC8C + ldr r3, [r4] + lsls r0, 4 + adds r0, r3 + ldr r1, =gSaveBlock2Ptr + ldrh r6, [r0] + ldr r1, [r1] +_081BA166: + movs r4, 0xE7 + lsls r4, 4 + adds r0, r1, r4 + ldrh r0, [r0] + lsls r0, 4 + adds r0, r3 + ldrh r0, [r0] + cmp r6, r0 + beq _081BA180 + adds r1, 0xC + adds r2, 0x1 + cmp r2, 0x5 + ble _081BA166 +_081BA180: + cmp r2, 0x6 + bne _081BA220 + movs r4, 0 + cmp r4, r5 + bge _081BA1B0 + mov r0, sp + ldrh r0, [r0] + cmp r0, r6 + beq _081BA1B0 + ldr r6, =gUnknown_03001298 + ldr r3, =gUnknown_0203BC8C + mov r2, sp +_081BA198: + adds r2, 0x2 + adds r4, 0x1 + cmp r4, r5 + bge _081BA1B0 + ldrh r0, [r6] + ldr r1, [r3] + lsls r0, 4 + adds r0, r1 + ldrh r1, [r2] + ldrh r0, [r0] + cmp r1, r0 + bne _081BA198 +_081BA1B0: + cmp r4, r5 + bne _081BA220 + movs r4, 0 + cmp r4, r5 + bge _081BA1E6 + ldr r6, =gBattleFrontierHeldItems + mov r12, r6 + add r3, sp, 0x8 +_081BA1C0: + ldrh r2, [r3] + cmp r2, 0 + beq _081BA1DE + ldr r1, =gUnknown_03001298 + ldrh r0, [r1] + ldr r6, =gUnknown_0203BC8C + ldr r1, [r6] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0xA] + lsls r0, 1 + add r0, r12 + ldrh r0, [r0] + cmp r2, r0 + beq _081BA1E6 +_081BA1DE: + adds r3, 0x2 + adds r4, 0x1 + cmp r4, r5 + blt _081BA1C0 +_081BA1E6: + cmp r4, r5 + bne _081BA220 + lsls r2, r5, 1 + ldrh r0, [r7] + ldr r1, =gUnknown_0203BC8C + ldr r4, [r1] + lsls r0, 4 + adds r0, r4 + ldrh r0, [r0] + mov r3, r8 + strh r0, [r3] + add r1, sp, 0x8 + adds r1, r2 + ldr r3, =gBattleFrontierHeldItems + ldrh r0, [r7] + lsls r0, 4 + adds r0, r4 + ldrb r0, [r0, 0xA] + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + strh r0, [r1] + ldr r0, =gUnknown_03006298 + adds r2, r0 + ldrh r0, [r7] + strh r0, [r2] + movs r4, 0x2 + add r8, r4 + adds r5, 0x1 +_081BA220: + cmp r5, 0x3 + bne _081BA13E + 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_81BA040 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_8161F74.s b/asm/battle_tower.s old mode 100644 new mode 100755 similarity index 67% rename from asm/rom_8161F74.s rename to asm/battle_tower.s index 75bfc07bb..0782b8609 --- a/asm/rom_8161F74.s +++ b/asm/battle_tower.s @@ -4,7 +4,7 @@ .syntax unified .text - + thumb_func_start sub_8161F74 sub_8161F74: @ 8161F74 push {lr} @@ -7802,3767 +7802,4 @@ _081661E8: .pool thumb_func_end sub_8166188 - thumb_func_start sub_8166204 -sub_8166204: @ 8166204 - push {r4-r6,lr} - adds r5, r0, 0 - adds r6, r1, 0 - ldr r4, =gUnknown_0203BCAC - ldr r0, =0x0000806c - bl AllocZeroed - str r0, [r4] - ldr r1, =gUnknown_0203BC90 - ldr r2, =0x00007fd0 - adds r0, r2 - str r0, [r1] - str r5, [r0, 0x8] - str r6, [r0, 0x4] - ldr r0, =sub_8166380 - bl launch_c3_walk_stairs_and_run_once - ldr r0, =sub_816631C - bl SetMainCallback2 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8166204 - - thumb_func_start sub_816624C -sub_816624C: @ 816624C - push {r4,r5,lr} - ldr r4, =gUnknown_0203BCAC - ldr r0, =0x0000806c - bl AllocZeroed - str r0, [r4] - ldr r5, =gUnknown_0203BC90 - ldr r1, =0x00007fd0 - adds r0, r1 - str r0, [r5] - ldr r1, =gUnknown_0203BC98 - ldr r1, [r1] - str r1, [r0, 0x8] - ldr r1, =gUnknown_0203BC94 - ldr r1, [r1] - str r1, [r0, 0x4] - ldr r4, =gUnknown_0203BC9C - ldrb r0, [r4] - bl sub_81672E4 - strb r0, [r4] - ldr r5, [r5] - movs r1, 0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bls _08166284 - movs r1, 0x1 -_08166284: - adds r0, r5, 0 - adds r0, 0x56 - strb r1, [r0] - ldr r0, =sub_8166380 - bl launch_c3_walk_stairs_and_run_once - ldr r0, =sub_81662C0 - bl SetMainCallback2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816624C - - thumb_func_start sub_81662C0 -sub_81662C0: @ 81662C0 - push {r4,lr} - ldr r4, =gUnknown_0203BC90 - ldr r0, [r4] - ldr r0, [r0] - bl _call_via_r0 - bl AnimateSprites - bl BuildOamBuffer - bl UpdatePaletteFade - ldr r4, [r4] - ldr r1, [r4] - ldr r0, =map_warp_consider_1_to_outside_or_stair_or_dive - cmp r1, r0 - bne _081662F0 - adds r0, r4, 0 - adds r0, 0x50 - movs r1, 0 - strb r1, [r0] - ldr r0, =sub_8166304 - bl SetMainCallback2 -_081662F0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81662C0 - - thumb_func_start sub_8166304 -sub_8166304: @ 8166304 - push {lr} - bl sub_81668F8 - bl AnimateSprites - bl BuildOamBuffer - bl UpdatePaletteFade - pop {r0} - bx r0 - thumb_func_end sub_8166304 - - thumb_func_start sub_816631C -sub_816631C: @ 816631C - push {lr} - ldr r0, =gUnknown_0203BC90 - ldr r0, [r0] - ldr r0, [r0] - bl _call_via_r0 - bl AnimateSprites - bl BuildOamBuffer - bl RunTextPrinters - bl UpdatePaletteFade - pop {r0} - bx r0 - .pool - thumb_func_end sub_816631C - - thumb_func_start sub_8166340 -sub_8166340: @ 8166340 - push {lr} - bl LoadOam - bl ProcessSpriteCopyRequests - bl TransferPlttBuffer - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r1, =0x00007c58 - adds r0, r1 - bl sub_81D2108 - bl sub_80BA0A8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8166340 - - thumb_func_start launch_c3_walk_stairs_and_run_once -launch_c3_walk_stairs_and_run_once: @ 816636C - ldr r1, =gUnknown_0203BC90 - ldr r1, [r1] - str r0, [r1] - adds r1, 0x50 - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end launch_c3_walk_stairs_and_run_once - - thumb_func_start sub_8166380 -sub_8166380: @ 8166380 - push {r4,r5,lr} - sub sp, 0x4 - ldr r1, =gUnknown_0203BC90 - ldr r0, [r1] - adds r0, 0x50 - ldrb r0, [r0] - adds r2, r1, 0 - cmp r0, 0xF - bls _08166394 - b _08166556 -_08166394: - lsls r0, 2 - ldr r1, =_081663A8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081663A8: - .4byte _081663E8 - .4byte _0816640C - .4byte _08166416 - .4byte _08166434 - .4byte _08166464 - .4byte _08166468 - .4byte _08166474 - .4byte _08166484 - .4byte _08166490 - .4byte _0816649C - .4byte _081664B8 - .4byte _081664BC - .4byte _081664E4 - .4byte _08166510 - .4byte _08166528 - .4byte _08166550 -_081663E8: - ldr r2, =gUnknown_0203BCAC - ldr r0, [r2] - ldr r1, =0x00007b10 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldr r0, [r2] - ldr r2, =0x00007c58 - adds r0, r2 - bl sub_81D1ED4 - b _0816653C - .pool -_0816640C: - bl ResetSpriteData - bl FreeAllSpritePalettes - b _0816653C -_08166416: - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - str r0, [sp] - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x05006000 - mov r0, sp - bl CpuSet - b _0816653C - .pool -_08166434: - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_085DFCCC - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - ldr r0, =gUnknown_085DFCDC - bl InitWindows - bl DeactivateAllTextPrinters - movs r0, 0 - movs r1, 0x97 - movs r2, 0xE0 - bl sub_809882C - b _0816653C - .pool -_08166464: - ldr r1, [r2] - b _08166540 -_08166468: - bl sub_8168328 - lsls r0, 24 - cmp r0, 0 - bne _08166556 - b _0816653C -_08166474: - ldr r1, =gKeyRepeatStartDelay - movs r0, 0x14 - strh r0, [r1] - bl sub_8167420 - b _0816653C - .pool -_08166484: - bl sub_8167930 - lsls r0, 24 - cmp r0, 0 - bne _08166556 - b _0816653C -_08166490: - movs r0, 0 - bl sub_8167608 - bl sub_8167760 - b _0816653C -_0816649C: - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r1, =0x00007b0e - adds r0, r1 - bl sub_81D312C - lsls r0, 24 - cmp r0, 0 - bne _08166556 - b _0816653C - .pool -_081664B8: - ldr r1, [r2] - b _08166540 -_081664BC: - ldr r5, =gUnknown_0203BCAC - ldr r1, [r5] - ldr r4, =0x00007c58 - adds r0, r1, r4 - ldr r2, =0x00007c6c - adds r1, r2 - bl sub_81D2754 - ldr r0, [r5] - adds r0, r4 - bl sub_81D20AC - b _0816653C - .pool -_081664E4: - ldr r4, =gUnknown_0203BCAC - ldr r0, [r4] - ldr r1, =0x00007c58 - adds r0, r1 - bl sub_81D20BC - lsls r0, 24 - cmp r0, 0 - bne _08166556 - ldr r2, [r4] - ldr r1, =0x00007c58 - adds r0, r2, r1 - adds r1, 0x14 - adds r2, r1 - adds r1, r2, 0 - bl sub_81D1F84 - b _0816653C - .pool -_08166510: - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r2, =0x00007c58 - adds r0, r2 - bl sub_81D2230 - b _0816653C - .pool -_08166528: - movs r0, 0 - bl PutWindowTilemap - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0 - movs r1, 0x1 - bl sub_8167BA0 -_0816653C: - ldr r0, =gUnknown_0203BC90 - ldr r1, [r0] -_08166540: - adds r1, 0x50 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08166556 - .pool -_08166550: - ldr r0, =map_warp_consider_1_to_outside_or_stair_or_dive - bl launch_c3_walk_stairs_and_run_once -_08166556: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8166380 - - thumb_func_start map_warp_consider_1_to_outside_or_stair_or_dive -map_warp_consider_1_to_outside_or_stair_or_dive: @ 8166564 - push {r4,lr} - sub sp, 0x4 - ldr r4, =gUnknown_0203BC90 - ldr r0, [r4] - adds r0, 0x50 - ldrb r1, [r0] - cmp r1, 0 - beq _08166580 - cmp r1, 0x1 - beq _081665C0 - b _08166610 - .pool -_08166580: - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - ldr r0, =sub_8166340 - bl SetVBlankCallback - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x3 - bl ShowBg - movs r0, 0x2 - bl ShowBg - ldr r1, [r4] - adds r1, 0x50 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08166610 - .pool -_081665C0: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08166610 - ldr r4, =gUnknown_0203BCAC - ldr r0, [r4] - ldr r1, =0x00007b1c - adds r0, r1 - bl sub_81D3464 - ldr r4, [r4] - ldr r2, =0x00008041 - adds r0, r4, r2 - ldrb r1, [r0] - ldr r3, =0x00008040 - adds r0, r4, r3 - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - beq _0816660A - ldr r1, =0x00007fb3 - adds r0, r4, r1 - movs r1, 0 - ldrsb r1, [r0, r1] - subs r2, 0x91 - adds r0, r4, r2 - adds r0, r1 - ldrb r2, [r0] - ldr r3, =0x00007b1c - adds r0, r4, r3 - subs r3, 0xC - adds r1, r4, r3 - ldrb r1, [r1] - bl sub_81D3480 -_0816660A: - ldr r0, =sub_8166634 - bl launch_c3_walk_stairs_and_run_once -_08166610: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end map_warp_consider_1_to_outside_or_stair_or_dive - - thumb_func_start sub_8166634 -sub_8166634: @ 8166634 - push {lr} - ldr r0, =gUnknown_0203BC90 - ldr r0, [r0] - adds r0, 0x50 - ldrb r0, [r0] - cmp r0, 0x7 - bls _08166644 - b _0816680E -_08166644: - lsls r0, 2 - ldr r1, =_08166658 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08166658: - .4byte _08166678 - .4byte _0816675C - .4byte _0816680E - .4byte _08166788 - .4byte _0816680E - .4byte _08166794 - .4byte _081667AC - .4byte _081667F4 -_08166678: - ldr r2, =gMain - ldrh r1, [r2, 0x2C] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081666B8 - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - bl sub_8167CA0 - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r1, =0x00007b1c - adds r0, r1 - bl sub_81D3520 - ldr r0, =gUnknown_0203BC90 - ldr r0, [r0] - adds r0, 0x50 - movs r1, 0x1 - b _0816680C - .pool -_081666B8: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081666F0 - movs r0, 0x5 - bl PlaySE - movs r0, 0 - bl sub_8167CA0 - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r2, =0x00007b1c - adds r0, r2 - bl sub_81D3520 - ldr r0, =gUnknown_0203BC90 - ldr r0, [r0] - adds r0, 0x50 - movs r1, 0x1 - b _0816680C - .pool -_081666F0: - ldrh r1, [r2, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08166710 - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0203BC90 - ldr r0, [r0] - adds r0, 0x50 - movs r1, 0x3 - b _0816680C - .pool -_08166710: - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0816671A - b _0816680E -_0816671A: - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r2, =0x00008041 - adds r1, r0, r2 - ldrb r1, [r1] - subs r2, 0x1 - adds r0, r2 - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - bne _0816674C - ldr r0, =gUnknown_0203BC90 - ldr r0, [r0] - adds r0, 0x50 - movs r1, 0x3 - b _0816680C - .pool -_0816674C: - ldr r0, =gUnknown_0203BC90 - ldr r0, [r0] - adds r0, 0x50 - movs r1, 0x5 - b _0816680C - .pool -_0816675C: - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r1, =0x00008044 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _0816680E - ldr r0, =gUnknown_0203BC90 - ldr r0, [r0] - adds r0, 0x50 - b _0816680C - .pool -_08166788: - ldr r0, =sub_8166BEC - bl launch_c3_walk_stairs_and_run_once - b _0816680E - .pool -_08166794: - bl sub_8166D44 - ldr r0, =gUnknown_0203BC90 - ldr r1, [r0] - adds r1, 0x50 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0816680E - .pool -_081667AC: - bl sub_8166DE4 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _081667CC - cmp r1, 0 - bgt _081667C6 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _08166804 - b _0816680E -_081667C6: - cmp r1, 0x1 - bne _0816680E - b _08166804 -_081667CC: - bl sub_8167268 - lsls r0, 24 - cmp r0, 0 - beq _081667E8 - bl sub_8166F50 - ldr r0, =gUnknown_0203BC90 - ldr r0, [r0] - adds r0, 0x50 - movs r1, 0x7 - b _0816680C - .pool -_081667E8: - ldr r0, =sub_816681C - bl launch_c3_walk_stairs_and_run_once - b _0816680E - .pool -_081667F4: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _0816680E - bl sub_8166F94 -_08166804: - ldr r0, =gUnknown_0203BC90 - ldr r0, [r0] - adds r0, 0x50 - movs r1, 0 -_0816680C: - strb r1, [r0] -_0816680E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8166634 - - thumb_func_start sub_816681C -sub_816681C: @ 816681C - push {r4,r5,lr} - sub sp, 0x4 - ldr r5, =gUnknown_0203BC90 - ldr r0, [r5] - adds r0, 0x50 - ldrb r4, [r0] - cmp r4, 0 - beq _08166838 - cmp r4, 0x1 - beq _08166888 - b _081668D4 - .pool -_08166838: - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r1, =0x00008041 - adds r0, r1 - ldrb r0, [r0] - bl sub_81672A4 - ldr r1, =gUnknown_0203BC9C - strb r0, [r1] - ldr r1, =gUnknown_0203BC94 - ldr r2, [r5] - ldr r0, [r2, 0x4] - str r0, [r1] - ldr r1, =gUnknown_0203BC98 - ldr r0, [r2, 0x8] - str r0, [r1] - movs r0, 0x1 - negs r0, r0 - str r4, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r1, [r5] - adds r1, 0x50 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _081668D4 - .pool -_08166888: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _081668D4 - movs r0, 0 - bl SetVBlankCallback - ldr r4, =gUnknown_0203BCA0 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203BCA4 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203BCA8 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203BCAC - ldr r0, [r4] - bl Free - str r5, [r4] - bl FreeAllWindowBuffers - ldr r1, =gMain - ldr r0, =sub_816624C - str r0, [r1, 0x8] - bl sub_8179D70 -_081668D4: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816681C - - thumb_func_start sub_81668F8 -sub_81668F8: @ 81668F8 - push {r4,lr} - sub sp, 0x4 - ldr r1, =gUnknown_0203BC90 - ldr r0, [r1] - adds r0, 0x50 - ldrb r0, [r0] - adds r4, r1, 0 - cmp r0, 0x6 - bls _0816690C - b _08166A18 -_0816690C: - lsls r0, 2 - ldr r1, =_08166920 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08166920: - .4byte _0816693C - .4byte _08166972 - .4byte _08166A18 - .4byte _081669A0 - .4byte _081669AE - .4byte _081669C8 - .4byte _081669F4 -_0816693C: - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r1, =0x00008041 - adds r0, r1 - ldr r1, =gUnknown_0203BC9C - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - beq _08166968 - ldr r0, [r4] - adds r0, 0x56 - ldrb r0, [r0] - bl sub_8167CA0 - ldr r1, [r4] - b _081669E2 - .pool -_08166968: - ldr r0, [r4] - adds r0, 0x50 - movs r1, 0x3 - strb r1, [r0] - b _08166A18 -_08166972: - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r1, =0x00008044 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _08166A18 - ldr r0, =gUnknown_0203BC90 - ldr r0, [r0] - adds r0, 0x50 - strb r1, [r0] - b _08166A18 - .pool -_081669A0: - movs r0, 0x1 - negs r0, r0 - movs r1, 0x10 - movs r2, 0 - bl BlendPalettes - b _081669DE -_081669AE: - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x3 - bl ShowBg - movs r0, 0x2 - bl ShowBg - b _081669DE -_081669C8: - ldr r0, =sub_8166340 - bl SetVBlankCallback - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade -_081669DE: - ldr r0, =gUnknown_0203BC90 - ldr r1, [r0] -_081669E2: - adds r1, 0x50 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08166A18 - .pool -_081669F4: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08166A18 - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r1, =0x00007b1c - adds r0, r1 - bl sub_81D3464 - ldr r0, =sub_8166A34 - bl launch_c3_walk_stairs_and_run_once - ldr r0, =sub_816631C - bl SetMainCallback2 -_08166A18: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81668F8 - - thumb_func_start sub_8166A34 -sub_8166A34: @ 8166A34 - push {r4-r6,lr} - ldr r1, =gUnknown_0203BC90 - ldr r0, [r1] - adds r0, 0x50 - ldrb r0, [r0] - adds r5, r1, 0 - cmp r0, 0x5 - bls _08166A46 - b _08166BDA -_08166A46: - lsls r0, 2 - ldr r1, =_08166A58 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08166A58: - .4byte _08166A70 - .4byte _08166AAC - .4byte _08166AC0 - .4byte _08166B14 - .4byte _08166B94 - .4byte _08166BB6 -_08166A70: - ldr r4, [r5] - ldr r3, =gPlayerParty - str r3, [r4, 0xC] - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r2, =0x00008041 - adds r1, r0, r2 - ldrb r1, [r1] - lsls r1, 2 - adds r1, r0, r1 - subs r2, 0x88 - adds r1, r2 - ldrb r2, [r1] - movs r1, 0x64 - muls r1, r2 - adds r1, r3 - str r1, [r4, 0xC] - ldr r3, =0x00007b1c - adds r0, r3 - bl sub_81D3520 - b _08166BAA - .pool -_08166AAC: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - bne _08166ABA - b _08166BDA -_08166ABA: - b _08166BAA - .pool -_08166AC0: - bl sub_8167104 - ldr r6, =gUnknown_0203BC90 - ldr r0, [r6] - adds r0, 0x5C - ldr r4, =gUnknown_0203BCAC - ldr r1, [r4] - ldr r5, =0x00007ca8 - adds r1, r5 - bl sub_81D2754 - ldr r2, [r4] - ldr r4, =0x00007c58 - adds r0, r2, r4 - ldr r3, =0x00007fb3 - adds r1, r2, r3 - movs r3, 0 - ldrsb r3, [r1, r3] - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 2 - adds r4, 0x14 - adds r1, r4 - adds r1, r2, r1 - adds r2, r5 - bl sub_81D1F84 - bl sub_8167338 - ldr r1, [r6] - b _08166BAC - .pool -_08166B14: - ldr r5, =gUnknown_0203BCAC - ldr r0, [r5] - ldr r1, =0x00007c58 - adds r0, r1 - bl sub_81D2074 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - bne _08166BDA - ldr r0, [r5] - ldr r4, =0x00008041 - adds r0, r4 - ldrb r0, [r0] - bl sub_81672A4 - lsls r0, 24 - lsrs r0, 24 - bl sub_81681F4 - ldr r3, [r5] - adds r4, r3, r4 - ldrb r1, [r4] - ldr r2, =0x00008040 - adds r0, r3, r2 - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - beq _08166B6C - ldr r4, =0x00007fb3 - adds r0, r3, r4 - movs r1, 0 - ldrsb r1, [r0, r1] - subs r2, 0x90 - adds r0, r3, r2 - adds r0, r1 - ldrb r2, [r0] - ldr r4, =0x00007b1c - adds r0, r3, r4 - subs r4, 0xC - adds r1, r3, r4 - ldrb r1, [r1] - bl sub_81D3480 -_08166B6C: - ldr r1, =gUnknown_0203BC90 - ldr r0, [r1] - adds r0, 0x52 - strb r6, [r0] - ldr r1, [r1] - b _08166BAC - .pool -_08166B94: - ldr r1, [r5] - adds r1, 0x52 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x10 - bls _08166BDA - bl sub_8166E24 -_08166BAA: - ldr r1, [r5] -_08166BAC: - adds r1, 0x50 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08166BDA -_08166BB6: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _08166BDA - bl sub_8166EDC - lsls r0, 24 - cmp r0, 0 - bne _08166BDA - ldr r0, =gScriptItemId - ldrb r0, [r0] - bl sub_8136F68 - ldr r0, =sub_8166BEC - bl launch_c3_walk_stairs_and_run_once -_08166BDA: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8166A34 - - thumb_func_start sub_8166BEC -sub_8166BEC: @ 8166BEC - push {r4-r6,lr} - sub sp, 0x4 - ldr r4, =gUnknown_0203BC90 - ldr r0, [r4] - adds r2, r0, 0 - adds r2, 0x50 - ldrb r1, [r2] - cmp r1, 0x1 - beq _08166C28 - cmp r1, 0x1 - bgt _08166C0C - cmp r1, 0 - beq _08166C16 - b _08166D18 - .pool -_08166C0C: - cmp r1, 0x2 - beq _08166C40 - cmp r1, 0x3 - beq _08166C5C - b _08166D18 -_08166C16: - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - b _08166C4A -_08166C28: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08166D18 - movs r0, 0x2 - strb r0, [r2] - b _08166D18 - .pool -_08166C40: - ldr r1, =gUnknown_02039B28 - movs r0, 0x3 - strb r0, [r1, 0x15] - bl sub_80BA0A8 -_08166C4A: - ldr r1, [r4] - adds r1, 0x50 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08166D18 - .pool -_08166C5C: - ldr r0, [r0, 0x4] - bl SetMainCallback2 - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r1, =0x00007b1c - adds r0, r1 - bl sub_81D354C - movs r4, 0 -_08166C70: - ldr r5, =gUnknown_0203BCAC - ldr r0, [r5] - ldr r2, =0x00007b06 - adds r0, r2 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySprite - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x6 - bls _08166C70 - movs r0, 0 - bl FreeSpriteTilesByTag - movs r0, 0x1 - bl FreeSpriteTilesByTag - movs r0, 0 - bl FreeSpritePaletteByTag - movs r0, 0x1 - bl FreeSpritePaletteByTag - movs r4, 0 -_08166CAE: - ldr r0, [r5] - lsls r1, r4, 2 - ldr r2, =0x00007b44 - adds r0, r2 - adds r0, r1 - ldr r0, [r0] - bl DestroySprite - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _08166CAE - ldr r6, =gUnknown_0203BCAC - ldr r0, [r6] - ldr r2, =0x00007b10 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0xFF - beq _08166CE6 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySprite -_08166CE6: - movs r0, 0 - bl SetVBlankCallback - ldr r4, =gUnknown_0203BCA0 - ldr r0, [r4] - bl Free - movs r5, 0 - str r5, [r4] - ldr r4, =gUnknown_0203BCA4 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203BCA8 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r0, [r6] - bl Free - str r5, [r6] - bl FreeAllWindowBuffers -_08166D18: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8166BEC - - thumb_func_start sub_8166D44 -sub_8166D44: @ 8166D44 - push {r4,lr} - sub sp, 0x4C - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r1, =0x00008041 - adds r0, r1 - ldrb r0, [r0] - bl sub_81672A4 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x2 - add r2, sp, 0xC - bl GetMonData - add r0, sp, 0xC - bl StringGetEnd10 - ldr r1, =gUnknown_085EC7A0 - add r0, sp, 0xC - bl StringAppend - ldr r4, =gStringVar4 - adds r0, r4, 0 - add r1, sp, 0xC - bl StringCopy - movs r0, 0x2 - movs r1, 0x11 - bl FillWindowPixelBuffer - movs r0, 0x2 - movs r1, 0x97 - movs r2, 0xE - bl sub_8098858 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0 - bl PrintTextOnWindow - movs r0, 0x2 - bl PutWindowTilemap - movs r0, 0x2 - movs r1, 0x3 - bl CopyWindowToVram - ldr r0, =gUnknown_085DFCFC - movs r1, 0x97 - movs r2, 0xE - movs r3, 0 - bl CreateYesNoMenu - add sp, 0x4C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8166D44 - - thumb_func_start sub_8166DE4 -sub_8166DE4: @ 8166DE4 - push {r4,lr} - bl sub_8198C58 - lsls r0, 24 - lsrs r4, r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _08166E18 - cmp r1, 0 - bgt _08166E02 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _08166E06 - b _08166E18 -_08166E02: - cmp r1, 0x1 - bne _08166E18 -_08166E06: - movs r0, 0x5 - bl PlaySE - movs r0, 0x2 - bl rbox_fill_rectangle - movs r0, 0x2 - bl ClearWindowTilemap -_08166E18: - lsls r0, r4, 24 - asrs r0, 24 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8166DE4 - - thumb_func_start sub_8166E24 -sub_8166E24: @ 8166E24 - push {r4,lr} - movs r0, 0x2 - movs r1, 0x97 - movs r2, 0xE - bl sub_8098858 - movs r0, 0x2 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r3, =gUnknown_0203BC90 - ldr r0, [r3] - adds r0, 0x53 - movs r1, 0 - strb r1, [r0] - ldr r2, [r3] - adds r1, r2, 0 - adds r1, 0x53 - ldrb r0, [r1] - cmp r0, 0x4 - bhi _08166EA8 - adds r0, r2, 0 - adds r0, 0x61 - ldrb r1, [r1] - adds r0, r1 - ldrb r0, [r0] - adds r4, r3, 0 - cmp r0, 0 - bne _08166E84 - adds r2, r4, 0 -_08166E60: - ldr r0, [r2] - adds r0, 0x53 - ldrb r1, [r0] - adds r1, 0x1 - strb r1, [r0] - ldr r3, [r2] - adds r1, r3, 0 - adds r1, 0x53 - ldrb r0, [r1] - cmp r0, 0x4 - bhi _08166EA8 - adds r0, r3, 0 - adds r0, 0x61 - ldrb r1, [r1] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _08166E60 -_08166E84: - ldr r2, [r4] - adds r1, r2, 0 - adds r1, 0x53 - ldrb r0, [r1] - cmp r0, 0x4 - bhi _08166EA8 - ldr r0, =gStringVar4 - ldrb r1, [r1] - adds r2, 0x61 - adds r2, r1 - ldrb r2, [r2] - bl sub_8166FD4 - b _08166EB8 - .pool -_08166EA8: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_0203BC90 - ldr r1, [r1] - adds r1, 0x53 - ldrb r1, [r1] - movs r2, 0 - bl sub_8166FD4 -_08166EB8: - ldr r0, =gStringVar4 - bl sub_8166FB0 - movs r0, 0x2 - bl PutWindowTilemap - movs r0, 0x2 - movs r1, 0x3 - bl CopyWindowToVram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8166E24 - - thumb_func_start sub_8166EDC -sub_8166EDC: @ 8166EDC - push {r4,r5,lr} - movs r0, 0x2 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r5, =gUnknown_0203BC90 - adds r3, r5, 0 - movs r4, 0x5 -_08166EEC: - ldr r0, [r3] - adds r0, 0x53 - ldrb r1, [r0] - adds r1, 0x1 - strb r1, [r0] - ldr r2, [r3] - adds r1, r2, 0 - adds r1, 0x53 - ldrb r0, [r1] - cmp r0, 0x4 - bhi _08166F18 - adds r0, r2, 0 - adds r0, 0x61 - ldrb r1, [r1] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _08166F1E - b _08166EEC - .pool -_08166F18: - strb r4, [r1] - movs r0, 0 - b _08166F44 -_08166F1E: - ldr r4, =gStringVar4 - ldr r0, [r5] - adds r1, r0, 0 - adds r1, 0x53 - ldrb r1, [r1] - adds r0, 0x61 - adds r0, r1 - ldrb r2, [r0] - adds r0, r4, 0 - bl sub_8166FD4 - adds r0, r4, 0 - bl sub_8166FB0 - movs r0, 0x2 - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0x1 -_08166F44: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8166EDC - - thumb_func_start sub_8166F50 -sub_8166F50: @ 8166F50 - push {lr} - sub sp, 0xC - movs r0, 0x2 - movs r1, 0x11 - bl FillWindowPixelBuffer - movs r0, 0x2 - movs r1, 0x97 - movs r2, 0xE - bl sub_8098858 - ldr r2, =gUnknown_085EC800 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x1 - movs r3, 0 - bl PrintTextOnWindow - movs r0, 0x2 - bl PutWindowTilemap - movs r0, 0x2 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_8166F50 - - thumb_func_start sub_8166F94 -sub_8166F94: @ 8166F94 - push {lr} - movs r0, 0x2 - bl rbox_fill_rectangle - movs r0, 0x2 - bl ClearWindowTilemap - movs r0, 0x2 - movs r1, 0x3 - bl CopyWindowToVram - pop {r0} - bx r0 - thumb_func_end sub_8166F94 - - thumb_func_start sub_8166FB0 -sub_8166FB0: @ 8166FB0 - push {lr} - sub sp, 0xC - ldr r2, =gStringVar4 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x1 - movs r3, 0 - bl PrintTextOnWindow - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_8166FB0 - - thumb_func_start sub_8166FD4 -sub_8166FD4: @ 8166FD4 - push {r4,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r3, r1, 24 - lsls r2, 16 - lsrs r0, r2, 16 - asrs r2, 16 - cmp r2, 0 - beq _08167010 - cmp r2, 0 - ble _08166FEC - movs r0, 0 -_08166FEC: - lsls r0, 16 - ldr r1, =gUnknown_085DFD04 - lsls r0, r3, 2 - adds r0, r1 - ldr r1, [r0] - adds r0, r4, 0 - bl StringCopy - ldr r1, =gUnknown_085EC7E1 - adds r0, r4, 0 - bl StringAppend - b _08167018 - .pool -_08167010: - ldr r1, =gUnknown_085EC7EF - adds r0, r4, 0 - bl StringCopy -_08167018: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8166FD4 - - thumb_func_start sub_8167024 -sub_8167024: @ 8167024 - push {r4-r7,lr} - adds r6, r0, 0 - adds r5, r1, 0 - movs r4, 0 - ldr r7, =gUnknown_085DFCB0 -_0816702E: - lsls r0, r4, 2 - adds r0, r7 - ldr r1, [r0] - adds r0, r6, 0 - bl GetMonData - adds r1, r5, r4 - strb r0, [r1] - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x4 - bls _0816702E - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8167024 - - thumb_func_start sub_8167054 -sub_8167054: @ 8167054 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - mov r8, r0 - adds r5, r1, 0 - adds r0, r5, 0 - movs r1, 0x30 - bl GetMonData - cmp r0, 0xFF - beq _081670F0 - mov r0, r8 - adds r1, r5, 0 - bl sub_8167184 - movs r4, 0 - mov r7, sp -_08167078: - ldr r1, =gUnknown_085DFCB0 - lsls r0, r4, 2 - adds r0, r1 - ldr r6, [r0] - adds r0, r5, 0 - adds r1, r6, 0 - bl GetMonData - lsls r0, 24 - lsrs r0, 24 - strb r0, [r7] - ldr r1, =gUnknown_0203BC90 - ldr r1, [r1] - lsls r2, r4, 1 - adds r1, 0x66 - adds r1, r2 - ldrh r1, [r1] - adds r0, r1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r0, 0 - bge _081670A6 - movs r1, 0 -_081670A6: - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0xFF - ble _081670B0 - movs r1, 0xFF -_081670B0: - strb r1, [r7] - adds r0, r5, 0 - adds r1, r6, 0 - mov r2, sp - bl SetMonData - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x4 - bls _08167078 - adds r0, r5, 0 - movs r1, 0x30 - bl GetMonData - lsls r0, 24 - lsrs r0, 24 - mov r2, r8 - ldrb r2, [r2, 0x6] - adds r1, r0, r2 - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0xFF - ble _081670E2 - movs r1, 0xFF -_081670E2: - mov r0, sp - strb r1, [r0] - adds r0, r5, 0 - movs r1, 0x30 - mov r2, sp - bl SetMonData -_081670F0: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8167054 - - thumb_func_start sub_8167104 -sub_8167104: @ 8167104 - push {r4,r5,lr} - ldr r5, =gPlayerParty - ldr r0, =gUnknown_0203BCAC - ldr r1, [r0] - ldr r2, =0x00008041 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 2 - adds r1, r0 - ldr r0, =0x00007fb9 - adds r1, r0 - ldrb r1, [r1] - movs r0, 0x64 - muls r0, r1 - adds r5, r0, r5 - ldr r4, =gUnknown_0203BC90 - ldr r1, [r4] - adds r1, 0x57 - adds r0, r5, 0 - bl sub_8167024 - ldr r0, [r4] - ldr r0, [r0, 0x8] - adds r1, r5, 0 - bl sub_8167054 - ldr r1, [r4] - adds r1, 0x5C - adds r0, r5, 0 - bl sub_8167024 - movs r3, 0 -_08167144: - ldr r0, [r4] - adds r2, r0, 0 - adds r2, 0x61 - adds r2, r3 - adds r1, r0, 0 - adds r1, 0x5C - adds r1, r3 - adds r0, 0x57 - adds r0, r3 - ldrb r1, [r1] - ldrb r0, [r0] - subs r1, r0 - strb r1, [r2] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x4 - bls _08167144 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8167104 - - thumb_func_start sub_8167184 -sub_8167184: @ 8167184 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r10, r1 - ldr r1, =gUnknown_0203BC90 - ldr r3, [r1] - ldrb r1, [r0, 0x1] - adds r2, r3, 0 - adds r2, 0x66 - strh r1, [r2] - ldrb r2, [r0, 0x5] - adds r1, r3, 0 - adds r1, 0x68 - strh r2, [r1] - ldrb r1, [r0, 0x4] - adds r2, r3, 0 - adds r2, 0x6A - strh r1, [r2] - ldrb r2, [r0, 0x3] - adds r1, r3, 0 - adds r1, 0x6C - strh r2, [r1] - ldrb r1, [r0, 0x2] - adds r0, r3, 0 - adds r0, 0x6E - strh r1, [r0] - ldr r0, =gUnknown_0203BC9E - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - ble _081671D4 - movs r0, 0x1 - b _081671DA - .pool -_081671D4: - cmp r0, 0 - bge _08167250 - movs r0, 0xFF -_081671DA: - movs r2, 0 - lsls r0, 24 - mov r9, r0 - ldr r0, =gUnknown_0203BC90 - mov r8, r0 -_081671E4: - mov r0, r8 - ldr r1, [r0] - lsls r0, r2, 24 - asrs r6, r0, 24 - lsls r7, r6, 1 - adds r1, 0x66 - adds r1, r7 - movs r2, 0 - ldrsh r4, [r1, r2] - adds r0, r4, 0 - movs r1, 0xA - bl __divsi3 - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r4, 0 - movs r1, 0xA - bl __modsi3 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _0816721C - lsls r0, r5, 24 - movs r1, 0x80 - lsls r1, 17 - adds r0, r1 - lsrs r5, r0, 24 -_0816721C: - ldr r0, =gUnknown_085DFCC4 - adds r0, r6, r0 - ldrb r1, [r0] - mov r0, r10 - bl GetMonFlavourRelation - lsls r0, 24 - asrs r2, r0, 24 - cmp r0, r9 - bne _08167244 - mov r1, r8 - ldr r0, [r1] - adds r0, 0x66 - adds r0, r7 - lsls r1, r5, 24 - asrs r1, 24 - muls r1, r2 - ldrh r2, [r0] - adds r1, r2 - strh r1, [r0] -_08167244: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - asrs r0, 24 - cmp r0, 0x4 - ble _081671E4 -_08167250: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8167184 - - thumb_func_start sub_8167268 -sub_8167268: @ 8167268 - push {lr} - ldr r0, =gUnknown_0203BCAC - ldr r1, [r0] - ldr r2, =0x00008041 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 2 - adds r1, r0 - subs r2, 0x89 - adds r0, r1, r2 - ldrb r0, [r0] - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - movs r2, 0x30 - movs r3, 0 - bl sub_81D2C68 - cmp r0, 0xFF - beq _0816729C - movs r0, 0 - b _0816729E - .pool -_0816729C: - movs r0, 0x1 -_0816729E: - pop {r1} - bx r1 - thumb_func_end sub_8167268 - - thumb_func_start sub_81672A4 -sub_81672A4: @ 81672A4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 -_081672AC: - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x2D - bl GetMonData - cmp r0, 0 - bne _081672D2 - cmp r5, 0 - bne _081672CC - adds r0, r4, 0 - b _081672DE - .pool -_081672CC: - subs r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_081672D2: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _081672AC - movs r0, 0 -_081672DE: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81672A4 - - thumb_func_start sub_81672E4 -sub_81672E4: @ 81672E4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - movs r6, 0 - cmp r6, r5 - bcs _08167314 -_081672F2: - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x2D - bl GetMonData - cmp r0, 0 - beq _0816730A - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_0816730A: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _081672F2 -_08167314: - subs r0, r5, r6 - lsls r0, 24 - lsrs r0, 24 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81672E4 - - thumb_func_start sub_8167324 -sub_8167324: @ 8167324 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl sub_81672A4 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_8167324 - - thumb_func_start sub_8167338 -sub_8167338: @ 8167338 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =gUnknown_085DFD18 - bl LoadSpriteSheet - ldr r0, =gUnknown_085DFD20 - bl LoadSpritePalette - ldr r2, =gUnknown_0203BC90 - ldr r0, [r2] - adds r0, 0x54 - movs r1, 0 - strb r1, [r0] - movs r4, 0 - adds r5, r2, 0 - ldr r6, =gUnknown_085DFD28 - adds r0, r6, 0x2 - mov r8, r0 - ldr r7, =gSprites + 0x1C -_08167360: - ldr r0, [r5] - adds r0, 0x61 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - beq _081673AC - lsls r2, r4, 2 - adds r0, r2, r6 - movs r3, 0 - ldrsh r1, [r0, r3] - add r2, r8 - movs r0, 0 - ldrsh r2, [r2, r0] - ldr r0, =gUnknown_085DFD5C - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x40 - beq _081673AC - ldr r0, [r5] - adds r0, 0x61 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - beq _081673A2 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_81673DC - str r1, [r0] -_081673A2: - ldr r1, [r5] - adds r1, 0x54 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_081673AC: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x4 - bls _08167360 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8167338 - - thumb_func_start sub_81673DC -sub_81673DC: @ 81673DC - push {lr} - adds r1, r0, 0 - movs r2, 0x2E - ldrsh r0, [r1, r2] - cmp r0, 0x5 - bgt _081673EE - ldrh r0, [r1, 0x26] - subs r0, 0x2 - b _081673F6 -_081673EE: - cmp r0, 0xB - bgt _081673F8 - ldrh r0, [r1, 0x26] - adds r0, 0x2 -_081673F6: - strh r0, [r1, 0x26] -_081673F8: - ldrh r0, [r1, 0x2E] - adds r0, 0x1 - strh r0, [r1, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3C - ble _08167418 - adds r0, r1, 0 - bl DestroySprite - ldr r0, =gUnknown_0203BC90 - ldr r1, [r0] - adds r1, 0x54 - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] -_08167418: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81673DC - - thumb_func_start sub_8167420 -sub_8167420: @ 8167420 - push {r4-r6,lr} - movs r4, 0 - movs r5, 0 - ldr r6, =gUnknown_0203BCAC - b _08167472 - .pool -_08167430: - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x2D - bl GetMonData - adds r3, r0, 0 - cmp r3, 0 - bne _0816746C - ldr r1, [r6] - lsls r2, r5, 2 - adds r1, r2 - ldr r0, =0x00007fb8 - adds r1, r0 - movs r0, 0xE - strb r0, [r1] - ldr r0, [r6] - adds r0, r2 - ldr r1, =0x00007fb9 - adds r0, r1 - strb r4, [r0] - ldr r0, [r6] - adds r0, r2 - ldr r2, =0x00007fba - adds r0, r2 - strh r3, [r0] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 -_0816746C: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 -_08167472: - bl CalculatePlayerPartyCount - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bcc _08167430 - ldr r2, =gUnknown_0203BCAC - ldr r0, [r2] - ldr r1, =0x00008041 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - adds r1, r5, 0x1 - ldr r2, =0x00008040 - adds r0, r2 - strb r1, [r0] - bl sub_81674BC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8167420 - - thumb_func_start sub_81674BC -sub_81674BC: @ 81674BC - push {r4,r5,lr} - ldr r4, =gUnknown_0203BCAC - ldr r0, [r4] - ldr r5, =0x00008041 - adds r0, r5 - ldrb r0, [r0] - movs r1, 0 - bl sub_816753C - ldr r0, [r4] - ldr r1, =0x00007fb3 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - ldr r0, [r4] - ldr r2, =0x00007fb4 - adds r0, r2 - movs r1, 0x1 - strb r1, [r0] - ldr r0, [r4] - ldr r1, =0x00007fb5 - adds r0, r1 - movs r1, 0x2 - strb r1, [r0] - ldr r0, [r4] - adds r5, r0, r5 - ldrb r3, [r5] - adds r1, r3, 0x1 - adds r2, 0x8C - adds r0, r2 - ldrb r2, [r0] - cmp r1, r2 - blt _08167500 - movs r1, 0 -_08167500: - subs r0, r3, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r0, 0 - bge _08167510 - subs r0, r2, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 -_08167510: - adds r0, r1, 0 - movs r1, 0x1 - bl sub_816753C - lsls r0, r4, 16 - asrs r0, 16 - movs r1, 0x2 - bl sub_816753C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81674BC - - thumb_func_start sub_816753C -sub_816753C: @ 816753C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - adds r5, r0, 0 - adds r4, r1, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_0203BCAC - mov r9, r0 - ldr r1, [r0] - lsls r5, 16 - asrs r0, r5, 14 - adds r0, r1, r0 - ldr r3, =0x00007fb8 - adds r2, r0, r3 - ldrb r7, [r2] - ldr r2, =0x00007fb9 - adds r0, r2 - ldrb r0, [r0] - mov r10, r0 - adds r3, 0x88 - adds r0, r1, r3 - ldrb r6, [r0] - movs r0, 0 - mov r8, r0 - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 3 - ldr r2, =0x00007b4d - adds r0, r2 - adds r0, r1, r0 - lsls r2, r4, 6 - ldr r3, =0x00007b95 - adds r2, r3 - adds r1, r2 - lsrs r5, 16 - str r5, [sp] - str r6, [sp, 0x4] - mov r2, r8 - str r2, [sp, 0x8] - adds r2, r7, 0 - mov r3, r10 - bl sub_81D2ED4 - mov r3, r9 - ldr r1, [r3] - ldr r2, =0x00007c58 - adds r0, r1, r2 - ldr r3, =0x00007fb0 - adds r1, r3 - str r5, [sp] - str r4, [sp, 0x4] - str r6, [sp, 0x8] - mov r2, r8 - str r2, [sp, 0xC] - adds r2, r7, 0 - mov r3, r10 - bl sub_81D2F78 - lsls r0, r4, 13 - movs r1, 0xC1 - lsls r1, 2 - adds r0, r1 - mov r3, r9 - ldr r1, [r3] - adds r0, r1, r0 - lsls r4, 7 - adds r4, 0x4 - adds r1, r4 - str r5, [sp] - str r6, [sp, 0x4] - mov r2, r8 - str r2, [sp, 0x8] - adds r2, r7, 0 - mov r3, r10 - bl sub_81D3094 - 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_816753C - - thumb_func_start sub_8167608 -sub_8167608: @ 8167608 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x28 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =gUnknown_0203BCAC - ldr r3, [r1] - ldr r0, =0x00007b10 - mov r8, r0 - adds r0, r3, r0 - ldrb r0, [r0] - adds r7, r1, 0 - cmp r0, 0xFF - bne _08167714 - add r5, sp, 0x18 - add r4, sp, 0x20 - adds r0, r5, 0 - mov r1, sp - adds r2, r4, 0 - bl sub_81D31D0 - lsls r0, r6, 13 - movs r1, 0xC1 - lsls r1, 2 - adds r0, r1 - ldr r1, [r7] - adds r0, r1, r0 - str r0, [sp, 0x18] - lsls r0, r6, 7 - adds r0, 0x4 - adds r1, r0 - str r1, [sp, 0x20] - adds r0, r4, 0 - bl LoadSpritePalette - ldr r1, [r7] - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x00007b12 - adds r1, r2 - strh r0, [r1] - adds r0, r5, 0 - bl LoadSpriteSheet - ldr r1, [r7] - ldr r3, =0x00007b14 - adds r1, r3 - strh r0, [r1] - mov r0, sp - movs r1, 0x26 - movs r2, 0x68 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r1, r0, 24 - ldr r0, [r7] - ldr r2, =0x00007b10 - adds r0, r2 - strb r1, [r0] - cmp r1, 0x40 - bne _081676AC - movs r0, 0x64 - bl FreeSpriteTilesByTag - movs r0, 0x64 - bl FreeSpritePaletteByTag - ldr r0, [r7] - add r0, r8 - movs r1, 0xFF - strb r1, [r0] - b _08167742 - .pool -_081676AC: - ldr r0, [r7] - add r0, r8 - strb r1, [r0] - ldr r4, =gSprites - ldr r2, [r7] - mov r0, r8 - adds r3, r2, r0 - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_8168168 - str r1, [r0] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x26] - subs r1, 0x22 - strh r1, [r0, 0x26] - ldr r3, =0x00007b18 - adds r1, r2, r3 - subs r3, 0x4 - adds r0, r2, r3 - ldrh r0, [r0] - lsls r0, 5 - ldr r3, =0x06010000 - adds r0, r3 - str r0, [r1] - ldr r0, =0x00007b12 - adds r2, r0 - ldrh r0, [r2] - lsls r0, 4 - movs r1, 0x80 - lsls r1, 1 - adds r0, r1 - strh r0, [r2] - b _08167742 - .pool -_08167714: - lsls r1, r6, 13 - movs r0, 0xC1 - lsls r0, 2 - adds r1, r0 - adds r1, r3, r1 - ldr r2, =0x00007b18 - adds r0, r3, r2 - ldr r2, [r0] - ldr r0, =0x040000d4 - str r1, [r0] - str r2, [r0, 0x4] - ldr r1, =0x80000400 - str r1, [r0, 0x8] - ldr r0, [r0, 0x8] - lsls r0, r6, 7 - adds r0, 0x4 - adds r0, r3, r0 - ldr r2, =0x00007b12 - adds r1, r3, r2 - ldrh r1, [r1] - movs r2, 0x20 - bl LoadPalette -_08167742: - add sp, 0x28 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8167608 - - thumb_func_start sub_8167760 -sub_8167760: @ 8167760 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x60 - add r5, sp, 0x20 - add r4, sp, 0x38 - mov r0, sp - adds r1, r5, 0 - adds r2, r4, 0 - bl sub_81D321C - mov r0, sp - bl LoadSpriteSheets - adds r0, r4, 0 - bl LoadSpritePalettes - movs r4, 0 - ldr r1, =gUnknown_0203BCAC - ldr r0, [r1] - ldr r2, =0x00008040 - adds r0, r2 - ldrb r0, [r0] - subs r0, 0x1 - adds r6, r5, 0 - add r2, sp, 0x50 - mov r9, r2 - add r2, sp, 0x58 - mov r10, r2 - cmp r4, r0 - bge _0816781C - adds r5, r1, 0 - ldr r7, =gSprites - movs r0, 0x1C - adds r0, r7 - mov r8, r0 -_081677AC: - lsls r2, r4, 2 - adds r2, r4 - lsls r2, 18 - movs r1, 0x80 - lsls r1, 12 - adds r2, r1 - asrs r2, 16 - adds r0, r6, 0 - movs r1, 0xE2 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x40 - beq _081677FC - ldr r0, [r5] - ldr r2, =0x00007b06 - adds r0, r2 - adds r0, r4 - strb r3, [r0] - lsls r0, r3, 4 - adds r0, r3 - lsls r0, 2 - adds r1, r0, r7 - strh r4, [r1, 0x2E] - add r0, r8 - ldr r1, =sub_8168180 - str r1, [r0] - b _08167808 - .pool -_081677FC: - ldr r0, [r5] - ldr r1, =0x00007b06 - adds r0, r1 - adds r0, r4 - movs r1, 0xFF - strb r1, [r0] -_08167808: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, [r5] - ldr r2, =0x00008040 - adds r0, r2 - ldrb r0, [r0] - subs r0, 0x1 - cmp r4, r0 - blt _081677AC -_0816781C: - movs r0, 0x67 - strh r0, [r6] - cmp r4, 0x5 - bhi _0816788A - ldr r5, =gUnknown_0203BCAC - ldr r7, =gSprites -_08167828: - lsls r2, r4, 2 - adds r2, r4 - lsls r2, 18 - movs r0, 0x80 - lsls r0, 12 - adds r2, r0 - asrs r2, 16 - adds r0, r6, 0 - movs r1, 0xE6 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x40 - beq _08167874 - ldr r0, [r5] - ldr r1, =0x00007b06 - adds r0, r1 - adds r0, r4 - strb r3, [r0] - lsls r1, r3, 4 - adds r1, r3 - lsls r1, 2 - adds r1, r7 - ldrb r2, [r1, 0x3] - movs r0, 0x3F - ands r0, r2 - strb r0, [r1, 0x3] - b _08167880 - .pool -_08167874: - ldr r0, [r5] - ldr r2, =0x00007b06 - adds r0, r2 - adds r0, r4 - movs r1, 0xFF - strb r1, [r0] -_08167880: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x5 - bls _08167828 -_0816788A: - movs r0, 0x66 - strh r0, [r6] - ldr r0, =sub_81681B4 - str r0, [r6, 0x14] - lsls r2, r4, 2 - adds r2, r4 - lsls r2, 18 - movs r0, 0x80 - lsls r0, 12 - adds r2, r0 - asrs r2, 16 - adds r0, r6, 0 - movs r1, 0xDE - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x40 - beq _081678F4 - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r1, =0x00007b06 - adds r0, r1 - adds r0, r4 - strb r3, [r0] - ldr r0, =gSprites - lsls r2, r3, 4 - adds r2, r3 - lsls r2, 2 - adds r2, r0 - ldrb r3, [r2, 0x1] - movs r1, 0x3F - adds r0, r1, 0 - ands r0, r3 - movs r3, 0x40 - orrs r0, r3 - strb r0, [r2, 0x1] - ldrb r0, [r2, 0x3] - ands r1, r0 - movs r0, 0x80 - orrs r1, r0 - strb r1, [r2, 0x3] - b _08167902 - .pool -_081678F4: - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r2, =0x00007b06 - adds r0, r2 - adds r0, r4 - movs r1, 0xFF - strb r1, [r0] -_08167902: - mov r0, r9 - mov r1, r10 - bl sub_81D32B0 - mov r0, r9 - bl LoadSpriteSheet - mov r0, r10 - bl LoadSpritePalette - add sp, 0x60 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8167760 - - thumb_func_start sub_8167930 -sub_8167930: @ 8167930 - push {r4,r5,lr} - sub sp, 0x8 - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r2, =0x00008048 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0xB - bls _08167944 - b _08167B78 -_08167944: - lsls r0, 2 - ldr r1, =_0816795C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0816795C: - .4byte _0816798C - .4byte _08167A04 - .4byte _08167A38 - .4byte _08167A48 - .4byte _08167A5C - .4byte _08167A74 - .4byte _08167A9C - .4byte _08167AB0 - .4byte _08167AD4 - .4byte _08167AEC - .4byte _08167B1C - .4byte _08167B38 -_0816798C: - 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 r1, 0x88 - lsls r1, 6 - movs r0, 0x3 - movs r2, 0 - bl ChangeBgY - ldr r1, =0x00007040 - movs r0, 0 - bl SetGpuReg - movs r1, 0x91 - lsls r1, 2 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x0000040b - movs r0, 0x52 - bl SetGpuReg - b _08167B7E - .pool -_08167A04: - ldr r4, =gUnknown_0203BCA4 - movs r0, 0xD0 - lsls r0, 5 - bl Alloc - str r0, [r4] - ldr r5, =gUnknown_0203BCA0 - movs r4, 0xA0 - lsls r4, 3 - adds r0, r4, 0 - bl Alloc - str r0, [r5] - ldr r5, =gUnknown_0203BCA8 - adds r0, r4, 0 - bl Alloc - str r0, [r5] - b _08167B7E - .pool -_08167A38: - ldr r0, =gUnknown_085DFB60 - ldr r1, =gUnknown_0203BCA8 - b _08167AA0 - .pool -_08167A48: - ldr r1, =gUnknown_085DFA80 - movs r0, 0x3 - movs r2, 0xE0 - movs r3, 0 - bl LoadBgTiles - b _08167B7E - .pool -_08167A5C: - ldr r0, =gUnknown_0203BCA8 - ldr r1, [r0] - movs r2, 0xA0 - lsls r2, 3 - movs r0, 0x3 - movs r3, 0 - bl LoadBgTilemap - b _08167B7E - .pool -_08167A74: - ldr r0, =gUnknown_085DFA60 - movs r1, 0xD0 - movs r2, 0x20 - bl LoadPalette - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r1, =0x00007b0e - adds r0, r1 - ldr r1, =0x0000ffb0 - strh r1, [r0] - b _08167B7E - .pool -_08167A9C: - ldr r0, =gUnknown_08DCCF7C - ldr r1, =gUnknown_0203BCA4 -_08167AA0: - ldr r1, [r1] - bl LZ77UnCompVram - b _08167B7E - .pool -_08167AB0: - ldr r0, =gUnknown_08DCD81C - ldr r1, =gUnknown_0203BCA0 - ldr r1, [r1] - bl LZ77UnCompVram - ldr r0, =gUnknown_08DCCF5C - movs r1, 0x20 - movs r2, 0x20 - bl LoadPalette - b _08167B7E - .pool -_08167AD4: - ldr r0, =gUnknown_0203BCA4 - ldr r1, [r0] - movs r2, 0xD0 - lsls r2, 5 - movs r3, 0xA0 - lsls r3, 2 - movs r0, 0x1 - bl LoadBgTiles - b _08167B7E - .pool -_08167AEC: - ldr r0, =gUnknown_0203BCA0 - ldr r1, [r0] - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, =gUnknown_08DCDA30 - movs r0, 0xC - str r0, [sp] - movs r0, 0x4 - str r0, [sp, 0x4] - movs r0, 0x1 - movs r2, 0 - movs r3, 0xD - bl CopyToBgTilemapBufferRect - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - b _08167B7E - .pool -_08167B1C: - ldr r0, =gUnknown_085DFC0C - ldr r1, =gUnknown_0203BCAC - ldr r1, [r1] - ldr r2, =0x00007304 - adds r1, r2 - bl LZ77UnCompVram - b _08167B7E - .pool -_08167B38: - ldr r0, =gUnknown_0203BCAC - ldr r1, [r0] - ldr r0, =0x00007304 - adds r1, r0 - movs r2, 0xA0 - lsls r2, 3 - movs r0, 0x2 - movs r3, 0 - bl LoadBgTilemap - ldr r0, =gUnknown_086231E8 - movs r1, 0x30 - movs r2, 0x20 - bl LoadPalette - ldr r0, =gUnknown_08623208 - movs r1, 0xF0 - movs r2, 0x20 - bl LoadPalette - movs r0, 0x2 - bl sub_81D21DC - b _08167B7E - .pool -_08167B78: - movs r0, 0 - strb r0, [r1] - b _08167B8E -_08167B7E: - ldr r0, =gUnknown_0203BCAC - ldr r1, [r0] - ldr r2, =0x00008048 - adds r1, r2 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - movs r0, 0x1 -_08167B8E: - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8167930 - - thumb_func_start sub_8167BA0 -sub_8167BA0: @ 8167BA0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - lsls r0, 16 - lsrs r4, r0, 16 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - movs r0, 0 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r7, =gUnknown_0203BCAC - ldr r3, [r7] - ldr r1, =0x00008041 - adds r0, r3, r1 - ldrb r1, [r0] - ldr r2, =0x00008040 - adds r0, r3, r2 - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - beq _08167C46 - lsls r2, r4, 6 - ldr r0, =0x00007b95 - adds r2, r0 - adds r2, r3, r2 - movs r0, 0x1 - str r0, [sp] - movs r5, 0 - str r5, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r3, 0 - bl PrintTextOnWindow - ldr r0, [r7] - ldr r1, =0x00008041 - adds r0, r1 - ldrb r0, [r0] - bl sub_81672A4 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - bl GetNature - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, [r7] - ldr r6, =0x0000804a - adds r0, r6 - ldr r1, =gUnknown_085EBF8D - bl StringCopy - ldr r1, =gNatureNamePointers - lsls r4, 2 - adds r4, r1 - ldr r1, [r4] - bl StringCopy - ldr r0, =gUnknown_085DFCC9 - str r0, [sp] - str r5, [sp, 0x4] - ldr r0, [r7] - adds r0, r6 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x2 - movs r3, 0x1 - bl box_print -_08167C46: - mov r2, r8 - cmp r2, 0 - beq _08167C84 - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - movs r0, 0x1 - movs r1, 0x3 - bl CopyWindowToVram - b _08167C94 - .pool -_08167C84: - movs r0, 0 - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0x1 - movs r1, 0x2 - bl CopyWindowToVram -_08167C94: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8167BA0 - - thumb_func_start sub_8167CA0 -sub_8167CA0: @ 8167CA0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0 - beq _08167CC0 - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r1, =0x00007fb5 - adds r0, r1 - b _08167CC8 - .pool -_08167CC0: - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r2, =0x00007fb4 - adds r0, r2 -_08167CC8: - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r5, =gUnknown_0203BCAC - ldr r2, [r5] - ldr r3, =0x00007c58 - adds r0, r2, r3 - ldr r4, =0x00007fb3 - adds r1, r2, r4 - movs r3, 0 - ldrsb r3, [r1, r3] - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 2 - ldr r4, =0x00007c6c - adds r1, r4 - adds r1, r2, r1 - lsls r3, r6, 2 - adds r3, r6 - lsls r3, 2 - adds r3, r4 - adds r2, r3 - bl sub_81D1F84 - ldr r4, [r5] - ldr r1, =0x00008041 - adds r0, r4, r1 - ldrb r1, [r0] - ldr r2, =0x00008040 - mov r12, r2 - adds r0, r4, r2 - ldrb r0, [r0] - subs r0, 0x1 - eors r1, r0 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - mov r8, r0 - cmp r7, 0 - beq _08167D98 - ldr r3, =0x00007fb4 - adds r0, r4, r3 - ldrb r1, [r0] - subs r2, 0x8B - adds r0, r4, r2 - strb r1, [r0] - ldr r0, [r5] - ldr r4, =0x00007fb3 - adds r1, r0, r4 - ldrb r1, [r1] - adds r0, r3 - strb r1, [r0] - ldr r0, [r5] - adds r0, r4 - strb r6, [r0] - ldr r0, [r5] - adds r2, r0, r2 - ldrb r1, [r2] - ldr r2, =0x00007fb6 - adds r0, r2 - strb r1, [r0] - ldr r1, [r5] - adds r3, 0x8D - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, 0 - bne _08167D58 - mov r4, r12 - adds r0, r1, r4 - ldrb r0, [r0] -_08167D58: - subs r2, r0, 0x1 - ldr r0, =0x00008041 - adds r1, r0 - strb r2, [r1] - ldr r1, =gUnknown_0203BCAC - ldr r3, [r1] - adds r0, r3, r0 - ldrb r0, [r0] - adds r6, r1, 0 - cmp r0, 0 - bne _08167D74 - ldr r1, =0x00008040 - adds r0, r3, r1 - ldrb r0, [r0] -_08167D74: - subs r1, r0, 0x1 - b _08167E1E - .pool -_08167D98: - ldr r3, =0x00007fb5 - adds r0, r4, r3 - ldrb r1, [r0] - ldr r2, =0x00007fb4 - adds r0, r4, r2 - strb r1, [r0] - ldr r0, [r5] - ldr r4, =0x00007fb3 - adds r1, r0, r4 - ldrb r1, [r1] - adds r0, r3 - strb r1, [r0] - ldr r0, [r5] - adds r0, r4 - strb r6, [r0] - ldr r0, [r5] - adds r2, r0, r2 - ldrb r1, [r2] - ldr r2, =0x00007fb6 - adds r0, r2 - strb r1, [r0] - ldr r2, [r5] - adds r3, 0x8C - adds r0, r2, r3 - ldrb r1, [r0] - adds r4, 0x8D - adds r0, r2, r4 - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - bge _08167DEC - adds r3, r1, 0x1 - b _08167DEE - .pool -_08167DEC: - movs r3, 0 -_08167DEE: - ldr r1, =0x00008041 - adds r0, r2, r1 - strb r3, [r0] - ldr r2, =gUnknown_0203BCAC - ldr r3, [r2] - adds r1, r3, r1 - ldrb r1, [r1] - ldr r4, =0x00008040 - adds r0, r3, r4 - ldrb r0, [r0] - subs r0, 0x1 - adds r6, r2, 0 - cmp r1, r0 - bge _08167E1C - adds r1, 0x1 - b _08167E1E - .pool -_08167E1C: - movs r1, 0 -_08167E1E: - ldr r2, =0x00007b4c - adds r0, r3, r2 - strb r1, [r0] - adds r5, r6, 0 - ldr r0, [r5] - ldr r3, =0x00008041 - adds r1, r0, r3 - ldrb r2, [r1] - ldr r4, =0x00008040 - adds r1, r0, r4 - ldrb r1, [r1] - subs r1, 0x1 - eors r2, r1 - negs r1, r2 - orrs r1, r2 - lsrs r4, r1, 31 - ldr r1, =0x00007b1c - adds r0, r1 - bl sub_81D3520 - mov r2, r8 - cmp r2, 0 - bne _08167E70 - ldr r0, [r5] - ldr r3, =0x00008044 - adds r0, r3 - ldr r1, =sub_8167EA4 - b _08167E90 - .pool -_08167E70: - cmp r4, 0 - bne _08167E88 - ldr r0, [r5] - ldr r4, =0x00008044 - adds r0, r4 - ldr r1, =sub_8167FA4 - b _08167E90 - .pool -_08167E88: - ldr r0, [r6] - ldr r1, =0x00008044 - adds r0, r1 - ldr r1, =sub_8168048 -_08167E90: - str r1, [r0] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8167CA0 - - thumb_func_start sub_8167EA4 -sub_8167EA4: @ 8167EA4 - push {r4-r6,lr} - ldr r4, =gUnknown_0203BCAC - ldr r1, [r4] - ldr r5, =0x00008048 - adds r0, r1, r5 - ldrb r0, [r0] - cmp r0, 0x1 - beq _08167EE4 - cmp r0, 0x1 - bgt _08167EC8 - cmp r0, 0 - beq _08167ED2 - b _08167F9C - .pool -_08167EC8: - cmp r0, 0x2 - beq _08167F08 - cmp r0, 0x3 - beq _08167F48 - b _08167F9C -_08167ED2: - ldr r2, =0x00007fb3 - adds r0, r1, r2 - ldrb r0, [r0] - bl sub_8167608 - b _08167F2C - .pool -_08167EE4: - ldr r6, =0x00007fb3 - adds r0, r1, r6 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0 - bl sub_8167BA0 - ldr r1, [r4] - ldr r0, =0x00008048 - adds r1, r0 - b _08167F30 - .pool -_08167F08: - ldr r2, =0x00007c58 - adds r0, r1, r2 - ldr r6, =0x00007b0e - adds r1, r6 - bl sub_81D3178 - lsls r0, 24 - cmp r0, 0 - bne _08167F9C - ldr r1, [r4] - ldr r2, =0x00007b4c - adds r0, r1, r2 - ldrb r0, [r0] - ldr r6, =0x00007fb6 - adds r1, r6 - ldrb r1, [r1] - bl sub_816753C -_08167F2C: - ldr r1, [r4] - adds r1, r5 -_08167F30: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08167F9C - .pool -_08167F48: - ldr r2, =0x00007b1c - adds r0, r1, r2 - bl sub_81D3464 - ldr r3, [r4] - ldr r6, =0x00008041 - adds r0, r3, r6 - ldrb r1, [r0] - ldr r2, =0x00008040 - adds r0, r3, r2 - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - beq _08167F82 - subs r6, 0x8E - adds r0, r3, r6 - movs r1, 0 - ldrsb r1, [r0, r1] - subs r2, 0x90 - adds r0, r3, r2 - adds r0, r1 - ldrb r2, [r0] - ldr r6, =0x00007b1c - adds r0, r3, r6 - subs r6, 0xC - adds r1, r3, r6 - ldrb r1, [r1] - bl sub_81D3480 -_08167F82: - ldr r0, [r4] - adds r0, r5 - movs r1, 0 - strb r1, [r0] - movs r0, 0 - b _08167F9E - .pool -_08167F9C: - movs r0, 0x1 -_08167F9E: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8167EA4 - - thumb_func_start sub_8167FA4 -sub_8167FA4: @ 8167FA4 - push {r4,r5,lr} - ldr r4, =gUnknown_0203BCAC - ldr r1, [r4] - ldr r5, =0x00008048 - adds r2, r1, r5 - ldrb r0, [r2] - cmp r0, 0x1 - beq _08167FF0 - cmp r0, 0x1 - bgt _08167FC8 - cmp r0, 0 - beq _08167FD2 - b _0816803E - .pool -_08167FC8: - cmp r0, 0x2 - beq _08168014 - cmp r0, 0x3 - beq _08168038 - b _0816803E -_08167FD2: - ldr r2, =0x00007c58 - adds r0, r1, r2 - ldr r2, =0x00007b0e - adds r1, r2 - bl sub_81D31A4 - lsls r0, 24 - cmp r0, 0 - bne _0816803E - b _08168024 - .pool -_08167FF0: - ldr r2, =0x00007fb3 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0 - bl sub_8167BA0 - ldr r1, [r4] - ldr r0, =0x00008048 - adds r1, r0 - b _08168028 - .pool -_08168014: - ldr r2, =0x00007b4c - adds r0, r1, r2 - ldrb r0, [r0] - ldr r2, =0x00007fb6 - adds r1, r2 - ldrb r1, [r1] - bl sub_816753C -_08168024: - ldr r1, [r4] - adds r1, r5 -_08168028: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0816803E - .pool -_08168038: - movs r0, 0 - strb r0, [r2] - b _08168040 -_0816803E: - movs r0, 0x1 -_08168040: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8167FA4 - - thumb_func_start sub_8168048 -sub_8168048: @ 8168048 - push {r4-r6,lr} - ldr r4, =gUnknown_0203BCAC - ldr r1, [r4] - ldr r5, =0x00008048 - adds r0, r1, r5 - ldrb r0, [r0] - cmp r0, 0x1 - beq _081680A8 - cmp r0, 0x1 - bgt _0816806C - cmp r0, 0 - beq _08168076 - b _08168160 - .pool -_0816806C: - cmp r0, 0x2 - beq _081680CC - cmp r0, 0x3 - beq _0816810C - b _08168160 -_08168076: - ldr r2, =0x00007c58 - adds r0, r1, r2 - bl sub_81D2074 - ldr r0, [r4] - ldr r6, =0x00007b0e - adds r0, r6 - bl sub_81D3150 - lsls r0, 24 - cmp r0, 0 - bne _08168160 - ldr r0, [r4] - ldr r1, =0x00007fb3 - adds r0, r1 - ldrb r0, [r0] - bl sub_8167608 - b _081680F0 - .pool -_081680A8: - ldr r2, =0x00007fb3 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0 - bl sub_8167BA0 - ldr r1, [r4] - ldr r6, =0x00008048 - adds r1, r6 - b _081680F4 - .pool -_081680CC: - ldr r2, =0x00007c58 - adds r0, r1, r2 - ldr r6, =0x00007b0e - adds r1, r6 - bl sub_81D3178 - lsls r0, 24 - cmp r0, 0 - bne _08168160 - ldr r1, [r4] - ldr r2, =0x00007b4c - adds r0, r1, r2 - ldrb r0, [r0] - ldr r6, =0x00007fb6 - adds r1, r6 - ldrb r1, [r1] - bl sub_816753C -_081680F0: - ldr r1, [r4] - adds r1, r5 -_081680F4: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08168160 - .pool -_0816810C: - ldr r2, =0x00007b1c - adds r0, r1, r2 - bl sub_81D3464 - ldr r3, [r4] - ldr r6, =0x00008041 - adds r0, r3, r6 - ldrb r1, [r0] - ldr r2, =0x00008040 - adds r0, r3, r2 - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - beq _08168146 - subs r6, 0x8E - adds r0, r3, r6 - movs r1, 0 - ldrsb r1, [r0, r1] - subs r2, 0x90 - adds r0, r3, r2 - adds r0, r1 - ldrb r2, [r0] - ldr r6, =0x00007b1c - adds r0, r3, r6 - subs r6, 0xC - adds r1, r3, r6 - ldrb r1, [r1] - bl sub_81D3480 -_08168146: - ldr r0, [r4] - adds r0, r5 - movs r1, 0 - strb r1, [r0] - movs r0, 0 - b _08168162 - .pool -_08168160: - movs r0, 0x1 -_08168162: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8168048 - - thumb_func_start sub_8168168 -sub_8168168: @ 8168168 - ldr r1, =gUnknown_0203BCAC - ldr r1, [r1] - ldr r2, =0x00007b0e - adds r1, r2 - ldrh r1, [r1] - adds r1, 0x26 - strh r1, [r0, 0x20] - bx lr - .pool - thumb_func_end sub_8168168 - - thumb_func_start sub_8168180 -sub_8168180: @ 8168180 - push {lr} - adds r2, r0, 0 - movs r0, 0x2E - ldrsh r1, [r2, r0] - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r3, =0x00008041 - adds r0, r3 - ldrb r0, [r0] - cmp r1, r0 - bne _081681A8 - adds r0, r2, 0 - movs r1, 0 - bl StartSpriteAnim - b _081681B0 - .pool -_081681A8: - adds r0, r2, 0 - movs r1, 0x1 - bl StartSpriteAnim -_081681B0: - pop {r0} - bx r0 - thumb_func_end sub_8168180 - - thumb_func_start sub_81681B4 -sub_81681B4: @ 81681B4 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r2, =0x00008041 - adds r1, r0, r2 - ldrb r1, [r1] - subs r2, 0x1 - adds r0, r2 - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - bne _081681DC - movs r0, 0x65 - b _081681DE - .pool -_081681DC: - movs r0, 0x66 -_081681DE: - bl IndexOfSpritePaletteTag - lsls r0, 4 - ldrb r2, [r4, 0x5] - movs r1, 0xF - ands r1, r2 - orrs r1, r0 - strb r1, [r4, 0x5] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81681B4 - - thumb_func_start sub_81681F4 -sub_81681F4: @ 81681F4 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x30 - bl GetMonData - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r3, =0x00007fb3 - adds r1, r0, r3 - ldrb r1, [r1] - lsls r1, 24 - asrs r1, 24 - subs r3, 0x3 - adds r0, r3 - adds r4, r0, r1 - cmp r2, 0xFF - beq _0816823C - adds r0, r2, 0 - movs r1, 0x1D - bl __udivsi3 - b _0816823E - .pool -_0816823C: - movs r0, 0x9 -_0816823E: - strb r0, [r4] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81681F4 - - thumb_func_start sub_8168248 -sub_8168248: @ 8168248 - push {lr} - sub sp, 0x10 - ldr r0, =gUnknown_085DFDB8 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp, 0x8] - str r1, [sp, 0xC] - ldr r0, =gUnknown_08DCCBB8 - str r0, [sp] - ldr r1, =0xffff0000 - ldr r0, [sp, 0x4] - ands r0, r1 - movs r1, 0x80 - lsls r1, 4 - orrs r0, r1 - ldr r1, =0x0000ffff - ands r0, r1 - adds r1, 0x1 - orrs r0, r1 - str r0, [sp, 0x4] - mov r0, sp - bl LoadCompressedObjectPic - add r0, sp, 0x8 - bl LoadSpritePalette - add sp, 0x10 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8168248 - - thumb_func_start sub_8168294 -sub_8168294: @ 8168294 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r1, =0x00007b44 - adds r7, r0, r1 - ldr r0, =gUnknown_085DFDA0 - mov r10, r0 - movs r6, 0 - movs r1, 0x40 - mov r9, r1 - movs r0, 0x60 - negs r0, r0 - mov r8, r0 -_081682B6: - mov r5, r9 - muls r5, r6 - mov r0, r8 - adds r1, r0, r5 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x11 - lsls r2, r0, 16 - mov r0, r10 - asrs r2, 16 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x40 - beq _081682FE - ldr r0, =gSprites - lsls r4, r1, 4 - adds r4, r1 - lsls r4, 2 - adds r4, r0 - movs r1, 0x8 - strh r1, [r4, 0x2E] - movs r0, 0x20 - orrs r5, r0 - strh r5, [r4, 0x30] - strh r6, [r4, 0x32] - lsls r1, r6, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartSpriteAnim - lsls r0, r6, 2 - adds r0, r7 - str r4, [r0] -_081682FE: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x1 - bls _081682B6 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8168294 - - thumb_func_start sub_8168328 -sub_8168328: @ 8168328 - push {r4,r5,lr} - ldr r4, =gUnknown_0203BCAC - ldr r0, [r4] - ldr r5, =0x00008048 - adds r0, r5 - ldrb r0, [r0] - cmp r0, 0 - beq _08168348 - cmp r0, 0x1 - beq _08168360 - b _0816836C - .pool -_08168348: - bl sub_8168248 - ldr r1, [r4] - ldr r0, =0x00008048 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - movs r0, 0x1 - b _0816836E - .pool -_08168360: - bl sub_8168294 - ldr r0, [r4] - adds r0, r5 - movs r1, 0 - strb r1, [r0] -_0816836C: - movs r0, 0 -_0816836E: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8168328 - - thumb_func_start sub_8168374 -sub_8168374: @ 8168374 - push {r4,lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x20] - ldrh r1, [r2, 0x2E] - adds r3, r0, r1 - strh r3, [r2, 0x20] - lsls r0, 16 - asrs r4, r0, 16 - movs r0, 0x30 - ldrsh r1, [r2, r0] - cmp r4, r1 - bgt _08168398 - lsls r0, r3, 16 - asrs r0, 16 - cmp r0, r1 - bge _081683A0 - cmp r4, r1 - blt _081683A8 -_08168398: - lsls r0, r3, 16 - asrs r0, 16 - cmp r0, r1 - bgt _081683A8 -_081683A0: - ldrh r0, [r2, 0x30] - strh r0, [r2, 0x20] - ldr r0, =SpriteCallbackDummy - str r0, [r2, 0x1C] -_081683A8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8168374 - .align 2, 0 @ Don't pad with nop. diff --git a/asm/berry_fix_program.s b/asm/berry_fix_program.s new file mode 100755 index 000000000..19ed0babd --- /dev/null +++ b/asm/berry_fix_program.s @@ -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. diff --git a/asm/contest_link_81D9DE4.s b/asm/contest_link_81D9DE4.s new file mode 100755 index 000000000..cec1c6e5d --- /dev/null +++ b/asm/contest_link_81D9DE4.s @@ -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. diff --git a/asm/weather.s b/asm/field_screen.s similarity index 73% rename from asm/weather.s rename to asm/field_screen.s index 6612fd66c..e30408654 100644 --- a/asm/weather.s +++ b/asm/field_screen.s @@ -7816,4 +7816,2694 @@ _080AEFF6: bx r0 thumb_func_end sub_80AEFDC + thumb_func_start palette_bg_faded_fill_white +palette_bg_faded_fill_white: @ 80AEFFC + push {lr} + sub sp, 0x4 + ldr r0, =0x7fff7fff + str r0, [sp] + ldr r1, =gPlttBufferFaded + ldr r2, =0x01000100 + mov r0, sp + bl CpuFastSet + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end palette_bg_faded_fill_white + + thumb_func_start palette_bg_faded_fill_black +palette_bg_faded_fill_black: @ 80AF020 + push {lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + ldr r1, =gPlttBufferFaded + ldr r2, =0x01000100 + mov r0, sp + bl CpuFastSet + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end palette_bg_faded_fill_black + + thumb_func_start pal_fill_for_maplights +pal_fill_for_maplights: @ 80AF040 + push {r4,lr} + bl get_map_light_from_warp0 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sav1_map_get_light_level + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl fade_type_for_given_maplight_pair + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _080AF06A + cmp r0, 0x1 + beq _080AF078 + b _080AF084 +_080AF06A: + bl palette_bg_faded_fill_black + movs r0, 0 + movs r1, 0 + bl fade_screen + b _080AF084 +_080AF078: + bl palette_bg_faded_fill_white + movs r0, 0x2 + movs r1, 0 + bl fade_screen +_080AF084: + pop {r4} + pop {r0} + bx r0 + thumb_func_end pal_fill_for_maplights + + thumb_func_start sub_80AF08C +sub_80AF08C: @ 80AF08C + push {lr} + bl palette_bg_faded_fill_white + movs r0, 0x2 + movs r1, 0x8 + bl fade_screen + pop {r0} + bx r0 + thumb_func_end sub_80AF08C + + thumb_func_start pal_fill_black +pal_fill_black: @ 80AF0A0 + push {lr} + bl palette_bg_faded_fill_black + movs r0, 0 + movs r1, 0 + bl fade_screen + pop {r0} + bx r0 + thumb_func_end pal_fill_black + + thumb_func_start sub_80AF0B4 +sub_80AF0B4: @ 80AF0B4 + push {r4,lr} + bl sav1_map_get_light_level + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl warp1_get_mapheader + ldrb r1, [r0, 0x17] + adds r0, r4, 0 + bl sub_8137360 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _080AF0DA + cmp r0, 0x1 + beq _080AF0E4 + b _080AF0EC +_080AF0DA: + movs r0, 0x1 + movs r1, 0 + bl fade_screen + b _080AF0EC +_080AF0E4: + movs r0, 0x3 + movs r1, 0 + bl fade_screen +_080AF0EC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80AF0B4 + + thumb_func_start sub_80AF0F4 +sub_80AF0F4: @ 80AF0F4 + push {lr} + lsls r0, 24 + movs r1, 0 + cmp r0, 0 + bne _080AF100 + movs r1, 0x1 +_080AF100: + adds r0, r1, 0 + bl sub_808C0A8 + pop {r0} + bx r0 + thumb_func_end sub_80AF0F4 + + thumb_func_start task0A_nop_for_a_while +task0A_nop_for_a_while: @ 80AF10C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80AF71C + cmp r0, 0x1 + bne _080AF120 + adds r0, r4, 0 + bl DestroyTask +_080AF120: + pop {r4} + pop {r0} + bx r0 + thumb_func_end task0A_nop_for_a_while + + thumb_func_start sub_80AF128 +sub_80AF128: @ 80AF128 + push {lr} + bl ScriptContext2_Enable + bl sub_8085784 + bl pal_fill_black + ldr r0, =task0A_nop_for_a_while + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF128 + + thumb_func_start task0A_asap_script_env_2_enable_and_set_ctx_running +task0A_asap_script_env_2_enable_and_set_ctx_running: @ 80AF148 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80AF71C + cmp r0, 0x1 + bne _080AF160 + adds r0, r4, 0 + bl DestroyTask + bl EnableBothScriptContexts +_080AF160: + pop {r4} + pop {r0} + bx r0 + thumb_func_end task0A_asap_script_env_2_enable_and_set_ctx_running + + thumb_func_start sub_80AF168 +sub_80AF168: @ 80AF168 + push {lr} + bl ScriptContext2_Enable + bl sub_8085784 + bl pal_fill_black + ldr r0, =task0A_asap_script_env_2_enable_and_set_ctx_running + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF168 + + thumb_func_start sub_80AF188 +sub_80AF188: @ 80AF188 + push {lr} + bl ScriptContext2_Enable + bl pal_fill_black + ldr r0, =task0A_asap_script_env_2_enable_and_set_ctx_running + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF188 + + thumb_func_start task_mpl_807DD60 +task_mpl_807DD60: @ 80AF1A4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r2, =gTasks + adds r4, r0, r2 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080AF1DE + cmp r0, 0x1 + bgt _080AF1CC + cmp r0, 0 + beq _080AF1D2 + b _080AF20E + .pool +_080AF1CC: + cmp r0, 0x2 + beq _080AF1FC + b _080AF20E +_080AF1D2: + bl sub_80B3050 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0xA] + b _080AF1F4 +_080AF1DE: + movs r1, 0xA + ldrsh r0, [r4, r1] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrb r0, [r1, 0x4] + cmp r0, 0x1 + beq _080AF20E + bl pal_fill_for_maplights +_080AF1F4: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080AF20E +_080AF1FC: + bl sub_80AF71C + cmp r0, 0x1 + bne _080AF20E + bl ScriptContext2_Disable + adds r0, r5, 0 + bl DestroyTask +_080AF20E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end task_mpl_807DD60 + + thumb_func_start sub_80AF214 +sub_80AF214: @ 80AF214 + push {lr} + bl ScriptContext2_Enable + bl sub_8085784 + bl palette_bg_faded_fill_black + ldr r0, =task_mpl_807DD60 + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF214 + + thumb_func_start sub_80AF234 +sub_80AF234: @ 80AF234 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080AF268 + cmp r0, 0x1 + bgt _080AF25C + cmp r0, 0 + beq _080AF262 + b _080AF2AE + .pool +_080AF25C: + cmp r0, 0x2 + beq _080AF298 + b _080AF2AE +_080AF262: + bl sub_800ADF8 + b _080AF290 +_080AF268: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _080AF28C + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + movs r1, 0xE1 + lsls r1, 19 + cmp r0, r1 + ble _080AF2AE + movs r0, 0xC0 + lsls r0, 7 + bl sub_8011170 + b _080AF2AE +_080AF28C: + bl pal_fill_for_maplights +_080AF290: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080AF2AE +_080AF298: + bl sub_80AF71C + cmp r0, 0x1 + bne _080AF2AE + bl sub_8009F18 + bl ScriptContext2_Disable + adds r0, r5, 0 + bl DestroyTask +_080AF2AE: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80AF234 + + thumb_func_start sub_80AF2B4 +sub_80AF2B4: @ 80AF2B4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080AF2E8 + cmp r0, 0x1 + bgt _080AF2DC + cmp r0, 0 + beq _080AF2E2 + b _080AF30C + .pool +_080AF2DC: + cmp r0, 0x2 + beq _080AF2FA + b _080AF30C +_080AF2E2: + bl sub_800ADF8 + b _080AF2F2 +_080AF2E8: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080AF30C +_080AF2F2: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080AF30C +_080AF2FA: + bl sub_8009F18 + bl sub_8086C2C + bl ScriptContext2_Disable + adds r0, r5, 0 + bl DestroyTask +_080AF30C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80AF2B4 + + thumb_func_start sub_80AF314 +sub_80AF314: @ 80AF314 + push {lr} + bl ScriptContext2_Enable + bl sub_8085784 + bl palette_bg_faded_fill_black + ldr r0, =sub_80AF234 + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF314 + + thumb_func_start sub_80AF334 +sub_80AF334: @ 80AF334 + push {r4,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl PlayerGetDestCoords + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_8088EFC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080AF36C + ldr r1, =sub_80AF438 + b _080AF37E + .pool +_080AF36C: + adds r0, r4, 0 + bl sub_8088F58 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =task_map_chg_seq_0807E2CC + cmp r0, 0x1 + bne _080AF37E + ldr r1, =task_map_chg_seq_0807E20C +_080AF37E: + adds r0, r1, 0 + movs r1, 0xA + bl CreateTask + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF334 + + thumb_func_start mapldr_default +mapldr_default: @ 80AF398 + push {lr} + bl sub_8085784 + bl pal_fill_for_maplights + bl sub_80AF334 + bl ScriptContext2_Enable + pop {r0} + bx r0 + thumb_func_end mapldr_default + + thumb_func_start sub_80AF3B0 +sub_80AF3B0: @ 80AF3B0 + push {lr} + bl sub_8085784 + bl sub_80AF08C + bl sub_80AF334 + bl ScriptContext2_Enable + pop {r0} + bx r0 + thumb_func_end sub_80AF3B0 + + thumb_func_start sub_80AF3C8 +sub_80AF3C8: @ 80AF3C8 + push {lr} + bl sub_81D6534 + cmp r0, 0 + bne _080AF3D6 + bl sub_8085784 +_080AF3D6: + bl pal_fill_black + bl sub_80AF334 + bl ScriptContext2_Enable + pop {r0} + bx r0 + thumb_func_end sub_80AF3C8 + + thumb_func_start sub_80AF3E8 +sub_80AF3E8: @ 80AF3E8 + push {lr} + bl sub_8085784 + bl pal_fill_for_maplights + movs r0, 0x2E + bl PlaySE + ldr r0, =task0A_mpl_807E31C + movs r1, 0xA + bl CreateTask + bl ScriptContext2_Enable + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF3E8 + + thumb_func_start sub_80AF40C +sub_80AF40C: @ 80AF40C + push {lr} + bl sub_8085784 + bl pal_fill_for_maplights + movs r0, 0x2E + bl PlaySE + ldr r0, =task_map_chg_seq_0807E2CC + movs r1, 0xA + bl CreateTask + bl ScriptContext2_Enable + movs r0, 0xE + bl sub_8085540 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF40C + + thumb_func_start sub_80AF438 +sub_80AF438: @ 80AF438 + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =gTasks + adds r5, r0, r1 + adds r6, r5, 0 + adds r6, 0xC + adds r7, r5, 0 + adds r7, 0xE + movs r2, 0x8 + ldrsh r0, [r5, r2] + adds r2, r1, 0 + cmp r0, 0x4 + bhi _080AF54A + lsls r0, 2 + ldr r1, =_080AF46C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080AF46C: + .4byte _080AF480 + .4byte _080AF4A4 + .4byte _080AF4DC + .4byte _080AF520 + .4byte _080AF540 +_080AF480: + movs r0, 0 + bl sub_80AF0F4 + bl player_bitmagic + adds r0, r6, 0 + adds r1, r7, 0 + bl PlayerGetDestCoords + movs r1, 0 + ldrsh r0, [r6, r1] + movs r2, 0 + ldrsh r1, [r7, r2] + bl sub_808A854 + movs r0, 0x1 + strh r0, [r5, 0x8] + b _080AF54A +_080AF4A4: + bl sub_80AF71C + cmp r0, 0 + beq _080AF54A + movs r0, 0x1 + bl sub_80AF0F4 + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + bl GetFieldObjectIdByLocalIdAndMap + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gMapObjects + adds r0, r1 + movs r1, 0x8 + bl FieldObjectSetSpecialAnim + movs r0, 0x2 + strh r0, [r5, 0x8] + b _080AF54A + .pool +_080AF4DC: + bl walkrun_is_standing_still + lsls r0, 24 + cmp r0, 0 + beq _080AF54A + movs r1, 0 + ldrsh r0, [r6, r1] + movs r2, 0 + ldrsh r1, [r7, r2] + bl sub_808A8AC + lsls r0, 24 + asrs r0, 24 + strh r0, [r5, 0xA] + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + bl GetFieldObjectIdByLocalIdAndMap + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gMapObjects + adds r0, r1 + bl FieldObjectClearAnimIfSpecialAnimFinished + movs r0, 0x3 + strh r0, [r5, 0x8] + b _080AF54A + .pool +_080AF520: + movs r1, 0xA + ldrsh r0, [r5, r1] + cmp r0, 0 + blt _080AF536 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrb r0, [r1, 0x4] + cmp r0, 0x1 + beq _080AF54A +_080AF536: + bl sub_809757C + movs r0, 0x4 + strh r0, [r5, 0x8] + b _080AF54A +_080AF540: + bl ScriptContext2_Disable + adds r0, r4, 0 + bl DestroyTask +_080AF54A: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80AF438 + + thumb_func_start task_map_chg_seq_0807E20C +task_map_chg_seq_0807E20C: @ 80AF550 + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =gTasks + adds r5, r0, r1 + adds r6, r5, 0 + adds r6, 0xC + adds r7, r5, 0 + adds r7, 0xE + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _080AF5A2 + cmp r0, 0x1 + bgt _080AF580 + cmp r0, 0 + beq _080AF58A + b _080AF60A + .pool +_080AF580: + cmp r0, 0x2 + beq _080AF5EC + cmp r0, 0x3 + beq _080AF600 + b _080AF60A +_080AF58A: + movs r0, 0 + bl sub_80AF0F4 + bl player_bitmagic + adds r0, r6, 0 + adds r1, r7, 0 + bl PlayerGetDestCoords + movs r0, 0x1 + strh r0, [r5, 0x8] + b _080AF60A +_080AF5A2: + bl sub_80AF71C + cmp r0, 0 + beq _080AF60A + movs r0, 0x1 + bl sub_80AF0F4 + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + bl GetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =gMapObjects + adds r4, r0 + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + bl GetGoSpeed0AnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetSpecialAnim + movs r0, 0x2 + strh r0, [r5, 0x8] + b _080AF60A + .pool +_080AF5EC: + bl walkrun_is_standing_still + lsls r0, 24 + cmp r0, 0 + beq _080AF60A + bl sub_809757C + movs r0, 0x3 + strh r0, [r5, 0x8] + b _080AF60A +_080AF600: + bl ScriptContext2_Disable + adds r0, r4, 0 + bl DestroyTask +_080AF60A: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end task_map_chg_seq_0807E20C + + thumb_func_start task_map_chg_seq_0807E2CC +task_map_chg_seq_0807E2CC: @ 80AF610 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080AF634 + cmp r0, 0x1 + beq _080AF644 + b _080AF65A + .pool +_080AF634: + bl player_bitmagic + bl ScriptContext2_Enable + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080AF65A +_080AF644: + bl sub_80AF71C + cmp r0, 0 + beq _080AF65A + bl sub_809757C + bl ScriptContext2_Disable + adds r0, r5, 0 + bl DestroyTask +_080AF65A: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end task_map_chg_seq_0807E2CC + + thumb_func_start sub_80AF660 +sub_80AF660: @ 80AF660 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80AF71C + cmp r0, 0x1 + bne _080AF67C + adds r0, r4, 0 + bl DestroyTask + ldr r0, =sub_809FA34 + movs r1, 0x50 + bl CreateTask +_080AF67C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF660 + + thumb_func_start sub_80AF688 +sub_80AF688: @ 80AF688 + push {lr} + bl pal_fill_black + ldr r0, =sub_80AF660 + movs r1, 0x50 + bl CreateTask + bl ScriptContext2_Enable + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF688 + + thumb_func_start sub_80AF6A4 +sub_80AF6A4: @ 80AF6A4 + push {lr} + bl sub_809FA18 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_80AF6A4 + + thumb_func_start task_mpl_807E3C8 +task_mpl_807E3C8: @ 80AF6B0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80AF71C + cmp r0, 0x1 + bne _080AF6CC + bl ScriptContext2_Disable + adds r0, r4, 0 + bl DestroyTask + bl sub_80984F4 +_080AF6CC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end task_mpl_807E3C8 + + thumb_func_start sub_80AF6D4 +sub_80AF6D4: @ 80AF6D4 + push {lr} + bl ScriptContext2_Enable + bl pal_fill_black + ldr r0, =task_mpl_807E3C8 + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF6D4 + + thumb_func_start sub_80AF6F0 +sub_80AF6F0: @ 80AF6F0 + push {lr} + bl ScriptContext2_Enable + bl sub_8085784 + bl pal_fill_black + ldr r0, =task_mpl_807E3C8 + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF6F0 + + thumb_func_start sub_80AF710 +sub_80AF710: @ 80AF710 + ldr r0, =gPaletteFade + ldrb r0, [r0, 0x7] + lsrs r0, 7 + bx lr + .pool + thumb_func_end sub_80AF710 + + thumb_func_start sub_80AF71C +sub_80AF71C: @ 80AF71C + push {lr} + bl sub_80ABDFC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080AF72E + movs r0, 0 + b _080AF730 +_080AF72E: + movs r0, 0x1 +_080AF730: + pop {r1} + bx r1 + thumb_func_end sub_80AF71C + + thumb_func_start sub_80AF734 +sub_80AF734: @ 80AF734 + push {lr} + bl ScriptContext2_Enable + bl music_something + bl sub_80AF0B4 + bl play_some_sound + movs r0, 0x9 + bl PlaySE + ldr r0, =gUnknown_03005DAC + ldr r1, =mapldr_default + str r1, [r0] + ldr r0, =sub_80AFA0C + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF734 + + thumb_func_start sp13E_warp_to_last_warp +sp13E_warp_to_last_warp: @ 80AF76C + push {lr} + bl ScriptContext2_Enable + bl music_something + bl sub_80AF0B4 + bl play_some_sound + ldr r0, =gUnknown_03005DAC + ldr r1, =mapldr_default + str r1, [r0] + ldr r0, =sub_80AFA0C + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sp13E_warp_to_last_warp + + thumb_func_start sub_80AF79C +sub_80AF79C: @ 80AF79C + push {lr} + bl ScriptContext2_Enable + bl music_something + movs r0, 0x3 + movs r1, 0x8 + bl fade_screen + bl play_some_sound + ldr r0, =gUnknown_03005DAC + ldr r1, =sub_80AF3B0 + str r1, [r0] + ldr r0, =sub_80AFA0C + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF79C + + thumb_func_start sub_80AF7D0 +sub_80AF7D0: @ 80AF7D0 + push {lr} + bl ScriptContext2_Enable + ldr r0, =gUnknown_03005DAC + ldr r1, =mapldr_default + str r1, [r0] + ldr r0, =sub_80AFA88 + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF7D0 + + thumb_func_start sp13F_fall_to_last_warp +sp13F_fall_to_last_warp: @ 80AF7F4 + push {lr} + bl sp13E_warp_to_last_warp + ldr r1, =gUnknown_03005DAC + ldr r0, =sub_80B6B68 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sp13F_fall_to_last_warp + + thumb_func_start sub_80AF80C +sub_80AF80C: @ 80AF80C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl ScriptContext2_Enable + adds r0, r4, 0 + movs r1, 0xA + bl sub_80B6E4C + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80AF80C + + thumb_func_start sub_80AF828 +sub_80AF828: @ 80AF828 + push {lr} + bl ScriptContext2_Enable + movs r0, 0xA + bl sub_80B75D8 + pop {r0} + bx r0 + thumb_func_end sub_80AF828 + + thumb_func_start sub_80AF838 +sub_80AF838: @ 80AF838 + push {lr} + bl ScriptContext2_Enable + movs r0, 0xA + bl sub_80B7A74 + pop {r0} + bx r0 + thumb_func_end sub_80AF838 + + thumb_func_start sub_80AF848 +sub_80AF848: @ 80AF848 + push {lr} + bl ScriptContext2_Enable + bl music_something + bl sub_80AF0B4 + movs r0, 0x2D + bl PlaySE + ldr r0, =sub_80AFA0C + movs r1, 0xA + bl CreateTask + ldr r1, =gUnknown_03005DAC + ldr r0, =sub_80AF3E8 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF848 + + thumb_func_start sub_80AF87C +sub_80AF87C: @ 80AF87C + push {lr} + movs r0, 0x1 + bl sub_8085540 + bl ScriptContext2_Enable + bl save_serialize_npcs + bl music_something + bl sub_80AF0B4 + movs r0, 0x2D + bl PlaySE + ldr r0, =sub_80AFA0C + movs r1, 0xA + bl CreateTask + ldr r1, =gUnknown_03005DAC + ldr r0, =sub_80AF40C + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF87C + + thumb_func_start sub_80AF8B8 +sub_80AF8B8: @ 80AF8B8 + push {lr} + bl ScriptContext2_Enable + bl sub_80AF0B4 + ldr r0, =sub_80AFA0C + movs r1, 0xA + bl CreateTask + ldr r1, =gUnknown_03005DAC + ldr r0, =sub_80FB768 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF8B8 + + thumb_func_start sub_80AF8E0 +sub_80AF8E0: @ 80AF8E0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080AF914 + cmp r0, 0x1 + bgt _080AF908 + cmp r0, 0 + beq _080AF90E + b _080AF93E + .pool +_080AF908: + cmp r0, 0x2 + beq _080AF92E + b _080AF93E +_080AF90E: + bl ScriptContext2_Enable + b _080AF926 +_080AF914: + bl sub_80AF710 + cmp r0, 0 + bne _080AF93E + bl sub_80859A0 + lsls r0, 24 + cmp r0, 0 + beq _080AF93E +_080AF926: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080AF93E +_080AF92E: + bl warp_in + ldr r0, =sub_8086074 + bl SetMainCallback2 + adds r0, r5, 0 + bl DestroyTask +_080AF93E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF8E0 + + thumb_func_start sub_80AF948 +sub_80AF948: @ 80AF948 + push {lr} + bl ScriptContext2_Enable + bl music_something + bl sub_80AF0B4 + movs r0, 0x9 + bl PlaySE + ldr r0, =sub_80AF8E0 + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF948 + + thumb_func_start sub_80AF96C +sub_80AF96C: @ 80AF96C + 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 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080AF9B2 + cmp r0, 0x1 + bgt _080AF994 + cmp r0, 0 + beq _080AF99A + b _080AF9E8 + .pool +_080AF994: + cmp r0, 0x2 + beq _080AF9D0 + b _080AF9E8 +_080AF99A: + bl sub_8009FAC + movs r0, 0x1 + movs r1, 0 + bl fade_screen + bl music_something + movs r0, 0x9 + bl PlaySE + b _080AF9C8 +_080AF9B2: + bl sub_80AF710 + cmp r0, 0 + bne _080AF9E8 + bl sub_80859A0 + lsls r0, 24 + cmp r0, 0 + beq _080AF9E8 + bl sub_800AC34 +_080AF9C8: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _080AF9E8 +_080AF9D0: + ldr r0, =gUnknown_03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _080AF9E8 + bl warp_in + ldr r0, =c2_load_new_map + bl SetMainCallback2 + adds r0, r5, 0 + bl DestroyTask +_080AF9E8: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF96C + + thumb_func_start sub_80AF9F8 +sub_80AF9F8: @ 80AF9F8 + push {lr} + ldr r0, =sub_80AF96C + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF9F8 + + thumb_func_start sub_80AFA0C +sub_80AFA0C: @ 80AFA0C + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =gTasks + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r5, [r4, r0] + cmp r5, 0x1 + beq _080AFA44 + cmp r5, 0x1 + bgt _080AFA34 + cmp r5, 0 + beq _080AFA3A + b _080AFA7C + .pool +_080AFA34: + cmp r5, 0x2 + beq _080AFA6C + b _080AFA7C +_080AFA3A: + bl player_bitmagic + bl ScriptContext2_Enable + b _080AFA64 +_080AFA44: + bl sub_80AF710 + cmp r0, 0 + bne _080AFA7C + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080AFA5A + bl sub_81BE72C + strh r5, [r4, 0xA] +_080AFA5A: + bl sub_80859A0 + lsls r0, 24 + cmp r0, 0 + beq _080AFA7C +_080AFA64: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080AFA7C +_080AFA6C: + bl warp_in + ldr r0, =c2_load_new_map + bl SetMainCallback2 + adds r0, r6, 0 + bl DestroyTask +_080AFA7C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AFA0C + + thumb_func_start sub_80AFA88 +sub_80AFA88: @ 80AFA88 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + adds r5, r1, r0 + adds r4, r5, 0 + adds r4, 0xC + adds r6, r5, 0 + adds r6, 0xE + movs r2, 0x8 + ldrsh r1, [r5, r2] + adds r2, r0, 0 + cmp r1, 0x4 + bls _080AFAAC + b _080AFBE8 +_080AFAAC: + lsls r0, r1, 2 + ldr r1, =_080AFAC0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080AFAC0: + .4byte _080AFAD4 + .4byte _080AFB10 + .4byte _080AFB6C + .4byte _080AFBB8 + .4byte _080AFBD4 +_080AFAD4: + bl player_bitmagic + adds r0, r4, 0 + adds r1, r6, 0 + bl PlayerGetDestCoords + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0 + ldrsh r1, [r6, r2] + subs r1, 0x1 + bl cur_mapdata_get_door_sound_at + lsls r0, 16 + lsrs r0, 16 + bl PlaySE + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0 + ldrsh r1, [r6, r2] + subs r1, 0x1 + bl task_overworld_door_add_if_role_69_for_opening_door_at + lsls r0, 24 + asrs r0, 24 + strh r0, [r5, 0xA] + movs r0, 0x1 + strh r0, [r5, 0x8] + b _080AFBE8 +_080AFB10: + movs r1, 0xA + ldrsh r0, [r5, r1] + cmp r0, 0 + blt _080AFB26 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrb r0, [r1, 0x4] + cmp r0, 0x1 + beq _080AFBE8 +_080AFB26: + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + bl GetFieldObjectIdByLocalIdAndMap + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r4, =gMapObjects + adds r0, r4 + bl FieldObjectClearAnimIfSpecialAnimActive + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + bl GetFieldObjectIdByLocalIdAndMap + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x9 + bl FieldObjectSetSpecialAnim + movs r0, 0x2 + strh r0, [r5, 0x8] + b _080AFBE8 + .pool +_080AFB6C: + bl walkrun_is_standing_still + lsls r0, 24 + cmp r0, 0 + beq _080AFBE8 + movs r2, 0 + ldrsh r0, [r4, r2] + movs r2, 0 + ldrsh r1, [r6, r2] + subs r1, 0x1 + bl sub_808A8AC + lsls r0, 24 + asrs r0, 24 + strh r0, [r5, 0xA] + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + bl GetFieldObjectIdByLocalIdAndMap + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gMapObjects + adds r0, r1 + bl FieldObjectClearAnimIfSpecialAnimFinished + movs r0, 0 + bl sub_80AF0F4 + movs r0, 0x3 + strh r0, [r5, 0x8] + b _080AFBE8 + .pool +_080AFBB8: + movs r1, 0xA + ldrsh r0, [r5, r1] + cmp r0, 0 + blt _080AFBCE + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrb r0, [r1, 0x4] + cmp r0, 0x1 + beq _080AFBE8 +_080AFBCE: + movs r0, 0x4 + strh r0, [r5, 0x8] + b _080AFBE8 +_080AFBD4: + bl music_something + bl sub_80AF0B4 + bl play_some_sound + movs r0, 0 + strh r0, [r5, 0x8] + ldr r0, =sub_80AFA0C + str r0, [r5] +_080AFBE8: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AFA88 + + thumb_func_start task0A_fade_n_map_maybe +task0A_fade_n_map_maybe: @ 80AFBF4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080AFC2C + cmp r0, 0x1 + bgt _080AFC1C + cmp r0, 0 + beq _080AFC22 + b _080AFC56 + .pool +_080AFC1C: + cmp r0, 0x2 + beq _080AFC46 + b _080AFC56 +_080AFC22: + bl player_bitmagic + bl ScriptContext2_Enable + b _080AFC3E +_080AFC2C: + bl sub_80AF710 + cmp r0, 0 + bne _080AFC56 + bl sub_80859A0 + lsls r0, 24 + cmp r0, 0 + beq _080AFC56 +_080AFC3E: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080AFC56 +_080AFC46: + bl warp_in + ldr r0, =sub_8086024 + bl SetMainCallback2 + adds r0, r5, 0 + bl DestroyTask +_080AFC56: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end task0A_fade_n_map_maybe + + thumb_func_start sub_80AFC60 +sub_80AFC60: @ 80AFC60 + push {lr} + bl ScriptContext2_Enable + bl music_something + bl sub_80AF0B4 + bl play_some_sound + movs r0, 0x9 + bl PlaySE + ldr r0, =gUnknown_03005DAC + ldr r1, =sub_80AF3C8 + str r1, [r0] + ldr r0, =task0A_fade_n_map_maybe + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AFC60 + + thumb_func_start sub_80AFC98 +sub_80AFC98: @ 80AFC98 + push {lr} + cmp r1, 0xA0 + bhi _080AFCC0 + cmp r2, 0 + bge _080AFCA4 + movs r2, 0 +_080AFCA4: + cmp r2, 0xFF + ble _080AFCAA + movs r2, 0xFF +_080AFCAA: + cmp r3, 0 + bge _080AFCB0 + movs r3, 0 +_080AFCB0: + cmp r3, 0xFF + ble _080AFCB6 + movs r3, 0xFF +_080AFCB6: + lsls r1, 1 + adds r1, r0 + lsls r0, r2, 8 + orrs r0, r3 + strh r0, [r1] +_080AFCC0: + pop {r0} + bx r0 + thumb_func_end sub_80AFC98 + + thumb_func_start sub_80AFCC4 +sub_80AFCC4: @ 80AFCC4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + str r0, [sp] + mov r10, r1 + mov r9, r2 + adds r6, r3, 0 + mov r8, r6 + movs r7, 0 + cmp r6, 0 + blt _080AFD40 +_080AFCE0: + mov r0, r9 + subs r1, r0, r7 + mov r0, r10 + subs r4, r0, r6 + adds r5, r0, r6 + ldr r0, [sp] + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_80AFC98 + mov r0, r9 + adds r1, r0, r7 + ldr r0, [sp] + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_80AFC98 + mov r0, r9 + subs r1, r0, r6 + mov r0, r10 + subs r4, r0, r7 + adds r5, r0, r7 + ldr r0, [sp] + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_80AFC98 + mov r0, r9 + adds r1, r0, r6 + ldr r0, [sp] + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_80AFC98 + mov r1, r8 + adds r1, 0x1 + lsls r0, r7, 1 + subs r1, r0 + mov r8, r1 + adds r7, 0x1 + cmp r1, 0 + bge _080AFD3C + subs r1, r6, 0x1 + lsls r0, r1, 1 + add r8, r0 + adds r6, r1, 0 +_080AFD3C: + cmp r6, r7 + bge _080AFCE0 +_080AFD40: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80AFCC4 + + thumb_func_start sub_80AFD50 +sub_80AFD50: @ 80AFD50 + push {lr} + cmp r1, 0xA0 + bhi _080AFD78 + cmp r2, 0 + bge _080AFD5C + movs r2, 0 +_080AFD5C: + cmp r2, 0xF0 + ble _080AFD62 + movs r2, 0xF0 +_080AFD62: + cmp r3, 0 + bge _080AFD68 + movs r3, 0 +_080AFD68: + cmp r3, 0xF0 + ble _080AFD6E + movs r3, 0xF0 +_080AFD6E: + lsls r1, 1 + adds r1, r0 + lsls r0, r2, 8 + orrs r0, r3 + strh r0, [r1] +_080AFD78: + pop {r0} + bx r0 + thumb_func_end sub_80AFD50 + + thumb_func_start sub_80AFD7C +sub_80AFD7C: @ 80AFD7C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + str r0, [sp] + mov r10, r1 + mov r9, r2 + adds r6, r3, 0 + mov r8, r6 + movs r7, 0 + cmp r6, 0 + blt _080AFDF8 +_080AFD98: + mov r0, r9 + subs r1, r0, r7 + mov r0, r10 + subs r4, r0, r6 + adds r5, r0, r6 + ldr r0, [sp] + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_80AFD50 + mov r0, r9 + adds r1, r0, r7 + ldr r0, [sp] + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_80AFD50 + mov r0, r9 + subs r1, r0, r6 + mov r0, r10 + subs r4, r0, r7 + adds r5, r0, r7 + ldr r0, [sp] + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_80AFD50 + mov r0, r9 + adds r1, r0, r6 + ldr r0, [sp] + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_80AFD50 + mov r1, r8 + adds r1, 0x1 + lsls r0, r7, 1 + subs r1, r0 + mov r8, r1 + adds r7, 0x1 + cmp r1, 0 + bge _080AFDF4 + subs r1, r6, 0x1 + lsls r0, r1, 1 + add r8, r0 + adds r6, r1, 0 +_080AFDF4: + cmp r6, r7 + bge _080AFD98 +_080AFDF8: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80AFD7C + + thumb_func_start sub_80AFE08 +sub_80AFE08: @ 80AFE08 + push {r4-r6,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 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080AFE64 + cmp r0, 0x1 + bgt _080AFE30 + cmp r0, 0 + beq _080AFE36 + b _080AFEC6 + .pool +_080AFE30: + cmp r0, 0x2 + beq _080AFEBC + b _080AFEC6 +_080AFE36: + ldr r0, =gUnknown_02039B28 + ldrb r1, [r0, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + ldr r1, =gUnknown_02038C28 + adds r0, r1 + movs r2, 0x2 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + movs r5, 0x6 + ldrsh r3, [r4, r5] + bl sub_80AFCC4 + movs r0, 0x1 + strh r0, [r4] + b _080AFEC6 + .pool +_080AFE64: + ldr r0, =gUnknown_02039B28 + ldrb r1, [r0, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + ldr r1, =gUnknown_02038C28 + adds r0, r1 + movs r6, 0x2 + ldrsh r1, [r4, r6] + movs r3, 0x4 + ldrsh r2, [r4, r3] + movs r6, 0x6 + ldrsh r3, [r4, r6] + bl sub_80AFCC4 + movs r0, 0 + strh r0, [r4] + ldrh r0, [r4, 0xA] + ldrh r1, [r4, 0x6] + adds r0, r1 + strh r0, [r4, 0x6] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x8 + ldrsh r1, [r4, r2] + cmp r0, r1 + ble _080AFEC6 + movs r3, 0xC + ldrsh r0, [r4, r3] + cmp r0, 0x1 + bne _080AFEB4 + bl remove_some_task + movs r0, 0x2 + strh r0, [r4] + b _080AFEC6 + .pool +_080AFEB4: + adds r0, r5, 0 + bl DestroyTask + b _080AFEC6 +_080AFEBC: + bl dp12_8087EA4 + adds r0, r5, 0 + bl DestroyTask +_080AFEC6: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80AFE08 + + thumb_func_start sub_80AFECC +sub_80AFECC: @ 80AFECC + push {r4-r6,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 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080AFF28 + cmp r0, 0x1 + bgt _080AFEF4 + cmp r0, 0 + beq _080AFEFA + b _080AFF8A + .pool +_080AFEF4: + cmp r0, 0x2 + beq _080AFF80 + b _080AFF8A +_080AFEFA: + ldr r0, =gUnknown_02039B28 + ldrb r1, [r0, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + ldr r1, =gUnknown_02038C28 + adds r0, r1 + movs r2, 0x2 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + movs r5, 0x6 + ldrsh r3, [r4, r5] + bl sub_80AFD7C + movs r0, 0x1 + strh r0, [r4] + b _080AFF8A + .pool +_080AFF28: + ldr r0, =gUnknown_02039B28 + ldrb r1, [r0, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + ldr r1, =gUnknown_02038C28 + adds r0, r1 + movs r6, 0x2 + ldrsh r1, [r4, r6] + movs r3, 0x4 + ldrsh r2, [r4, r3] + movs r6, 0x6 + ldrsh r3, [r4, r6] + bl sub_80AFD7C + movs r0, 0 + strh r0, [r4] + ldrh r0, [r4, 0xA] + ldrh r1, [r4, 0x6] + adds r0, r1 + strh r0, [r4, 0x6] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x8 + ldrsh r1, [r4, r2] + cmp r0, r1 + ble _080AFF8A + movs r3, 0xC + ldrsh r0, [r4, r3] + cmp r0, 0x1 + bne _080AFF78 + bl remove_some_task + movs r0, 0x2 + strh r0, [r4] + b _080AFF8A + .pool +_080AFF78: + adds r0, r5, 0 + bl DestroyTask + b _080AFF8A +_080AFF80: + bl dp12_8087EA4 + adds r0, r5, 0 + bl DestroyTask +_080AFF8A: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80AFECC + + thumb_func_start sub_80AFF90 +sub_80AFF90: @ 80AFF90 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =sub_80AFE08 + bl FuncIsActiveTask + lsls r0, 24 + cmp r0, 0 + bne _080AFFAC + bl EnableBothScriptContexts + adds r0, r4, 0 + bl DestroyTask +_080AFFAC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AFF90 + + thumb_func_start sub_80AFFB8 +sub_80AFFB8: @ 80AFFB8 + push {r4,lr} + ldr r4, =sub_80AFF90 + adds r0, r4, 0 + bl FuncIsActiveTask + lsls r0, 24 + cmp r0, 0 + bne _080AFFD0 + adds r0, r4, 0 + movs r1, 0x50 + bl CreateTask +_080AFFD0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AFFB8 + + thumb_func_start sub_80AFFDC +sub_80AFFDC: @ 80AFFDC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r8, r0 + mov r9, r1 + adds r5, r2, 0 + adds r4, r3, 0 + ldr r6, [sp, 0x1C] + ldr r0, [sp, 0x20] + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =sub_80AFE08 + movs r1, 0x50 + bl CreateTask + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r1, r0, r1 + strh r5, [r1, 0x6] + strh r4, [r1, 0x8] + mov r0, r8 + strh r0, [r1, 0x2] + mov r0, r9 + strh r0, [r1, 0x4] + strh r6, [r1, 0xC] + cmp r5, r4 + bge _080B0028 + strh r7, [r1, 0xA] + b _080B002C + .pool +_080B0028: + negs r0, r7 + strh r0, [r1, 0xA] +_080B002C: + adds r0, r2, 0 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80AFFDC + + thumb_func_start sub_80B003C +sub_80B003C: @ 80B003C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r8, r0 + mov r9, r1 + adds r5, r2, 0 + adds r4, r3, 0 + ldr r6, [sp, 0x1C] + ldr r0, [sp, 0x20] + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =sub_80AFECC + movs r1, 0x50 + bl CreateTask + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r1, r0, r1 + strh r5, [r1, 0x6] + strh r4, [r1, 0x8] + mov r0, r8 + strh r0, [r1, 0x2] + mov r0, r9 + strh r0, [r1, 0x4] + strh r6, [r1, 0xC] + cmp r5, r4 + bge _080B0088 + strh r7, [r1, 0xA] + b _080B008C + .pool +_080B0088: + negs r0, r7 + strh r0, [r1, 0xA] +_080B008C: + adds r0, r2, 0 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80B003C + + thumb_func_start sub_80B009C +sub_80B009C: @ 80B009C + push {r4,r5,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + bl sav1_get_flash_used_on_map + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + cmp r4, 0 + bne _080B00B6 + movs r5, 0x1 +_080B00B6: + ldr r1, =gUnknown_0854FE64 + lsls r0, 1 + adds r0, r1 + ldrh r2, [r0] + lsls r0, r4, 1 + adds r0, r1 + ldrh r3, [r0] + str r5, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r0, 0x78 + movs r1, 0x50 + bl sub_80AFFDC + bl sub_80AFFB8 + bl ScriptContext2_Enable + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B009C + + thumb_func_start sub_80B00E8 +sub_80B00E8: @ 80B00E8 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _080B0116 + ldr r4, =gUnknown_02038C28 + ldr r1, =gUnknown_0854FE64 + lsls r0, 1 + adds r0, r1 + ldrh r3, [r0] + adds r0, r4, 0 + movs r1, 0x78 + movs r2, 0x50 + bl sub_80AFCC4 + movs r0, 0xF0 + lsls r0, 3 + adds r1, r4, r0 + movs r2, 0xF0 + lsls r2, 1 + adds r0, r4, 0 + bl CpuFastSet +_080B0116: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B00E8 + + thumb_func_start door_upload_tiles +door_upload_tiles: @ 80B0124 + push {r4,lr} + ldr r4, =gUnknown_02038C28 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000e68 + adds r0, r1 + ldrb r3, [r0] + adds r0, r4, 0 + movs r1, 0x78 + movs r2, 0x50 + bl sub_80AFCC4 + movs r0, 0xF0 + lsls r0, 3 + adds r1, r4, r0 + movs r2, 0xF0 + lsls r2, 1 + adds r0, r4, 0 + bl CpuFastSet + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end door_upload_tiles + + thumb_func_start task0A_mpl_807E31C +task0A_mpl_807E31C: @ 80B0160 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080B0184 + cmp r0, 0x1 + beq _080B0198 + b _080B01B6 + .pool +_080B0184: + bl player_bitmagic + bl ScriptContext2_Enable + bl sub_808D194 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080B01B6 +_080B0198: + bl sub_80AF71C + cmp r0, 0 + beq _080B01B6 + bl sub_808D1B4 + cmp r0, 0x1 + beq _080B01B6 + bl sub_809757C + bl ScriptContext2_Disable + adds r0, r5, 0 + bl DestroyTask +_080B01B6: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end task0A_mpl_807E31C + + thumb_func_start sub_80B01BC +sub_80B01BC: @ 80B01BC + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080B0202 + cmp r0, 0x1 + bgt _080B01E4 + cmp r0, 0 + beq _080B01EE + b _080B023A + .pool +_080B01E4: + cmp r0, 0x2 + beq _080B0210 + cmp r0, 0x3 + beq _080B022A + b _080B023A +_080B01EE: + bl player_bitmagic + bl ScriptContext2_Enable + movs r0, 0x2D + bl PlaySE + bl sub_808D1C8 + b _080B0222 +_080B0202: + bl sub_808D1E8 + cmp r0, 0 + bne _080B023A + bl sub_80AF0B4 + b _080B0222 +_080B0210: + bl sub_80AF710 + cmp r0, 0 + bne _080B023A + bl sub_80859A0 + lsls r0, 24 + cmp r0, 0 + beq _080B023A +_080B0222: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080B023A +_080B022A: + bl warp_in + ldr r0, =c2_load_new_map + bl SetMainCallback2 + adds r0, r5, 0 + bl DestroyTask +_080B023A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B01BC + + thumb_func_start sub_80B0244 +sub_80B0244: @ 80B0244 + push {lr} + bl ScriptContext2_Enable + ldr r0, =sub_80AFA0C + movs r1, 0xA + bl CreateTask + ldr r1, =gUnknown_03005DAC + ldr r0, =sub_80AF3E8 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B0244 + + thumb_func_start sub_80B0268 +sub_80B0268: @ 80B0268 + push {lr} + bl ScriptContext2_Enable + ldr r0, =gUnknown_03005DAC + ldr r1, =mapldr_default + str r1, [r0] + ldr r0, =sub_80B01BC + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B0268 + + thumb_func_start sub_80B028C +sub_80B028C: @ 80B028C + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + cmp r0, 0 + bne _080B029A + movs r1, 0x1F + b _080B02A0 +_080B029A: + movs r0, 0xF8 + lsls r0, 7 + adds r1, r0, 0 +_080B02A0: + mov r0, sp + strh r1, [r0] + movs r5, 0 + movs r4, 0xF0 + lsls r4, 16 +_080B02AA: + lsrs r1, r4, 16 + mov r0, sp + movs r2, 0x2 + bl LoadPalette + movs r0, 0x80 + lsls r0, 9 + adds r4, r0 + adds r5, 0x1 + cmp r5, 0xF + ble _080B02AA + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80B028C + + thumb_func_start sub_80B02C8 +sub_80B02C8: @ 80B02C8 + push {r4,r5,lr} + lsls r0, 16 + ldr r2, =0x04000052 + ldrh r1, [r2] + lsls r1, 24 + lsrs r5, r1, 24 + ldrh r1, [r2] + lsrs r4, r1, 8 + cmp r0, 0 + beq _080B02EC + cmp r5, 0 + beq _080B02F6 + subs r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + b _080B02F6 + .pool +_080B02EC: + cmp r4, 0xF + bhi _080B02F6 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_080B02F6: + lsls r1, r4, 8 + orrs r1, r5 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + cmp r5, 0 + bne _080B0310 + cmp r4, 0x10 + bne _080B0310 + movs r0, 0x1 + b _080B0312 +_080B0310: + movs r0, 0 +_080B0312: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B02C8 + + thumb_func_start sub_80B0318 +sub_80B0318: @ 80B0318 + push {r4,r5,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r5, r0, r1 + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0x7 + bls _080B0334 + b _080B052C +_080B0334: + lsls r0, 2 + ldr r1, =_080B0348 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080B0348: + .4byte _080B0368 + .4byte _080B0424 + .4byte _080B0450 + .4byte _080B046C + .4byte _080B0482 + .4byte _080B04F2 + .4byte _080B04AC + .4byte _080B04BA +_080B0368: + movs r0, 0x80 + lsls r0, 19 + ldrh r0, [r0] + strh r0, [r5, 0xC] + ldr r0, =0x04000050 + ldrh r0, [r0] + strh r0, [r5, 0xE] + ldr r0, =0x04000052 + ldrh r0, [r0] + strh r0, [r5, 0x10] + ldr r0, =0x04000048 + ldrh r0, [r0] + strh r0, [r5, 0x12] + ldr r0, =0x0400004a + ldrh r0, [r0] + strh r0, [r5, 0x14] + movs r1, 0x80 + lsls r1, 7 + movs r0, 0 + bl ClearGpuRegBits + ldr r0, =gUnknown_82EC7CC + ldrh r1, [r0] + movs r0, 0x50 + bl SetGpuRegBits + ldr r1, =0x0000070c + movs r0, 0x52 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0x3F + bl SetGpuReg + movs r0, 0x4A + movs r1, 0x1E + bl SetGpuReg + movs r0, 0x14 + str r0, [sp] + movs r0, 0xF + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x1E + bl sub_8199C30 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r4, =gUnknown_02038C28 + movs r2, 0x4 + ldrsh r1, [r5, r2] + movs r0, 0x6 + ldrsh r2, [r5, r0] + adds r0, r4, 0 + movs r3, 0x1 + bl sub_80AFD7C + movs r2, 0xF0 + lsls r2, 3 + adds r1, r4, r2 + movs r2, 0xF0 + lsls r2, 1 + adds r0, r4, 0 + bl CpuFastSet + ldr r2, =gUnknown_0854FE7C + ldr r0, [r2] + ldr r1, [r2, 0x4] + ldr r2, [r2, 0x8] + bl sub_80BA038 + movs r0, 0x1 + strh r0, [r5] + b _080B052C + .pool +_080B0424: + movs r0, 0 + movs r1, 0x11 + movs r2, 0 + movs r3, 0x1 + bl sub_8199DF0 + ldrb r0, [r5, 0x2] + bl sub_80B028C + movs r1, 0x4 + ldrsh r0, [r5, r1] + movs r2, 0x6 + ldrsh r1, [r5, r2] + movs r2, 0x1 + str r2, [sp] + movs r4, 0x2 + str r4, [sp, 0x4] + movs r3, 0xA0 + bl sub_80B003C + strh r4, [r5] + b _080B052C +_080B0450: + ldr r0, =sub_80AFECC + bl FuncIsActiveTask + lsls r0, 24 + cmp r0, 0 + bne _080B052C + bl EnableBothScriptContexts + movs r0, 0x3 + strh r0, [r5] + b _080B052C + .pool +_080B046C: + bl InstallCameraPanAheadCallback + movs r0, 0 + bl SetCameraPanningCallback + movs r0, 0 + strh r0, [r5, 0xA] + movs r0, 0x4 + strh r0, [r5, 0x8] + strh r0, [r5] + b _080B052C +_080B0482: + ldrh r0, [r5, 0x8] + subs r0, 0x1 + strh r0, [r5, 0x8] + lsls r0, 16 + cmp r0, 0 + bne _080B052C + movs r0, 0x4 + strh r0, [r5, 0x8] + ldrh r0, [r5, 0xA] + movs r1, 0x1 + eors r0, r1 + strh r0, [r5, 0xA] + movs r1, 0x4 + negs r1, r1 + cmp r0, 0 + beq _080B04A4 + movs r1, 0x4 +_080B04A4: + movs r0, 0 + bl SetCameraPanning + b _080B052C +_080B04AC: + bl InstallCameraPanAheadCallback + movs r0, 0x8 + strh r0, [r5, 0x8] + movs r0, 0x7 + strh r0, [r5] + b _080B052C +_080B04BA: + ldrh r0, [r5, 0x8] + subs r0, 0x1 + strh r0, [r5, 0x8] + lsls r0, 16 + cmp r0, 0 + bne _080B052C + movs r0, 0x8 + strh r0, [r5, 0x8] + ldrh r0, [r5, 0xA] + movs r1, 0x1 + eors r0, r1 + strh r0, [r5, 0xA] + ldrh r0, [r5, 0xA] + bl sub_80B02C8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B052C + movs r0, 0x5 + strh r0, [r5] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_8199DF0 + b _080B052C +_080B04F2: + movs r0, 0x40 + movs r1, 0xFF + bl SetGpuReg + ldrh r1, [r5, 0xC] + movs r0, 0 + bl SetGpuReg + ldrh r1, [r5, 0xE] + movs r0, 0x50 + bl SetGpuReg + ldrh r1, [r5, 0x10] + movs r0, 0x52 + bl SetGpuReg + ldrh r1, [r5, 0x12] + movs r0, 0x48 + bl SetGpuReg + ldrh r1, [r5, 0x14] + movs r0, 0x4A + bl SetGpuReg + bl EnableBothScriptContexts + adds r0, r4, 0 + bl DestroyTask +_080B052C: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80B0318 + + thumb_func_start sub_80B0534 +sub_80B0534: @ 80B0534 + push {lr} + ldr r0, =sub_80B0318 + movs r1, 0x50 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r1, r0 + ldr r0, =gScriptResult + ldrh r0, [r0] + cmp r0, 0 + bne _080B0568 + strh r0, [r1, 0x2] + movs r0, 0x68 + b _080B0580 + .pool +_080B0568: + cmp r0, 0x1 + bne _080B0572 + strh r0, [r1, 0x2] + movs r0, 0x88 + b _080B0580 +_080B0572: + cmp r0, 0x2 + bne _080B057A + movs r0, 0 + b _080B057C +_080B057A: + movs r0, 0x1 +_080B057C: + strh r0, [r1, 0x2] + movs r0, 0x78 +_080B0580: + strh r0, [r1, 0x4] + movs r0, 0x50 + strh r0, [r1, 0x6] + pop {r0} + bx r0 + thumb_func_end sub_80B0534 + + thumb_func_start sub_80B058C +sub_80B058C: @ 80B058C + push {lr} + ldr r0, =sub_80B0318 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0x6 + strh r0, [r1, 0x8] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B058C + + thumb_func_start sub_80B05B4 +sub_80B05B4: @ 80B05B4 + push {lr} + bl sub_80859B0 + ldr r0, =task50_0807F0C8 + movs r1, 0x50 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B05B4 + + thumb_func_start task50_0807F0C8 +task50_0807F0C8: @ 80B05CC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80859A0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B05E8 + adds r0, r4, 0 + bl DestroyTask + bl EnableBothScriptContexts +_080B05E8: + pop {r4} + pop {r0} + bx r0 + thumb_func_end task50_0807F0C8 + .align 2, 0 @ Don't pad with nop. diff --git a/asm/fldeff_cut.s b/asm/fldeff_cut.s new file mode 100755 index 000000000..dc962ef61 --- /dev/null +++ b/asm/fldeff_cut.s @@ -0,0 +1,1486 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_80D3718 +sub_80D3718: @ 80D3718 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + movs r0, 0x52 + bl npc_before_player_of_type + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080D3754 + ldr r1, =gUnknown_03005DB0 + ldr r0, =hm_add_c3_launch_phase_2 + str r0, [r1] + ldr r1, =gUnknown_0203CEEC + ldr r0, =sub_80D3A9C + str r0, [r1] + movs r0, 0x1 + b _080D3A2C + .pool +_080D3754: + ldr r0, =gUnknown_0203AB40 + adds r1, r0, 0x2 + bl PlayerGetDestCoords + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + bl GetMonAbility + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0xC] + cmp r0, 0x34 + bne _080D3798 + ldr r1, =gUnknown_03001100 + movs r0, 0x5 + strb r0, [r1] + ldr r0, =gUnknown_03001101 + movs r1, 0x2 + b _080D37A2 + .pool +_080D3798: + ldr r1, =gUnknown_03001100 + movs r0, 0x3 + strb r0, [r1] + ldr r0, =gUnknown_03001101 + movs r1, 0x1 +_080D37A2: + strb r1, [r0] + ldr r0, =gUnknown_03001102 + strb r1, [r0] + movs r6, 0 + movs r1, 0 +_080D37AC: + mov r2, sp + adds r0, r2, r6 + strb r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x8 + bls _080D37AC + movs r6, 0 + ldr r2, =gUnknown_03001108 + movs r1, 0 +_080D37C2: + adds r0, r6, r2 + strb r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x18 + bls _080D37C2 + movs r3, 0 + str r3, [sp, 0x10] + movs r6, 0 +_080D37D6: + ldr r4, =0x0000ffff + adds r0, r6, r4 + ldr r1, =gUnknown_0203AB40 + ldrh r1, [r1, 0x2] + adds r0, r1 + movs r5, 0 + adds r2, r6, 0x1 + str r2, [sp, 0x18] + lsls r7, r6, 1 + lsls r0, 16 + str r0, [sp, 0x14] + asrs r0, 16 + mov r10, r0 + lsls r0, r6, 2 + adds r0, r6 + mov r9, r0 +_080D37F6: + ldr r3, =0x0000ffff + adds r0, r5, r3 + ldr r4, =gUnknown_0203AB40 + ldrh r4, [r4] + adds r0, r4 + lsls r0, 16 + lsrs r1, r0, 16 + mov r8, r1 + asrs r4, r0, 16 + adds r0, r4, 0 + mov r1, r10 + bl MapGridGetZCoordAt + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gUnknown_0203AB40 + movs r1, 0x4 + ldrsb r1, [r2, r1] + cmp r0, r1 + bne _080D38BC + adds r0, r4, 0 + mov r1, r10 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_8088E64 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080D3846 + adds r0, r4, 0 + bl MetatileBehavior_IsAsh + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080D3856 +_080D3846: + adds r0, r5, 0x6 + add r0, r9 + ldr r3, =gUnknown_03001108 + adds r0, r3 + movs r1, 0x1 + strb r1, [r0] + movs r0, 0x1 + str r0, [sp, 0x10] +_080D3856: + mov r1, r8 + lsls r0, r1, 16 + asrs r0, 16 + ldr r2, [sp, 0x14] + asrs r1, r2, 16 + bl MapGridIsImpassableAt + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080D3890 + adds r0, r7, r6 + adds r0, r5 + mov r3, sp + adds r1, r3, r0 + b _080D38C4 + .pool +_080D3890: + adds r0, r7, r6 + adds r0, r5 + mov r2, sp + adds r1, r2, r0 + movs r0, 0x1 + strb r0, [r1] + adds r0, r4, 0 + bl sub_80899F8 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1 + bne _080D38C8 + adds r0, r5, 0x6 + add r0, r9 + ldr r3, =gUnknown_03001108 + adds r0, r3 + strb r1, [r0] + b _080D38C8 + .pool +_080D38BC: + adds r0, r7, r6 + adds r0, r5 + mov r4, sp + adds r1, r4, r0 +_080D38C4: + movs r0, 0 + strb r0, [r1] +_080D38C8: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _080D37F6 + ldr r1, [sp, 0x18] + lsls r0, r1, 24 + lsrs r6, r0, 24 + cmp r6, 0x2 + bhi _080D38DE + b _080D37D6 +_080D38DE: + ldr r2, [sp, 0xC] + cmp r2, 0x34 + beq _080D38EE + ldr r3, [sp, 0x10] + cmp r3, 0x1 + beq _080D38EC + b _080D3A2A +_080D38EC: + b _080D3A1E +_080D38EE: + movs r6, 0 + ldr r4, =gUnknown_0203AB40 + mov r9, r4 + ldr r0, =gUnknown_0857C608 + mov r10, r0 +_080D38F8: + lsls r2, r6, 2 + mov r3, r10 + adds r1, r2, r3 + movs r0, 0 + ldrsb r0, [r1, r0] + mov r4, r9 + ldrh r4, [r4] + adds r0, r4 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + movs r0, 0x1 + ldrsb r0, [r1, r0] + mov r1, r9 + ldrh r1, [r1, 0x2] + adds r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 + movs r7, 0x1 + movs r5, 0 + ldr r3, =gUnknown_0857C60A + adds r0, r2, r3 + ldrb r0, [r0] + adds r6, 0x1 + str r6, [sp, 0x18] + adds r6, r2, 0 + cmp r0, 0 + beq _080D395A +_080D3930: + adds r1, r2, 0 + adds r0, r5, r2 + adds r0, r3 + ldrb r0, [r0] + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + add r0, sp + ldrb r0, [r0] + cmp r0, 0 + beq _080D39F4 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bhi _080D395A + adds r0, r5, r1 + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _080D3930 +_080D395A: + cmp r7, 0x1 + bne _080D3A0C + mov r1, r8 + lsls r0, r1, 16 + asrs r5, r0, 16 + lsls r0, r4, 16 + asrs r4, r0, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridGetZCoordAt + lsls r0, 24 + lsrs r0, 24 + mov r2, r9 + movs r1, 0x4 + ldrsb r1, [r2, r1] + cmp r0, r1 + bne _080D3A0C + mov r3, r10 + adds r2, r6, r3 + movs r1, 0x1 + ldrsb r1, [r2, r1] + lsls r0, r1, 2 + adds r0, r1 + adds r0, 0xC + ldrb r2, [r2] + adds r0, r2 + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_8088E64 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080D39BC + adds r0, r4, 0 + bl MetatileBehavior_IsAsh + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080D39F8 +_080D39BC: + ldr r1, =gUnknown_03005DB0 + ldr r0, =hm_add_c3_launch_phase_2 + str r0, [r1] + ldr r1, =gUnknown_0203CEEC + ldr r0, =hm2_ruin_valley + str r0, [r1] + ldr r0, =gUnknown_03001108 + adds r0, r6, r0 + strb r7, [r0] + movs r4, 0x1 + str r4, [sp, 0x10] + b _080D3A0C + .pool +_080D39F4: + movs r7, 0 + b _080D395A +_080D39F8: + adds r0, r4, 0 + bl sub_80899F8 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1 + bne _080D3A0C + ldr r0, =gUnknown_03001108 + adds r0, r6, r0 + strb r1, [r0] +_080D3A0C: + ldr r1, [sp, 0x18] + lsls r0, r1, 24 + lsrs r6, r0, 24 + cmp r6, 0xF + bhi _080D3A18 + b _080D38F8 +_080D3A18: + ldr r2, [sp, 0x10] + cmp r2, 0x1 + bne _080D3A2A +_080D3A1E: + ldr r1, =gUnknown_03005DB0 + ldr r0, =hm_add_c3_launch_phase_2 + str r0, [r1] + ldr r1, =gUnknown_0203CEEC + ldr r0, =hm2_ruin_valley + str r0, [r1] +_080D3A2A: + ldr r0, [sp, 0x10] +_080D3A2C: + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80D3718 + + thumb_func_start hm2_ruin_valley +hm2_ruin_valley: @ 80D3A50 + push {lr} + movs r0, 0x1 + bl FieldEffectStart + bl brm_get_pokemon_selection + ldr r1, =gUnknown_02038C08 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end hm2_ruin_valley + + thumb_func_start sub_80D3A6C +sub_80D3A6C: @ 80D3A6C + push {lr} + bl oei_task_add + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, =sub_80D3AEC + lsrs r0, r2, 16 + strh r0, [r1, 0x18] + strh r2, [r1, 0x1A] + movs r0, 0x12 + bl IncrementGameStat + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80D3A6C + + thumb_func_start sub_80D3A9C +sub_80D3A9C: @ 80D3A9C + push {lr} + bl brm_get_pokemon_selection + ldr r1, =gUnknown_02038C08 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + ldr r0, =gUnknown_08290705 + bl ScriptContext1_SetupScript + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D3A9C + + thumb_func_start sub_80D3ABC +sub_80D3ABC: @ 80D3ABC + push {lr} + bl oei_task_add + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, =sub_80D4354 + lsrs r0, r2, 16 + strh r0, [r1, 0x18] + strh r2, [r1, 0x1A] + movs r0, 0x12 + bl IncrementGameStat + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80D3ABC + + thumb_func_start sub_80D3AEC +sub_80D3AEC: @ 80D3AEC + push {lr} + movs r0, 0x1 + bl FieldEffectActiveListRemove + movs r0, 0x3A + bl FieldEffectStart + pop {r0} + bx r0 + thumb_func_end sub_80D3AEC + + thumb_func_start sub_80D3B00 +sub_80D3B00: @ 80D3B00 + push {r4-r7,lr} + movs r6, 0 + movs r0, 0x80 + bl PlaySE + ldr r4, =gUnknown_0203AB40 + adds r1, r4, 0x2 + adds r0, r4, 0 + bl PlayerGetDestCoords + adds r7, r4, 0 +_080D3B16: + ldr r0, =gUnknown_03001108 + adds r0, r6, r0 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080D3B64 + adds r0, r6, 0 + movs r1, 0x5 + bl __umodsi3 + adds r4, r0, 0 + subs r4, 0x2 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + movs r1, 0x5 + bl __udivsi3 + adds r5, r0, 0 + subs r5, 0x2 + lsls r4, 24 + asrs r4, 24 + ldrh r0, [r7] + adds r4, r0 + lsls r5, 24 + asrs r5, 24 + ldrh r2, [r7, 0x2] + adds r5, r2 + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 16 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80D3C10 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_808E75C +_080D3B64: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x18 + bls _080D3B16 + ldr r2, =gUnknown_0203AB40 + ldr r0, =gUnknown_03001101 + ldrb r1, [r0] + ldrh r0, [r2] + subs r0, r1 + lsls r0, 16 + asrs r0, 16 + ldr r1, =gUnknown_03001102 + ldrb r1, [r1] + mvns r1, r1 + ldrh r2, [r2, 0x2] + adds r1, r2 + lsls r1, 16 + asrs r1, 16 + bl sub_80D3D5C + bl DrawWholeMapView + ldr r4, =gUnknown_02039DD0 + movs r0, 0x8 + bl AllocZeroed + str r0, [r4] + movs r6, 0 + ldr r5, =gSprites +_080D3BA0: + ldr r0, =gUnknown_02037590 + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrh r1, [r0, 0x2] + lsls r1, 23 + lsrs r1, 7 + movs r2, 0x80 + lsls r2, 12 + adds r1, r2 + asrs r1, 16 + ldrb r2, [r0] + adds r2, 0x14 + ldr r0, =gUnknown_0857C66C + movs r3, 0 + bl CreateSprite + ldr r1, [r4] + adds r1, r6 + strb r0, [r1] + ldr r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + lsls r1, r6, 5 + strh r1, [r0, 0x32] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x7 + bls _080D3BA0 + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80D3B00 + + thumb_func_start sub_80D3C10 +sub_80D3C10: @ 80D3C10 + push {r4-r7,lr} + lsls r0, 16 + lsls r1, 16 + lsrs r6, r0, 16 + asrs r4, r0, 16 + lsrs r7, r1, 16 + asrs r5, r1, 16 + adds r0, r4, 0 + adds r1, r5, 0 + bl MapGridGetMetatileIdAt + adds r1, r0, 0 + ldr r0, =0x00000207 + cmp r1, r0 + bgt _080D3C5C + subs r0, 0x1 + cmp r1, r0 + bge _080D3CD4 + cmp r1, 0x25 + beq _080D3CF6 + cmp r1, 0x25 + bgt _080D3C4C + cmp r1, 0xD + beq _080D3C9C + cmp r1, 0x15 + beq _080D3C9C + b _080D3D00 + .pool +_080D3C4C: + movs r0, 0xE3 + lsls r0, 1 + cmp r1, r0 + beq _080D3CAC + adds r0, 0x1 + cmp r1, r0 + beq _080D3CB2 + b _080D3D00 +_080D3C5C: + ldr r0, =0x00000212 + cmp r1, r0 + beq _080D3CE4 + cmp r1, r0 + bgt _080D3C78 + subs r0, 0xA + cmp r1, r0 + beq _080D3C9C + adds r0, 0x2 + cmp r1, r0 + beq _080D3CE4 + b _080D3D00 + .pool +_080D3C78: + ldr r0, =0x00000282 + cmp r1, r0 + beq _080D3CC4 + cmp r1, r0 + bgt _080D3C90 + subs r0, 0x1 + cmp r1, r0 + beq _080D3CBC + b _080D3D00 + .pool +_080D3C90: + ldr r0, =0x00000283 + cmp r1, r0 + beq _080D3CCC + b _080D3D00 + .pool +_080D3C9C: + lsls r0, r6, 16 + asrs r0, 16 + lsls r1, r7, 16 + asrs r1, 16 + movs r2, 0x1 + bl MapGridSetMetatileIdAt + b _080D3D00 +_080D3CAC: + movs r2, 0xE7 + lsls r2, 1 + b _080D3CD6 +_080D3CB2: + ldr r2, =0x000001cf + b _080D3CD6 + .pool +_080D3CBC: + ldr r2, =0x00000279 + b _080D3CD6 + .pool +_080D3CC4: + ldr r2, =0x0000027a + b _080D3CD6 + .pool +_080D3CCC: + ldr r2, =0x0000027b + b _080D3CD6 + .pool +_080D3CD4: + ldr r2, =0x00000271 +_080D3CD6: + adds r0, r4, 0 + adds r1, r5, 0 + bl MapGridSetMetatileIdAt + b _080D3D00 + .pool +_080D3CE4: + lsls r0, r6, 16 + asrs r0, 16 + lsls r1, r7, 16 + asrs r1, 16 + movs r2, 0x86 + lsls r2, 2 + bl MapGridSetMetatileIdAt + b _080D3D00 +_080D3CF6: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0xE + bl MapGridSetMetatileIdAt +_080D3D00: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80D3C10 + + thumb_func_start sub_80D3D08 +sub_80D3D08: @ 80D3D08 + push {lr} + lsls r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + bl MapGridGetMetatileIdAt + lsls r0, 16 + lsrs r1, r0, 16 + adds r2, r1, 0 + cmp r1, 0x1 + bne _080D3D24 + movs r0, 0x1 + b _080D3D56 +_080D3D24: + ldr r0, =0x00000279 + cmp r1, r0 + bne _080D3D34 + movs r0, 0x2 + b _080D3D56 + .pool +_080D3D34: + ldr r0, =0x0000027a + cmp r1, r0 + bne _080D3D44 + movs r0, 0x3 + b _080D3D56 + .pool +_080D3D44: + ldr r0, =0x0000027b + cmp r2, r0 + beq _080D3D54 + movs r0, 0 + b _080D3D56 + .pool +_080D3D54: + movs r0, 0x4 +_080D3D56: + pop {r1} + bx r1 + thumb_func_end sub_80D3D08 + + thumb_func_start sub_80D3D5C +sub_80D3D5C: @ 80D3D5C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + lsls r1, 16 + lsrs r1, 16 + mov r10, r1 + ldr r1, =gUnknown_03001100 + ldrb r2, [r1] + mov r3, r10 + adds r0, r2, r3 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp] + movs r4, 0 + cmp r4, r2 + blt _080D3D8A + b _080D3EA0 +_080D3D8A: + lsls r0, r3, 16 + asrs r7, r0, 16 +_080D3D8E: + mov r1, r9 + lsls r0, r1, 16 + asrs r0, 16 + lsls r4, 16 + asrs r1, r4, 16 + adds r0, r1 + lsls r0, 16 + lsrs r6, r0, 16 + asrs r5, r0, 16 + adds r0, r5, 0 + adds r1, r7, 0 + bl MapGridGetMetatileIdAt + mov r8, r4 + cmp r0, 0x15 + bne _080D3E12 + adds r4, r7, 0x1 + lsls r1, r4, 16 + asrs r1, 16 + adds r0, r5, 0 + bl sub_80D3D08 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _080D3DE8 + cmp r0, 0x2 + bgt _080D3DD0 + cmp r0, 0x1 + beq _080D3DDA + b _080D3E12 + .pool +_080D3DD0: + cmp r0, 0x3 + beq _080D3DF8 + cmp r0, 0x4 + beq _080D3E08 + b _080D3E12 +_080D3DDA: + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x82 + lsls r2, 2 + bl MapGridSetMetatileIdAt + b _080D3E12 +_080D3DE8: + adds r0, r5, 0 + adds r1, r4, 0 + ldr r2, =0x00000281 + bl MapGridSetMetatileIdAt + b _080D3E12 + .pool +_080D3DF8: + adds r0, r5, 0 + adds r1, r4, 0 + ldr r2, =0x00000282 + bl MapGridSetMetatileIdAt + b _080D3E12 + .pool +_080D3E08: + adds r0, r5, 0 + adds r1, r4, 0 + ldr r2, =0x00000283 + bl MapGridSetMetatileIdAt +_080D3E12: + lsls r0, r6, 16 + asrs r5, r0, 16 + ldr r3, [sp] + lsls r0, r3, 16 + asrs r4, r0, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridGetMetatileIdAt + cmp r0, 0x1 + bne _080D3E8C + adds r4, 0x1 + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridGetMetatileIdAt + movs r1, 0x82 + lsls r1, 2 + cmp r0, r1 + bne _080D3E44 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl MapGridSetMetatileIdAt +_080D3E44: + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridGetMetatileIdAt + ldr r1, =0x00000281 + cmp r0, r1 + bne _080D3E5C + adds r0, r5, 0 + adds r1, r4, 0 + ldr r2, =0x00000279 + bl MapGridSetMetatileIdAt +_080D3E5C: + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridGetMetatileIdAt + ldr r1, =0x00000282 + cmp r0, r1 + bne _080D3E74 + adds r0, r5, 0 + adds r1, r4, 0 + ldr r2, =0x0000027a + bl MapGridSetMetatileIdAt +_080D3E74: + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridGetMetatileIdAt + ldr r1, =0x00000283 + cmp r0, r1 + bne _080D3E8C + adds r0, r5, 0 + adds r1, r4, 0 + ldr r2, =0x0000027b + bl MapGridSetMetatileIdAt +_080D3E8C: + movs r1, 0x80 + lsls r1, 9 + add r1, r8 + lsrs r4, r1, 16 + asrs r1, 16 + ldr r0, =gUnknown_03001100 + ldrb r0, [r0] + cmp r1, r0 + bge _080D3EA0 + b _080D3D8E +_080D3EA0: + ldr r1, =gUnknown_03001100 + ldrb r0, [r1] + cmp r0, 0x5 + bne _080D3EC8 + mov r3, r9 + lsls r5, r3, 16 + asrs r5, 16 + mov r0, r10 + lsls r4, r0, 16 + asrs r4, 16 + movs r0, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_80D3EF4 + movs r0, 0x1 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_80D3EF4 +_080D3EC8: + 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_80D3D5C + + thumb_func_start sub_80D3EF4 +sub_80D3EF4: @ 80D3EF4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r5, r1, 16 + adds r3, r5, 0 + lsls r2, 16 + lsrs r2, 16 + mov r10, r2 + cmp r0, 0 + bne _080D3F2C + mov r2, sp + ldr r1, =gUnknown_03001108 + ldrb r0, [r1, 0x5] + strb r0, [r2] + ldrb r0, [r1, 0xA] + strb r0, [r2, 0x1] + ldrb r0, [r1, 0xF] + strb r0, [r2, 0x2] + mov r8, r5 + b _080D3F4E + .pool +_080D3F2C: + cmp r0, 0x1 + beq _080D3F32 + b _080D414A +_080D3F32: + mov r2, sp + ldr r1, =gUnknown_03001108 + ldrb r0, [r1, 0x9] + strb r0, [r2] + ldrb r0, [r1, 0xE] + strb r0, [r2, 0x1] + ldrb r0, [r1, 0x13] + strb r0, [r2, 0x2] + lsls r0, r3, 16 + movs r1, 0x80 + lsls r1, 11 + adds r0, r1 + lsrs r0, 16 + mov r8, r0 +_080D3F4E: + mov r0, sp + ldrb r0, [r0] + cmp r0, 0x1 + bne _080D3FC6 + mov r1, r8 + lsls r0, r1, 16 + asrs r5, r0, 16 + mov r1, r10 + lsls r0, r1, 16 + asrs r0, 16 + adds r4, r0, 0x3 + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridGetMetatileIdAt + movs r1, 0x82 + lsls r1, 2 + cmp r0, r1 + bne _080D3F7E + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl MapGridSetMetatileIdAt +_080D3F7E: + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridGetMetatileIdAt + ldr r1, =0x00000281 + cmp r0, r1 + bne _080D3F96 + ldr r2, =0x00000279 + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridSetMetatileIdAt +_080D3F96: + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridGetMetatileIdAt + ldr r1, =0x00000282 + cmp r0, r1 + bne _080D3FAE + ldr r2, =0x0000027a + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridSetMetatileIdAt +_080D3FAE: + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridGetMetatileIdAt + ldr r1, =0x00000283 + cmp r0, r1 + bne _080D3FC6 + ldr r2, =0x0000027b + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridSetMetatileIdAt +_080D3FC6: + mov r0, sp + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + bne _080D40C0 + mov r0, r8 + lsls r5, r0, 16 + asrs r6, r5, 16 + mov r1, r10 + lsls r4, r1, 16 + asrs r7, r4, 16 + adds r1, r7, 0x2 + adds r0, r6, 0 + bl MapGridGetMetatileIdAt + mov r9, r4 + cmp r0, 0x15 + bne _080D4056 + adds r4, r7, 0x3 + lsls r1, r4, 16 + asrs r1, 16 + adds r0, r6, 0 + bl sub_80D3D08 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _080D4034 + cmp r0, 0x2 + bgt _080D4024 + cmp r0, 0x1 + beq _080D402E + b _080D4056 + .pool +_080D4024: + cmp r0, 0x3 + beq _080D403C + cmp r0, 0x4 + beq _080D404C + b _080D4056 +_080D402E: + movs r2, 0x82 + lsls r2, 2 + b _080D403E +_080D4034: + ldr r2, =0x00000281 + b _080D403E + .pool +_080D403C: + ldr r2, =0x00000282 +_080D403E: + adds r0, r6, 0 + adds r1, r4, 0 + bl MapGridSetMetatileIdAt + b _080D4056 + .pool +_080D404C: + ldr r2, =0x00000283 + adds r0, r6, 0 + adds r1, r4, 0 + bl MapGridSetMetatileIdAt +_080D4056: + asrs r5, 16 + mov r1, r9 + asrs r0, r1, 16 + adds r4, r0, 0x4 + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridGetMetatileIdAt + movs r1, 0x82 + lsls r1, 2 + cmp r0, r1 + bne _080D4078 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl MapGridSetMetatileIdAt +_080D4078: + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridGetMetatileIdAt + ldr r1, =0x00000281 + cmp r0, r1 + bne _080D4090 + ldr r2, =0x00000279 + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridSetMetatileIdAt +_080D4090: + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridGetMetatileIdAt + ldr r1, =0x00000282 + cmp r0, r1 + bne _080D40A8 + ldr r2, =0x0000027a + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridSetMetatileIdAt +_080D40A8: + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridGetMetatileIdAt + ldr r1, =0x00000283 + cmp r0, r1 + bne _080D40C0 + ldr r2, =0x0000027b + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridSetMetatileIdAt +_080D40C0: + mov r0, sp + ldrb r0, [r0, 0x2] + cmp r0, 0x1 + bne _080D414A + mov r1, r8 + lsls r0, r1, 16 + asrs r5, r0, 16 + mov r1, r10 + lsls r0, r1, 16 + asrs r4, r0, 16 + adds r1, r4, 0x3 + adds r0, r5, 0 + bl MapGridGetMetatileIdAt + cmp r0, 0x15 + bne _080D414A + adds r4, 0x4 + lsls r1, r4, 16 + asrs r1, 16 + adds r0, r5, 0 + bl sub_80D3D08 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _080D4128 + cmp r0, 0x2 + bgt _080D4118 + cmp r0, 0x1 + beq _080D4122 + b _080D414A + .pool +_080D4118: + cmp r0, 0x3 + beq _080D4130 + cmp r0, 0x4 + beq _080D4140 + b _080D414A +_080D4122: + movs r2, 0x82 + lsls r2, 2 + b _080D4132 +_080D4128: + ldr r2, =0x00000281 + b _080D4132 + .pool +_080D4130: + ldr r2, =0x00000282 +_080D4132: + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridSetMetatileIdAt + b _080D414A + .pool +_080D4140: + ldr r2, =0x00000283 + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridSetMetatileIdAt +_080D414A: + 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_80D3EF4 + + thumb_func_start objc_8097BA8 +objc_8097BA8: @ 80D4160 + movs r2, 0 + movs r1, 0x8 + strh r1, [r0, 0x2E] + strh r2, [r0, 0x30] + strh r2, [r0, 0x34] + ldr r1, =objc_8097BBC + str r1, [r0, 0x1C] + bx lr + .pool + thumb_func_end objc_8097BA8 + + thumb_func_start objc_8097BBC +objc_8097BBC: @ 80D4174 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + movs r2, 0x2E + ldrsh r1, [r4, r2] + bl Sin + strh r0, [r4, 0x24] + movs r1, 0x32 + ldrsh r0, [r4, r1] + movs r2, 0x2E + ldrsh r1, [r4, r2] + bl Cos + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0x8 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x32] + ldrh r1, [r4, 0x2E] + adds r1, 0x1 + ldrh r2, [r4, 0x34] + lsls r0, r2, 16 + asrs r0, 18 + adds r1, r0 + strh r1, [r4, 0x2E] + adds r2, 0x1 + strh r2, [r4, 0x34] + ldrh r1, [r4, 0x30] + movs r2, 0x30 + ldrsh r0, [r4, r2] + cmp r0, 0x1C + beq _080D41C0 + adds r0, r1, 0x1 + strh r0, [r4, 0x30] + b _080D41C4 +_080D41C0: + ldr r0, =sub_80D41D0 + str r0, [r4, 0x1C] +_080D41C4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end objc_8097BBC + + thumb_func_start sub_80D41D0 +sub_80D41D0: @ 80D41D0 + push {r4-r6,lr} + movs r4, 0x1 +_080D41D4: + ldr r6, =gUnknown_02039DD0 + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, =gSprites + adds r0, r5 + bl DestroySprite + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _080D41D4 + ldr r0, [r6] + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x3A + bl FieldEffectStop + ldr r0, [r6] + bl Free + movs r0, 0 + str r0, [r6] + bl sub_80984F4 + bl ScriptContext2_Disable + bl unown_chamber_related + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080D422A + ldr r0, =gUnknown_08267EDB + bl ScriptContext1_SetupScript +_080D422A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D41D0 + + thumb_func_start sub_80D423C +sub_80D423C: @ 80D423C + push {r4,r5,lr} + lsls r0, 16 + asrs r5, r0, 16 + lsls r1, 16 + asrs r4, r1, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl MetatileBehavior_IsLongGrass2 + lsls r0, 24 + cmp r0, 0 + beq _080D42AE + adds r4, 0x1 + lsls r1, r4, 16 + asrs r1, 16 + adds r0, r5, 0 + bl sub_80D3D08 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _080D428A + cmp r0, 0x2 + bgt _080D427A + cmp r0, 0x1 + beq _080D4284 + b _080D42AE +_080D427A: + cmp r0, 0x3 + beq _080D4294 + cmp r0, 0x4 + beq _080D42A4 + b _080D42AE +_080D4284: + movs r2, 0x82 + lsls r2, 2 + b _080D4296 +_080D428A: + ldr r2, =0x00000281 + b _080D4296 + .pool +_080D4294: + ldr r2, =0x00000282 +_080D4296: + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridSetMetatileIdAt + b _080D42AE + .pool +_080D42A4: + ldr r2, =0x00000283 + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridSetMetatileIdAt +_080D42AE: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D423C + + thumb_func_start sub_80D42B8 +sub_80D42B8: @ 80D42B8 + push {r4,r5,lr} + lsls r0, 16 + asrs r4, r0, 16 + lsls r1, 16 + asrs r5, r1, 16 + adds r0, r4, 0 + adds r1, r5, 0 + bl MapGridGetMetatileIdAt + cmp r0, 0x1 + bne _080D434A + adds r5, 0x1 + adds r0, r4, 0 + adds r1, r5, 0 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl MetatileBehavior_IsLongGrassSouthEdge + lsls r0, 24 + cmp r0, 0 + beq _080D434A + adds r0, r4, 0 + adds r1, r5, 0 + bl MapGridGetMetatileIdAt + adds r1, r0, 0 + ldr r0, =0x00000281 + cmp r1, r0 + beq _080D4328 + cmp r1, r0 + bgt _080D4308 + subs r0, 0x79 + cmp r1, r0 + beq _080D431C + b _080D434A + .pool +_080D4308: + ldr r0, =0x00000282 + cmp r1, r0 + beq _080D4330 + adds r0, 0x1 + cmp r1, r0 + beq _080D4340 + b _080D434A + .pool +_080D431C: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl MapGridSetMetatileIdAt + b _080D434A +_080D4328: + ldr r2, =0x00000279 + b _080D4332 + .pool +_080D4330: + ldr r2, =0x0000027a +_080D4332: + adds r0, r4, 0 + adds r1, r5, 0 + bl MapGridSetMetatileIdAt + b _080D434A + .pool +_080D4340: + ldr r2, =0x0000027b + adds r0, r4, 0 + adds r1, r5, 0 + bl MapGridSetMetatileIdAt +_080D434A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D42B8 + + thumb_func_start sub_80D4354 +sub_80D4354: @ 80D4354 + push {lr} + movs r0, 0x80 + bl PlaySE + movs r0, 0x2 + bl FieldEffectActiveListRemove + bl EnableBothScriptContexts + pop {r0} + bx r0 + thumb_func_end sub_80D4354 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/fldeff_groundshake.s b/asm/fldeff_groundshake.s new file mode 100755 index 000000000..8fcdc0396 --- /dev/null +++ b/asm/fldeff_groundshake.s @@ -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. diff --git a/asm/fldeff_softboiled.s b/asm/fldeff_softboiled.s new file mode 100755 index 000000000..2de098970 --- /dev/null +++ b/asm/fldeff_softboiled.s @@ -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. diff --git a/asm/fossil_specials.s b/asm/fossil_specials.s new file mode 100755 index 000000000..6883743ec --- /dev/null +++ b/asm/fossil_specials.s @@ -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. diff --git a/asm/international_string_util.s b/asm/international_string_util.s new file mode 100755 index 000000000..7c52fc41a --- /dev/null +++ b/asm/international_string_util.s @@ -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. diff --git a/asm/item_icon.s b/asm/item_icon.s new file mode 100755 index 000000000..e3fe4189a --- /dev/null +++ b/asm/item_icon.s @@ -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. diff --git a/asm/item_menu.s b/asm/item_menu.s new file mode 100755 index 000000000..914fdf2b3 --- /dev/null +++ b/asm/item_menu.s @@ -0,0 +1,6452 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start ResetBagScrollPositions +ResetBagScrollPositions: @ 81AAB70 + push {r4,lr} + ldr r4, =gUnknown_0203CE58 + movs r0, 0 + strb r0, [r4, 0x5] + adds r0, r4, 0 + adds r0, 0x8 + movs r1, 0 + movs r2, 0xA + bl memset + adds r4, 0x12 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0xA + bl memset + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ResetBagScrollPositions + + thumb_func_start CB2_BagMenuFromStartMenu +@ void CB2_BagMenuFromStartMenu() +CB2_BagMenuFromStartMenu: @ 81AAB9C + push {lr} + ldr r2, =sub_8086194 + movs r0, 0 + movs r1, 0x5 + bl GoToBagMenu + pop {r0} + bx r0 + .pool + thumb_func_end CB2_BagMenuFromStartMenu + + thumb_func_start sub_81AABB0 +sub_81AABB0: @ 81AABB0 + push {lr} + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + bne _081AABCC + ldr r2, =sub_8059D50 + movs r0, 0x1 + movs r1, 0x5 + bl GoToBagMenu + b _081AABD4 + .pool +_081AABCC: + ldr r1, =sub_8059D50 + movs r0, 0x1 + bl sub_81C4F98 +_081AABD4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AABB0 + + thumb_func_start CB2_ChooseBerry +CB2_ChooseBerry: @ 81AABDC + push {lr} + ldr r2, =sub_80861B0 + movs r0, 0x4 + movs r1, 0x3 + bl GoToBagMenu + pop {r0} + bx r0 + .pool + thumb_func_end CB2_ChooseBerry + + thumb_func_start sub_81AABF0 +sub_81AABF0: @ 81AABF0 + push {lr} + adds r2, r0, 0 + movs r0, 0x5 + movs r1, 0x3 + bl GoToBagMenu + pop {r0} + bx r0 + thumb_func_end sub_81AABF0 + + thumb_func_start CB2_GoToSellMenu +@ void CB2_GoToSellMenu() +CB2_GoToSellMenu: @ 81AAC00 + push {lr} + ldr r2, =CB2_ExitSellMenu + movs r0, 0x3 + movs r1, 0x5 + bl GoToBagMenu + pop {r0} + bx r0 + .pool + thumb_func_end CB2_GoToSellMenu + + thumb_func_start sub_81AAC14 +sub_81AAC14: @ 81AAC14 + push {lr} + ldr r2, =sub_816B31C + movs r0, 0x6 + movs r1, 0x5 + bl GoToBagMenu + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AAC14 + + thumb_func_start sub_81AAC28 +sub_81AAC28: @ 81AAC28 + push {lr} + ldr r2, =bag_menu_leave_maybe_3 + movs r0, 0x9 + movs r1, 0x5 + bl GoToBagMenu + ldr r0, =gSpecialVar_0x8005 + movs r1, 0 + strh r1, [r0] + ldr r0, =gScriptResult + strh r1, [r0] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AAC28 + + thumb_func_start sub_81AAC50 +sub_81AAC50: @ 81AAC50 + push {lr} + ldr r2, =bag_menu_leave_maybe_2 + movs r0, 0x7 + movs r1, 0x5 + bl GoToBagMenu + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AAC50 + + thumb_func_start sub_81AAC70 +sub_81AAC70: @ 81AAC70 + push {lr} + ldr r2, =bag_menu_leave_maybe + movs r0, 0x8 + movs r1, 0x5 + bl GoToBagMenu + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AAC70 + + thumb_func_start GoToBagMenu +@ void GoToBagMenu(u8 bagMenuType, u8 pocketId, void ( *postExitMenuMainCallback2)()) +GoToBagMenu: @ 81AAC90 + push {r4-r7,lr} + adds r4, r2, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + ldr r6, =gUnknown_0203CE54 + ldr r0, =0x00000c48 + bl AllocZeroed + str r0, [r6] + cmp r0, 0 + bne _081AACBC + adds r0, r4, 0 + bl SetMainCallback2 + b _081AAD3A + .pool +_081AACBC: + ldr r0, =gUnknown_0203CE58 + cmp r5, 0xC + beq _081AACC4 + strb r5, [r0, 0x4] +_081AACC4: + cmp r4, 0 + beq _081AACCA + str r4, [r0] +_081AACCA: + cmp r7, 0x4 + bhi _081AACD0 + strb r7, [r0, 0x5] +_081AACD0: + ldrb r0, [r0, 0x4] + subs r0, 0x4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _081AACF0 + ldr r2, [r6] + ldr r0, =0x0000081b + adds r2, r0 + ldrb r1, [r2] + movs r0, 0x10 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] +_081AACF0: + ldr r0, [r6] + movs r1, 0 + str r1, [r0] + ldr r1, =0x0000081a + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldr r0, [r6] + ldr r1, =0x0000081e + adds r0, r1 + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + ldr r0, [r6] + ldr r1, =0x0000081f + adds r0, r1 + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + ldr r0, [r6] + ldr r1, =0x00000804 + adds r0, r1 + movs r1, 0xFF + movs r2, 0xC + bl memset + ldr r0, [r6] + movs r1, 0x81 + lsls r1, 4 + adds r0, r1 + movs r1, 0xFF + movs r2, 0xA + bl memset + ldr r0, =CB2_Bag + bl SetMainCallback2 +_081AAD3A: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end GoToBagMenu + + thumb_func_start c2_bag_3 +c2_bag_3: @ 81AAD5C + push {lr} + bl RunTasks + bl AnimateSprites + bl BuildOamBuffer + bl do_scheduled_bg_tilemap_copies_to_vram + bl UpdatePaletteFade + pop {r0} + bx r0 + thumb_func_end c2_bag_3 + + thumb_func_start vblank_cb_bag_menu +vblank_cb_bag_menu: @ 81AAD78 + push {lr} + bl LoadOam + bl ProcessSpriteCopyRequests + bl TransferPlttBuffer + pop {r0} + bx r0 + thumb_func_end vblank_cb_bag_menu + + thumb_func_start CB2_Bag +CB2_Bag: @ 81AAD8C + push {lr} +_081AAD8E: + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081AADB2 + bl setup_bag_menu + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081AADB2 + bl sub_81221AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081AAD8E +_081AADB2: + pop {r0} + bx r0 + thumb_func_end CB2_Bag + + thumb_func_start setup_bag_menu +setup_bag_menu: @ 81AADB8 + push {r4,r5,lr} + sub sp, 0x4 + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0x14 + bls _081AADCE + b _081AB02C +_081AADCE: + lsls r0, 2 + ldr r1, =_081AADE0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081AADE0: + .4byte _081AAE34 + .4byte _081AAE3E + .4byte _081AAE50 + .4byte _081AAE56 + .4byte _081AAE78 + .4byte _081AAE7E + .4byte _081AAE86 + .4byte _081AAEA4 + .4byte _081AAECC + .4byte _081AAEDA + .4byte _081AAEEC + .4byte _081AAEFA + .4byte _081AAF0C + .4byte _081AAF1C + .4byte _081AAF54 + .4byte _081AAFA0 + .4byte _081AAFBC + .4byte _081AAFC2 + .4byte _081AAFD8 + .4byte _081AAFDE + .4byte _081AAFF8 +_081AAE34: + bl SetVBlankHBlankCallbacksToNull + bl clear_scheduled_bg_copies_to_vram + b _081AB012 +_081AAE3E: + bl remove_some_task + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .pool +_081AAE50: + bl FreeAllSpritePalettes + b _081AB012 +_081AAE56: + bl ResetPaletteFade + ldr r2, =gPaletteFade + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .pool +_081AAE78: + bl ResetSpriteData + b _081AB012 +_081AAE7E: + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + b _081AB01A +_081AAE86: + bl sub_81221AC + lsls r0, 24 + cmp r0, 0 + bne _081AAE94 + bl ResetTasks +_081AAE94: + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .pool +_081AAEA4: + bl bag_menu_init_bgs + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r1, =0x00000834 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .pool +_081AAECC: + bl load_bag_menu_graphics + lsls r0, 24 + cmp r0, 0 + bne _081AAED8 + b _081AB044 +_081AAED8: + b _081AB012 +_081AAEDA: + bl setup_bag_menu_textboxes + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .pool +_081AAEEC: + bl sub_81ABA6C + bl sub_81ABAC4 + bl sub_81ABAE0 + b _081AB012 +_081AAEFA: + bl allocate_bag_item_list_buffers + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .pool +_081AAF0C: + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + bl load_bag_item_list_buffers + b _081AB012 + .pool +_081AAF1C: + ldr r1, =gPocketNames + ldr r4, =gUnknown_0203CE58 + ldrb r0, [r4, 0x5] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0 + bl bag_menu_print_pocket_names + movs r0, 0 + bl bag_menu_copy_pocket_name_to_window + ldrb r0, [r4, 0x5] + movs r1, 0x1 + bl bag_menu_draw_pocket_indicator_square + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .pool +_081AAF54: + ldr r4, =gUnknown_0203CE58 + ldrb r0, [r4, 0x4] + bl sub_81AB1F0 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_03006310 + ldrb r2, [r4, 0x5] + lsls r2, 1 + adds r1, r4, 0 + adds r1, 0x12 + adds r1, r2, r1 + ldrh r1, [r1] + adds r4, 0x8 + adds r2, r4 + ldrh r2, [r2] + bl ListMenuInit + ldr r2, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r2 + lsls r0, 24 + lsrs r0, 24 + movs r2, 0 + strh r0, [r1, 0x8] + strh r2, [r1, 0xE] + strh r2, [r1, 0x18] + b _081AB012 + .pool +_081AAFA0: + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + bl AddBagVisualObject + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .pool +_081AAFBC: + bl sub_80D4FAC + b _081AB012 +_081AAFC2: + bl bag_menu_add_pocket_scroll_arrow_indicators_maybe + bl bag_menu_add_list_scroll_arrow_indicators_maybe + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .pool +_081AAFD8: + bl bag_menu_prepare_tmhm_move_window + b _081AB012 +_081AAFDE: + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl BlendPalettes + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .pool +_081AAFF8: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade + ldr r2, =gPaletteFade + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x8] +_081AB012: + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 +_081AB01A: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _081AB044 + .pool +_081AB02C: + ldr r0, =vblank_cb_bag_menu + bl SetVBlankCallback + ldr r0, =c2_bag_3 + bl SetMainCallback2 + movs r0, 0x1 + b _081AB046 + .pool +_081AB044: + movs r0, 0 +_081AB046: + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end setup_bag_menu + + thumb_func_start bag_menu_init_bgs +bag_menu_init_bgs: @ 81AB050 + push {r4,lr} + bl sub_8121DA0 + ldr r4, =gUnknown_0203CE54 + ldr r0, [r4] + adds r0, 0x4 + movs r2, 0x80 + lsls r2, 4 + movs r1, 0 + bl memset + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_08613F90 + movs r0, 0 + movs r2, 0x3 + bl InitBgsFromTemplates + ldr r1, [r4] + adds r1, 0x4 + movs r0, 0x2 + bl SetBgTilemapBuffer + bl sub_8121E10 + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_init_bgs + + thumb_func_start load_bag_menu_graphics +load_bag_menu_graphics: @ 81AB0BC + push {r4,lr} + sub sp, 0x4 + ldr r4, =gUnknown_0203CE54 + ldr r0, [r4] + ldr r1, =0x00000834 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x4 + bls _081AB0D2 + b _081AB1CC +_081AB0D2: + lsls r0, 2 + ldr r1, =_081AB0E8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081AB0E8: + .4byte _081AB0FC + .4byte _081AB118 + .4byte _081AB13C + .4byte _081AB174 + .4byte _081AB1A8 +_081AB0FC: + bl reset_temp_tile_data_buffers + ldr r1, =gUnknown_08D9A620 + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + b _081AB1AE + .pool +_081AB118: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081AB1E4 + ldr r0, =gUnknown_08D9A88C + ldr r4, =gUnknown_0203CE54 + ldr r1, [r4] + adds r1, 0x4 + bl LZDecompressWram + ldr r1, [r4] + b _081AB1B2 + .pool +_081AB13C: + bl IsWallysBag + lsls r0, 24 + cmp r0, 0 + bne _081AB164 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + beq _081AB164 + ldr r0, =gUnknown_08D9A5D4 + movs r1, 0 + movs r2, 0x40 + bl LoadCompressedPalette + b _081AB1AE + .pool +_081AB164: + ldr r0, =gUnknown_08D9A588 + movs r1, 0 + movs r2, 0x40 + bl LoadCompressedPalette + b _081AB1AE + .pool +_081AB174: + bl IsWallysBag + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081AB18A + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _081AB19C +_081AB18A: + ldr r0, =gUnknown_0857FB34 + bl LoadCompressedObjectPic + b _081AB1AE + .pool +_081AB19C: + ldr r0, =gUnknown_0857FB3C + bl LoadCompressedObjectPic + b _081AB1AE + .pool +_081AB1A8: + ldr r0, =gUnknown_0857FB44 + bl LoadCompressedObjectPalette +_081AB1AE: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] +_081AB1B2: + ldr r0, =0x00000834 + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _081AB1E4 + .pool +_081AB1CC: + bl sub_8122328 + ldr r0, [r4] + ldr r1, =0x00000834 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + movs r0, 0x1 + b _081AB1E6 + .pool +_081AB1E4: + movs r0, 0 +_081AB1E6: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end load_bag_menu_graphics + + thumb_func_start sub_81AB1F0 +sub_81AB1F0: @ 81AB1F0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xA + bne _081AB204 + ldr r0, =Task_WallyTutorialBagMenu + b _081AB206 + .pool +_081AB204: + ldr r0, =Task_BagMenu +_081AB206: + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81AB1F0 + + thumb_func_start allocate_bag_item_list_buffers +allocate_bag_item_list_buffers: @ 81AB218 + push {r4,lr} + ldr r4, =gUnknown_0203CE74 + movs r0, 0x82 + lsls r0, 2 + bl Alloc + str r0, [r4] + ldr r4, =gUnknown_0203CE78 + movs r0, 0xC3 + lsls r0, 3 + bl Alloc + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end allocate_bag_item_list_buffers + + thumb_func_start load_bag_item_list_buffers +@ void load_bag_item_list_buffers(int pocket_id) +load_bag_item_list_buffers: @ 81AB240 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, r7, 3 + ldr r0, =gBagPockets + adds r1, r0 + mov r8, r1 + ldr r0, =gUnknown_0203CE54 + ldr r2, [r0] + ldr r1, =0x0000081b + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081AB2FC + movs r6, 0 + ldr r3, =0x00000829 + adds r0, r2, r3 + adds r0, r7 + ldrb r0, [r0] + subs r0, 0x1 + cmp r6, r0 + bge _081AB2B6 + ldr r5, =gUnknown_0203CE78 +_081AB276: + lsls r4, r6, 1 + adds r4, r6 + lsls r4, 3 + ldr r0, [r5] + adds r0, r4 + mov r1, r8 + ldr r2, [r1] + lsls r1, r6, 2 + adds r1, r2 + ldrh r1, [r1] + bl get_name + ldr r0, =gUnknown_0203CE74 + ldr r0, [r0] + lsls r1, r6, 3 + adds r1, r0 + ldr r0, [r5] + adds r0, r4 + str r0, [r1] + str r6, [r1, 0x4] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r3, =0x00000829 + adds r0, r3 + adds r0, r7 + ldrb r0, [r0] + subs r0, 0x1 + cmp r6, r0 + blt _081AB276 +_081AB2B6: + ldr r5, =gUnknown_0203CE78 + lsls r4, r6, 1 + adds r4, r6 + lsls r4, 3 + ldr r0, [r5] + adds r0, r4 + ldr r1, =gText_CloseBag + bl StringCopy + ldr r0, =gUnknown_0203CE74 + ldr r0, [r0] + lsls r1, r6, 3 + adds r1, r0 + ldr r0, [r5] + adds r0, r4 + str r0, [r1] + movs r0, 0x2 + negs r0, r0 + str r0, [r1, 0x4] + b _081AB34A + .pool +_081AB2FC: + movs r6, 0 + ldr r4, =0x00000829 + adds r0, r2, r4 + adds r0, r7 + ldrb r0, [r0] + cmp r6, r0 + bcs _081AB34A + ldr r5, =gUnknown_0203CE78 +_081AB30C: + lsls r4, r6, 1 + adds r4, r6 + lsls r4, 3 + ldr r0, [r5] + adds r0, r4 + mov r1, r8 + ldr r2, [r1] + lsls r1, r6, 2 + adds r1, r2 + ldrh r1, [r1] + bl get_name + ldr r0, =gUnknown_0203CE74 + ldr r0, [r0] + lsls r1, r6, 3 + adds r1, r0 + ldr r0, [r5] + adds r0, r4 + str r0, [r1] + str r6, [r1, 0x4] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r3, =0x00000829 + adds r0, r3 + adds r0, r7 + ldrb r0, [r0] + cmp r6, r0 + bcc _081AB30C +_081AB34A: + ldr r2, =gUnknown_03006310 + adds r1, r2, 0 + ldr r0, =gUnknown_08613F9C + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + ldr r4, =0x00000829 + adds r0, r1, r4 + adds r0, r7 + ldrb r0, [r0] + strh r0, [r2, 0xC] + ldr r0, =gUnknown_0203CE74 + ldr r0, [r0] + str r0, [r2] + ldr r5, =0x0000082e + adds r1, r5 + adds r1, r7 + ldrb r0, [r1] + strh r0, [r2, 0xE] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end load_bag_item_list_buffers + + thumb_func_start get_name +@ void get_name(char *dest, int name_id) +get_name: @ 81AB39C + push {r4-r6,lr} + adds r6, r0, 0 + lsls r1, 16 + lsrs r5, r1, 16 + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + cmp r0, 0x2 + beq _081AB3C0 + cmp r0, 0x3 + beq _081AB420 + adds r0, r5, 0 + adds r1, r6, 0 + bl CopyItemName + b _081AB43E + .pool +_081AB3C0: + ldr r4, =gStringVar2 + adds r0, r5, 0 + bl ItemIdToBattleMoveId + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xD + muls r1, r0 + ldr r0, =gMoveNames + adds r1, r0 + adds r0, r4, 0 + bl StringCopy + movs r0, 0xA9 + lsls r0, 1 + cmp r5, r0 + bls _081AB408 + ldr r0, =gStringVar1 + ldr r2, =0xfffffeae + adds r1, r5, r2 + movs r2, 0x2 + movs r3, 0x1 + bl ConvertIntToDecimalStringN + ldr r1, =gUnknown_085E921A + b _081AB438 + .pool +_081AB408: + ldr r0, =gStringVar1 + ldr r2, =0xfffffee0 + adds r1, r5, r2 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalStringN + b _081AB436 + .pool +_081AB420: + ldr r0, =gStringVar1 + adds r1, r5, 0 + subs r1, 0x84 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalStringN + ldr r1, =gStringVar2 + adds r0, r5, 0 + bl CopyItemName +_081AB436: + ldr r1, =gUnknown_085E9210 +_081AB438: + adds r0, r6, 0 + bl StringExpandPlaceholders +_081AB43E: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end get_name + + thumb_func_start bag_menu_change_item_callback +bag_menu_change_item_callback: @ 81AB450 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x1 + beq _081AB466 + movs r0, 0x5 + bl PlaySE + bl ShakeBagVisual +_081AB466: + ldr r4, =gUnknown_0203CE54 + ldr r1, [r4] + ldr r2, =0x0000081a + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0xFF + bne _081AB50C + adds r2, 0x1 + adds r0, r1, r2 + ldrb r1, [r0] + lsls r1, 26 + lsrs r1, 30 + movs r0, 0x1 + eors r0, r1 + bl RemoveBagItemIconObject + movs r0, 0x2 + negs r0, r0 + cmp r6, r0 + beq _081AB4C8 + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r6, 16 + lsrs r1, 16 + bl BagGetItemIdByPocketPosition + lsls r0, 16 + lsrs r0, 16 + ldr r1, [r4] + ldr r2, =0x0000081b + adds r1, r2 + ldrb r1, [r1] + lsls r1, 26 + lsrs r1, 30 + bl AddBagItemIconObject + b _081AB4DA + .pool +_081AB4C8: + ldr r0, =0x0000ffff + ldr r1, [r4] + ldr r2, =0x0000081b + adds r1, r2 + ldrb r1, [r1] + lsls r1, 26 + lsrs r1, 30 + bl AddBagItemIconObject +_081AB4DA: + ldr r5, =gUnknown_0203CE54 + ldr r2, [r5] + ldr r4, =0x0000081b + adds r2, r4 + ldrb r3, [r2] + lsls r0, r3, 26 + lsrs r0, 30 + movs r1, 0x1 + eors r1, r0 + lsls r1, 4 + movs r0, 0x31 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _081AB50C + adds r0, r6, 0 + bl bag_menu_print_description_box_text +_081AB50C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_change_item_callback + + thumb_func_start sub_81AB520 +@ void sub_81AB520(u8 rbox_id, int item_index_in_pocket, int a3) +sub_81AB520: @ 81AB520 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r2, 24 + lsrs r7, r2, 24 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + bne _081AB540 + b _081AB696 +_081AB540: + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r1, =0x0000081a + adds r0, r1 + ldrb r1, [r0] + cmp r1, 0xFF + beq _081AB570 + lsls r0, r4, 24 + lsrs r0, 24 + cmp r1, r0 + bne _081AB568 + adds r0, r7, 0 + movs r1, 0x2 + bl bag_menu_print_cursor + b _081AB570 + .pool +_081AB568: + adds r0, r7, 0 + movs r1, 0xFF + bl bag_menu_print_cursor +_081AB570: + ldr r5, =gUnknown_0203CE58 + ldrb r0, [r5, 0x5] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 16 + lsrs r4, 16 + adds r1, r4, 0 + bl BagGetItemIdByPocketPosition + lsls r0, 16 + lsrs r6, r0, 16 + ldrb r0, [r5, 0x5] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + bl BagGetQuantityByPocketPosition + lsls r0, 16 + lsrs r4, r0, 16 + mov r9, r4 + ldr r1, =0xfffffead + adds r0, r6, r1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x7 + bhi _081AB5BE + ldr r1, =gUnknown_08DC6378 + subs r3, r7, 0x1 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0x10 + str r0, [sp] + str r0, [sp, 0x4] + mov r0, r8 + movs r2, 0x8 + bl BlitBitmapToWindow +_081AB5BE: + ldrb r0, [r5, 0x5] + cmp r0, 0x3 + bne _081AB610 + ldr r0, =gStringVar1 + adds r1, r4, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gText_xVar1 + adds r0, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x7 + adds r1, r4, 0 + movs r2, 0x77 + bl GetStringRightAlignXOffset + lsls r3, r0, 24 + lsrs r3, 24 + str r7, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r0, 0xFF + str r0, [sp, 0xC] + str r1, [sp, 0x10] + b _081AB652 + .pool +_081AB610: + cmp r0, 0x4 + beq _081AB66C + adds r0, r6, 0 + bl itemid_is_unique + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _081AB66C + ldr r0, =gStringVar1 + mov r1, r9 + movs r2, 0x1 + movs r3, 0x2 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gText_xVar1 + adds r0, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x7 + adds r1, r4, 0 + movs r2, 0x77 + bl GetStringRightAlignXOffset + lsls r3, r0, 24 + lsrs r3, 24 + str r7, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0xFF + str r0, [sp, 0xC] + str r5, [sp, 0x10] +_081AB652: + mov r0, r8 + movs r1, 0x7 + adds r2, r4, 0 + bl bag_menu_print + b _081AB696 + .pool +_081AB66C: + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00000496 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _081AB696 + cmp r0, r6 + bne _081AB696 + ldr r1, =gUnknown_086140A4 + subs r3, r7, 0x1 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0x18 + str r0, [sp] + movs r0, 0x10 + str r0, [sp, 0x4] + mov r0, r8 + movs r2, 0x60 + bl BlitBitmapToWindow +_081AB696: + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AB520 + + thumb_func_start bag_menu_print_description_box_text +@ void bag_menu_print_description_box_text(int a1) +bag_menu_print_description_box_text: @ 81AB6B0 + push {r4,lr} + sub sp, 0x14 + adds r1, r0, 0 + movs r0, 0x2 + negs r0, r0 + cmp r1, r0 + beq _081AB6E0 + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r1, 16 + bl BagGetItemIdByPocketPosition + lsls r0, 16 + lsrs r0, 16 + bl ItemId_GetDescription + adds r4, r0, 0 + b _081AB6FC + .pool +_081AB6E0: + ldr r0, =gStringVar1 + ldr r2, =gUnknown_085E9180 + ldr r1, =gUnknown_0203CE58 + ldrb r1, [r1, 0x4] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl StringCopy + ldr r4, =gStringVar4 + ldr r1, =gText_ReturnToVar1 + adds r0, r4, 0 + bl StringExpandPlaceholders +_081AB6FC: + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r0, [sp, 0x10] + movs r0, 0x1 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x3 + bl bag_menu_print + add sp, 0x14 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_print_description_box_text + + thumb_func_start bag_menu_print_cursor_ +bag_menu_print_cursor_: @ 81AB73C + push {r4,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsrs r4, 24 + bl ListMenuGetYCoordForPrintingArrowCursor + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + bl bag_menu_print_cursor + pop {r4} + pop {r0} + bx r0 + thumb_func_end bag_menu_print_cursor_ + + thumb_func_start bag_menu_print_cursor +bag_menu_print_cursor: @ 81AB75C + push {r4,r5,lr} + sub sp, 0x14 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0xFF + bne _081AB798 + movs r0, 0x1 + movs r1, 0 + bl GetMenuCursorDimensionByFont + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + movs r1, 0x1 + bl GetMenuCursorDimensionByFont + lsls r0, 24 + lsrs r0, 24 + str r4, [sp] + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + adds r3, r5, 0 + bl FillWindowPixelRect + b _081AB7AE +_081AB798: + ldr r2, =gText_SelectorArrow2 + str r5, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r1, [sp, 0x10] + movs r1, 0x1 + movs r3, 0 + bl bag_menu_print +_081AB7AE: + add sp, 0x14 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_print_cursor + + thumb_func_start bag_menu_add_pocket_scroll_arrow_indicators_maybe +bag_menu_add_pocket_scroll_arrow_indicators_maybe: @ 81AB7BC + push {r4-r6,lr} + sub sp, 0x10 + ldr r5, =gUnknown_0203CE54 + ldr r4, [r5] + ldr r1, =0x0000081e + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0xFF + bne _081AB80A + ldr r2, =gUnknown_0203CE58 + ldrb r3, [r2, 0x5] + ldr r6, =0x00000829 + adds r0, r4, r6 + adds r0, r3 + ldrb r1, [r0] + adds r6, 0x5 + adds r0, r4, r6 + adds r0, r3 + ldrb r0, [r0] + subs r1, r0 + str r1, [sp] + movs r0, 0x6E + str r0, [sp, 0x4] + str r0, [sp, 0x8] + ldrb r0, [r2, 0x5] + lsls r0, 1 + adds r2, 0x12 + adds r0, r2 + str r0, [sp, 0xC] + movs r0, 0x2 + movs r1, 0xAC + movs r2, 0xC + movs r3, 0x94 + bl AddScrollIndicatorArrowPairParametrized + ldr r1, [r5] + ldr r2, =0x0000081e + adds r1, r2 + strb r0, [r1] +_081AB80A: + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_add_pocket_scroll_arrow_indicators_maybe + + thumb_func_start sub_81AB824 +sub_81AB824: @ 81AB824 + push {r4,lr} + ldr r4, =gUnknown_0203CE54 + ldr r0, [r4] + ldr r2, =0x0000081e + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xFF + beq _081AB842 + bl RemoveScrollIndicatorArrowPair + ldr r0, [r4] + ldr r1, =0x0000081e + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] +_081AB842: + bl sub_81AB89C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AB824 + + thumb_func_start bag_menu_add_list_scroll_arrow_indicators_maybe +bag_menu_add_list_scroll_arrow_indicators_maybe: @ 81AB854 + push {r4,lr} + ldr r4, =gUnknown_0203CE54 + ldr r2, [r4] + ldr r1, =0x0000081b + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x1 + beq _081AB882 + ldr r1, =0x0000081f + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0xFF + bne _081AB882 + ldr r0, =gUnknown_08614094 + ldr r1, =gUnknown_0203CE5E + bl AddScrollIndicatorArrowPair + ldr r1, [r4] + ldr r2, =0x0000081f + adds r1, r2 + strb r0, [r1] +_081AB882: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_add_list_scroll_arrow_indicators_maybe + + thumb_func_start sub_81AB89C +sub_81AB89C: @ 81AB89C + push {r4,lr} + ldr r4, =gUnknown_0203CE54 + ldr r0, [r4] + ldr r2, =0x0000081f + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xFF + beq _081AB8BA + bl RemoveScrollIndicatorArrowPair + ldr r0, [r4] + ldr r1, =0x0000081f + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] +_081AB8BA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AB89C + + thumb_func_start free_bag_item_list_buffers +free_bag_item_list_buffers: @ 81AB8C8 + push {lr} + ldr r0, =gUnknown_0203CE78 + ldr r0, [r0] + bl Free + ldr r0, =gUnknown_0203CE74 + ldr r0, [r0] + bl Free + bl FreeAllWindowBuffers + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + bl Free + pop {r0} + bx r0 + .pool + thumb_func_end free_bag_item_list_buffers + + thumb_func_start unknown_ItemMenu_Confirm +unknown_ItemMenu_Confirm: @ 81AB8F8 + 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, =task_close_bag_menu_2 + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end unknown_ItemMenu_Confirm + + thumb_func_start task_close_bag_menu_2 +task_close_bag_menu_2: @ 81AB930 + 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 r2, r0, r1 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081AB9A0 + ldrb r0, [r2] + ldr r4, =gUnknown_0203CE58 + ldrb r2, [r4, 0x5] + lsls r2, 1 + adds r1, r4, 0 + adds r1, 0x12 + adds r1, r2, r1 + adds r3, r4, 0 + adds r3, 0x8 + adds r2, r3 + bl sub_81AE6C8 + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0 + beq _081AB984 + bl SetMainCallback2 + b _081AB98A + .pool +_081AB984: + ldr r0, [r4] + bl SetMainCallback2 +_081AB98A: + bl sub_81AB824 + bl ResetSpriteData + bl FreeAllSpritePalettes + bl free_bag_item_list_buffers + adds r0, r5, 0 + bl DestroyTask +_081AB9A0: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end task_close_bag_menu_2 + + thumb_func_start sub_81AB9A8 +sub_81AB9A8: @ 81AB9A8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, r5, 3 + ldr r0, =gBagPockets + adds r4, r1, r0 + cmp r5, 0x3 + bgt _081AB9C8 + cmp r5, 0x2 + blt _081AB9C8 + adds r0, r4, 0 + bl sub_80D6FB4 + b _081AB9CE + .pool +_081AB9C8: + adds r0, r4, 0 + bl sub_80D6F64 +_081AB9CE: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + ldr r6, =0x00000829 + adds r1, r6 + adds r1, r5 + movs r2, 0 + strb r2, [r1] + adds r3, r0, 0 + ldrb r0, [r4, 0x4] + cmp r2, r0 + bcs _081ABA12 + ldr r0, [r4] + ldrh r0, [r0] + cmp r0, 0 + beq _081ABA12 + adds r7, r3, 0 +_081AB9EE: + ldr r0, [r7] + adds r0, r6 + adds r0, r5 + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + ldrb r1, [r4, 0x4] + cmp r2, r1 + bcs _081ABA12 + ldr r0, [r4] + lsls r1, r2, 2 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _081AB9EE +_081ABA12: + ldr r2, [r3] + ldr r1, =0x0000081b + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081ABA2E + ldr r0, =0x00000829 + adds r1, r2, r0 + adds r1, r5 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_081ABA2E: + ldr r1, [r3] + ldr r2, =0x00000829 + adds r0, r1, r2 + adds r0, r5 + ldrb r2, [r0] + cmp r2, 0x8 + bls _081ABA58 + ldr r3, =0x0000082e + adds r0, r1, r3 + adds r0, r5 + movs r1, 0x8 + strb r1, [r0] + b _081ABA60 + .pool +_081ABA58: + ldr r3, =0x0000082e + adds r0, r1, r3 + adds r0, r5 + strb r2, [r0] +_081ABA60: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AB9A8 + + thumb_func_start sub_81ABA6C +sub_81ABA6C: @ 81ABA6C + push {r4,lr} + movs r4, 0 +_081ABA70: + adds r0, r4, 0 + bl sub_81AB9A8 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x4 + bls _081ABA70 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81ABA6C + + thumb_func_start sub_81ABA88 +sub_81ABA88: @ 81ABA88 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 1 + ldr r2, =gUnknown_0203CE6A + adds r4, r1, r2 + subs r2, 0xA + adds r1, r2 + ldr r2, =gUnknown_0203CE54 + ldr r3, [r2] + ldr r5, =0x0000082e + adds r2, r3, r5 + adds r2, r0 + ldrb r2, [r2] + subs r5, 0x5 + adds r3, r5 + adds r3, r0 + ldrb r3, [r3] + adds r0, r4, 0 + bl sub_812225C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81ABA88 + + thumb_func_start sub_81ABAC4 +sub_81ABAC4: @ 81ABAC4 + push {r4,lr} + movs r4, 0 +_081ABAC8: + adds r0, r4, 0 + bl sub_81ABA88 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x4 + bls _081ABAC8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81ABAC4 + + thumb_func_start sub_81ABAE0 +sub_81ABAE0: @ 81ABAE0 + push {r4-r7,lr} + sub sp, 0x4 + movs r5, 0 + ldr r6, =gUnknown_0203CE6A + adds r7, r6, 0 + subs r7, 0xA +_081ABAEC: + lsls r1, r5, 1 + adds r0, r1, r6 + adds r1, r7 + ldr r2, =gUnknown_0203CE54 + ldr r3, [r2] + ldr r4, =0x0000082e + adds r2, r3, r4 + adds r2, r5 + ldrb r2, [r2] + subs r4, 0x5 + adds r3, r4 + adds r3, r5 + ldrb r3, [r3] + movs r4, 0x8 + str r4, [sp] + bl sub_8122298 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x4 + bls _081ABAEC + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81ABAE0 + + thumb_func_start sub_81ABB2C +sub_81ABB2C: @ 81ABB2C + lsls r0, 24 + ldr r1, =gUnknown_0203CE58 + lsrs r0, 23 + adds r2, r1, 0 + adds r2, 0x12 + adds r2, r0, r2 + adds r1, 0x8 + adds r0, r1 + ldrb r0, [r0] + ldrb r2, [r2] + adds r0, r2 + lsls r0, 24 + lsrs r0, 24 + bx lr + .pool + thumb_func_end sub_81ABB2C + + thumb_func_start DisplayItemMessage +@ void DisplayItemMessage(u8 taskId, u8 fontId, u8 *str, void ( *callback)(u8 taskId)) +DisplayItemMessage: @ 81ABB4C + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x10 + adds r5, r0, 0 + adds r6, r1, 0 + mov r8, r2 + mov r9, r3 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + movs r0, 0x4 + bl AddItemMessageWindow + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x14] + movs r1, 0x11 + bl FillWindowPixelBuffer + bl sav2_get_text_speed + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r4, 0x14] + str r6, [sp] + str r0, [sp, 0x4] + mov r0, r8 + str r0, [sp, 0x8] + mov r0, r9 + str r0, [sp, 0xC] + adds r0, r5, 0 + movs r2, 0xA + movs r3, 0xD + bl DisplayMessageAndContinueTask + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end DisplayItemMessage + + thumb_func_start bag_menu_inits_lists_menu +bag_menu_inits_lists_menu: @ 81ABBBC + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + lsls r5, r6, 2 + adds r5, r6 + lsls r5, 3 + ldr r0, =gTasks + 0x8 + adds r5, r0 + ldr r7, =gUnknown_0203CE58 + ldrb r4, [r7, 0x5] + lsls r4, 1 + movs r0, 0x12 + adds r0, r7 + mov r8, r0 + add r8, r4 + adds r0, r7, 0 + adds r0, 0x8 + adds r4, r0 + movs r0, 0x4 + bl bag_menu_RemoveBagItem_message_window + ldrb r0, [r5] + mov r1, r8 + adds r2, r4, 0 + bl sub_81AE6C8 + ldrb r0, [r7, 0x5] + bl sub_81AB9A8 + ldrb r0, [r7, 0x5] + bl sub_81ABA88 + ldrb r0, [r7, 0x5] + bl load_bag_item_list_buffers + ldr r0, =gUnknown_03006310 + mov r2, r8 + ldrh r1, [r2] + ldrh r2, [r4] + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5] + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + adds r0, r6, 0 + bl set_callback3_to_bag + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_inits_lists_menu + + thumb_func_start sub_81ABC3C +sub_81ABC3C: @ 81ABC3C + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl bag_menu_add_window + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_81ABC54 + pop {r0} + bx r0 + thumb_func_end sub_81ABC3C + + thumb_func_start sub_81ABC54 +sub_81ABC54: @ 81ABC54 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 16 + lsrs r1, 16 + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + movs r3, 0x2 + cmp r0, 0x3 + bne _081ABC6C + movs r3, 0x3 +_081ABC6C: + ldr r0, =gStringVar1 + lsls r1, 16 + asrs r1, 16 + movs r2, 0x2 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gText_xVar1 + adds r0, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x28 + bl GetStringCenterAlignXOffset + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x2 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl PrintTextOnWindow + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81ABC54 + + thumb_func_start sub_81ABCC0 +sub_81ABCC0: @ 81ABCC0 + push {r4-r7,lr} + sub sp, 0xC + adds r4, r0, 0 + adds r7, r2, 0 + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + movs r3, 0x2 + cmp r0, 0x3 + bne _081ABCD4 + movs r3, 0x3 +_081ABCD4: + ldr r0, =gStringVar1 + movs r2, 0x2 + bl ConvertIntToDecimalStringN + ldr r6, =gStringVar4 + ldr r1, =gText_xVar1 + adds r0, r6, 0 + bl StringExpandPlaceholders + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r5, 0 + str r5, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + adds r2, r6, 0 + movs r3, 0 + bl PrintTextOnWindow + str r5, [sp] + adds r0, r4, 0 + movs r1, 0x26 + movs r2, 0x1 + adds r3, r7, 0 + bl PrintMoneyAmount + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81ABCC0 + + thumb_func_start Task_BagMenu +Task_BagMenu: @ 81ABD28 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r0, 2 + add r0, r9 + lsls r0, 3 + str r0, [sp] + ldr r1, =gTasks + 0x8 + adds r6, r0, r1 + ldr r5, =gUnknown_0203CE58 + ldrb r0, [r5, 0x5] + lsls r0, 1 + adds r1, r5, 0 + adds r1, 0x12 + adds r7, r0, r1 + subs r1, 0xA + adds r0, r1 + mov r8, r0 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081ABD66 + b _081ABEB2 +_081ABD66: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081ABD74 + b _081ABEB2 +_081ABD74: + bl GetSwitchBagPocketDirection + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081ABDB8 + cmp r0, 0x2 + beq _081ABDC0 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x4 + ands r0, r1 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + cmp r0, 0 + beq _081ABE10 + bl sub_81AC2C0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081ABDA4 + b _081ABEB2 +_081ABDA4: + b _081ABDCC + .pool +_081ABDB8: + movs r1, 0x1 + negs r1, r1 + mov r0, r9 + b _081ABDC4 +_081ABDC0: + mov r0, r9 + movs r1, 0x1 +_081ABDC4: + movs r2, 0 + bl SwitchBagPocket + b _081ABEB2 +_081ABDCC: + ldrb r0, [r6] + adds r1, r7, 0 + mov r2, r8 + bl get_coro_args_x18_x1A + ldrh r2, [r7] + mov r3, r8 + ldrh r0, [r3] + adds r2, r0 + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r1, =gUnknown_0203CE58 + ldr r3, =0x00000829 + adds r0, r3 + ldrb r1, [r1, 0x5] + adds r0, r1 + ldrb r0, [r0] + subs r0, 0x1 + cmp r2, r0 + beq _081ABEB2 + movs r0, 0x5 + bl PlaySE + mov r0, r9 + bl bag_menu_swap_items + b _081ABEB2 + .pool +_081ABE10: + ldrb r0, [r6] + bl ListMenuHandleInput + adds r4, r0, 0 + ldrb r0, [r6] + adds r1, r7, 0 + mov r2, r8 + bl get_coro_args_x18_x1A + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _081ABE32 + adds r0, 0x1 + cmp r4, r0 + bne _081ABE68 + b _081ABEB2 +_081ABE32: + ldrb r0, [r5, 0x4] + cmp r0, 0x5 + bne _081ABE40 + movs r0, 0x20 + bl PlaySE + b _081ABEB2 +_081ABE40: + movs r0, 0x5 + bl PlaySE + ldr r0, =gScriptItemId + mov r1, r10 + strh r1, [r0] + ldr r0, =gTasks + 0x8 + subs r0, 0x8 + ldr r3, [sp] + adds r0, r3, r0 + ldr r1, =unknown_ItemMenu_Confirm + str r1, [r0] + b _081ABEB2 + .pool +_081ABE68: + movs r0, 0x5 + bl PlaySE + bl sub_81AB824 + ldrb r0, [r6] + movs r1, 0x2 + bl bag_menu_print_cursor_ + strh r4, [r6, 0x2] + ldrb r0, [r5, 0x5] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 16 + lsrs r4, 16 + adds r1, r4, 0 + bl BagGetQuantityByPocketPosition + strh r0, [r6, 0x4] + ldrb r0, [r5, 0x5] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + bl BagGetItemIdByPocketPosition + ldr r1, =gScriptItemId + strh r0, [r1] + ldr r1, =gUnknown_08614054 + ldrb r0, [r5, 0x4] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + mov r0, r9 + bl _call_via_r1 +_081ABEB2: + 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 Task_BagMenu + + thumb_func_start set_callback3_to_bag +set_callback3_to_bag: @ 81ABECC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl bag_menu_add_pocket_scroll_arrow_indicators_maybe + bl bag_menu_add_list_scroll_arrow_indicators_maybe + movs r0, 0x3 + bl ClearWindowTilemap + movs r0, 0x4 + bl ClearWindowTilemap + movs r0, 0x1 + bl PutWindowTilemap + movs r0, 0 + 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, =Task_BagMenu + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end set_callback3_to_bag + + thumb_func_start GetSwitchBagPocketDirection +GetSwitchBagPocketDirection: @ 81ABF10 + push {lr} + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r1, =0x0000081b + adds r0, r1 + ldrb r1, [r0] + movs r0, 0xF + ands r0, r1 + cmp r0, 0 + bne _081ABF6A + bl GetLRKeysState + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _081ABF3C + cmp r2, 0x1 + bne _081ABF54 +_081ABF3C: + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + b _081ABF6C + .pool +_081ABF54: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _081ABF60 + cmp r2, 0x2 + bne _081ABF6A +_081ABF60: + movs r0, 0x5 + bl PlaySE + movs r0, 0x2 + b _081ABF6C +_081ABF6A: + movs r0, 0 +_081ABF6C: + pop {r1} + bx r1 + thumb_func_end GetSwitchBagPocketDirection + + thumb_func_start ChangeBagPocketId +@ void ChangeBagPocketId(u8 *bagPocketId, u8 deltaBagPocketId) +ChangeBagPocketId: @ 81ABF70 + push {r4,lr} + adds r2, r0, 0 + lsls r1, 24 + lsrs r4, r1, 24 + asrs r1, 24 + cmp r1, 0x1 + bne _081ABF88 + ldrb r0, [r2] + cmp r0, 0x4 + bne _081ABF88 + movs r0, 0 + b _081ABFA0 +_081ABF88: + lsls r0, r4, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + ldrb r3, [r2] + cmp r0, r1 + bne _081ABF9E + cmp r3, 0 + bne _081ABF9E + movs r0, 0x4 + b _081ABFA0 +_081ABF9E: + adds r0, r3, r4 +_081ABFA0: + strb r0, [r2] + pop {r4} + pop {r0} + bx r0 + thumb_func_end ChangeBagPocketId + + thumb_func_start SwitchBagPocket +@ void SwitchBagPocket(u8 taskId, u16 deltaBagPocketId, u16 a3) +SwitchBagPocket: @ 81ABFA8 + push {r4-r6,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 16 + lsrs r5, r1, 16 + lsls r2, 16 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + movs r0, 0 + strh r0, [r4, 0x1A] + strh r0, [r4, 0x18] + strh r5, [r4, 0x16] + cmp r2, 0 + bne _081AC026 + movs r0, 0 + bl ClearWindowTilemap + movs r0, 0x1 + bl ClearWindowTilemap + ldrb r0, [r4] + ldr r3, =gUnknown_0203CE58 + ldrb r2, [r3, 0x5] + lsls r2, 1 + adds r1, r3, 0 + adds r1, 0x12 + adds r1, r2, r1 + adds r3, 0x8 + adds r2, r3 + bl sub_81AE6C8 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r3, =gSprites + ldr r0, =gUnknown_0203CE54 + ldr r2, [r0] + ldr r1, =0x0000081b + adds r0, r2, r1 + ldrb r1, [r0] + lsls r1, 26 + lsrs r1, 30 + movs r0, 0x1 + eors r0, r1 + adds r2, r0 + ldr r0, =0x00000806 + adds r2, r0 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + bl sub_81AB824 +_081AC026: + ldr r4, =gUnknown_0203CE58 + ldrb r1, [r4, 0x5] + add r0, sp, 0x8 + strb r1, [r0] + lsls r1, r5, 24 + asrs r1, 24 + bl ChangeBagPocketId + lsls r0, r5, 16 + asrs r1, r0, 16 + adds r5, r0, 0 + cmp r1, 0x1 + bne _081AC07C + ldr r2, =gPocketNames + ldrb r0, [r4, 0x5] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + add r1, sp, 0x8 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl bag_menu_print_pocket_names + movs r0, 0 + bl bag_menu_copy_pocket_name_to_window + b _081AC09A + .pool +_081AC07C: + ldr r2, =gPocketNames + add r0, sp, 0x8 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ldrb r1, [r4, 0x5] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl bag_menu_print_pocket_names + movs r0, 0x8 + bl bag_menu_copy_pocket_name_to_window +_081AC09A: + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + movs r1, 0 + bl bag_menu_draw_pocket_indicator_square + add r0, sp, 0x8 + ldrb r0, [r0] + movs r1, 0x1 + bl bag_menu_draw_pocket_indicator_square + movs r0, 0xF + str r0, [sp] + movs r0, 0x10 + str r0, [sp, 0x4] + movs r0, 0x2 + movs r1, 0xB + movs r2, 0xE + movs r3, 0x2 + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + add r0, sp, 0x8 + ldrb r0, [r0] + movs r1, 0x1 + bl SetBagVisualPocketId + movs r0, 0x1 + bl RemoveBagObject + asrs r0, r5, 16 + bl AddSwitchPocketRotatingBallObject + ldr r1, =sub_81AC10C + ldr r2, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r2 + ldr r2, [r0] + adds r0, r6, 0 + bl SetTaskFuncWithFollowupFunc + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end SwitchBagPocket + + thumb_func_start sub_81AC10C +sub_81AC10C: @ 81AC10C + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r6, r0, r1 + bl sub_81221AC + lsls r0, 24 + cmp r0, 0 + bne _081AC184 + bl IsWallysBag + lsls r0, 24 + cmp r0, 0 + bne _081AC184 + bl GetSwitchBagPocketDirection + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081AC148 + cmp r0, 0x2 + beq _081AC164 + b _081AC184 + .pool +_081AC148: + ldr r0, =gUnknown_0203CE5D + movs r1, 0x16 + ldrsb r1, [r6, r1] + bl ChangeBagPocketId + adds r0, r7, 0 + bl SwitchTaskToFollowupFunc + movs r1, 0x1 + negs r1, r1 + adds r0, r7, 0 + b _081AC178 + .pool +_081AC164: + ldr r0, =gUnknown_0203CE5D + movs r1, 0x16 + ldrsb r1, [r6, r1] + bl ChangeBagPocketId + adds r0, r7, 0 + bl SwitchTaskToFollowupFunc + adds r0, r7, 0 + movs r1, 0x1 +_081AC178: + movs r2, 0x1 + bl SwitchBagPocket + b _081AC22E + .pool +_081AC184: + movs r1, 0x1A + ldrsh r0, [r6, r1] + cmp r0, 0 + beq _081AC192 + cmp r0, 0x1 + beq _081AC1DC + b _081AC22E +_081AC192: + ldrb r0, [r6, 0x18] + bl sub_81AC23C + ldrh r0, [r6, 0x18] + adds r1, r0, 0x1 + strh r1, [r6, 0x18] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081AC1CC + movs r2, 0x16 + ldrsh r0, [r6, r2] + cmp r0, 0x1 + bne _081AC1BC + lsls r0, r1, 16 + asrs r0, 17 + lsls r0, 24 + lsrs r0, 24 + bl bag_menu_copy_pocket_name_to_window + b _081AC1CC +_081AC1BC: + lsls r1, 16 + asrs r1, 17 + movs r0, 0x8 + subs r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl bag_menu_copy_pocket_name_to_window +_081AC1CC: + movs r1, 0x18 + ldrsh r0, [r6, r1] + cmp r0, 0x10 + bne _081AC22E + ldrh r0, [r6, 0x1A] + adds r0, 0x1 + strh r0, [r6, 0x1A] + b _081AC22E +_081AC1DC: + ldr r4, =gUnknown_0203CE5D + movs r1, 0x16 + ldrsb r1, [r6, r1] + adds r0, r4, 0 + bl ChangeBagPocketId + subs r5, r4, 0x5 + ldrb r0, [r5, 0x5] + bl load_bag_item_list_buffers + ldr r0, =gUnknown_03006310 + ldrb r2, [r5, 0x5] + lsls r2, 1 + adds r1, r4, 0 + adds r1, 0xD + adds r1, r2, r1 + ldrh r1, [r1] + adds r4, 0x3 + adds r2, r4 + ldrh r2, [r2] + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6] + movs r0, 0x1 + bl PutWindowTilemap + movs r0, 0x2 + bl PutWindowTilemap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + bl bag_menu_add_pocket_scroll_arrow_indicators_maybe + bl bag_menu_add_list_scroll_arrow_indicators_maybe + adds r0, r7, 0 + bl SwitchTaskToFollowupFunc +_081AC22E: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AC10C + + thumb_func_start sub_81AC23C +sub_81AC23C: @ 81AC23C + push {lr} + sub sp, 0x8 + adds r3, r0, 0 + lsls r3, 24 + movs r0, 0x80 + lsls r0, 18 + adds r3, r0 + lsrs r3, 24 + movs r0, 0xF + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r0, 0x2 + movs r1, 0x11 + movs r2, 0xE + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x8 + pop {r0} + bx r0 + thumb_func_end sub_81AC23C + + thumb_func_start bag_menu_draw_pocket_indicator_square +@ void bag_menu_draw_pocket_indicator_square(char x, int is_current_bag) +bag_menu_draw_pocket_indicator_square: @ 81AC26C + push {lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + cmp r1, 0 + bne _081AC298 + ldr r1, =0x00001017 + adds r2, r0, 0x5 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x1 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x2 + movs r3, 0x3 + bl FillBgTilemapBufferRect_Palette0 + b _081AC2AE + .pool +_081AC298: + ldr r1, =0x0000102b + adds r2, r0, 0x5 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x1 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x2 + movs r3, 0x3 + bl FillBgTilemapBufferRect_Palette0 +_081AC2AE: + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x8 + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_draw_pocket_indicator_square + + thumb_func_start sub_81AC2C0 +sub_81AC2C0: @ 81AC2C0 + push {lr} + ldr r1, =gUnknown_0203CE58 + ldrb r0, [r1, 0x4] + cmp r0, 0x1 + bhi _081AC2E0 + ldrb r0, [r1, 0x5] + subs r0, 0x2 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _081AC2E0 + movs r0, 0x1 + b _081AC2E2 + .pool +_081AC2E0: + movs r0, 0 +_081AC2E2: + pop {r1} + bx r1 + thumb_func_end sub_81AC2C0 + + thumb_func_start bag_menu_swap_items +bag_menu_swap_items: @ 81AC2E8 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + mov r9, r0 + adds r6, r4, r0 + ldrb r0, [r6] + movs r1, 0x10 + movs r2, 0x1 + bl sub_81AF15C + ldr r3, =gUnknown_0203CE58 + ldrb r0, [r3, 0x5] + lsls r0, 1 + adds r2, r3, 0 + adds r2, 0x12 + adds r2, r0, r2 + adds r1, r3, 0 + adds r1, 0x8 + adds r0, r1 + ldrh r1, [r0] + ldrh r2, [r2] + adds r1, r2 + strh r1, [r6, 0x2] + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r2, =0x0000081a + adds r0, r2 + movs r5, 0 + strb r1, [r0] + ldrb r0, [r3, 0x5] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r6, 0x2] + bl BagGetItemIdByPocketPosition + lsls r0, 16 + lsrs r0, 16 + ldr r1, =gStringVar1 + bl CopyItemName + ldr r0, =gStringVar4 + mov r8, r0 + ldr r1, =gText_MoveVar1Where + bl StringExpandPlaceholders + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x1 + str r0, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + str r5, [sp, 0xC] + str r5, [sp, 0x10] + movs r1, 0x1 + mov r2, r8 + movs r3, 0x3 + bl bag_menu_print + ldrb r0, [r6, 0x2] + bl sub_80D4FEC + bl sub_81AB89C + ldrb r0, [r6] + movs r1, 0x2 + bl bag_menu_print_cursor_ + movs r2, 0x8 + negs r2, r2 + add r9, r2 + add r4, r9 + ldr r0, =sub_81AC3C0 + str r0, [r4] + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_swap_items + + thumb_func_start sub_81AC3C0 +@ void sub_81AC3C0(u8 taskId) +sub_81AC3C0: @ 81AC3C0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081AC48E + ldr r0, =gMain + mov r8, r0 + ldrh r1, [r0, 0x2E] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _081AC418 + movs r0, 0x5 + bl PlaySE + ldrb r0, [r4] + ldr r3, =gUnknown_0203CE58 + ldrb r2, [r3, 0x5] + lsls r2, 1 + adds r1, r3, 0 + adds r1, 0x12 + adds r1, r2, r1 + adds r3, 0x8 + adds r2, r3 + bl get_coro_args_x18_x1A + b _081AC472 + .pool +_081AC418: + ldrb r0, [r4] + bl ListMenuHandleInput + adds r7, r0, 0 + ldrb r0, [r4] + ldr r5, =gUnknown_0203CE58 + ldrb r2, [r5, 0x5] + lsls r2, 1 + adds r1, r5, 0 + adds r1, 0x12 + adds r1, r2, r1 + adds r4, r5, 0 + adds r4, 0x8 + adds r2, r4 + bl get_coro_args_x18_x1A + movs r0, 0 + bl sub_80D4FC8 + ldrb r0, [r5, 0x5] + lsls r0, 1 + adds r0, r4 + ldrb r0, [r0] + bl sub_80D4FEC + movs r0, 0x2 + negs r0, r0 + cmp r7, r0 + beq _081AC460 + adds r0, 0x1 + cmp r7, r0 + bne _081AC482 + b _081AC48E + .pool +_081AC460: + movs r0, 0x5 + bl PlaySE + mov r0, r8 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081AC47A +_081AC472: + adds r0, r6, 0 + bl sub_81AC498 + b _081AC48E +_081AC47A: + adds r0, r6, 0 + bl sub_81AC590 + b _081AC48E +_081AC482: + movs r0, 0x5 + bl PlaySE + adds r0, r6, 0 + bl sub_81AC498 +_081AC48E: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81AC3C0 + + thumb_func_start sub_81AC498 +sub_81AC498: @ 81AC498 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + mov r10, r0 + ldr r0, =gTasks + 0x8 + add r0, r10 + mov r9, r0 + ldr r5, =gUnknown_0203CE58 + ldrb r6, [r5, 0x5] + lsls r1, r6, 1 + adds r0, r5, 0 + adds r0, 0x12 + adds r0, r1 + mov r8, r0 + ldr r2, =gUnknown_0203CE60 + adds r7, r1, r2 + ldrh r0, [r7] + mov r1, r8 + ldrh r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 + mov r0, r9 + movs r1, 0x2 + ldrsh r2, [r0, r1] + cmp r2, r4 + beq _081AC4E2 + subs r0, r4, 0x1 + cmp r2, r0 + bne _081AC4F8 +_081AC4E2: + adds r0, r3, 0 + bl sub_81AC590 + b _081AC566 + .pool +_081AC4F8: + ldr r1, =gBagPockets + lsls r0, r6, 3 + adds r0, r1 + ldr r0, [r0] + adds r1, r2, 0 + adds r2, r4, 0 + bl sub_80D702C + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r2, =0x0000081a + adds r0, r2 + movs r1, 0xFF + strb r1, [r0] + mov r1, r9 + ldrb r0, [r1] + mov r1, r8 + adds r2, r7, 0 + bl sub_81AE6C8 + mov r2, r9 + movs r1, 0x2 + ldrsh r0, [r2, r1] + cmp r0, r4 + bge _081AC538 + ldrb r1, [r5, 0x5] + lsls r1, 1 + ldr r2, =gUnknown_0203CE60 + adds r1, r2 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] +_081AC538: + ldrb r0, [r5, 0x5] + bl load_bag_item_list_buffers + ldr r0, =gUnknown_03006310 + mov r2, r8 + ldrh r1, [r2] + ldrh r2, [r7] + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + mov r1, r9 + strh r0, [r1] + movs r0, 0x1 + bl sub_80D4FC8 + bl bag_menu_add_list_scroll_arrow_indicators_maybe + ldr r0, =gTasks + 0x8 + subs r0, 0x8 + add r0, r10 + ldr r1, =Task_BagMenu + str r1, [r0] +_081AC566: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AC498 + + thumb_func_start sub_81AC590 +sub_81AC590: @ 81AC590 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + mov r9, r1 + ldr r0, =gTasks + 0x8 + mov r10, r0 + mov r7, r9 + add r7, r10 + ldr r4, =gUnknown_0203CE58 + ldrb r0, [r4, 0x5] + lsls r0, 1 + adds r1, r4, 0 + adds r1, 0x12 + adds r6, r0, r1 + movs r1, 0x8 + adds r1, r4 + mov r8, r1 + adds r5, r0, r1 + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r1, =0x0000081a + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldrb r0, [r7] + adds r1, r6, 0 + adds r2, r5, 0 + bl sub_81AE6C8 + movs r0, 0x2 + ldrsh r2, [r7, r0] + ldrh r0, [r6] + ldrh r1, [r5] + adds r0, r1 + cmp r2, r0 + bge _081AC5F2 + ldrb r1, [r4, 0x5] + lsls r1, 1 + add r1, r8 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] +_081AC5F2: + ldrb r0, [r4, 0x5] + bl load_bag_item_list_buffers + ldr r0, =gUnknown_03006310 + ldrh r1, [r6] + ldrh r2, [r5] + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7] + movs r0, 0x1 + bl sub_80D4FC8 + bl bag_menu_add_list_scroll_arrow_indicators_maybe + mov r0, r10 + subs r0, 0x8 + add r0, r9 + ldr r1, =Task_BagMenu + str r1, [r0] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AC590 + + thumb_func_start sub_81AC644 +sub_81AC644: @ 81AC644 + push {r4,r5,lr} + sub sp, 0x14 + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x4] + subs r0, 0x1 + cmp r0, 0x9 + bls _081AC654 + b _081AC82C +_081AC654: + lsls r0, 2 + ldr r1, =_081AC668 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081AC668: + .4byte _081AC690 + .4byte _081AC82C + .4byte _081AC82C + .4byte _081AC82C + .4byte _081AC6E8 + .4byte _081AC82C + .4byte _081AC76C + .4byte _081AC7CC + .4byte _081AC70C + .4byte _081AC690 +_081AC690: + ldr r0, =gScriptItemId + ldrh r0, [r0] + bl ItemId_GetBattleUsage + lsls r0, 24 + cmp r0, 0 + beq _081AC6C4 + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_08614042 + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x2 + b _081ACA10 + .pool +_081AC6C4: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_08614046 + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x1 + b _081ACA10 + .pool +_081AC6E8: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_08614047 + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x4 + b _081ACA10 + .pool +_081AC70C: + ldr r4, =gScriptItemId + ldrh r0, [r4] + bl itemid_is_unique + lsls r0, 24 + cmp r0, 0 + bne _081AC748 + ldrh r0, [r4] + cmp r0, 0xAF + beq _081AC748 + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_0861404B + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x2 + b _081ACA10 + .pool +_081AC748: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_08614046 + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x1 + b _081ACA10 + .pool +_081AC76C: + ldr r4, =gScriptItemId + ldrh r0, [r4] + bl itemid_is_unique + lsls r0, 24 + cmp r0, 0 + bne _081AC7A8 + ldrh r0, [r4] + cmp r0, 0xAF + beq _081AC7A8 + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_0861404D + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x2 + b _081ACA10 + .pool +_081AC7A8: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_08614046 + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x1 + b _081ACA10 + .pool +_081AC7CC: + ldr r4, =gScriptItemId + ldrh r0, [r4] + bl itemid_is_unique + lsls r0, 24 + cmp r0, 0 + bne _081AC808 + ldrh r0, [r4] + cmp r0, 0xAF + beq _081AC808 + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_0861404F + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x2 + b _081ACA10 + .pool +_081AC808: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_08614046 + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x1 + b _081ACA10 + .pool +_081AC82C: + bl sub_81221AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081AC840 + bl InUnionRoom + cmp r0, 0x1 + bne _081AC8A4 +_081AC840: + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + cmp r0, 0x4 + beq _081AC856 + ldr r0, =gScriptItemId + ldrh r0, [r0] + bl sub_8122148 + lsls r0, 24 + cmp r0, 0 + bne _081AC880 +_081AC856: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_08614046 + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x1 + b _081ACA10 + .pool +_081AC880: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_08614044 + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x2 + b _081ACA10 + .pool +_081AC8A4: + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + cmp r0, 0x4 + bls _081AC8AE + b _081ACA12 +_081AC8AE: + lsls r0, 2 + ldr r1, =_081AC8C0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081AC8C0: + .4byte _081AC8D4 + .4byte _081AC9B4 + .4byte _081AC9D8 + .4byte _081AC9FC + .4byte _081AC92C +_081AC8D4: + ldr r4, =gUnknown_0203CE54 + ldr r1, [r4] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r3, =0x00000824 + adds r0, r1, r3 + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x4 + strb r0, [r1] + ldr r0, [r4] + adds r0, r3 + ldr r1, =gUnknown_0861402C + movs r2, 0x4 + bl memcpy + ldr r0, =gScriptItemId + ldrh r0, [r0] + bl itemid_is_mail + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081AC90A + b _081ACA12 +_081AC90A: + ldr r0, [r4] + ldr r1, =0x00000824 + adds r0, r1 + movs r1, 0x6 + strb r1, [r0] + b _081ACA12 + .pool +_081AC92C: + ldr r4, =gUnknown_0203CE54 + ldr r1, [r4] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r5, =0x00000824 + adds r0, r1, r5 + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x4 + strb r0, [r1] + ldr r0, [r4] + adds r0, r5 + ldr r1, =gUnknown_08614030 + movs r2, 0x4 + bl memcpy + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00000496 + adds r0, r1 + ldr r2, =gScriptItemId + ldrh r0, [r0] + ldrh r1, [r2] + cmp r0, r1 + bne _081AC96C + ldr r0, [r4] + ldr r1, =0x00000825 + adds r0, r1 + movs r1, 0x8 + strb r1, [r0] +_081AC96C: + ldrh r1, [r2] + ldr r0, =0x00000103 + cmp r1, r0 + beq _081AC97A + adds r0, 0xD + cmp r1, r0 + bne _081ACA12 +_081AC97A: + movs r0, 0x6 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + beq _081ACA12 + ldr r0, [r4] + adds r0, r5 + movs r1, 0x7 + strb r1, [r0] + b _081ACA12 + .pool +_081AC9B4: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_08614034 + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x4 + b _081ACA10 + .pool +_081AC9D8: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_08614038 + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x4 + b _081ACA10 + .pool +_081AC9FC: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_0861403C + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x6 +_081ACA10: + strb r0, [r1] +_081ACA12: + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + cmp r0, 0x2 + bne _081ACA50 + movs r0, 0x1 + bl ClearWindowTilemap + ldr r0, =gScriptItemId + ldrh r0, [r0] + bl PrintTMHMMoveData + movs r0, 0x3 + bl PutWindowTilemap + movs r0, 0x4 + bl PutWindowTilemap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + b _081ACA86 + .pool +_081ACA50: + ldr r0, =gScriptItemId + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gText_Var1IsSelected + adds r0, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r0, [sp, 0x10] + movs r0, 0x1 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x3 + bl bag_menu_print +_081ACA86: + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r1, =0x00000828 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081ACAB0 + movs r0, 0 + b _081ACAB6 + .pool +_081ACAB0: + cmp r0, 0x2 + bne _081ACAC4 + movs r0, 0x1 +_081ACAB6: + bl bag_menu_add_window + lsls r0, 24 + lsrs r0, 24 + bl sub_81ACAF8 + b _081ACAEE +_081ACAC4: + cmp r0, 0x4 + bne _081ACADC + movs r0, 0x2 + bl bag_menu_add_window + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + movs r2, 0x2 + bl sub_81ACB54 + b _081ACAEE +_081ACADC: + movs r0, 0x3 + bl bag_menu_add_window + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + movs r2, 0x3 + bl sub_81ACB54 +_081ACAEE: + add sp, 0x14 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81AC644 + + thumb_func_start sub_81ACAF8 +sub_81ACAF8: @ 81ACAF8 + push {r4-r6,lr} + sub sp, 0x14 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + str r0, [sp] + movs r0, 0x10 + str r0, [sp, 0x4] + ldr r6, =gUnknown_0203CE54 + ldr r1, [r6] + ldr r5, =0x00000828 + adds r0, r1, r5 + ldrb r0, [r0] + str r0, [sp, 0x8] + ldr r0, =gUnknown_08613FB4 + str r0, [sp, 0xC] + movs r0, 0x82 + lsls r0, 4 + adds r1, r0 + ldr r0, [r1] + str r0, [sp, 0x10] + adds r0, r4, 0 + movs r1, 0x7 + movs r2, 0x8 + movs r3, 0x1 + bl AddItemMenuActionTextPrinters + ldr r0, [r6] + adds r0, r5 + ldrb r1, [r0] + adds r0, r4, 0 + movs r2, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81ACAF8 + + thumb_func_start sub_81ACB54 +sub_81ACB54: @ 81ACB54 + push {r4-r6,lr} + sub sp, 0x14 + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + movs r0, 0x38 + str r0, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + ldr r0, =gUnknown_08613FB4 + str r0, [sp, 0xC] + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + movs r1, 0x82 + lsls r1, 4 + adds r0, r1 + ldr r0, [r0] + str r0, [sp, 0x10] + adds r0, r4, 0 + movs r1, 0x7 + movs r2, 0x8 + movs r3, 0x1 + bl sub_8198DBC + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r1, 0x38 + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_8199944 + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81ACB54 + + thumb_func_start unknown_item_menu_type +unknown_item_menu_type: @ 81ACBB0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_81AC644 + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r1, =0x00000828 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x2 + bhi _081ACBE8 + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =Task_HandleInBattleItemMenuInput + b _081ACBF4 + .pool +_081ACBE8: + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =Task_HandleOutOfBattleItemMenuInput +_081ACBF4: + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end unknown_item_menu_type + + thumb_func_start Task_HandleInBattleItemMenuInput +Task_HandleInBattleItemMenuInput: @ 81ACC04 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081ACC6A + bl ProcessMenuInputNoWrapAround + lsls r0, 24 + asrs r4, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _081ACC6A + adds r0, 0x1 + cmp r4, r0 + bne _081ACC44 + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_08613FB4 + ldr r1, [r0, 0x24] + adds r0, r5, 0 + bl _call_via_r1 + b _081ACC6A + .pool +_081ACC44: + movs r0, 0x5 + bl PlaySE + ldr r1, =gUnknown_08613FB4 + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + movs r2, 0x82 + lsls r2, 4 + adds r0, r2 + ldr r0, [r0] + adds r0, r4 + ldrb r0, [r0] + lsls r0, 3 + adds r1, 0x4 + adds r0, r1 + ldr r1, [r0] + adds r0, r6, 0 + bl _call_via_r1 +_081ACC6A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end Task_HandleInBattleItemMenuInput + + thumb_func_start Task_HandleOutOfBattleItemMenuInput +Task_HandleOutOfBattleItemMenuInput: @ 81ACC78 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081ACC8C + b _081ACDF0 +_081ACC8C: + bl GetMenuCursorPos + lsls r0, 24 + lsrs r4, r0, 24 + ldr r5, =gMain + ldrh r1, [r5, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081ACCD4 + lsls r0, r4, 24 + asrs r0, 24 + cmp r0, 0 + bgt _081ACCAA + b _081ACDF0 +_081ACCAA: + subs r0, 0x2 + lsls r0, 24 + asrs r0, 24 + bl sub_81ACDFC + lsls r0, 24 + cmp r0, 0 + bne _081ACCBC + b _081ACDF0 +_081ACCBC: + movs r0, 0x5 + bl PlaySE + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + bl sub_8199134 + b _081ACDF0 + .pool +_081ACCD4: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081ACD1C + lsls r0, r4, 24 + asrs r1, r0, 24 + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r2, =0x00000828 + adds r0, r2 + ldrb r0, [r0] + subs r0, 0x2 + cmp r1, r0 + blt _081ACCF2 + b _081ACDF0 +_081ACCF2: + adds r0, r1, 0x2 + lsls r0, 24 + asrs r0, 24 + bl sub_81ACDFC + lsls r0, 24 + cmp r0, 0 + beq _081ACDF0 + movs r0, 0x5 + bl PlaySE + movs r0, 0 + movs r1, 0x1 + bl sub_8199134 + b _081ACDF0 + .pool +_081ACD1C: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _081ACD30 + bl GetLRKeysState + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081ACD58 +_081ACD30: + lsls r0, r4, 24 + asrs r1, r0, 24 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081ACDF0 + subs r0, r1, 0x1 + lsls r0, 24 + asrs r0, 24 + bl sub_81ACDFC + lsls r0, 24 + cmp r0, 0 + beq _081ACDF0 + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + negs r0, r0 + b _081ACD92 +_081ACD58: + ldrh r1, [r5, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _081ACD6E + bl GetLRKeysState + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _081ACD9A +_081ACD6E: + lsls r0, r4, 24 + asrs r1, r0, 24 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081ACDF0 + adds r0, r1, 0x1 + lsls r0, 24 + asrs r0, 24 + bl sub_81ACDFC + lsls r0, 24 + cmp r0, 0 + beq _081ACDF0 + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 +_081ACD92: + movs r1, 0 + bl sub_8199134 + b _081ACDF0 +_081ACD9A: + ldrh r1, [r5, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081ACDD8 + movs r0, 0x5 + bl PlaySE + ldr r2, =gUnknown_08613FB4 + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + lsls r1, r4, 24 + asrs r1, 24 + movs r3, 0x82 + lsls r3, 4 + adds r0, r3 + ldr r0, [r0] + adds r0, r1 + ldrb r0, [r0] + lsls r0, 3 + adds r2, 0x4 + adds r0, r2 + ldr r1, [r0] + adds r0, r6, 0 + bl _call_via_r1 + b _081ACDF0 + .pool +_081ACDD8: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081ACDF0 + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_08613FB4 + ldr r1, [r0, 0x24] + adds r0, r6, 0 + bl _call_via_r1 +_081ACDF0: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end Task_HandleOutOfBattleItemMenuInput + + thumb_func_start sub_81ACDFC +sub_81ACDFC: @ 81ACDFC + push {lr} + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + blt _081ACE30 + ldr r0, =gUnknown_0203CE54 + ldr r2, [r0] + ldr r3, =0x00000828 + adds r0, r2, r3 + ldrb r0, [r0] + cmp r1, r0 + bgt _081ACE30 + movs r3, 0x82 + lsls r3, 4 + adds r0, r2, r3 + ldr r0, [r0] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0xE + beq _081ACE30 + movs r0, 0x1 + b _081ACE32 + .pool +_081ACE30: + movs r0, 0 +_081ACE32: + pop {r1} + bx r1 + thumb_func_end sub_81ACDFC + + thumb_func_start bag_menu_remove_some_window +bag_menu_remove_some_window: @ 81ACE38 + push {lr} + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r1, =0x00000828 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081ACE58 + movs r0, 0 + bl bag_menu_remove_window + b _081ACE76 + .pool +_081ACE58: + cmp r0, 0x2 + bne _081ACE64 + movs r0, 0x1 + bl bag_menu_remove_window + b _081ACE76 +_081ACE64: + cmp r0, 0x4 + bne _081ACE70 + movs r0, 0x2 + bl bag_menu_remove_window + b _081ACE76 +_081ACE70: + movs r0, 0x3 + bl bag_menu_remove_window +_081ACE76: + pop {r0} + bx r0 + thumb_func_end bag_menu_remove_some_window + + thumb_func_start ItemMenu_UseOutOfBattle +@ void ItemMenu_UseOutOfBattle(u8 taskId) +ItemMenu_UseOutOfBattle: @ 81ACE7C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r5, =gScriptItemId + ldrh r0, [r5] + bl ItemId_GetFieldFunc + cmp r0, 0 + beq _081ACEEE + bl bag_menu_remove_some_window + bl CalculatePlayerPartyCount + lsls r0, 24 + cmp r0, 0 + bne _081ACEB8 + ldrh r0, [r5] + bl ItemId_GetType + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081ACEB8 + adds r0, r4, 0 + bl bag_menu_print_there_is_no_pokemon + b _081ACEEE + .pool +_081ACEB8: + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + cmp r0, 0x3 + beq _081ACEE8 + ldr r0, =gScriptItemId + ldrh r0, [r0] + bl ItemId_GetFieldFunc + adds r1, r0, 0 + adds r0, r4, 0 + bl _call_via_r1 + b _081ACEEE + .pool +_081ACEE8: + adds r0, r4, 0 + bl sub_80FDD10 +_081ACEEE: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end ItemMenu_UseOutOfBattle + + thumb_func_start ItemMenu_Toss +ItemMenu_Toss: @ 81ACEF4 + push {r4-r7,lr} + sub sp, 0x14 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r6, r0, 3 + ldr r7, =gTasks + 0x8 + adds r4, r6, r7 + bl bag_menu_remove_some_window + movs r0, 0x1 + strh r0, [r4, 0x10] + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _081ACF24 + adds r0, r5, 0 + bl BagMenuConfirmToss + b _081ACF6A + .pool +_081ACF24: + ldr r0, =gScriptItemId + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gText_TossHowManyVar1s + adds r0, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r0, [sp, 0x10] + movs r0, 0x1 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x3 + bl bag_menu_print + movs r0, 0x7 + bl sub_81ABC3C + adds r0, r7, 0 + subs r0, 0x8 + adds r0, r6, r0 + ldr r1, =Task_ChooseHowManyToToss + str r1, [r0] +_081ACF6A: + add sp, 0x14 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end ItemMenu_Toss + + thumb_func_start BagMenuConfirmToss +BagMenuConfirmToss: @ 81ACF88 + push {r4,r5,lr} + sub sp, 0x14 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + ldr r0, =gScriptItemId + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r0, =gStringVar2 + movs r2, 0x10 + ldrsh r1, [r4, r2] + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gText_ConfirmTossItems + adds r0, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r0, [sp, 0x10] + movs r0, 0x1 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x3 + bl bag_menu_print + ldr r2, =gUnknown_08614084 + adds r0, r5, 0 + movs r1, 0x5 + bl bag_menu_yes_no + add sp, 0x14 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end BagMenuConfirmToss + + thumb_func_start BagMenuCancelToss +BagMenuCancelToss: @ 81AD010 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + movs r1, 0x2 + ldrsh r0, [r4, r1] + bl bag_menu_print_description_box_text + ldrb r0, [r4] + movs r1, 0 + bl bag_menu_print_cursor_ + adds r0, r5, 0 + bl set_callback3_to_bag + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end BagMenuCancelToss + + thumb_func_start Task_ChooseHowManyToToss +Task_ChooseHowManyToToss: @ 81AD044 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + adds r0, r4, 0 + adds r0, 0x10 + ldrh r1, [r4, 0x4] + bl AdjustQuantityAccordingToDPadInput + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081AD088 + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r1, =0x00000817 + adds r0, r1 + ldrb r0, [r0] + movs r2, 0x10 + ldrsh r1, [r4, r2] + bl sub_81ABC54 + b _081AD0C6 + .pool +_081AD088: + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081AD0AC + movs r0, 0x5 + bl PlaySE + movs r0, 0x7 + bl bag_menu_remove_window + adds r0, r5, 0 + bl BagMenuConfirmToss + b _081AD0C6 + .pool +_081AD0AC: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081AD0C6 + movs r0, 0x5 + bl PlaySE + movs r0, 0x7 + bl bag_menu_remove_window + adds r0, r6, 0 + bl BagMenuCancelToss +_081AD0C6: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end Task_ChooseHowManyToToss + + thumb_func_start BagMenuActuallyToss +BagMenuActuallyToss: @ 81AD0CC + push {r4-r6,lr} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r5, =gTasks + 0x8 + adds r6, r4, r5 + ldr r0, =gScriptItemId + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r0, =gStringVar2 + movs r2, 0x10 + ldrsh r1, [r6, r2] + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + ldr r6, =gStringVar4 + ldr r1, =gText_ThrewAwayVar2Var1s + adds r0, r6, 0 + bl StringExpandPlaceholders + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r0, [sp, 0x10] + movs r0, 0x1 + movs r1, 0x1 + adds r2, r6, 0 + movs r3, 0x3 + bl bag_menu_print + subs r5, 0x8 + adds r4, r5 + ldr r0, =Task_ActuallyToss + str r0, [r4] + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end BagMenuActuallyToss + + thumb_func_start Task_ActuallyToss +Task_ActuallyToss: @ 81AD150 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r5, r0, r1 + ldr r4, =gUnknown_0203CE58 + ldrb r0, [r4, 0x5] + lsls r0, 1 + adds r1, r4, 0 + adds r1, 0x12 + adds r1, r0 + mov r8, r1 + adds r1, r4, 0 + adds r1, 0x8 + adds r7, r0, r1 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081AD1CE + movs r0, 0x5 + bl PlaySE + ldr r0, =gScriptItemId + ldrh r0, [r0] + ldrh r1, [r5, 0x10] + bl RemoveBagItem + ldrb r0, [r5] + mov r1, r8 + adds r2, r7, 0 + bl sub_81AE6C8 + ldrb r0, [r4, 0x5] + bl sub_81AB9A8 + ldrb r0, [r4, 0x5] + bl sub_81ABA88 + ldrb r0, [r4, 0x5] + bl load_bag_item_list_buffers + ldr r0, =gUnknown_03006310 + mov r2, r8 + ldrh r1, [r2] + ldrh r2, [r7] + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5] + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + adds r0, r6, 0 + bl set_callback3_to_bag +_081AD1CE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end Task_ActuallyToss + + thumb_func_start ItemMenu_Register +ItemMenu_Register: @ 81AD1EC + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r7, r0, r1 + ldr r0, =gUnknown_0203CE58 + ldrb r1, [r0, 0x5] + lsls r1, 1 + adds r2, r0, 0 + adds r2, 0x12 + adds r6, r1, r2 + adds r0, 0x8 + adds r5, r1, r0 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =0x00000496 + adds r1, r0, r2 + ldr r0, =gScriptItemId + ldrh r2, [r0] + ldrh r0, [r1] + cmp r0, r2 + bne _081AD238 + movs r0, 0 + strh r0, [r1] + b _081AD23A + .pool +_081AD238: + strh r2, [r1] +_081AD23A: + ldrb r0, [r7] + adds r1, r6, 0 + adds r2, r5, 0 + bl sub_81AE6C8 + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + bl load_bag_item_list_buffers + ldr r0, =gUnknown_03006310 + ldrh r1, [r6] + ldrh r2, [r5] + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7] + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + adds r0, r4, 0 + bl ItemMenu_Cancel + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end ItemMenu_Register + + thumb_func_start ItemMenu_Give +ItemMenu_Give: @ 81AD278 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + bl bag_menu_remove_some_window + ldr r5, =gScriptItemId + ldrh r0, [r5] + bl itemid_80BF6D8_mail_related + lsls r0, 24 + cmp r0, 0 + bne _081AD2AC + ldr r2, =gText_CantWriteMail + ldr r3, =sub_81AD350 + adds r0, r4, 0 + movs r1, 0x1 + bl DisplayItemMessage + b _081AD2EA + .pool +_081AD2AC: + ldrh r0, [r5] + bl itemid_is_unique + lsls r0, 24 + cmp r0, 0 + bne _081AD2E4 + bl CalculatePlayerPartyCount + lsls r0, 24 + cmp r0, 0 + bne _081AD2CA + adds r0, r4, 0 + bl bag_menu_print_there_is_no_pokemon + b _081AD2EA +_081AD2CA: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + ldr r0, =sub_81B7F60 + str r0, [r1] + adds r0, r4, 0 + bl unknown_ItemMenu_Confirm + b _081AD2EA + .pool +_081AD2E4: + adds r0, r6, 0 + bl bag_menu_print_cant_be_held_msg +_081AD2EA: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end ItemMenu_Give + + thumb_func_start bag_menu_print_there_is_no_pokemon +bag_menu_print_there_is_no_pokemon: @ 81AD2F0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gText_NoPokemon + ldr r3, =sub_81AD350 + movs r1, 0x1 + bl DisplayItemMessage + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_print_there_is_no_pokemon + + thumb_func_start bag_menu_print_cant_be_held_msg +bag_menu_print_cant_be_held_msg: @ 81AD30C + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gScriptItemId + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r5, =gStringVar4 + ldr r1, =gText_Var1CantBeHeld + adds r0, r5, 0 + bl StringExpandPlaceholders + ldr r3, =sub_81AD350 + adds r0, r4, 0 + movs r1, 0x1 + adds r2, r5, 0 + bl DisplayItemMessage + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_print_cant_be_held_msg + + thumb_func_start sub_81AD350 +sub_81AD350: @ 81AD350 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081AD36E + movs r0, 0x5 + bl PlaySE + adds r0, r4, 0 + bl bag_menu_inits_lists_menu +_081AD36E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AD350 + + thumb_func_start ItemMenu_CheckTag +ItemMenu_CheckTag: @ 81AD378 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0203CE54 + ldr r2, [r1] + ldr r1, =sub_8177C14 + str r1, [r2] + bl unknown_ItemMenu_Confirm + pop {r0} + bx r0 + .pool + thumb_func_end ItemMenu_CheckTag + + thumb_func_start ItemMenu_Cancel +ItemMenu_Cancel: @ 81AD398 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + bl bag_menu_remove_some_window + movs r1, 0x2 + ldrsh r0, [r4, r1] + bl bag_menu_print_description_box_text + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + ldrb r0, [r4] + movs r1, 0 + bl bag_menu_print_cursor_ + adds r0, r5, 0 + bl set_callback3_to_bag + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ItemMenu_Cancel + + thumb_func_start ItemMenu_UseInBattle +ItemMenu_UseInBattle: @ 81AD3DC + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =gScriptItemId + ldrh r0, [r4] + bl ItemId_GetBattleFunc + cmp r0, 0 + beq _081AD400 + bl bag_menu_remove_some_window + ldrh r0, [r4] + bl ItemId_GetBattleFunc + adds r1, r0, 0 + adds r0, r5, 0 + bl _call_via_r1 +_081AD400: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ItemMenu_UseInBattle + + thumb_func_start bag_menu_mail_related +bag_menu_mail_related: @ 81AD40C + push {lr} + movs r0, 0xC + movs r1, 0x5 + movs r2, 0 + bl GoToBagMenu + pop {r0} + bx r0 + thumb_func_end bag_menu_mail_related + + thumb_func_start item_menu_type_2 +item_menu_type_2: @ 81AD41C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =gScriptItemId + ldrh r0, [r4] + bl itemid_80BF6D8_mail_related + lsls r0, 24 + cmp r0, 0 + bne _081AD44C + ldr r2, =gText_CantWriteMail + ldr r3, =sub_81AD350 + adds r0, r5, 0 + movs r1, 0x1 + bl DisplayItemMessage + b _081AD4AE + .pool +_081AD44C: + ldrh r0, [r4] + bl sub_8122148 + lsls r0, 24 + cmp r0, 0 + bne _081AD488 + ldrh r0, [r4] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gText_Var1CantBeHeldHere + adds r0, r4, 0 + bl StringExpandPlaceholders + ldr r3, =sub_81AD350 + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl DisplayItemMessage + b _081AD4AE + .pool +_081AD488: + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + cmp r0, 0x4 + beq _081AD4A8 + ldrh r0, [r4] + bl itemid_is_unique + lsls r0, 24 + cmp r0, 0 + bne _081AD4A8 + adds r0, r5, 0 + bl unknown_ItemMenu_Confirm + b _081AD4AE + .pool +_081AD4A8: + adds r0, r5, 0 + bl bag_menu_print_cant_be_held_msg +_081AD4AE: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end item_menu_type_2 + + thumb_func_start item_menu_type_b +item_menu_type_b: @ 81AD4B4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r5, =gScriptItemId + ldrh r0, [r5] + bl itemid_is_mail + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081AD4E4 + ldr r2, =gText_CantWriteMail + ldr r3, =sub_81AD350 + adds r0, r4, 0 + movs r1, 0x1 + bl DisplayItemMessage + b _081AD51A + .pool +_081AD4E4: + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + cmp r0, 0x4 + beq _081AD514 + ldrh r0, [r5] + bl itemid_is_unique + lsls r0, 24 + cmp r0, 0 + bne _081AD514 + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =unknown_ItemMenu_Confirm + str r0, [r1] + b _081AD51A + .pool +_081AD514: + adds r0, r4, 0 + bl bag_menu_print_cant_be_held_msg +_081AD51A: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end item_menu_type_b + + thumb_func_start UseRegisteredKeyItemOnField +@ bool8 UseRegisteredKeyItemOnField() +UseRegisteredKeyItemOnField: @ 81AD520 + push {r4-r7,lr} + bl InUnionRoom + cmp r0, 0x1 + beq _081AD54C + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + bne _081AD54C + bl InBattlePike + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0 + bne _081AD54C + bl InMultiBattleRoom + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081AD550 +_081AD54C: + movs r0, 0 + b _081AD5D2 +_081AD550: + bl HideMapNamePopUpWindow + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY_ScreenOff + ldr r4, =gSaveBlock1Ptr + ldr r0, [r4] + ldr r5, =0x00000496 + adds r1, r0, r5 + ldrh r0, [r1] + cmp r0, 0 + beq _081AD5CA + movs r1, 0x1 + bl CheckBagHasItem + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x1 + bne _081AD5C4 + bl ScriptContext2_Enable + bl player_bitmagic + bl sub_808B864 + bl sub_808BCF4 + ldr r2, =gScriptItemId + ldr r0, [r4] + adds r0, r5 + ldrh r1, [r0] + strh r1, [r2] + ldrh r0, [r0] + bl ItemId_GetFieldFunc + movs r1, 0x8 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r6, [r1, 0xE] + b _081AD5D0 + .pool +_081AD5C4: + ldr r0, [r4] + adds r0, r5 + strh r7, [r0] +_081AD5CA: + ldr r0, =gUnknown_082736B3 + bl ScriptContext1_SetupScript +_081AD5D0: + movs r0, 0x1 +_081AD5D2: + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end UseRegisteredKeyItemOnField + + thumb_func_start display_sell_item_ask_str +@ void display_sell_item_ask_str(int a1) +display_sell_item_ask_str: @ 81AD5DC + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r7, r5, 0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + ldr r6, =gScriptItemId + ldrh r0, [r6] + bl itemid_get_market_price + lsls r0, 16 + cmp r0, 0 + bne _081AD634 + ldrh r0, [r6] + ldr r1, =gStringVar2 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E960F + adds r0, r4, 0 + bl StringExpandPlaceholders + ldr r3, =bag_menu_inits_lists_menu + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl DisplayItemMessage + b _081AD66A + .pool +_081AD634: + movs r0, 0x1 + strh r0, [r4, 0x10] + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _081AD64C + bl bag_menu_AddMoney_window + adds r0, r5, 0 + bl sub_81AD680 + b _081AD66A +_081AD64C: + ldrh r0, [r6] + ldr r1, =gStringVar2 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E962F + adds r0, r4, 0 + bl StringExpandPlaceholders + ldr r3, =sub_81AD730 + adds r0, r7, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl DisplayItemMessage +_081AD66A: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end display_sell_item_ask_str + + thumb_func_start sub_81AD680 +sub_81AD680: @ 81AD680 + push {r4-r6,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + ldr r6, =gStringVar1 + ldr r0, =gScriptItemId + ldrh r0, [r0] + bl itemid_get_market_price + lsls r0, 16 + lsrs r0, 17 + movs r2, 0x10 + ldrsh r1, [r4, r2] + muls r1, r0 + adds r0, r6, 0 + movs r2, 0 + movs r3, 0x6 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9654 + adds r0, r4, 0 + bl StringExpandPlaceholders + ldr r3, =sub_81AD6E4 + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl DisplayItemMessage + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AD680 + + thumb_func_start sub_81AD6E4 +sub_81AD6E4: @ 81AD6E4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gUnknown_0861408C + movs r1, 0x6 + bl bag_menu_yes_no + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AD6E4 + + thumb_func_start sub_81AD6FC +sub_81AD6FC: @ 81AD6FC + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + bl bag_menu_remove_money_window + movs r0, 0x4 + bl bag_menu_RemoveBagItem_message_window + ldrb r0, [r4] + movs r1, 0 + bl bag_menu_print_cursor_ + adds r0, r5, 0 + bl set_callback3_to_bag + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AD6FC + + thumb_func_start sub_81AD730 +sub_81AD730: @ 81AD730 + push {r4-r6,lr} + mov r6, r8 + push {r6} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r6, =gTasks + 0x8 + adds r0, r4, r6 + mov r8, r0 + movs r0, 0x8 + bl bag_menu_add_window + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gScriptItemId + ldrh r0, [r0] + bl itemid_get_market_price + lsls r0, 16 + lsrs r0, 17 + mov r2, r8 + movs r3, 0x10 + ldrsh r1, [r2, r3] + adds r2, r0, 0 + muls r2, r1 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_81ABCC0 + bl bag_menu_AddMoney_window + subs r6, 0x8 + adds r4, r6 + ldr r0, =sub_81AD794 + str r0, [r4] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AD730 + + thumb_func_start sub_81AD794 +sub_81AD794: @ 81AD794 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r6, r0, r1 + adds r0, r6, 0 + adds r0, 0x10 + ldrh r1, [r6, 0x4] + bl AdjustQuantityAccordingToDPadInput + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081AD7F4 + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r1, =0x00000818 + adds r0, r1 + ldrb r4, [r0] + movs r2, 0x10 + ldrsh r5, [r6, r2] + ldr r0, =gScriptItemId + ldrh r0, [r0] + bl itemid_get_market_price + lsls r0, 16 + lsrs r0, 17 + movs r2, 0x10 + ldrsh r1, [r6, r2] + adds r2, r0, 0 + muls r2, r1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_81ABCC0 + b _081AD844 + .pool +_081AD7F4: + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081AD818 + movs r0, 0x5 + bl PlaySE + movs r0, 0x8 + bl bag_menu_remove_window + adds r0, r4, 0 + bl sub_81AD680 + b _081AD844 + .pool +_081AD818: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081AD844 + movs r0, 0x5 + bl PlaySE + ldrb r0, [r6] + movs r1, 0 + bl bag_menu_print_cursor_ + bl bag_menu_remove_money_window + movs r0, 0x8 + bl bag_menu_remove_window + movs r0, 0x4 + bl bag_menu_RemoveBagItem_message_window + adds r0, r5, 0 + bl set_callback3_to_bag +_081AD844: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81AD794 + + thumb_func_start sub_81AD84C +sub_81AD84C: @ 81AD84C + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + ldr r6, =gScriptItemId + ldrh r0, [r6] + ldr r1, =gStringVar2 + bl CopyItemName + ldr r0, =gStringVar1 + mov r8, r0 + ldrh r0, [r6] + bl itemid_get_market_price + lsls r0, 16 + lsrs r0, 17 + movs r2, 0x10 + ldrsh r1, [r4, r2] + muls r1, r0 + mov r0, r8 + movs r2, 0 + movs r3, 0x6 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9677 + adds r0, r4, 0 + bl StringExpandPlaceholders + ldr r3, =sub_81AD8C8 + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl DisplayItemMessage + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AD84C + + thumb_func_start sub_81AD8C8 +sub_81AD8C8: @ 81AD8C8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + lsls r6, r0, 2 + adds r6, r0 + lsls r6, 3 + ldr r0, =gTasks + 0x8 + adds r0, r6 + mov r10, r0 + ldr r7, =gUnknown_0203CE58 + ldrb r5, [r7, 0x5] + lsls r5, 1 + movs r1, 0x12 + adds r1, r7 + mov r9, r1 + add r9, r5 + adds r0, r7, 0 + adds r0, 0x8 + adds r5, r0 + movs r0, 0x5F + bl PlaySE + ldr r2, =gScriptItemId + mov r8, r2 + ldrh r0, [r2] + mov r3, r10 + ldrh r1, [r3, 0x10] + bl RemoveBagItem + ldr r0, =gSaveBlock1Ptr + ldr r4, [r0] + movs r1, 0x92 + lsls r1, 3 + adds r4, r1 + mov r2, r8 + ldrh r0, [r2] + bl itemid_get_market_price + lsls r0, 16 + lsrs r0, 17 + mov r3, r10 + movs r2, 0x10 + ldrsh r1, [r3, r2] + muls r1, r0 + adds r0, r4, 0 + bl AddMoney + mov r3, r10 + ldrb r0, [r3] + mov r1, r9 + adds r2, r5, 0 + bl sub_81AE6C8 + ldrb r0, [r7, 0x5] + bl sub_81AB9A8 + ldrb r0, [r7, 0x5] + bl sub_81ABA88 + ldrb r0, [r7, 0x5] + bl load_bag_item_list_buffers + ldr r0, =gUnknown_03006310 + mov r2, r9 + ldrh r1, [r2] + ldrh r2, [r5] + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + mov r3, r10 + strh r0, [r3] + movs r1, 0x2 + bl bag_menu_print_cursor_ + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r1, =0x00000819 + adds r0, r1 + ldrb r4, [r0] + ldr r2, =gSaveBlock1Ptr + ldr r0, [r2] + movs r3, 0x92 + lsls r3, 3 + adds r0, r3 + bl GetMoney + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + bl PrintMoneyAmountInMoneyBox + ldr r0, =gTasks + 0x8 + subs r0, 0x8 + adds r6, r0 + ldr r0, =sub_81AD9C0 + str r0, [r6] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AD8C8 + + thumb_func_start sub_81AD9C0 +sub_81AD9C0: @ 81AD9C0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081AD9E2 + movs r0, 0x5 + bl PlaySE + bl bag_menu_remove_money_window + adds r0, r4, 0 + bl bag_menu_inits_lists_menu +_081AD9E2: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AD9C0 + + thumb_func_start display_deposit_item_ask_str +display_deposit_item_ask_str: @ 81AD9EC + push {r4-r6,lr} + sub sp, 0x14 + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r5, r0, 3 + ldr r6, =gTasks + 0x8 + adds r1, r5, r6 + movs r0, 0x1 + strh r0, [r1, 0x10] + movs r3, 0x4 + ldrsh r0, [r1, r3] + cmp r0, 0x1 + bne _081ADA18 + adds r0, r2, 0 + bl sub_81ADB14 + b _081ADA5E + .pool +_081ADA18: + ldr r0, =gScriptItemId + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gText_DepositHowManyVar1 + adds r0, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r0, [sp, 0x10] + movs r0, 0x1 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x3 + bl bag_menu_print + movs r0, 0x7 + bl sub_81ABC3C + adds r0, r6, 0 + subs r0, 0x8 + adds r0, r5, r0 + ldr r1, =sub_81ADA7C + str r1, [r0] +_081ADA5E: + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end display_deposit_item_ask_str + + thumb_func_start sub_81ADA7C +sub_81ADA7C: @ 81ADA7C + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r5, r0, r1 + adds r0, r5, 0 + adds r0, 0x10 + ldrh r1, [r5, 0x4] + bl AdjustQuantityAccordingToDPadInput + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081ADAC0 + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r1, =0x00000817 + adds r0, r1 + ldrb r0, [r0] + movs r2, 0x10 + ldrsh r1, [r5, r2] + bl sub_81ABC54 + b _081ADB0E + .pool +_081ADAC0: + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081ADAE4 + movs r0, 0x5 + bl PlaySE + movs r0, 0x7 + bl bag_menu_remove_window + adds r0, r4, 0 + bl sub_81ADB14 + b _081ADB0E + .pool +_081ADAE4: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081ADB0E + movs r0, 0x5 + bl PlaySE + movs r1, 0x2 + ldrsh r0, [r5, r1] + bl bag_menu_print_description_box_text + ldrb r0, [r5] + movs r1, 0 + bl bag_menu_print_cursor_ + movs r0, 0x7 + bl bag_menu_remove_window + adds r0, r6, 0 + bl set_callback3_to_bag +_081ADB0E: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81ADA7C + + thumb_func_start sub_81ADB14 +sub_81ADB14: @ 81ADB14 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r7, r1, 3 + ldr r0, =gTasks + 0x8 + mov r9, r0 + adds r2, r7, 0 + add r2, r9 + mov r8, r2 + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r4, =gScriptItemId + ldrh r0, [r4] + bl itemid_is_unique + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + beq _081ADB6C + ldr r2, =gText_CantStoreImportantItems + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r0, [sp, 0x10] + movs r0, 0x1 + b _081ADBE2 + .pool +_081ADB6C: + ldrh r0, [r4] + mov r3, r8 + ldrh r1, [r3, 0x10] + bl sub_80D6D70 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x1 + bne _081ADBD4 + ldrh r0, [r4] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r0, =gStringVar2 + mov r2, r8 + movs r3, 0x10 + ldrsh r1, [r2, r3] + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gText_DepositedVar2Var1s + adds r0, r4, 0 + bl StringExpandPlaceholders + str r6, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + str r5, [sp, 0xC] + str r5, [sp, 0x10] + movs r0, 0x1 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x3 + bl bag_menu_print + mov r0, r9 + subs r0, 0x8 + adds r0, r7, r0 + ldr r1, =Task_ActuallyToss + b _081ADBF2 + .pool +_081ADBD4: + ldr r2, =gText_NoRoomForItems + movs r0, 0x1 + str r0, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + str r5, [sp, 0xC] + str r5, [sp, 0x10] +_081ADBE2: + movs r1, 0x1 + movs r3, 0x3 + bl bag_menu_print + mov r0, r9 + subs r0, 0x8 + adds r0, r7, r0 + ldr r1, =sub_81ADC0C +_081ADBF2: + str r1, [r0] + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81ADB14 + + thumb_func_start sub_81ADC0C +sub_81ADC0C: @ 81ADC0C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r5, r0, r1 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081ADC44 + movs r0, 0x5 + bl PlaySE + movs r1, 0x2 + ldrsh r0, [r5, r1] + bl bag_menu_print_description_box_text + ldrb r0, [r5] + movs r1, 0 + bl bag_menu_print_cursor_ + adds r0, r4, 0 + bl set_callback3_to_bag +_081ADC44: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81ADC0C + + thumb_func_start IsWallysBag +@ bool8 IsWallysBag() +IsWallysBag: @ 81ADC54 + push {lr} + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x4] + cmp r0, 0xA + beq _081ADC68 + movs r0, 0 + b _081ADC6A + .pool +_081ADC68: + movs r0, 0x1 +_081ADC6A: + pop {r1} + bx r1 + thumb_func_end IsWallysBag + + thumb_func_start PrepareBagForWallyTutorial +@ void PrepareBagForWallyTutorial() +PrepareBagForWallyTutorial: @ 81ADC70 + push {r4-r6,lr} + ldr r4, =gUnknown_0203CE80 + movs r0, 0xD0 + bl AllocZeroed + str r0, [r4] + ldr r5, =gSaveBlock1Ptr + ldr r1, [r5] + movs r2, 0xAC + lsls r2, 3 + adds r1, r2 + movs r2, 0x78 + bl memcpy + ldr r0, [r4] + ldr r1, [r5] + movs r2, 0xCA + lsls r2, 3 + adds r1, r2 + adds r0, 0x78 + movs r2, 0x40 + bl memcpy + ldr r0, [r4] + ldr r2, =gUnknown_0203CE58 + ldrb r1, [r2, 0x5] + adds r0, 0xCE + strh r1, [r0] + movs r6, 0 + adds r5, r2, 0 + adds r5, 0x8 +_081ADCAE: + ldr r2, [r4] + lsls r3, r6, 1 + adds r0, r2, 0 + adds r0, 0xB8 + adds r0, r3 + ldrh r1, [r5] + strh r1, [r0] + adds r2, 0xC2 + adds r2, r3 + ldrh r0, [r5, 0xA] + strh r0, [r2] + adds r5, 0x2 + adds r6, 0x1 + cmp r6, 0x4 + bls _081ADCAE + ldr r4, =gSaveBlock1Ptr + ldr r0, [r4] + movs r1, 0xAC + lsls r1, 3 + adds r0, r1 + movs r1, 0x1E + bl ClearItemSlots + ldr r0, [r4] + movs r2, 0xCA + lsls r2, 3 + adds r0, r2 + movs r1, 0x10 + bl ClearItemSlots + bl ResetBagScrollPositions + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end PrepareBagForWallyTutorial + + thumb_func_start RestoreBagAfterWallyTutorial +@ void RestoreBagAfterWallyTutorial() +RestoreBagAfterWallyTutorial: @ 81ADD00 + push {r4-r6,lr} + ldr r5, =gSaveBlock1Ptr + ldr r0, [r5] + movs r1, 0xAC + lsls r1, 3 + adds r0, r1 + ldr r4, =gUnknown_0203CE80 + ldr r1, [r4] + movs r2, 0x78 + bl memcpy + ldr r0, [r5] + movs r1, 0xCA + lsls r1, 3 + adds r0, r1 + ldr r1, [r4] + adds r1, 0x78 + movs r2, 0x40 + bl memcpy + ldr r1, =gUnknown_0203CE58 + ldr r0, [r4] + adds r0, 0xCE + ldrh r0, [r0] + strb r0, [r1, 0x5] + movs r5, 0 + adds r6, r4, 0 + adds r3, r1, 0 + adds r3, 0x8 +_081ADD3A: + lsls r2, r5, 1 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0xB8 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r3] + adds r1, 0xC2 + adds r1, r2 + ldrh r0, [r1] + strh r0, [r3, 0xA] + adds r3, 0x2 + adds r5, 0x1 + cmp r5, 0x4 + bls _081ADD3A + ldr r0, [r6] + bl Free + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end RestoreBagAfterWallyTutorial + + thumb_func_start DoWallyTutorialBagMenu +@ void DoWallyTutorialBagMenu() +DoWallyTutorialBagMenu: @ 81ADD70 + push {lr} + bl PrepareBagForWallyTutorial + movs r0, 0xD + movs r1, 0x1 + bl AddBagItem + movs r0, 0x4 + movs r1, 0x1 + bl AddBagItem + ldr r2, =sub_8059D50 + movs r0, 0xA + movs r1, 0 + bl GoToBagMenu + pop {r0} + bx r0 + .pool + thumb_func_end DoWallyTutorialBagMenu + + thumb_func_start Task_WallyTutorialBagMenu +@ void Task_WallyTutorialBagMenu(u8 taskId) +Task_WallyTutorialBagMenu: @ 81ADD98 + 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 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081ADE32 + movs r0, 0x10 + ldrsh r1, [r4, r0] + cmp r1, 0xCC + beq _081ADDEC + cmp r1, 0xCC + bgt _081ADDD0 + cmp r1, 0x66 + beq _081ADDDA + b _081ADE2C + .pool +_081ADDD0: + movs r0, 0x99 + lsls r0, 1 + cmp r1, r0 + beq _081ADE0C + b _081ADE2C +_081ADDDA: + movs r0, 0x5 + bl PlaySE + adds r0, r5, 0 + movs r1, 0x1 + movs r2, 0 + bl SwitchBagPocket + b _081ADE2C +_081ADDEC: + movs r0, 0x5 + bl PlaySE + ldrb r0, [r4] + movs r1, 0x2 + bl bag_menu_print_cursor_ + ldr r1, =gScriptItemId + movs r0, 0x4 + strh r0, [r1] + adds r0, r5, 0 + bl sub_81AC644 + b _081ADE2C + .pool +_081ADE0C: + movs r0, 0x5 + bl PlaySE + bl bag_menu_remove_some_window + ldrb r0, [r4] + movs r1, 0 + movs r2, 0 + bl sub_81AE6C8 + bl RestoreBagAfterWallyTutorial + adds r0, r5, 0 + bl unknown_ItemMenu_Confirm + b _081ADE32 +_081ADE2C: + ldrh r0, [r4, 0x10] + adds r0, 0x1 + strh r0, [r4, 0x10] +_081ADE32: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end Task_WallyTutorialBagMenu + + thumb_func_start unknown_ItemMenu_Show +unknown_ItemMenu_Show: @ 81ADE38 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =gSpecialVar_0x8005 + ldr r0, =gScriptItemId + ldrh r0, [r0] + strh r0, [r1] + ldr r1, =gScriptResult + movs r0, 0x1 + strh r0, [r1] + bl bag_menu_remove_some_window + adds r0, r4, 0 + bl unknown_ItemMenu_Confirm + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end unknown_ItemMenu_Show + + thumb_func_start bag_menu_leave_maybe_3 +bag_menu_leave_maybe_3: @ 81ADE6C + push {lr} + ldr r0, =gUnknown_03005DAC + ldr r1, =sub_819FA50 + str r1, [r0] + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_leave_maybe_3 + + thumb_func_start unknown_ItemMenu_Give2 +unknown_ItemMenu_Give2: @ 81ADE8C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gScriptItemId + ldrh r0, [r0] + movs r1, 0x1 + bl RemoveBagItem + ldr r1, =gScriptResult + movs r0, 0x1 + strh r0, [r1] + bl bag_menu_remove_some_window + adds r0, r4, 0 + bl unknown_ItemMenu_Confirm + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end unknown_ItemMenu_Give2 + + thumb_func_start bag_menu_leave_maybe_2 +bag_menu_leave_maybe_2: @ 81ADEBC + push {lr} + ldr r0, =gUnknown_03005DAC + ldr r1, =sub_818DEF4 + str r1, [r0] + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_leave_maybe_2 + + thumb_func_start unknown_ItemMenu_Confirm2 +unknown_ItemMenu_Confirm2: @ 81ADEDC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =gScriptResult + movs r0, 0x1 + strh r0, [r1] + bl bag_menu_remove_some_window + adds r0, r4, 0 + bl unknown_ItemMenu_Confirm + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end unknown_ItemMenu_Confirm2 + + thumb_func_start bag_menu_leave_maybe +bag_menu_leave_maybe: @ 81ADF00 + push {lr} + ldr r0, =gUnknown_03005DAC + ldr r1, =sub_818E564 + str r1, [r0] + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_leave_maybe + + thumb_func_start bag_menu_print_pocket_names +bag_menu_print_pocket_names: @ 81ADF20 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x1C + adds r4, r0, 0 + mov r8, r1 + movs r0, 0 + movs r1, 0 + str r0, [sp, 0x14] + str r1, [sp, 0x18] + ldr r1, =0x00ffffff + ldr r0, [sp, 0x14] + ands r0, r1 + movs r1, 0x80 + lsls r1, 21 + orrs r0, r1 + str r0, [sp, 0x14] + ldr r1, =0xffffff00 + ldr r0, [sp, 0x18] + ands r0, r1 + movs r1, 0x2 + orrs r0, r1 + str r0, [sp, 0x18] + add r0, sp, 0x14 + bl AddWindow + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r6, 0 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x40 + bl GetStringCenterAlignXOffset + lsls r3, r0, 24 + lsrs r3, 24 + movs r7, 0x1 + str r7, [sp] + movs r5, 0 + str r5, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0xFF + mov r9, r0 + str r0, [sp, 0xC] + str r7, [sp, 0x10] + adds r0, r6, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl bag_menu_print + mov r2, r8 + cmp r2, 0 + beq _081ADFBA + movs r0, 0x1 + mov r1, r8 + movs r2, 0x40 + bl GetStringCenterAlignXOffset + adds r3, r0, 0 + adds r3, 0x40 + lsls r3, 24 + lsrs r3, 24 + str r7, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + mov r0, r9 + str r0, [sp, 0xC] + str r7, [sp, 0x10] + adds r0, r6, 0 + movs r1, 0x1 + mov r2, r8 + bl bag_menu_print +_081ADFBA: + adds r0, r6, 0 + movs r1, 0x7 + bl GetWindowAttribute + ldr r1, =gUnknown_0203CE54 + ldr r1, [r1] + ldr r2, =0x00000844 + adds r1, r2 + ldr r2, =0x04000100 + bl CpuSet + adds r0, r6, 0 + bl RemoveWindow + add sp, 0x1C + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_print_pocket_names + + thumb_func_start bag_menu_copy_pocket_name_to_window +bag_menu_copy_pocket_name_to_window: @ 81ADFF8 + push {r4-r7,lr} + adds r7, r0, 0 + cmp r7, 0x8 + bls _081AE002 + movs r7, 0x8 +_081AE002: + ldr r0, =gUnknown_0203CE54 + ldr r4, [r0] + ldr r0, =0x00000844 + adds r4, r0 + movs r0, 0x2 + movs r1, 0x7 + bl GetWindowAttribute + adds r5, r0, 0 + lsls r0, r7, 5 + adds r0, r4, r0 + ldr r6, =0x04000040 + adds r1, r5, 0 + adds r2, r6, 0 + bl CpuSet + adds r0, r7, 0 + adds r0, 0x10 + lsls r0, 5 + adds r4, r0 + movs r0, 0x80 + lsls r0, 1 + adds r5, r0 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl CpuSet + movs r0, 0x2 + movs r1, 0x2 + bl CopyWindowToVram + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_copy_pocket_name_to_window + + thumb_func_start setup_bag_menu_textboxes +setup_bag_menu_textboxes: @ 81AE054 + push {r4,lr} + ldr r0, =gUnknown_08614174 + bl InitWindows + bl DeactivateAllTextPrinters + movs r0, 0 + movs r1, 0x1 + movs r2, 0xE0 + bl sub_809882C + movs r0, 0 + movs r1, 0xA + movs r2, 0xD0 + bl copy_textbox_border_tile_patterns_to_vram + movs r0, 0xC0 + movs r1, 0x1 + bl sub_819A2BC + ldr r0, =gUnknown_0860F074 + movs r1, 0xF0 + movs r2, 0x20 + bl LoadPalette + movs r4, 0 +_081AE088: + adds r0, r4, 0 + movs r1, 0 + bl FillWindowPixelBuffer + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _081AE088 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end setup_bag_menu_textboxes + + thumb_func_start bag_menu_print +bag_menu_print: @ 81AE0BC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + mov r9, r3 + ldr r3, [sp, 0x30] + ldr r4, [sp, 0x34] + ldr r6, [sp, 0x38] + ldr r5, [sp, 0x3C] + mov r8, r5 + ldr r5, [sp, 0x40] + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r7, r9 + lsls r7, 24 + lsrs r7, 24 + mov r9, r7 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r5, 24 + lsrs r5, 24 + str r4, [sp] + str r6, [sp, 0x4] + lsls r4, r5, 1 + adds r4, r5 + ldr r5, =gUnknown_08614164 + adds r4, r5 + str r4, [sp, 0x8] + mov r4, r8 + lsls r4, 24 + asrs r4, 24 + str r4, [sp, 0xC] + str r2, [sp, 0x10] + mov r2, r9 + bl AddTextPrinterParametrized2 + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_print + + thumb_func_start sub_81AE124 +sub_81AE124: @ 81AE124 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0203CE54 + ldr r1, [r1] + movs r2, 0x81 + lsls r2, 4 + adds r1, r2 + adds r1, r0 + ldrb r0, [r1] + bx lr + .pool + thumb_func_end sub_81AE124 + + thumb_func_start bag_menu_add_window +bag_menu_add_window: @ 81AE13C + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =gUnknown_0203CE54 + movs r3, 0x81 + lsls r3, 4 + adds r1, r2, r3 + ldr r0, [r0] + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0xFF + bne _081AE172 + lsls r0, r2, 3 + ldr r1, =gUnknown_086141AC + adds r0, r1 + bl AddWindow + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + movs r2, 0x1 + movs r3, 0xE + bl SetWindowBorderStyle + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram +_081AE172: + ldrb r0, [r4] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end bag_menu_add_window + + thumb_func_start bag_menu_remove_window +bag_menu_remove_window: @ 81AE184 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0203CE54 + movs r2, 0x81 + lsls r2, 4 + adds r0, r2 + ldr r1, [r1] + adds r4, r1, r0 + ldrb r0, [r4] + cmp r0, 0xFF + beq _081AE1B8 + movs r1, 0 + bl sub_8198070 + ldrb r0, [r4] + bl ClearWindowTilemap + ldrb r0, [r4] + bl RemoveWindow + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0xFF + strb r0, [r4] +_081AE1B8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_remove_window + + thumb_func_start AddItemMessageWindow +@ u8 AddItemMessageWindow(u8 a1) +AddItemMessageWindow: @ 81AE1C4 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =gUnknown_0203CE54 + movs r3, 0x81 + lsls r3, 4 + adds r1, r2, r3 + ldr r0, [r0] + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0xFF + bne _081AE1E8 + lsls r0, r2, 3 + ldr r1, =gUnknown_086141AC + adds r0, r1 + bl AddWindow + strb r0, [r4] +_081AE1E8: + ldrb r0, [r4] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end AddItemMessageWindow + + thumb_func_start bag_menu_RemoveBagItem_message_window +bag_menu_RemoveBagItem_message_window: @ 81AE1F8 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0203CE54 + movs r2, 0x81 + lsls r2, 4 + adds r0, r2 + ldr r1, [r1] + adds r4, r1, r0 + ldrb r0, [r4] + cmp r0, 0xFF + beq _081AE22C + movs r1, 0 + bl sub_8197DF8 + ldrb r0, [r4] + bl ClearWindowTilemap + ldrb r0, [r4] + bl RemoveWindow + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0xFF + strb r0, [r4] +_081AE22C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_RemoveBagItem_message_window + + thumb_func_start bag_menu_yes_no +bag_menu_yes_no: @ 81AE238 + push {lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 21 + ldr r3, =gUnknown_086141AC + adds r1, r3 + movs r3, 0x2 + str r3, [sp] + movs r3, 0x1 + str r3, [sp, 0x4] + movs r3, 0xE + str r3, [sp, 0x8] + str r2, [sp, 0xC] + movs r2, 0x1 + movs r3, 0 + bl CreateYesNoMenuWithCallbacks + add sp, 0x10 + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_yes_no + + thumb_func_start bag_menu_AddMoney_window +bag_menu_AddMoney_window: @ 81AE268 + push {r4,lr} + movs r0, 0x9 + bl bag_menu_add_window + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + bl GetMoney + adds r3, r0, 0 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0xE + bl set_window_border_style_and_print_money_box + movs r0, 0x13 + movs r1, 0xB + bl AddMoneyLabelObject + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_AddMoney_window + + thumb_func_start bag_menu_remove_money_window +bag_menu_remove_money_window: @ 81AE2A4 + push {lr} + movs r0, 0x9 + bl bag_menu_remove_window + bl RemoveMoneyLabelObject + pop {r0} + bx r0 + thumb_func_end bag_menu_remove_money_window + + thumb_func_start bag_menu_prepare_tmhm_move_window +bag_menu_prepare_tmhm_move_window: @ 81AE2B4 + push {lr} + movs r0, 0x3 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x3 + movs r1, 0x13 + movs r2, 0 + movs r3, 0 + bl blit_move_info_icon + movs r0, 0x3 + movs r1, 0x14 + movs r2, 0 + movs r3, 0xC + bl blit_move_info_icon + movs r0, 0x3 + movs r1, 0x15 + movs r2, 0 + movs r3, 0x18 + bl blit_move_info_icon + movs r0, 0x3 + movs r1, 0x16 + movs r2, 0 + movs r3, 0x24 + bl blit_move_info_icon + movs r0, 0x3 + movs r1, 0x2 + bl CopyWindowToVram + pop {r0} + bx r0 + thumb_func_end bag_menu_prepare_tmhm_move_window + + thumb_func_start PrintTMHMMoveData +PrintTMHMMoveData: @ 81AE2FC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x4 + movs r1, 0 + bl FillWindowPixelBuffer + cmp r4, 0 + bne _081AE354 + movs r4, 0 + movs r5, 0 +_081AE31A: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 26 + lsrs r0, 24 + str r0, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0xFF + str r0, [sp, 0xC] + movs r0, 0x4 + str r0, [sp, 0x10] + movs r1, 0x1 + ldr r2, =gText_ThreeDashes + movs r3, 0x7 + bl bag_menu_print + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _081AE31A + movs r0, 0x4 + movs r1, 0x2 + bl CopyWindowToVram + b _081AE440 + .pool +_081AE354: + adds r0, r4, 0 + bl ItemIdToBattleMoveId + lsls r0, 16 + lsrs r7, r0, 16 + ldr r1, =gBattleMoves + lsls r0, r7, 1 + adds r0, r7 + lsls r0, 2 + adds r5, r0, r1 + ldrb r1, [r5, 0x2] + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x4 + movs r2, 0 + movs r3, 0 + bl blit_move_info_icon + ldrb r0, [r5, 0x1] + cmp r0, 0x1 + bhi _081AE38C + ldr r2, =gText_ThreeDashes + b _081AE39C + .pool +_081AE38C: + ldr r4, =gStringVar1 + ldrb r1, [r5, 0x1] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + adds r2, r4, 0 +_081AE39C: + movs r0, 0xC + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0xFF + str r0, [sp, 0xC] + movs r0, 0x4 + str r0, [sp, 0x10] + movs r1, 0x1 + movs r3, 0x7 + bl bag_menu_print + ldr r2, =gBattleMoves + lsls r1, r7, 1 + adds r0, r1, r7 + lsls r0, 2 + adds r2, r0, r2 + ldrb r0, [r2, 0x3] + adds r6, r1, 0 + cmp r0, 0 + bne _081AE3D8 + ldr r2, =gText_ThreeDashes + b _081AE3E8 + .pool +_081AE3D8: + ldr r4, =gStringVar1 + ldrb r1, [r2, 0x3] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + adds r2, r4, 0 +_081AE3E8: + movs r0, 0x18 + str r0, [sp] + movs r4, 0 + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0xFF + mov r8, r0 + str r0, [sp, 0xC] + movs r0, 0x4 + mov r9, r0 + str r0, [sp, 0x10] + movs r1, 0x1 + movs r3, 0x7 + bl bag_menu_print + ldr r5, =gStringVar1 + ldr r1, =gBattleMoves + adds r0, r6, r7 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x4] + adds r0, r5, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + movs r0, 0x24 + str r0, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + mov r0, r8 + str r0, [sp, 0xC] + mov r0, r9 + str r0, [sp, 0x10] + movs r0, 0x4 + movs r1, 0x1 + adds r2, r5, 0 + movs r3, 0x7 + bl bag_menu_print + movs r0, 0x4 + movs r1, 0x2 + bl CopyWindowToVram +_081AE440: + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end PrintTMHMMoveData + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/item_menu_icons.s b/asm/item_menu_icons.s new file mode 100755 index 000000000..1adc0feb7 --- /dev/null +++ b/asm/item_menu_icons.s @@ -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. diff --git a/asm/learn_move.s b/asm/learn_move.s new file mode 100755 index 000000000..c2ef76350 --- /dev/null +++ b/asm/learn_move.s @@ -0,0 +1,1646 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_8160624 +sub_8160624: @ 8160624 + push {lr} + bl LoadOam + bl ProcessSpriteCopyRequests + bl TransferPlttBuffer + pop {r0} + bx r0 + thumb_func_end sub_8160624 + + thumb_func_start sub_8160638 +sub_8160638: @ 8160638 + push {lr} + sub sp, 0x4 + bl ScriptContext2_Enable + ldr r0, =sub_8160664 + movs r1, 0xA + bl CreateTask + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8160638 + + thumb_func_start sub_8160664 +sub_8160664: @ 8160664 + 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 _08160688 + ldr r0, =sub_81606A0 + bl SetMainCallback2 + ldr r1, =gUnknown_03005DAC + ldr r0, =sub_80AF168 + str r0, [r1] + adds r0, r4, 0 + bl DestroyTask +_08160688: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8160664 + + thumb_func_start sub_81606A0 +sub_81606A0: @ 81606A0 + push {r4-r6,lr} + bl ResetSpriteData + bl FreeAllSpritePalettes + bl ResetTasks + bl clear_scheduled_bg_copies_to_vram + ldr r6, =gUnknown_0203BC34 + movs r0, 0x8C + lsls r0, 1 + bl AllocZeroed + str r0, [r6] + ldr r1, =gSpecialVar_0x8004 + ldrh r1, [r1] + adds r0, 0x44 + movs r5, 0 + strb r1, [r0] + ldr r0, =sub_8160624 + bl SetVBlankCallback + bl sub_81607EC + movs r0, 0 + bl sub_81D2824 + ldr r4, =gUnknown_0203BC38 + movs r0, 0 + strh r5, [r4] + strh r5, [r4, 0x2] + strb r0, [r4, 0x4] + bl sub_8161280 + ldr r0, =gUnknown_085CEBB0 + bl LoadSpriteSheet + ldr r0, =gUnknown_085CEBB8 + bl LoadSpritePalette + bl sub_81610B8 + ldr r0, =gUnknown_03006310 + ldrh r1, [r4] + ldrh r2, [r4, 0x2] + bl ListMenuInit + ldr r1, [r6] + movs r2, 0x89 + lsls r2, 1 + adds r1, r2 + strb r0, [r1] + movs r0, 0 + movs r1, 0 + movs r2, 0x2 + bl FillPalette + ldr r0, =sub_816082C + bl SetMainCallback2 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81606A0 + + thumb_func_start sub_8160740 +sub_8160740: @ 8160740 + push {r4,r5,lr} + bl ResetSpriteData + bl FreeAllSpritePalettes + bl ResetTasks + bl clear_scheduled_bg_copies_to_vram + ldr r5, =gUnknown_0203BC34 + movs r0, 0x8C + lsls r0, 1 + bl AllocZeroed + str r0, [r5] + movs r1, 0x1C + strb r1, [r0] + ldr r0, [r5] + ldr r1, =gSpecialVar_0x8004 + ldrh r1, [r1] + adds r0, 0x44 + strb r1, [r0] + ldr r0, [r5] + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + adds r0, 0x45 + strb r1, [r0] + ldr r0, =sub_8160624 + bl SetVBlankCallback + bl sub_81607EC + ldr r4, =gUnknown_0203BC38 + ldrb r0, [r4, 0x4] + bl sub_81D2824 + bl sub_8161280 + ldr r0, =gUnknown_085CEBB0 + bl LoadSpriteSheet + ldr r0, =gUnknown_085CEBB8 + bl LoadSpritePalette + bl sub_81610B8 + ldr r0, =gUnknown_03006310 + ldrh r1, [r4] + ldrh r2, [r4, 0x2] + bl ListMenuInit + ldr r1, [r5] + movs r2, 0x89 + lsls r2, 1 + adds r1, r2 + strb r0, [r1] + movs r0, 0 + movs r1, 0 + movs r2, 0x2 + bl FillPalette + ldr r0, =sub_816082C + bl SetMainCallback2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8160740 + + thumb_func_start sub_81607EC +sub_81607EC: @ 81607EC + push {lr} + bl sub_8121DA0 + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_085CEC28 + movs r0, 0 + movs r2, 0x2 + bl InitBgsFromTemplates + bl sub_8121E10 + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + pop {r0} + bx r0 + .pool + thumb_func_end sub_81607EC + + thumb_func_start sub_816082C +sub_816082C: @ 816082C + push {lr} + bl sub_8160868 + bl RunTasks + bl AnimateSprites + bl BuildOamBuffer + bl do_scheduled_bg_tilemap_copies_to_vram + bl UpdatePaletteFade + pop {r0} + bx r0 + thumb_func_end sub_816082C + + thumb_func_start sub_816084C +sub_816084C: @ 816084C + push {r4,lr} + adds r1, r0, 0 + ldr r4, =gStringVar4 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + bl sub_81D2BF4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816084C + + thumb_func_start sub_8160868 +sub_8160868: @ 8160868 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + ldr r1, =gUnknown_0203BC34 + ldr r0, [r1] + ldrb r0, [r0] + adds r7, r1, 0 + cmp r0, 0x21 + bls _0816087E + b _08160E8A +_0816087E: + lsls r0, 2 + ldr r1, =_08160890 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08160890: + .4byte _08160918 + .4byte _08160932 + .4byte _0816094C + .4byte _08160954 + .4byte _0816095C + .4byte _08160964 + .4byte _08160980 + .4byte _08160E8A + .4byte _08160988 + .4byte _081609A8 + .4byte _08160E8A + .4byte _08160E8A + .4byte _08160A44 + .4byte _08160A64 + .4byte _08160CB8 + .4byte _08160CD8 + .4byte _08160AB8 + .4byte _08160AD0 + .4byte _08160AEC + .4byte _08160C1C + .4byte _08160C48 + .4byte _08160C98 + .4byte _08160CA6 + .4byte _08160E8A + .4byte _08160B2C + .4byte _08160B60 + .4byte _08160B80 + .4byte _08160BDC + .4byte _08160CFC + .4byte _08160D48 + .4byte _08160E0C + .4byte _08160E38 + .4byte _08160E58 + .4byte _08160E70 +_08160918: + ldr r1, [r7] + ldrb r0, [r1] + adds r0, 0x1 + movs r4, 0 + strb r0, [r1] + movs r0, 0 + bl render_previous_quest_text + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + b _08160CAE +_08160932: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08160940 + b _08160E8A +_08160940: + ldr r1, [r7] + movs r0, 0x4 + b _08160E88 + .pool +_0816094C: + ldr r1, [r7] + ldrb r0, [r1] + adds r0, 0x1 + b _08160E88 +_08160954: + movs r0, 0 + bl render_previous_quest_text + b _0816096A +_0816095C: + movs r0, 0 + bl sub_8160F50 + b _08160E8A +_08160964: + movs r0, 0 + bl sub_8161074 +_0816096A: + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + bl sub_81611AC + b _08160E8A + .pool +_08160980: + movs r0, 0x1 + bl sub_8160F50 + b _08160E8A +_08160988: + bl sub_81D2C3C + lsls r0, 16 + cmp r0, 0 + beq _08160994 + b _08160E8A +_08160994: + bl sub_81D2C50 + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + b _08160E88 + .pool +_081609A8: + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + bne _08160A0A + ldr r5, =gUnknown_0203BC34 + ldr r0, [r5] + adds r0, 0x44 + ldrb r1, [r0] + movs r0, 0x64 + adds r4, r1, 0 + muls r4, r0 + ldr r0, =gPlayerParty + adds r4, r0 + bl sub_8161054 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl GiveMoveToMon + lsls r0, 16 + ldr r1, =0xffff0000 + cmp r0, r1 + beq _08160A04 + ldr r0, =gUnknown_085EF8E4 + bl sub_816084C + ldr r1, =gSpecialVar_0x8004 + movs r0, 0x1 + strh r0, [r1] + ldr r1, [r5] + movs r0, 0x1F + b _08160E88 + .pool +_08160A04: + ldr r1, [r5] + movs r0, 0x10 + b _08160E88 +_08160A0A: + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08160A18 + cmp r1, 0x1 + beq _08160A18 + b _08160E8A +_08160A18: + ldr r0, =gUnknown_0203BC38 + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _08160A30 + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + movs r0, 0x3 + b _08160E88 + .pool +_08160A30: + cmp r0, 0x1 + beq _08160A36 + b _08160E8A +_08160A36: + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + movs r0, 0x5 + b _08160E88 + .pool +_08160A44: + bl sub_81D2C3C + lsls r0, 16 + cmp r0, 0 + beq _08160A50 + b _08160E8A +_08160A50: + bl sub_81D2C50 + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + b _08160E88 + .pool +_08160A64: + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + bne _08160A7C + ldr r0, =gSpecialVar_0x8004 + strh r1, [r0] + b _08160E82 + .pool +_08160A7C: + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08160A8A + cmp r1, 0x1 + beq _08160A8A + b _08160E8A +_08160A8A: + ldr r0, =gUnknown_0203BC38 + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _08160AA4 + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + movs r0, 0x3 + b _08160E88 + .pool +_08160AA4: + cmp r0, 0x1 + beq _08160AAA + b _08160E8A +_08160AAA: + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + movs r0, 0x5 + b _08160E88 + .pool +_08160AB8: + ldr r0, =gUnknown_085EF8F3 + bl sub_816084C + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + b _08160E88 + .pool +_08160AD0: + bl sub_81D2C3C + lsls r0, 16 + cmp r0, 0 + beq _08160ADC + b _08160E8A +_08160ADC: + bl sub_81D2C50 + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + movs r0, 0x12 + b _08160E88 + .pool +_08160AEC: + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + bne _08160B10 + ldr r0, =gUnknown_085EFA10 + bl sub_816084C + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + movs r0, 0x13 + b _08160E88 + .pool +_08160B10: + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08160B1E + cmp r1, 0x1 + beq _08160B1E + b _08160E8A +_08160B1E: + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + movs r0, 0x18 + b _08160E88 + .pool +_08160B2C: + ldr r4, =gStringVar2 + bl sub_8161054 + movs r1, 0xD + muls r1, r0 + ldr r0, =gMoveNames + adds r1, r0 + adds r0, r4, 0 + bl StringCopy + ldr r0, =gUnknown_085EF960 + bl sub_816084C + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + b _08160E88 + .pool +_08160B60: + bl sub_81D2C3C + lsls r0, 16 + cmp r0, 0 + beq _08160B6C + b _08160E8A +_08160B6C: + bl sub_81D2C50 + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + b _08160E88 + .pool +_08160B80: + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + bne _08160B98 + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + movs r0, 0x1B + b _08160E88 + .pool +_08160B98: + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08160BA6 + cmp r1, 0x1 + beq _08160BA6 + b _08160E8A +_08160BA6: + ldr r0, =gUnknown_0203BC38 + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _08160BC4 + ldr r2, =gUnknown_0203BC34 + ldr r1, [r2] + movs r0, 0x3 + strb r0, [r1] + adds r7, r2, 0 + b _08160BD0 + .pool +_08160BC4: + ldr r7, =gUnknown_0203BC34 + cmp r0, 0x1 + bne _08160BD0 + ldr r1, [r7] + movs r0, 0x5 + strb r0, [r1] +_08160BD0: + ldr r1, [r7] + movs r0, 0x10 + b _08160E88 + .pool +_08160BDC: + bl sub_81D2C3C + lsls r0, 16 + cmp r0, 0 + beq _08160BE8 + b _08160E8A +_08160BE8: + movs r0, 0x3 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r0, =gUnknown_0203BC38 + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _08160C08 + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + movs r0, 0x3 + b _08160E88 + .pool +_08160C08: + cmp r0, 0x1 + beq _08160C0E + b _08160E8A +_08160C0E: + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + movs r0, 0x5 + b _08160E88 + .pool +_08160C1C: + bl sub_81D2C3C + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0 + beq _08160C2A + b _08160E8A +_08160C2A: + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + movs r0, 0x14 + strb r0, [r1] + subs r0, 0x15 + str r2, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + b _08160E8A + .pool +_08160C48: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08160C56 + b _08160E8A +_08160C56: + bl sub_8161054 + lsls r0, 16 + lsrs r0, 16 + ldr r4, =gPlayerParty + ldr r1, =gUnknown_0203BC34 + ldr r1, [r1] + adds r1, 0x44 + ldrb r1, [r1] + ldr r2, =gPlayerPartyCount + ldrb r2, [r2] + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldr r3, =sub_8160740 + str r0, [sp] + adds r0, r4, 0 + bl sub_81BFA38 + bl sub_8160EA0 + b _08160E8A + .pool +_08160C98: + bl sub_81D2C3C + lsls r0, 16 + cmp r0, 0 + beq _08160CA4 + b _08160E8A +_08160CA4: + b _08160E82 +_08160CA6: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] +_08160CAE: + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade + b _08160E8A +_08160CB8: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + b _08160E88 + .pool +_08160CD8: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08160CE6 + b _08160E8A +_08160CE6: + bl sub_8160EA0 + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + b _08160E8A + .pool +_08160CFC: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, =gUnknown_0203BC38 + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _08160D30 + movs r0, 0x1 + bl render_previous_quest_text + b _08160D3A + .pool +_08160D30: + cmp r0, 0x1 + bne _08160D3A + movs r0, 0x1 + bl sub_8161074 +_08160D3A: + bl sub_8161234 + movs r0, 0x3 + movs r1, 0x2 + bl CopyWindowToVram + b _08160E8A +_08160D48: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08160D56 + b _08160E8A +_08160D56: + ldr r1, [r7] + adds r2, r1, 0 + adds r2, 0x45 + ldrb r0, [r2] + cmp r0, 0x4 + bne _08160D6C + movs r0, 0x18 + b _08160E88 + .pool +_08160D6C: + adds r0, r1, 0 + adds r0, 0x44 + ldrb r0, [r0] + movs r4, 0x64 + muls r0, r4 + ldr r5, =gPlayerParty + adds r0, r5 + ldrb r1, [r2] + adds r1, 0xD + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + ldr r2, =gStringVar3 + movs r1, 0xD + mov r8, r1 + mov r1, r8 + muls r1, r0 + ldr r6, =gMoveNames + adds r1, r6 + adds r0, r2, 0 + bl StringCopy + ldr r1, [r7] + adds r0, r1, 0 + adds r0, 0x44 + ldrb r0, [r0] + muls r0, r4 + adds r0, r5 + adds r1, 0x45 + ldrb r1, [r1] + bl RemoveMonPPBonus + ldr r0, [r7] + adds r0, 0x44 + ldrb r0, [r0] + muls r4, r0 + adds r4, r5 + bl sub_8161054 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [r7] + adds r0, 0x45 + ldrb r2, [r0] + adds r0, r4, 0 + bl SetMonMoveSlot + ldr r4, =gStringVar2 + bl sub_8161054 + mov r1, r8 + muls r1, r0 + adds r1, r6 + adds r0, r4, 0 + bl StringCopy + ldr r0, =gUnknown_085EF979 + bl sub_816084C + ldr r1, [r7] + movs r0, 0x1E + strb r0, [r1] + ldr r1, =gSpecialVar_0x8004 + movs r0, 0x1 + strh r0, [r1] + b _08160E8A + .pool +_08160E0C: + bl sub_81D2C3C + lsls r0, 16 + cmp r0, 0 + bne _08160E8A + ldr r0, =gUnknown_085EF9A6 + bl sub_816084C + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + movs r0, 0x1F + strb r0, [r1] + ldr r0, =0x0000016f + bl PlayFanfare + b _08160E8A + .pool +_08160E38: + bl sub_81D2C3C + lsls r0, 16 + cmp r0, 0 + bne _08160E8A + ldr r0, =0x0000016f + bl PlayFanfare + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + movs r0, 0x20 + b _08160E88 + .pool +_08160E58: + bl IsFanfareTaskInactive + lsls r0, 24 + cmp r0, 0 + beq _08160E8A + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + movs r0, 0x21 + b _08160E88 + .pool +_08160E70: + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08160E8A + movs r0, 0x5 + bl PlaySE +_08160E82: + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + movs r0, 0xE +_08160E88: + strb r0, [r1] +_08160E8A: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8160868 + + thumb_func_start sub_8160EA0 +sub_8160EA0: @ 8160EA0 + push {r4,lr} + bl sub_8161234 + ldr r4, =gUnknown_0203BC34 + ldr r0, [r4] + movs r1, 0x89 + lsls r1, 1 + adds r0, r1 + ldrb r0, [r0] + ldr r1, =gUnknown_0203BC38 + adds r2, r1, 0x2 + bl sub_81AE6C8 + bl FreeAllWindowBuffers + ldr r0, [r4] + bl Free + movs r0, 0 + str r0, [r4] + bl ResetSpriteData + bl FreeAllSpritePalettes + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8160EA0 + + thumb_func_start render_previous_quest_text +render_previous_quest_text: @ 8160EE0 + push {r4-r6,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + movs r2, 0 + ldr r6, =gSprites + ldr r4, =gUnknown_0203BC34 + movs r3, 0x4 +_08160EF0: + ldr r0, [r4] + adds r0, 0x1 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r3 + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0xF + ble _08160EF0 + cmp r5, 0 + bne _08160F38 + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EF8C2 + adds r0, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x3 + movs r1, 0x11 + bl FillWindowPixelBuffer + movs r0, 0x1 + str r0, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0 + bl PrintTextOnWindow +_08160F38: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end render_previous_quest_text + + thumb_func_start sub_8160F50 +sub_8160F50: @ 8160F50 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r6, =gUnknown_0203BC34 + ldr r0, [r6] + movs r4, 0x89 + lsls r4, 1 + adds r0, r4 + ldrb r0, [r0] + bl ListMenuHandleInput + adds r5, r0, 0 + ldr r0, [r6] + adds r0, r4 + ldrb r0, [r0] + ldr r4, =gUnknown_0203BC38 + adds r2, r4, 0x2 + adds r1, r4, 0 + bl get_coro_args_x18_x1A + movs r0, 0x2 + negs r0, r0 + cmp r5, r0 + beq _08160FE4 + adds r0, 0x1 + cmp r5, r0 + bne _08161010 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x30 + ands r0, r1 + cmp r0, 0 + bne _08160F9C + bl GetLRKeysState + lsls r0, 24 + cmp r0, 0 + beq _0816103E +_08160F9C: + movs r0, 0x5 + bl PlaySE + cmp r7, 0 + bne _08160FC4 + movs r0, 0x1 + bl PutWindowTilemap + ldr r0, [r6] + movs r1, 0x5 + strb r1, [r0] + movs r0, 0x1 + strb r0, [r4, 0x4] + b _08160FD4 + .pool +_08160FC4: + movs r0, 0 + bl PutWindowTilemap + ldr r0, [r6] + movs r2, 0 + movs r1, 0x3 + strb r1, [r0] + strb r2, [r4, 0x4] +_08160FD4: + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + bl sub_8161054 + bl sub_816137C + b _0816103E +_08160FE4: + movs r0, 0x5 + bl PlaySE + bl sub_8161234 + ldr r1, [r6] + movs r0, 0xC + strb r0, [r1] + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EF9E6 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + bl sub_81D2BF4 + b _0816103E + .pool +_08161010: + movs r0, 0x5 + bl PlaySE + bl sub_8161234 + ldr r1, [r6] + movs r0, 0x8 + strb r0, [r1] + ldr r0, =gStringVar2 + movs r1, 0xD + muls r1, r5 + ldr r2, =gMoveNames + adds r1, r2 + bl StringCopy + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EF8DA + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + bl sub_81D2BF4 +_0816103E: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8160F50 + + thumb_func_start sub_8161054 +sub_8161054: @ 8161054 + ldr r0, =gUnknown_0203BC34 + ldr r2, [r0] + ldr r1, =gUnknown_0203BC38 + ldrh r0, [r1, 0x2] + ldrh r1, [r1] + adds r0, r1 + lsls r0, 3 + adds r2, 0x4C + adds r2, r0 + ldr r0, [r2] + bx lr + .pool + thumb_func_end sub_8161054 + + thumb_func_start sub_8161074 +sub_8161074: @ 8161074 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _081610A6 + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EF8C2 + adds r0, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x3 + movs r1, 0x11 + bl FillWindowPixelBuffer + movs r0, 0x1 + str r0, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0 + bl PrintTextOnWindow +_081610A6: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8161074 + + thumb_func_start sub_81610B8 +sub_81610B8: @ 81610B8 + push {r4-r7,lr} + ldr r2, =gUnknown_0203BC34 + ldr r0, [r2] + movs r1, 0x8A + lsls r1, 1 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldr r0, [r2] + ldr r2, =0x00000113 + adds r1, r0, r2 + movs r0, 0x1 + negs r0, r0 + strb r0, [r1] + bl sub_81611AC + movs r4, 0 + ldr r5, =gUnknown_085CEC10 +_081610DC: + adds r2, r4, 0 + cmp r4, 0 + bge _081610E4 + adds r2, r4, 0x3 +_081610E4: + asrs r2, 2 + lsls r1, r2, 2 + subs r1, r4, r1 + lsls r1, 19 + movs r0, 0xD0 + lsls r0, 15 + adds r1, r0 + asrs r1, 16 + lsls r2, 19 + movs r0, 0x90 + lsls r0, 14 + adds r2, r0 + asrs r2, 16 + adds r0, r5, 0 + movs r3, 0 + bl CreateSprite + ldr r2, =gUnknown_0203BC34 + ldr r1, [r2] + adds r1, 0x1 + adds r1, r4 + strb r0, [r1] + adds r4, 0x1 + cmp r4, 0x7 + ble _081610DC + movs r4, 0 + ldr r7, =gUnknown_085CEC10 + adds r6, r2, 0 +_0816111C: + adds r2, r4, 0 + cmp r4, 0 + bge _08161124 + adds r2, r4, 0x3 +_08161124: + asrs r2, 2 + lsls r1, r2, 2 + subs r1, r4, r1 + lsls r1, 19 + movs r0, 0xD0 + lsls r0, 15 + adds r1, r0 + asrs r1, 16 + lsls r2, 19 + movs r0, 0xD0 + lsls r0, 14 + adds r2, r0 + asrs r2, 16 + adds r0, r7, 0 + movs r3, 0 + bl CreateSprite + ldr r1, [r6] + adds r2, r4, 0 + adds r2, 0x8 + adds r1, 0x1 + adds r1, r2 + strb r0, [r1] + ldr r0, [r6] + adds r0, 0x1 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, =gSprites + adds r0, r5 + movs r1, 0x2 + bl StartSpriteAnim + adds r4, 0x1 + cmp r4, 0x7 + ble _0816111C + movs r4, 0 + ldr r3, =gUnknown_0203BC34 + movs r2, 0x4 +_08161176: + ldr r0, [r3] + adds r0, 0x1 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0xF + ble _08161176 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81610B8 + + thumb_func_start sub_81611AC +sub_81611AC: @ 81611AC + push {r4-r6,lr} + ldr r4, =gUnknown_0203BC34 + ldr r1, [r4] + movs r2, 0x8A + lsls r2, 1 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0xFF + bne _081611D4 + ldr r0, =gUnknown_085CEBC0 + movs r3, 0x8B + lsls r3, 1 + adds r1, r3 + bl AddScrollIndicatorArrowPair + ldr r1, [r4] + movs r5, 0x8A + lsls r5, 1 + adds r1, r5 + strb r0, [r1] +_081611D4: + ldr r0, [r4] + ldr r6, =0x00000113 + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0xFF + bne _08161210 + ldr r0, =gUnknown_0203CE8C + adds r2, r0, 0 + ldr r1, =gUnknown_085CEBD0 + ldm r1!, {r3,r5,r6} + stm r2!, {r3,r5,r6} + ldr r1, [r1] + str r1, [r2] + ldr r2, [r4] + movs r3, 0x88 + lsls r3, 1 + adds r1, r2, r3 + ldrb r1, [r1] + ldr r5, =0x00000111 + adds r2, r5 + ldrb r2, [r2] + subs r1, r2 + strh r1, [r0, 0x8] + ldr r1, =gUnknown_0203BC38 + bl AddScrollIndicatorArrowPair + ldr r1, [r4] + ldr r6, =0x00000113 + adds r1, r6 + strb r0, [r1] +_08161210: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81611AC + + thumb_func_start sub_8161234 +sub_8161234: @ 8161234 + push {r4,lr} + ldr r4, =gUnknown_0203BC34 + ldr r0, [r4] + movs r2, 0x8A + lsls r2, 1 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xFF + beq _08161256 + bl RemoveScrollIndicatorArrowPair + ldr r0, [r4] + movs r1, 0x8A + lsls r1, 1 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] +_08161256: + ldr r0, [r4] + ldr r2, =0x00000113 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xFF + beq _08161270 + bl RemoveScrollIndicatorArrowPair + ldr r0, [r4] + ldr r2, =0x00000113 + adds r1, r0, r2 + movs r0, 0xFF + strb r0, [r1] +_08161270: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8161234 + + thumb_func_start sub_8161280 +sub_8161280: @ 8161280 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + ldr r4, =gUnknown_0203BC34 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x44 + ldrb r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, =gPlayerParty + adds r0, r2 + adds r1, 0x12 + bl GetMoveRelearnerMoves + ldr r1, [r4] + movs r6, 0x88 + lsls r6, 1 + adds r1, r6 + strb r0, [r1] + movs r5, 0 + ldr r0, [r4] + adds r0, r6 + ldrb r0, [r0] + cmp r5, r0 + bge _081612F6 + mov r8, r4 + movs r0, 0xD + mov r12, r0 + ldr r2, =gMoveNames + mov r9, r2 +_081612C2: + mov r7, r8 + ldr r4, [r7] + lsls r3, r5, 3 + adds r2, r4, 0 + adds r2, 0x48 + adds r2, r3 + lsls r0, r5, 1 + adds r1, r4, 0 + adds r1, 0x12 + adds r1, r0 + ldrh r0, [r1] + mov r7, r12 + muls r7, r0 + adds r0, r7, 0 + add r0, r9 + str r0, [r2] + adds r0, r4, 0 + adds r0, 0x4C + adds r0, r3 + ldrh r1, [r1] + str r1, [r0] + adds r5, 0x1 + adds r0, r4, r6 + ldrb r0, [r0] + cmp r5, r0 + blt _081612C2 +_081612F6: + ldr r4, =gUnknown_0203BC34 + ldr r0, [r4] + adds r0, 0x44 + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl GetMonData + ldr r0, =gStringVar1 + mov r1, sp + bl StringCopy10 + ldr r2, [r4] + movs r5, 0x88 + lsls r5, 1 + adds r3, r2, r5 + ldrb r0, [r3] + lsls r0, 3 + adds r1, r2, 0 + adds r1, 0x48 + adds r1, r0 + ldr r0, =gText_Cancel + str r0, [r1] + ldrb r0, [r3] + lsls r0, 3 + adds r2, 0x4C + adds r2, r0 + movs r0, 0x2 + negs r0, r0 + str r0, [r2] + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x48 + adds r1, r5 + ldrb r1, [r1] + bl sub_81D28C8 + ldr r1, [r4] + ldr r2, =0x00000111 + adds r1, r2 + strb r0, [r1] + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8161280 + + thumb_func_start sub_816137C +sub_816137C: @ 816137C + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + ldr r0, =gUnknown_0203BC38 + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _08161394 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + bne _081613CC +_08161394: + movs r5, 0 + ldr r4, =gSprites + ldr r3, =gUnknown_0203BC34 + movs r2, 0x4 +_0816139C: + ldr r0, [r3] + adds r0, 0x1 + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0xF + bls _0816139C + b _081614FE + .pool +_081613CC: + ldr r1, =gContestEffects + ldr r0, =gContestMoves + lsls r4, 3 + adds r0, r4, r0 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x1] + movs r1, 0xA + bl __udivsi3 + lsls r0, 24 + lsrs r6, r0, 24 + mov r8, r4 + cmp r6, 0xFF + bne _081613EE + movs r6, 0 +_081613EE: + movs r5, 0 + ldr r7, =gUnknown_0203BC34 + ldr r4, =gSprites +_081613F4: + cmp r5, r6 + bcs _08161420 + ldr r0, [r7] + adds r0, 0x1 + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + bl StartSpriteAnim + b _08161436 + .pool +_08161420: + ldr r0, [r7] + adds r0, 0x1 + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0 + bl StartSpriteAnim +_08161436: + ldr r0, [r7] + adds r0, 0x1 + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + movs r3, 0x5 + negs r3, r3 + adds r2, r3, 0 + ands r1, r2 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x7 + bls _081613F4 + ldr r1, =gContestEffects + ldr r0, =gContestMoves + add r0, r8 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x2] + movs r1, 0xA + bl __udivsi3 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0xFF + bne _0816147C + movs r6, 0 +_0816147C: + movs r5, 0 + ldr r0, =gUnknown_0203BC34 + mov r8, r0 + ldr r7, =gSprites +_08161484: + cmp r5, r6 + bcs _081614B8 + mov r1, r8 + ldr r0, [r1] + adds r4, r5, 0 + adds r4, 0x8 + adds r0, 0x1 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + movs r1, 0x3 + bl StartSpriteAnim + b _081614D4 + .pool +_081614B8: + mov r3, r8 + ldr r0, [r3] + adds r4, r5, 0 + adds r4, 0x8 + adds r0, 0x1 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + movs r1, 0x2 + bl StartSpriteAnim +_081614D4: + mov r1, r8 + ldr r0, [r1] + adds r0, 0x1 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + adds r0, 0x3E + ldrb r1, [r0] + movs r3, 0x5 + negs r3, r3 + adds r2, r3, 0 + ands r1, r2 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x7 + bls _08161484 +_081614FE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_816137C + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/list_menu.s b/asm/list_menu.s new file mode 100755 index 000000000..5e6da159e --- /dev/null +++ b/asm/list_menu.s @@ -0,0 +1,1643 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start ListMenuDummyTask +@ void ListMenuDummyTask(u8 taskId) +ListMenuDummyTask: @ 81AE458 + bx lr + thumb_func_end ListMenuDummyTask + + thumb_func_start DoMysteryGiftListMenu +@ int DoMysteryGiftListMenu(struct WindowTemplate *windowTemplate, struct ListMenuTemplate *listMenuTemplate, int a3, int a4, int a5) +DoMysteryGiftListMenu: @ 81AE45C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + mov r12, r0 + str r1, [sp] + ldr r0, [sp, 0x28] + lsls r2, 24 + lsrs r6, r2, 24 + mov r10, r6 + lsls r3, 16 + lsrs r7, r3, 16 + str r7, [sp, 0x4] + lsls r0, 16 + mov r8, r0 + lsrs r0, 16 + mov r9, r0 + ldr r5, =gUnknown_0203CE84 + ldrb r4, [r5, 0x4] + cmp r4, 0x1 + beq _081AE4F4 + cmp r4, 0x1 + ble _081AE492 + cmp r4, 0x2 + beq _081AE558 +_081AE492: + mov r0, r12 + bl AddWindow + strb r0, [r5, 0x5] + cmp r6, 0x1 + beq _081AE4B0 + cmp r6, 0x2 + bne _081AE4C0 + ldrb r0, [r5, 0x5] + mov r1, r9 + lsls r2, r1, 24 + lsrs r2, 24 + adds r1, r7, 0 + bl sub_809882C +_081AE4B0: + ldrb r0, [r5, 0x5] + mov r3, r8 + lsrs r2, r3, 20 + lsls r2, 24 + lsrs r2, 24 + ldr r1, [sp, 0x4] + bl sub_8098858 +_081AE4C0: + ldr r0, =gUnknown_03006310 + adds r2, r0, 0 + ldr r1, [sp] + ldm r1!, {r3-r5} + stm r2!, {r3-r5} + ldm r1!, {r3-r5} + stm r2!, {r3-r5} + ldr r4, =gUnknown_0203CE84 + ldrb r1, [r4, 0x5] + strb r1, [r0, 0x10] + movs r1, 0 + movs r2, 0 + bl ListMenuInit + strb r0, [r4, 0x6] + ldrb r0, [r4, 0x5] + movs r1, 0x1 + bl CopyWindowToVram + movs r0, 0x1 + strb r0, [r4, 0x4] + b _081AE570 + .pool +_081AE4F4: + ldrb r0, [r5, 0x6] + bl ListMenuHandleInput + str r0, [r5] + ldr r1, =gMain + ldrh r0, [r1, 0x2E] + ands r4, r0 + cmp r4, 0 + beq _081AE50A + movs r0, 0x2 + strb r0, [r5, 0x4] +_081AE50A: + ldrh r1, [r1, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081AE51E + movs r0, 0x2 + negs r0, r0 + str r0, [r5] + movs r0, 0x2 + strb r0, [r5, 0x4] +_081AE51E: + ldrb r0, [r5, 0x4] + cmp r0, 0x2 + bne _081AE570 + cmp r6, 0 + bne _081AE534 + ldrb r0, [r5, 0x5] + bl ClearWindowTilemap + b _081AE546 + .pool +_081AE534: + mov r4, r10 + cmp r4, 0 + blt _081AE546 + cmp r4, 0x2 + bgt _081AE546 + ldrb r0, [r5, 0x5] + movs r1, 0 + bl sub_819746C +_081AE546: + ldr r0, =gUnknown_0203CE84 + ldrb r0, [r0, 0x5] + movs r1, 0x1 + bl CopyWindowToVram + b _081AE570 + .pool +_081AE558: + ldrb r0, [r5, 0x6] + movs r1, 0 + movs r2, 0 + bl sub_81AE6C8 + ldrb r0, [r5, 0x5] + bl RemoveWindow + movs r0, 0 + strb r0, [r5, 0x4] + ldr r0, [r5] + b _081AE574 +_081AE570: + movs r0, 0x1 + negs r0, r0 +_081AE574: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end DoMysteryGiftListMenu + + thumb_func_start ListMenuInit +@ u8 ListMenuInit(struct ListMenuTemplate *listMenuTemplate, u16 scrollOffset, u16 selectedRow) +ListMenuInit: @ 81AE584 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + bl ListMenuInitInternal + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r5, 0x10] + bl PutWindowTilemap + ldrb r0, [r5, 0x10] + movs r1, 0x2 + bl CopyWindowToVram + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end ListMenuInit + + thumb_func_start Unused_ListMenuInit2 +@ u8 Unused_ListMenuInit2(struct ListMenuTemplate *listMenuTemplate, int a2, u16 scrollOffset, u16 selectedRow) +Unused_ListMenuInit2: @ 81AE5B0 + push {r4-r7,lr} + sub sp, 0x8 + adds r6, r0, 0 + adds r4, r1, 0 + adds r1, r2, 0 + adds r2, r3, 0 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + bl ListMenuInitInternal + lsls r0, 24 + lsrs r7, r0, 24 + ldrb r0, [r4, 0x4] + cmp r0, 0xFF + beq _081AE5F0 + adds r5, r4, 0 +_081AE5D4: + ldrb r0, [r6, 0x10] + ldrb r1, [r5] + ldrb r2, [r5, 0x1] + ldrb r3, [r5, 0x2] + ldrb r4, [r5, 0x3] + str r4, [sp] + ldrb r4, [r5, 0x4] + str r4, [sp, 0x4] + bl PutWindowRectTilemapOverridePalette + adds r5, 0x8 + ldrb r0, [r5, 0x4] + cmp r0, 0xFF + bne _081AE5D4 +_081AE5F0: + ldrb r0, [r6, 0x10] + movs r1, 0x2 + bl CopyWindowToVram + adds r0, r7, 0 + add sp, 0x8 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end Unused_ListMenuInit2 + + thumb_func_start ListMenuHandleInput +@ int ListMenuHandleInput(u8 taskId) +ListMenuHandleInput: @ 81AE604 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r3, r1, r0 + ldr r2, =gMain + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081AE638 + ldrh r0, [r3, 0x18] + ldrh r1, [r3, 0x1A] + adds r0, r1 + ldr r1, [r3] + lsls r0, 3 + adds r0, r1 + ldr r0, [r0, 0x4] + b _081AE6C2 + .pool +_081AE638: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081AE646 + movs r0, 0x2 + negs r0, r0 + b _081AE6C2 +_081AE646: + ldrh r1, [r2, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081AE65A + adds r0, r3, 0 + movs r1, 0x1 + movs r2, 0x1 + movs r3, 0 + b _081AE6BA +_081AE65A: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081AE66A + adds r0, r3, 0 + movs r1, 0x1 + movs r2, 0x1 + b _081AE6B8 +_081AE66A: + ldrb r0, [r3, 0x16] + lsrs r0, 6 + cmp r0, 0x1 + beq _081AE680 + cmp r0, 0x1 + ble _081AE67A + cmp r0, 0x2 + beq _081AE68C +_081AE67A: + movs r2, 0 + movs r0, 0 + b _081AE6A0 +_081AE680: + movs r0, 0x20 + ands r0, r1 + lsls r0, 16 + lsrs r2, r0, 16 + movs r0, 0x10 + b _081AE69A +_081AE68C: + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + lsls r0, 16 + lsrs r2, r0, 16 + movs r0, 0x80 + lsls r0, 1 +_081AE69A: + ands r0, r1 + lsls r0, 16 + lsrs r0, 16 +_081AE6A0: + cmp r2, 0 + beq _081AE6AE + ldrb r2, [r3, 0xE] + adds r0, r3, 0 + movs r1, 0x1 + movs r3, 0 + b _081AE6BA +_081AE6AE: + cmp r0, 0 + beq _081AE6BE + ldrb r2, [r3, 0xE] + adds r0, r3, 0 + movs r1, 0x1 +_081AE6B8: + movs r3, 0x1 +_081AE6BA: + bl ListMenuChangeSelection +_081AE6BE: + movs r0, 0x1 + negs r0, r0 +_081AE6C2: + pop {r1} + bx r1 + thumb_func_end ListMenuHandleInput + + thumb_func_start sub_81AE6C8 +sub_81AE6C8: @ 81AE6C8 + push {r4,lr} + adds r3, r1, 0 + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r1, r0, r1 + cmp r3, 0 + beq _081AE6E4 + ldrh r0, [r1, 0x18] + strh r0, [r3] +_081AE6E4: + cmp r2, 0 + beq _081AE6EC + ldrh r0, [r1, 0x1A] + strh r0, [r2] +_081AE6EC: + ldrb r0, [r1, 0x1E] + cmp r0, 0xFF + beq _081AE6FC + ldrb r1, [r1, 0x17] + lsrs r1, 6 + subs r1, 0x2 + bl ListMenuRemoveCursorObject +_081AE6FC: + adds r0, r4, 0 + bl DestroyTask + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AE6C8 + + thumb_func_start sub_81AE70C +sub_81AE70C: @ 81AE70C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + ldrb r0, [r4, 0x10] + ldrb r2, [r4, 0x15] + lsls r2, 28 + lsrs r1, r2, 4 + orrs r1, r2 + lsrs r1, 24 + bl FillWindowPixelBuffer + ldrh r1, [r4, 0x18] + ldrh r3, [r4, 0xE] + adds r0, r4, 0 + movs r2, 0 + bl ListMenuPrintEntries + adds r0, r4, 0 + bl ListMenuDrawCursor + ldrb r0, [r4, 0x10] + movs r1, 0x2 + bl CopyWindowToVram + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AE70C + + thumb_func_start sub_81AE750 +sub_81AE750: @ 81AE750 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + lsrs r1, 20 + ldrb r6, [r4, 0x14] + movs r5, 0xF + adds r0, r5, 0 + ands r0, r6 + orrs r0, r1 + strb r0, [r4, 0x14] + ands r2, r5 + ldrb r1, [r4, 0x15] + movs r0, 0x10 + negs r0, r0 + ands r0, r1 + orrs r0, r2 + lsrs r3, 20 + ands r0, r5 + orrs r0, r3 + strb r0, [r4, 0x15] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AE750 + + thumb_func_start sub_81AE794 +sub_81AE794: @ 81AE794 + push {r4,r5,lr} + adds r3, r1, 0 + adds r5, r2, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + ldrb r0, [r4, 0x10] + movs r1, 0x1 + adds r2, r3, 0 + bl SetWindowAttribute + ldrb r0, [r4, 0x10] + movs r1, 0x2 + adds r2, r5, 0 + bl SetWindowAttribute + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AE794 + + thumb_func_start sub_81AE7D0 +sub_81AE7D0: @ 81AE7D0 + push {r4-r7,lr} + sub sp, 0x20 + mov r12, r2 + ldr r5, [sp, 0x34] + lsls r3, 16 + lsrs r3, 16 + adds r4, r3, 0 + mov r3, sp + ldm r0!, {r2,r6,r7} + stm r3!, {r2,r6,r7} + ldm r0!, {r2,r6,r7} + stm r3!, {r2,r6,r7} + mov r0, sp + movs r3, 0 + strh r1, [r0, 0x18] + mov r1, r12 + strh r1, [r0, 0x1A] + strb r3, [r0, 0x1C] + strb r3, [r0, 0x1D] + cmp r4, 0x40 + bne _081AE804 + movs r1, 0 + movs r2, 0x1 + movs r3, 0 + bl ListMenuChangeSelection +_081AE804: + cmp r4, 0x80 + bne _081AE814 + mov r0, sp + movs r1, 0 + movs r2, 0x1 + movs r3, 0x1 + bl ListMenuChangeSelection +_081AE814: + cmp r5, 0 + beq _081AE81E + mov r0, sp + ldrh r0, [r0, 0x18] + strh r0, [r5] +_081AE81E: + ldr r2, [sp, 0x38] + cmp r2, 0 + beq _081AE82A + mov r0, sp + ldrh r0, [r0, 0x1A] + strh r0, [r2] +_081AE82A: + movs r0, 0x1 + negs r0, r0 + add sp, 0x20 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81AE7D0 + + thumb_func_start sub_81AE838 +sub_81AE838: @ 81AE838 + push {lr} + adds r2, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r1, r0 + cmp r2, 0 + beq _081AE856 + ldrh r0, [r1, 0x1A] + ldrh r1, [r1, 0x18] + adds r0, r1 + strh r0, [r2] +_081AE856: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AE838 + + thumb_func_start get_coro_args_x18_x1A +get_coro_args_x18_x1A: @ 81AE860 + push {lr} + adds r3, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r1, r0 + cmp r3, 0 + beq _081AE87A + ldrh r0, [r1, 0x18] + strh r0, [r3] +_081AE87A: + cmp r2, 0 + beq _081AE882 + ldrh r0, [r1, 0x1A] + strh r0, [r2] +_081AE882: + pop {r0} + bx r0 + .pool + thumb_func_end get_coro_args_x18_x1A + + thumb_func_start ListMenuGetYCoordForPrintingArrowCursor +@ u8 ListMenuGetYCoordForPrintingArrowCursor(u8 taskId) +ListMenuGetYCoordForPrintingArrowCursor: @ 81AE88C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + ldrb r0, [r4, 0x17] + lsls r0, 26 + lsrs r0, 26 + movs r1, 0x1 + bl GetFontAttribute + ldrb r1, [r4, 0x16] + lsls r1, 26 + lsrs r1, 29 + adds r0, r1 + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x1A] + adds r2, r1, 0 + muls r2, r0 + adds r1, r2, 0 + ldrb r0, [r4, 0x14] + lsls r0, 28 + lsrs r0, 28 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end ListMenuGetYCoordForPrintingArrowCursor + + thumb_func_start ListMenuInitInternal +@ u8 ListMenuInitInternal(struct ListMenuTemplate *listMenuTemplate, u16 scrollOffset, u16 selectedRow) +ListMenuInitInternal: @ 81AE8D4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 16 + lsrs r6, 16 + ldr r0, =ListMenuDummyTask + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r7, r0, r1 + adds r0, r7, 0 + ldm r4!, {r1-r3} + stm r0!, {r1-r3} + ldm r4!, {r1-r3} + stm r0!, {r1-r3} + movs r1, 0 + strh r5, [r7, 0x18] + strh r6, [r7, 0x1A] + strb r1, [r7, 0x1C] + strb r1, [r7, 0x1D] + movs r0, 0xFF + strb r0, [r7, 0x1E] + strb r1, [r7, 0x1F] + ldr r3, =gUnknown_03006300 + ldrb r1, [r7, 0x14] + movs r5, 0xF + lsrs r1, 4 + ldrb r4, [r3] + movs r2, 0x10 + negs r2, r2 + adds r0, r2, 0 + ands r0, r4 + orrs r0, r1 + strb r0, [r3] + ldrb r1, [r7, 0x15] + lsls r1, 28 + lsrs r1, 24 + ands r0, r5 + orrs r0, r1 + strb r0, [r3] + ldrb r0, [r7, 0x15] + lsrs r0, 4 + ands r5, r0 + ldrb r0, [r3, 0x1] + ands r2, r0 + orrs r2, r5 + strb r2, [r3, 0x1] + ldrb r1, [r7, 0x16] + lsls r1, 29 + lsrs r1, 17 + ldr r0, [r3] + ldr r2, =0xfffc0fff + ands r0, r2 + orrs r0, r1 + str r0, [r3] + ldrb r0, [r7, 0x17] + lsls r0, 26 + lsrs r0, 26 + strb r0, [r3, 0x3] + ldrh r0, [r7, 0xC] + ldrh r1, [r7, 0xE] + cmp r0, r1 + bcs _081AE96C + strh r0, [r7, 0xE] +_081AE96C: + ldrb r0, [r7, 0x10] + ldrb r2, [r7, 0x15] + lsls r2, 28 + lsrs r1, r2, 4 + orrs r1, r2 + lsrs r1, 24 + bl FillWindowPixelBuffer + ldrh r1, [r7, 0x18] + ldrh r3, [r7, 0xE] + adds r0, r7, 0 + movs r2, 0 + bl ListMenuPrintEntries + adds r0, r7, 0 + bl ListMenuDrawCursor + adds r0, r7, 0 + movs r1, 0x1 + bl ListMenuCallSelectionChangedCallback + mov r0, r8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end ListMenuInitInternal + + thumb_func_start ListMenuPrint +@ void ListMenuPrint(struct ListMenu *listMenu, u8 *str, u8 x, u8 y) +ListMenuPrint: @ 81AE9B4 + push {r4-r7,lr} + sub sp, 0x18 + adds r4, r0, 0 + adds r6, r1, 0 + lsls r2, 24 + lsrs r7, r2, 24 + lsls r3, 24 + lsrs r3, 24 + mov r12, r3 + ldr r5, =gUnknown_03006300 + ldrb r1, [r5, 0x3] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + beq _081AEA20 + add r1, sp, 0x14 + ldr r2, [r5] + lsls r0, r2, 24 + lsrs r0, 28 + movs r3, 0 + strb r0, [r1] + lsls r0, r2, 28 + lsrs r0, 28 + strb r0, [r1, 0x1] + lsls r0, r2, 20 + lsrs r0, 28 + strb r0, [r1, 0x2] + ldrb r0, [r4, 0x10] + lsls r1, r2, 1 + lsrs r1, 25 + lsls r2, 14 + lsrs r2, 26 + str r2, [sp] + str r3, [sp, 0x4] + add r2, sp, 0x14 + str r2, [sp, 0x8] + movs r2, 0x1 + negs r2, r2 + str r2, [sp, 0xC] + str r6, [sp, 0x10] + adds r2, r7, 0 + mov r3, r12 + bl AddTextPrinterParametrized2 + ldrb r1, [r5, 0x3] + movs r0, 0x7F + ands r0, r1 + strb r0, [r5, 0x3] + b _081AEA5E + .pool +_081AEA20: + add r2, sp, 0x14 + ldrb r1, [r4, 0x15] + lsls r0, r1, 28 + lsrs r0, 28 + strb r0, [r2] + ldrb r0, [r4, 0x14] + lsrs r0, 4 + strb r0, [r2, 0x1] + adds r0, r2, 0 + lsls r1, 24 + lsrs r1, 28 + strb r1, [r0, 0x2] + ldrb r0, [r4, 0x10] + ldrb r1, [r4, 0x17] + lsls r1, 26 + lsrs r1, 26 + ldrb r2, [r4, 0x16] + lsls r2, 29 + lsrs r2, 29 + str r2, [sp] + str r3, [sp, 0x4] + add r2, sp, 0x14 + str r2, [sp, 0x8] + movs r2, 0x1 + negs r2, r2 + str r2, [sp, 0xC] + str r6, [sp, 0x10] + adds r2, r7, 0 + mov r3, r12 + bl AddTextPrinterParametrized2 +_081AEA5E: + add sp, 0x18 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end ListMenuPrint + + thumb_func_start ListMenuPrintEntries +@ void ListMenuPrintEntries(struct ListMenu *listMenu, u16 startIndex, u16 yOffset, u16 count) +ListMenuPrintEntries: @ 81AEA68 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r4, r0, 0 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + lsls r2, 16 + lsrs r2, 16 + str r2, [sp] + lsls r3, 16 + lsrs r3, 16 + mov r10, r3 + ldrb r0, [r4, 0x17] + lsls r0, 26 + lsrs r0, 26 + movs r1, 0x1 + bl GetFontAttribute + ldrb r1, [r4, 0x16] + lsls r1, 26 + lsrs r1, 29 + adds r0, r1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + movs r0, 0 + mov r8, r0 + cmp r8, r10 + bge _081AEB10 +_081AEAAA: + ldr r0, [r4] + mov r2, r9 + lsls r1, r2, 3 + adds r0, r1, r0 + ldr r2, [r0, 0x4] + movs r0, 0x3 + negs r0, r0 + adds r5, r1, 0 + cmp r2, r0 + beq _081AEAC2 + ldrb r6, [r4, 0x12] + b _081AEAC4 +_081AEAC2: + ldrb r6, [r4, 0x11] +_081AEAC4: + ldr r0, [sp] + add r0, r8 + ldr r2, [sp, 0x4] + adds r1, r0, 0 + muls r1, r2 + ldrb r0, [r4, 0x14] + lsls r0, 28 + lsrs r0, 28 + adds r0, r1 + lsls r0, 24 + lsrs r2, r0, 24 + adds r7, r2, 0 + ldr r3, [r4, 0x8] + cmp r3, 0 + beq _081AEAEE + ldrb r0, [r4, 0x10] + ldr r1, [r4] + adds r1, r5, r1 + ldr r1, [r1, 0x4] + bl _call_via_r3 +_081AEAEE: + ldr r0, [r4] + adds r0, r5, r0 + ldr r1, [r0] + adds r0, r4, 0 + adds r2, r6, 0 + adds r3, r7, 0 + bl ListMenuPrint + mov r0, r9 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + movs r0, 0x1 + add r8, r0 + cmp r8, r10 + blt _081AEAAA +_081AEB10: + 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 ListMenuPrintEntries + + thumb_func_start ListMenuDrawCursor +@ void ListMenuDrawCursor(struct ListMenu *listMenu) +ListMenuDrawCursor: @ 81AEB20 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + ldrb r0, [r6, 0x17] + lsls r0, 26 + lsrs r0, 26 + movs r1, 0x1 + bl GetFontAttribute + ldrb r1, [r6, 0x16] + lsls r1, 26 + lsrs r1, 29 + adds r0, r1 + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r6, 0x13] + mov r8, r1 + ldrh r1, [r6, 0x1A] + muls r1, r0 + ldrb r0, [r6, 0x14] + lsls r0, 28 + lsrs r0, 28 + adds r0, r1 + lsls r0, 24 + lsrs r7, r0, 24 + ldrb r0, [r6, 0x17] + lsrs r0, 6 + cmp r0, 0x1 + beq _081AEC0C + cmp r0, 0x1 + bgt _081AEB66 + cmp r0, 0 + beq _081AEB70 + b _081AEC0C +_081AEB66: + cmp r0, 0x2 + beq _081AEB84 + cmp r0, 0x3 + beq _081AEBCC + b _081AEC0C +_081AEB70: + ldr r1, =gText_SelectorArrow2 + adds r0, r6, 0 + mov r2, r8 + adds r3, r7, 0 + bl ListMenuPrint + b _081AEC0C + .pool +_081AEB84: + ldrb r0, [r6, 0x1E] + cmp r0, 0xFF + bne _081AEB94 + adds r0, r6, 0 + movs r1, 0 + bl ListMenuAddCursorObject + strb r0, [r6, 0x1E] +_081AEB94: + ldrb r5, [r6, 0x1E] + ldrb r0, [r6, 0x10] + movs r1, 0x1 + bl GetWindowAttribute + adds r4, r0, 0 + lsls r4, 19 + ldr r0, =0xffff0000 + adds r4, r0 + lsrs r4, 16 + ldrb r0, [r6, 0x10] + movs r1, 0x2 + bl GetWindowAttribute + adds r2, r0, 0 + lsls r2, 3 + adds r2, r7 + subs r2, 0x1 + lsls r2, 16 + lsrs r2, 16 + adds r0, r5, 0 + adds r1, r4, 0 + movs r3, 0 + bl ListMenuUpdateCursorObject + b _081AEC0C + .pool +_081AEBCC: + ldrb r0, [r6, 0x1E] + cmp r0, 0xFF + bne _081AEBDC + adds r0, r6, 0 + movs r1, 0x1 + bl ListMenuAddCursorObject + strb r0, [r6, 0x1E] +_081AEBDC: + ldrb r5, [r6, 0x1E] + ldrb r0, [r6, 0x10] + movs r1, 0x1 + bl GetWindowAttribute + adds r4, r0, 0 + lsls r4, 3 + add r4, r8 + lsls r4, 16 + lsrs r4, 16 + ldrb r0, [r6, 0x10] + movs r1, 0x2 + bl GetWindowAttribute + adds r2, r0, 0 + lsls r2, 3 + adds r2, r7 + lsls r2, 16 + lsrs r2, 16 + adds r0, r5, 0 + adds r1, r4, 0 + movs r3, 0x1 + bl ListMenuUpdateCursorObject +_081AEC0C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end ListMenuDrawCursor + + thumb_func_start ListMenuAddCursorObject +ListMenuAddCursorObject: @ 81AEC18 + push {r4,r5,lr} + sub sp, 0xC + adds r4, r0, 0 + adds r5, r1, 0 + mov r1, sp + movs r0, 0 + strb r0, [r1] + movs r0, 0xA0 + strb r0, [r1, 0x1] + ldrb r0, [r4, 0x10] + movs r1, 0x3 + bl GetWindowAttribute + mov r1, sp + lsls r0, 3 + adds r0, 0x2 + strh r0, [r1, 0x2] + ldrb r0, [r4, 0x17] + lsls r0, 26 + lsrs r0, 26 + movs r1, 0x1 + bl GetFontAttribute + mov r1, sp + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x2 + strh r0, [r1, 0x4] + movs r0, 0x80 + lsls r0, 7 + strh r0, [r1, 0x6] + ldr r0, =0x0000ffff + strh r0, [r1, 0x8] + movs r0, 0xF + strb r0, [r1, 0xA] + mov r0, sp + adds r1, r5, 0 + bl ListMenuAddCursorObjectInternal + lsls r0, 24 + lsrs r0, 24 + add sp, 0xC + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end ListMenuAddCursorObject + + thumb_func_start ListMenuErasePrintedCursor +ListMenuErasePrintedCursor: @ 81AEC78 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r7, r0, 0 + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + ldrb r1, [r7, 0x17] + lsrs r0, r1, 6 + cmp r0, 0 + bne _081AECF4 + lsls r0, r1, 26 + lsrs r0, 26 + movs r1, 0x1 + bl GetFontAttribute + adds r4, r0, 0 + ldrb r0, [r7, 0x16] + lsls r0, 26 + lsrs r0, 29 + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r7, 0x17] + lsls r0, 26 + lsrs r0, 26 + movs r1, 0 + bl GetMenuCursorDimensionByFont + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldrb r0, [r7, 0x17] + lsls r0, 26 + lsrs r0, 26 + movs r1, 0x1 + bl GetMenuCursorDimensionByFont + lsls r0, 24 + lsrs r0, 24 + ldrb r6, [r7, 0x10] + ldrb r2, [r7, 0x15] + lsls r2, 28 + lsrs r1, r2, 4 + orrs r1, r2 + lsrs r1, 24 + ldrb r2, [r7, 0x13] + mov r3, r8 + muls r3, r4 + adds r4, r3, 0 + ldrb r3, [r7, 0x14] + lsls r3, 28 + lsrs r3, 28 + adds r3, r4 + lsls r3, 16 + lsrs r3, 16 + str r5, [sp] + str r0, [sp, 0x4] + adds r0, r6, 0 + bl FillWindowPixelRect +_081AECF4: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end ListMenuErasePrintedCursor + + thumb_func_start ListMenuUpdateSelectedRowIndexAndScrollOffset +@ u8 ListMenuUpdateSelectedRowIndexAndScrollOffset(int, bool8 movingDown) +ListMenuUpdateSelectedRowIndexAndScrollOffset: @ 81AED00 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 24 + ldrh r3, [r4, 0x1A] + ldrh r5, [r4, 0x18] + cmp r1, 0 + bne _081AED74 + ldrh r0, [r4, 0xE] + cmp r0, 0x1 + bne _081AED18 + movs r2, 0 + b _081AED2A +_081AED18: + ldrh r0, [r4, 0xE] + lsrs r2, r0, 1 + movs r1, 0x1 + ands r1, r0 + adds r2, r1 + subs r0, r2 + subs r0, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 +_081AED2A: + cmp r5, 0 + bne _081AED50 + cmp r3, 0 + beq _081AEDB6 + ldr r1, [r4] + movs r2, 0x3 + negs r2, r2 +_081AED38: + subs r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + adds r0, r5, r3 + lsls r0, 3 + adds r0, r1 + ldr r0, [r0, 0x4] + cmp r0, r2 + bne _081AEDBA + cmp r3, 0 + bne _081AED38 + b _081AEDB6 +_081AED50: + cmp r3, r2 + bls _081AED70 + ldr r1, [r4] + movs r6, 0x3 + negs r6, r6 +_081AED5A: + subs r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + adds r0, r5, r3 + lsls r0, 3 + adds r0, r1 + ldr r0, [r0, 0x4] + cmp r0, r6 + bne _081AEDBA + cmp r3, r2 + bhi _081AED5A +_081AED70: + subs r0, r5, 0x1 + b _081AEDE2 +_081AED74: + ldrh r0, [r4, 0xE] + cmp r0, 0x1 + bne _081AED7E + movs r2, 0 + b _081AED88 +_081AED7E: + ldrh r0, [r4, 0xE] + lsrs r2, r0, 1 + movs r1, 0x1 + ands r1, r0 + adds r2, r1 +_081AED88: + adds r1, r0, 0 + ldrh r0, [r4, 0xC] + subs r0, r1 + cmp r5, r0 + bne _081AEDC0 + subs r0, r1, 0x1 + cmp r3, r0 + bge _081AEDB6 + ldr r2, [r4] + movs r6, 0x3 + negs r6, r6 + adds r1, r0, 0 +_081AEDA0: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + adds r0, r5, r3 + lsls r0, 3 + adds r0, r2 + ldr r0, [r0, 0x4] + cmp r0, r6 + bne _081AEDBA + cmp r3, r1 + blt _081AEDA0 +_081AEDB6: + movs r0, 0 + b _081AEDE8 +_081AEDBA: + strh r3, [r4, 0x1A] + movs r0, 0x1 + b _081AEDE8 +_081AEDC0: + cmp r3, r2 + bcs _081AEDE0 + ldr r1, [r4] + movs r6, 0x3 + negs r6, r6 +_081AEDCA: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + adds r0, r5, r3 + lsls r0, 3 + adds r0, r1 + ldr r0, [r0, 0x4] + cmp r0, r6 + bne _081AEDBA + cmp r3, r2 + bcc _081AEDCA +_081AEDE0: + adds r0, r5, 0x1 +_081AEDE2: + strh r2, [r4, 0x1A] + strh r0, [r4, 0x18] + movs r0, 0x2 +_081AEDE8: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end ListMenuUpdateSelectedRowIndexAndScrollOffset + + thumb_func_start ListMenuScroll +@ void ListMenuScroll(struct ListMenu *listMenu, int a2, bool8 movingDown) +ListMenuScroll: @ 81AEDF0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r6, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + adds r7, r5, 0 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + ldrh r0, [r6, 0xE] + cmp r5, r0 + bcc _081AEE2A + ldrb r0, [r6, 0x10] + ldrb r2, [r6, 0x15] + lsls r2, 28 + lsrs r1, r2, 4 + orrs r1, r2 + lsrs r1, 24 + bl FillWindowPixelBuffer + ldrh r1, [r6, 0x18] + ldrh r3, [r6, 0xE] + adds r0, r6, 0 + movs r2, 0 + bl ListMenuPrintEntries + b _081AEF1A +_081AEE2A: + ldrb r0, [r6, 0x17] + lsls r0, 26 + lsrs r0, 26 + movs r1, 0x1 + bl GetFontAttribute + ldrb r1, [r6, 0x16] + lsls r1, 26 + lsrs r1, 29 + adds r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + mov r1, r8 + cmp r1, 0 + bne _081AEEBC + ldrb r0, [r6, 0x10] + adds r2, r5, 0 + muls r2, r4 + lsls r2, 24 + lsrs r2, 24 + ldrb r1, [r6, 0x15] + lsls r1, 28 + lsrs r3, r1, 4 + orrs r3, r1 + lsrs r3, 24 + movs r1, 0x1 + bl ScrollWindow + ldrh r1, [r6, 0x18] + adds r0, r6, 0 + movs r2, 0 + adds r3, r5, 0 + bl ListMenuPrintEntries + ldrh r0, [r6, 0xE] + adds r1, r0, 0 + muls r1, r4 + adds r0, r1, 0 + ldrb r4, [r6, 0x14] + lsls r4, 28 + lsrs r4, 28 + adds r4, r0 + lsls r4, 16 + lsrs r4, 16 + ldrb r0, [r6, 0x10] + movs r1, 0x3 + bl GetWindowAttribute + adds r5, r0, 0 + lsls r5, 19 + lsrs r5, 16 + ldrb r0, [r6, 0x10] + movs r1, 0x4 + bl GetWindowAttribute + lsls r0, 3 + subs r0, r4 + lsls r0, 16 + lsrs r0, 16 + ldrb r3, [r6, 0x10] + ldrb r2, [r6, 0x15] + lsls r2, 28 + lsrs r1, r2, 4 + orrs r1, r2 + lsrs r1, 24 + str r5, [sp] + str r0, [sp, 0x4] + adds r0, r3, 0 + movs r2, 0 + adds r3, r4, 0 + bl FillWindowPixelRect + b _081AEF1A +_081AEEBC: + ldrb r0, [r6, 0x10] + adds r2, r7, 0 + muls r2, r4 + lsls r2, 24 + lsrs r2, 24 + ldrb r1, [r6, 0x15] + lsls r1, 28 + lsrs r3, r1, 4 + orrs r3, r1 + lsrs r3, 24 + movs r1, 0 + bl ScrollWindow + ldrh r2, [r6, 0xE] + subs r2, r7 + ldrh r1, [r6, 0x18] + adds r1, r2 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + adds r0, r6, 0 + adds r3, r7, 0 + bl ListMenuPrintEntries + ldrb r0, [r6, 0x10] + movs r1, 0x3 + bl GetWindowAttribute + lsls r0, 19 + lsrs r0, 16 + ldrb r3, [r6, 0x10] + ldrb r2, [r6, 0x15] + lsls r2, 28 + lsrs r1, r2, 4 + orrs r1, r2 + lsrs r1, 24 + str r0, [sp] + ldrb r0, [r6, 0x14] + lsls r0, 28 + lsrs r0, 28 + str r0, [sp, 0x4] + adds r0, r3, 0 + movs r2, 0 + movs r3, 0 + bl FillWindowPixelRect +_081AEF1A: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end ListMenuScroll + + thumb_func_start ListMenuChangeSelection +@ bool8 ListMenuChangeSelection(struct ListMenu *listMenu, bool8 updateCursorAndCallCallback, u8 count, bool8 movingDown) +ListMenuChangeSelection: @ 81AEF28 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r4, r0, 0 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r3, 24 + mov r9, r3 + ldrh r0, [r4, 0x1A] + mov r10, r0 + movs r7, 0 + movs r5, 0 + movs r0, 0 + cmp r7, r8 + bcs _081AEF90 +_081AEF56: + adds r6, r0, 0x1 + b _081AEF76 +_081AEF5A: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + ldrh r0, [r4, 0x18] + ldrh r1, [r4, 0x1A] + adds r0, r1 + ldr r1, [r4] + lsls r0, 3 + adds r0, r1 + ldr r1, [r0, 0x4] + movs r0, 0x3 + negs r0, r0 + cmp r1, r0 + bne _081AEF88 +_081AEF76: + adds r0, r4, 0 + mov r1, r9 + bl ListMenuUpdateSelectedRowIndexAndScrollOffset + lsls r0, 24 + lsrs r0, 24 + orrs r5, r0 + cmp r0, 0x2 + beq _081AEF5A +_081AEF88: + lsls r0, r6, 24 + lsrs r0, 24 + cmp r0, r8 + bcc _081AEF56 +_081AEF90: + ldr r0, [sp] + cmp r0, 0 + beq _081AEFEE + cmp r5, 0x1 + beq _081AEFA6 + cmp r5, 0x1 + ble _081AEFA2 + cmp r5, 0x3 + ble _081AEFC6 +_081AEFA2: + movs r0, 0x1 + b _081AEFF0 +_081AEFA6: + adds r0, r4, 0 + mov r1, r10 + bl ListMenuErasePrintedCursor + adds r0, r4, 0 + bl ListMenuDrawCursor + adds r0, r4, 0 + movs r1, 0 + bl ListMenuCallSelectionChangedCallback + ldrb r0, [r4, 0x10] + movs r1, 0x2 + bl CopyWindowToVram + b _081AEFEE +_081AEFC6: + adds r0, r4, 0 + mov r1, r10 + bl ListMenuErasePrintedCursor + adds r0, r4, 0 + adds r1, r7, 0 + mov r2, r9 + bl ListMenuScroll + adds r0, r4, 0 + bl ListMenuDrawCursor + adds r0, r4, 0 + movs r1, 0 + bl ListMenuCallSelectionChangedCallback + ldrb r0, [r4, 0x10] + movs r1, 0x2 + bl CopyWindowToVram +_081AEFEE: + movs r0, 0 +_081AEFF0: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end ListMenuChangeSelection + + thumb_func_start ListMenuCallSelectionChangedCallback +@ void ListMenuCallSelectionChangedCallback(struct ListMenu *listMenu, u8 a2) +ListMenuCallSelectionChangedCallback: @ 81AF000 + push {r4,lr} + adds r2, r0, 0 + lsls r1, 24 + lsrs r4, r1, 24 + ldr r3, [r2, 0x4] + cmp r3, 0 + beq _081AF022 + ldrh r0, [r2, 0x18] + ldrh r1, [r2, 0x1A] + adds r0, r1 + ldr r1, [r2] + lsls r0, 3 + adds r0, r1 + ldr r0, [r0, 0x4] + adds r1, r4, 0 + bl _call_via_r3 +_081AF022: + pop {r4} + pop {r0} + bx r0 + thumb_func_end ListMenuCallSelectionChangedCallback + + thumb_func_start sub_81AF028 +sub_81AF028: @ 81AF028 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsls r2, 24 + lsrs r2, 24 + ldr r6, =gUnknown_03006300 + movs r5, 0xF + ands r0, r5 + ldrb r3, [r6] + mov r8, r3 + movs r4, 0x10 + negs r4, r4 + adds r3, r4, 0 + mov r7, r8 + ands r3, r7 + orrs r3, r0 + lsrs r1, 20 + ands r3, r5 + orrs r3, r1 + strb r3, [r6] + ands r2, r5 + ldrb r0, [r6, 0x1] + ands r4, r0 + orrs r4, r2 + strb r4, [r6, 0x1] + ldrb r0, [r6, 0x3] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r6, 0x3] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AF028 + + thumb_func_start sub_81AF078 +sub_81AF078: @ 81AF078 + push {lr} + lsls r1, 24 + cmp r1, 0 + bne _081AF086 + movs r0, 0x5 + bl PlaySE +_081AF086: + pop {r0} + bx r0 + thumb_func_end sub_81AF078 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/mail_data.s b/asm/mail_data.s new file mode 100755 index 000000000..94cb3e9e6 --- /dev/null +++ b/asm/mail_data.s @@ -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. diff --git a/asm/map_name_popup.s b/asm/map_name_popup.s new file mode 100755 index 000000000..f10dff946 --- /dev/null +++ b/asm/map_name_popup.s @@ -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. diff --git a/asm/rom_8151534.s b/asm/math_util.s similarity index 100% rename from asm/rom_8151534.s rename to asm/math_util.s diff --git a/asm/menu.s b/asm/menu.s new file mode 100755 index 000000000..553161d40 --- /dev/null +++ b/asm/menu.s @@ -0,0 +1,5505 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start AddTextPrinterWithCallbackForMessage +@ void AddTextPrinterWithCallbackForMessage(u8 allowSkippingDelayWithButtonPress, void ( *callback)(u16, struct TextPrinter *)) +AddTextPrinterWithCallbackForMessage: @ 8197A9C + push {r4,r5,lr} + sub sp, 0x10 + adds r5, r1, 0 + lsls r0, 24 + lsrs r0, 24 + ldr r3, =gTextFlags + movs r4, 0x1 + ands r0, r4 + ldrb r2, [r3] + movs r1, 0x2 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3] + bl sav2_get_text_speed + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + ldr r2, =gStringVar4 + str r5, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x3 + str r0, [sp, 0xC] + movs r0, 0 + movs r1, 0x1 + bl AddTextPrinterParametrized + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end AddTextPrinterWithCallbackForMessage + + thumb_func_start sub_8197AE8 +sub_8197AE8: @ 8197AE8 + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x20 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect + cmp r4, 0x1 + bne _08197B12 + movs r0, 0 + bl CopyBgTilemapBufferToVram +_08197B12: + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8197AE8 + + thumb_func_start sub_8197B1C +sub_8197B1C: @ 8197B1C + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_0203CD9C + strh r2, [r0] + ldr r0, =gUnknown_0203CD9E + strb r3, [r0] + ldr r1, =sub_8197BB4 + adds r0, r5, 0 + bl CallWindowFunction + adds r0, r5, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + adds r0, r5, 0 + bl PutWindowTilemap + cmp r4, 0x1 + bne _08197B52 + adds r0, r5, 0 + movs r1, 0x3 + bl CopyWindowToVram +_08197B52: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8197B1C + + thumb_func_start sub_8197B64 +sub_8197B64: @ 8197B64 + push {r4-r6,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_0203CD9C + strh r2, [r0] + ldr r5, =gUnknown_0203CD9E + adds r0, r6, 0 + movs r1, 0x5 + bl GetWindowAttribute + strb r0, [r5] + ldr r1, =sub_8197BB4 + adds r0, r6, 0 + bl CallWindowFunction + adds r0, r6, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + adds r0, r6, 0 + bl PutWindowTilemap + cmp r4, 0x1 + bne _08197BA2 + adds r0, r6, 0 + movs r1, 0x3 + bl CopyWindowToVram +_08197BA2: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8197B64 + + thumb_func_start sub_8197BB4 +sub_8197BB4: @ 8197BB4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + mov r8, r0 + adds r5, r2, 0 + adds r6, r3, 0 + ldr r2, [sp, 0x44] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r0, r1, 24 + lsls r5, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r1, r2, 24 + lsrs r1, 24 + str r1, [sp, 0x10] + ldr r2, =gUnknown_0203CD9C + ldrh r1, [r2] + adds r1, 0x1 + lsls r1, 16 + lsrs r1, 16 + lsrs r3, r0, 24 + str r3, [sp, 0xC] + movs r3, 0xFE + lsls r3, 24 + adds r2, r0, r3 + lsrs r2, 24 + str r2, [sp, 0x14] + lsrs r0, r5, 24 + mov r9, r0 + movs r2, 0xFF + lsls r2, 24 + adds r5, r2 + lsrs r5, 24 + movs r4, 0x1 + str r4, [sp] + str r4, [sp, 0x4] + ldr r3, =gUnknown_0203CD9E + mov r10, r3 + ldrb r0, [r3] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0x14] + adds r3, r5, 0 + bl FillBgTilemapBufferRect + ldr r0, =gUnknown_0203CD9C + ldrh r1, [r0] + adds r1, 0x3 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0xC] + subs r0, 0x1 + lsls r2, r0, 24 + lsrs r2, 24 + str r2, [sp, 0x18] + str r4, [sp] + str r4, [sp, 0x4] + mov r2, r10 + ldrb r0, [r2] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0x18] + adds r3, r5, 0 + bl FillBgTilemapBufferRect + ldr r3, =gUnknown_0203CD9C + ldrh r1, [r3] + adds r1, 0x4 + lsls r1, 16 + lsrs r1, 16 + subs r0, r6, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x1C] + str r0, [sp] + str r4, [sp, 0x4] + mov r2, r10 + ldrb r0, [r2] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0xC] + adds r3, r5, 0 + bl FillBgTilemapBufferRect + ldr r3, =gUnknown_0203CD9C + ldrh r1, [r3] + adds r1, 0x5 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0xC] + adds r7, r0, r6 + subs r0, r7, 0x1 + lsls r2, r0, 24 + lsrs r2, 24 + str r2, [sp, 0x20] + str r4, [sp] + str r4, [sp, 0x4] + mov r2, r10 + ldrb r0, [r2] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0x20] + adds r3, r5, 0 + bl FillBgTilemapBufferRect + ldr r3, =gUnknown_0203CD9C + ldrh r1, [r3] + adds r1, 0x6 + lsls r1, 16 + lsrs r1, 16 + lsls r2, r7, 24 + lsrs r7, r2, 24 + str r4, [sp] + str r4, [sp, 0x4] + mov r2, r10 + ldrb r0, [r2] + str r0, [sp, 0x8] + mov r0, r8 + adds r2, r7, 0 + adds r3, r5, 0 + bl FillBgTilemapBufferRect + ldr r3, =gUnknown_0203CD9C + ldrh r1, [r3] + adds r1, 0x7 + lsls r1, 16 + lsrs r1, 16 + str r4, [sp] + movs r5, 0x5 + str r5, [sp, 0x4] + mov r2, r10 + ldrb r0, [r2] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0x14] + mov r3, r9 + bl FillBgTilemapBufferRect + ldr r3, =gUnknown_0203CD9C + ldrh r1, [r3] + adds r1, 0x9 + lsls r1, 16 + lsrs r1, 16 + adds r6, 0x1 + lsls r6, 24 + lsrs r6, 24 + str r6, [sp] + str r5, [sp, 0x4] + mov r2, r10 + ldrb r0, [r2] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0x18] + mov r3, r9 + bl FillBgTilemapBufferRect + ldr r3, =gUnknown_0203CD9C + ldrh r1, [r3] + adds r1, 0xA + lsls r1, 16 + lsrs r1, 16 + str r4, [sp] + str r5, [sp, 0x4] + mov r2, r10 + ldrb r0, [r2] + str r0, [sp, 0x8] + mov r0, r8 + adds r2, r7, 0 + mov r3, r9 + bl FillBgTilemapBufferRect + ldr r3, =0x00000801 + adds r1, r3, 0 + ldr r0, =gUnknown_0203CD9C + ldrh r0, [r0] + adds r1, r0 + lsls r1, 16 + lsrs r1, 16 + ldr r2, [sp, 0x10] + add r9, r2 + mov r3, r9 + lsls r3, 24 + lsrs r3, 24 + mov r9, r3 + str r4, [sp] + str r4, [sp, 0x4] + mov r2, r10 + ldrb r0, [r2] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0x14] + bl FillBgTilemapBufferRect + ldr r3, =0x00000803 + adds r1, r3, 0 + ldr r0, =gUnknown_0203CD9C + ldrh r0, [r0] + adds r1, r0 + lsls r1, 16 + lsrs r1, 16 + str r4, [sp] + str r4, [sp, 0x4] + mov r2, r10 + ldrb r0, [r2] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0x18] + mov r3, r9 + bl FillBgTilemapBufferRect + ldr r3, =0x00000804 + adds r1, r3, 0 + ldr r0, =gUnknown_0203CD9C + ldrh r0, [r0] + adds r1, r0 + lsls r1, 16 + lsrs r1, 16 + ldr r2, [sp, 0x1C] + str r2, [sp] + str r4, [sp, 0x4] + mov r3, r10 + ldrb r0, [r3] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0xC] + mov r3, r9 + bl FillBgTilemapBufferRect + ldr r0, =0x00000805 + adds r1, r0, 0 + ldr r2, =gUnknown_0203CD9C + ldrh r2, [r2] + adds r1, r2 + lsls r1, 16 + lsrs r1, 16 + str r4, [sp] + str r4, [sp, 0x4] + mov r3, r10 + ldrb r0, [r3] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0x20] + mov r3, r9 + bl FillBgTilemapBufferRect + ldr r0, =0x00000806 + adds r1, r0, 0 + ldr r2, =gUnknown_0203CD9C + ldrh r2, [r2] + adds r1, r2 + lsls r1, 16 + lsrs r1, 16 + str r4, [sp] + str r4, [sp, 0x4] + mov r3, r10 + ldrb r0, [r3] + str r0, [sp, 0x8] + mov r0, r8 + adds r2, r7, 0 + mov r3, r9 + bl FillBgTilemapBufferRect + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8197BB4 + + thumb_func_start sub_8197DF8 +sub_8197DF8: @ 8197DF8 + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =sub_8197E30 + adds r0, r5, 0 + bl CallWindowFunction + adds r0, r5, 0 + movs r1, 0 + bl FillWindowPixelBuffer + adds r0, r5, 0 + bl ClearWindowTilemap + cmp r4, 0x1 + bne _08197E26 + adds r0, r5, 0 + movs r1, 0x3 + bl CopyWindowToVram +_08197E26: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8197DF8 + + thumb_func_start sub_8197E30 +sub_8197E30: @ 8197E30 + push {r4,r5,lr} + sub sp, 0xC + adds r4, r1, 0 + adds r5, r2, 0 + ldr r1, [sp, 0x18] + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsls r5, 24 + lsls r3, 24 + lsls r1, 24 + movs r2, 0xFD + lsls r2, 24 + adds r4, r2 + lsrs r4, 24 + movs r2, 0xFF + lsls r2, 24 + adds r5, r2 + lsrs r5, 24 + movs r2, 0xC0 + lsls r2, 19 + adds r3, r2 + lsrs r3, 24 + str r3, [sp] + movs r2, 0x80 + lsls r2, 18 + adds r1, r2 + lsrs r1, 24 + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + adds r2, r4, 0 + adds r3, r5, 0 + bl FillBgTilemapBufferRect + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8197E30 + + thumb_func_start SetWindowBorderStyle +@ void SetWindowBorderStyle(u8 windowId, bool copyToVram, s16 tileStart, s8 palette) +SetWindowBorderStyle: @ 8197E80 + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_0203CD9C + strh r2, [r0] + ldr r0, =gUnknown_0203CD9E + strb r3, [r0] + ldr r1, =DrawWindowBorder + adds r0, r5, 0 + bl CallWindowFunction + adds r0, r5, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + adds r0, r5, 0 + bl PutWindowTilemap + cmp r4, 0x1 + bne _08197EB6 + adds r0, r5, 0 + movs r1, 0x3 + bl CopyWindowToVram +_08197EB6: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end SetWindowBorderStyle + + thumb_func_start sub_8197EC8 +sub_8197EC8: @ 8197EC8 + push {r4-r6,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_0203CD9C + strh r2, [r0] + ldr r5, =gUnknown_0203CD9E + adds r0, r6, 0 + movs r1, 0x5 + bl GetWindowAttribute + strb r0, [r5] + ldr r1, =DrawWindowBorder + adds r0, r6, 0 + bl CallWindowFunction + adds r0, r6, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + adds r0, r6, 0 + bl PutWindowTilemap + cmp r4, 0x1 + bne _08197F06 + adds r0, r6, 0 + movs r1, 0x3 + bl CopyWindowToVram +_08197F06: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8197EC8 + + thumb_func_start DrawWindowBorder +DrawWindowBorder: @ 8197F18 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + mov r9, r0 + adds r6, r1, 0 + adds r4, r2, 0 + ldr r0, [sp, 0x38] + mov r1, r9 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + lsls r6, 24 + lsls r4, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x10] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x14] + ldr r2, =gUnknown_0203CD9C + ldrh r1, [r2] + lsrs r0, r6, 24 + str r0, [sp, 0xC] + movs r2, 0xFF + lsls r2, 24 + adds r6, r2 + lsrs r6, 24 + lsrs r0, r4, 24 + mov r8, r0 + adds r4, r2 + lsrs r4, 24 + movs r5, 0x1 + str r5, [sp] + str r5, [sp, 0x4] + ldr r7, =gUnknown_0203CD9E + ldrb r0, [r7] + str r0, [sp, 0x8] + mov r0, r9 + adds r2, r6, 0 + adds r3, r4, 0 + bl FillBgTilemapBufferRect + ldr r2, =gUnknown_0203CD9C + ldrh r1, [r2] + adds r1, 0x1 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x10] + str r0, [sp] + str r5, [sp, 0x4] + ldrb r0, [r7] + str r0, [sp, 0x8] + mov r0, r9 + ldr r2, [sp, 0xC] + adds r3, r4, 0 + bl FillBgTilemapBufferRect + ldr r2, =gUnknown_0203CD9C + ldrh r1, [r2] + adds r1, 0x2 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0xC] + ldr r2, [sp, 0x10] + adds r0, r2 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + str r5, [sp] + str r5, [sp, 0x4] + ldrb r0, [r7] + str r0, [sp, 0x8] + mov r0, r9 + mov r2, r10 + adds r3, r4, 0 + bl FillBgTilemapBufferRect + ldr r0, =gUnknown_0203CD9C + ldrh r1, [r0] + adds r1, 0x3 + lsls r1, 16 + lsrs r1, 16 + str r5, [sp] + ldr r2, [sp, 0x14] + str r2, [sp, 0x4] + ldrb r0, [r7] + str r0, [sp, 0x8] + mov r0, r9 + adds r2, r6, 0 + mov r3, r8 + bl FillBgTilemapBufferRect + ldr r0, =gUnknown_0203CD9C + ldrh r1, [r0] + adds r1, 0x5 + lsls r1, 16 + lsrs r1, 16 + str r5, [sp] + ldr r2, [sp, 0x14] + str r2, [sp, 0x4] + ldrb r0, [r7] + str r0, [sp, 0x8] + mov r0, r9 + mov r2, r10 + mov r3, r8 + bl FillBgTilemapBufferRect + ldr r0, =gUnknown_0203CD9C + ldrh r1, [r0] + adds r1, 0x6 + lsls r1, 16 + lsrs r1, 16 + ldr r2, [sp, 0x14] + add r8, r2 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + str r5, [sp] + str r5, [sp, 0x4] + ldrb r0, [r7] + str r0, [sp, 0x8] + mov r0, r9 + adds r2, r6, 0 + mov r3, r8 + bl FillBgTilemapBufferRect + ldr r2, =gUnknown_0203CD9C + ldrh r1, [r2] + adds r1, 0x7 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x10] + str r0, [sp] + str r5, [sp, 0x4] + ldrb r0, [r7] + str r0, [sp, 0x8] + mov r0, r9 + ldr r2, [sp, 0xC] + mov r3, r8 + bl FillBgTilemapBufferRect + ldr r2, =gUnknown_0203CD9C + ldrh r1, [r2] + adds r1, 0x8 + lsls r1, 16 + lsrs r1, 16 + str r5, [sp] + str r5, [sp, 0x4] + ldrb r0, [r7] + str r0, [sp, 0x8] + mov r0, r9 + mov r2, r10 + mov r3, r8 + bl FillBgTilemapBufferRect + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end DrawWindowBorder + + thumb_func_start sub_8198070 +sub_8198070: @ 8198070 + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =sub_81980A8 + adds r0, r5, 0 + bl CallWindowFunction + adds r0, r5, 0 + movs r1, 0 + bl FillWindowPixelBuffer + adds r0, r5, 0 + bl ClearWindowTilemap + cmp r4, 0x1 + bne _0819809E + adds r0, r5, 0 + movs r1, 0x3 + bl CopyWindowToVram +_0819809E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8198070 + + thumb_func_start sub_81980A8 +sub_81980A8: @ 81980A8 + push {r4,r5,lr} + sub sp, 0xC + adds r4, r1, 0 + adds r5, r2, 0 + ldr r1, [sp, 0x18] + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsls r5, 24 + lsls r3, 24 + lsls r1, 24 + movs r2, 0xFF + lsls r2, 24 + adds r4, r2 + lsrs r4, 24 + adds r5, r2 + lsrs r5, 24 + movs r2, 0x80 + lsls r2, 18 + adds r3, r2 + lsrs r3, 24 + str r3, [sp] + adds r1, r2 + lsrs r1, 24 + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + adds r2, r4, 0 + adds r3, r5, 0 + bl FillBgTilemapBufferRect + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81980A8 + + thumb_func_start sub_81980F0 +sub_81980F0: @ 81980F0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + ldr r4, [sp, 0x20] + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r5, r3, 24 + lsls r4, 16 + lsrs r4, 16 + mov r0, sp + movs r1, 0 + movs r2, 0x8 + bl memset + cmp r6, 0x3 + bls _08198126 + movs r1, 0 + mov r0, sp + strb r1, [r0] + b _0819812A +_08198126: + mov r0, sp + strb r6, [r0] +_0819812A: + mov r1, sp + mov r0, r8 + strb r0, [r1, 0x2] + movs r0, 0x2 + strb r0, [r1, 0x4] + movs r0, 0x1E + subs r0, r7 + strb r0, [r1, 0x1] + strb r7, [r1, 0x3] + strb r5, [r1, 0x5] + strh r4, [r1, 0x6] + ldr r4, =gUnknown_0203CDA0 + mov r0, sp + bl AddWindow + strb r0, [r4] + cmp r5, 0xF + bls _08198158 + movs r5, 0xF0 + b _0819815C + .pool +_08198158: + lsls r0, r5, 28 + lsrs r5, r0, 24 +_0819815C: + ldr r0, =gUnknown_0860F0B0 + adds r1, r5, 0 + movs r2, 0x20 + bl LoadPalette + ldr r0, =gUnknown_0203CDA0 + ldrb r0, [r0] + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81980F0 + + thumb_func_start sub_8198180 +sub_8198180: @ 8198180 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + adds r6, r0, 0 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + ldr r5, =gUnknown_0203CDA0 + ldrb r0, [r5] + cmp r0, 0xFF + beq _081981EE + bl PutWindowTilemap + ldrb r0, [r5] + movs r1, 0xFF + bl FillWindowPixelBuffer + movs r0, 0 + adds r1, r6, 0 + movs r2, 0 + bl GetStringWidth + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldrb r0, [r5] + movs r1, 0x1 + bl GetWindowAttribute + movs r2, 0xEC + subs r2, r7 + lsls r0, 3 + subs r2, r0 + subs r2, r4 + lsls r2, 24 + lsrs r2, 24 + ldrb r0, [r5] + ldr r1, =gUnknown_0860F0D0 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r6, [sp, 0x8] + movs r3, 0x1 + bl box_print + mov r0, r8 + cmp r0, 0 + beq _081981EE + ldrb r0, [r5] + movs r1, 0x3 + bl CopyWindowToVram +_081981EE: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8198180 + + thumb_func_start sub_8198204 +sub_8198204: @ 8198204 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + mov r10, r0 + adds r6, r1, 0 + ldr r0, [sp, 0x38] + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r4, 0 + ldr r0, =gUnknown_0203CDA0 + ldrb r1, [r0] + adds r7, r0, 0 + cmp r1, 0xFF + beq _081982C8 + cmp r2, 0 + beq _08198244 + add r0, sp, 0x14 + strb r4, [r0] + adds r1, r0, 0 + b _0819824A + .pool +_08198244: + add r1, sp, 0x14 + movs r0, 0xF + strb r0, [r1] +_0819824A: + movs r0, 0x1 + strb r0, [r1, 0x1] + movs r0, 0x2 + strb r0, [r1, 0x2] + adds r5, r7, 0 + ldrb r0, [r5] + bl PutWindowTilemap + ldrb r0, [r5] + movs r1, 0xFF + bl FillWindowPixelBuffer + cmp r6, 0 + beq _0819829E + movs r0, 0 + adds r1, r6, 0 + movs r2, 0 + bl GetStringWidth + lsls r0, 16 + lsrs r4, r0, 16 + ldrb r0, [r5] + movs r1, 0x1 + bl GetWindowAttribute + movs r2, 0xEC + mov r1, r8 + subs r2, r1 + lsls r0, 3 + subs r2, r0 + subs r2, r4 + lsls r2, 24 + lsrs r2, 24 + ldrb r0, [r5] + add r1, sp, 0x14 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r6, [sp, 0x8] + movs r3, 0x1 + bl box_print +_0819829E: + ldrb r0, [r7] + movs r1, 0 + str r1, [sp] + str r1, [sp, 0x4] + add r2, sp, 0x14 + str r2, [sp, 0x8] + str r1, [sp, 0xC] + mov r1, r10 + str r1, [sp, 0x10] + movs r1, 0x1 + movs r2, 0x4 + movs r3, 0x1 + bl AddTextPrinterParametrized2 + mov r2, r9 + cmp r2, 0 + beq _081982C8 + ldrb r0, [r7] + movs r1, 0x3 + bl CopyWindowToVram +_081982C8: + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8198204 + + thumb_func_start sub_81982D8 +sub_81982D8: @ 81982D8 + push {lr} + ldr r1, =gUnknown_0203CDA0 + ldrb r0, [r1] + cmp r0, 0xFF + beq _081982E8 + movs r1, 0x3 + bl CopyWindowToVram +_081982E8: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81982D8 + + thumb_func_start sub_81982F0 +sub_81982F0: @ 81982F0 + push {r4,lr} + ldr r4, =gUnknown_0203CDA0 + ldrb r0, [r4] + cmp r0, 0xFF + beq _08198308 + movs r1, 0xFF + bl FillWindowPixelBuffer + ldrb r0, [r4] + movs r1, 0x3 + bl CopyWindowToVram +_08198308: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81982F0 + + thumb_func_start sub_8198314 +sub_8198314: @ 8198314 + push {r4,lr} + ldr r4, =gUnknown_0203CDA0 + ldrb r0, [r4] + cmp r0, 0xFF + beq _0819833C + movs r1, 0 + bl FillWindowPixelBuffer + ldrb r0, [r4] + bl ClearWindowTilemap + ldrb r0, [r4] + movs r1, 0x3 + bl CopyWindowToVram + ldrb r0, [r4] + bl RemoveWindow + movs r0, 0xFF + strb r0, [r4] +_0819833C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8198314 + + thumb_func_start sub_8198348 +sub_8198348: @ 8198348 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, [sp, 0x18] + mov r8, r4 + ldr r4, [sp, 0x1C] + ldr r5, [sp, 0x20] + ldr r6, [sp, 0x24] + mov r12, r6 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r7, r5, 24 + ldr r5, =gUnknown_0203CD90 + movs r6, 0 + strb r2, [r5] + strb r3, [r5, 0x1] + strb r6, [r5, 0x3] + subs r4, 0x1 + strb r4, [r5, 0x4] + strb r0, [r5, 0x5] + strb r1, [r5, 0x6] + mov r0, r8 + strb r0, [r5, 0x8] + mov r4, r12 + strb r4, [r5, 0xB] + cmp r7, 0 + blt _08198388 + movs r0, 0x4 + ldrsb r0, [r5, r0] + cmp r7, r0 + ble _08198390 +_08198388: + strb r6, [r5, 0x2] + b _08198392 + .pool +_08198390: + strb r7, [r5, 0x2] +_08198392: + movs r0, 0 + bl MoveMenuCursor + ldr r0, =gUnknown_0203CD90 + ldrb r0, [r0, 0x2] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8198348 + + thumb_func_start sub_81983AC +sub_81983AC: @ 81983AC + push {r4-r6,lr} + sub sp, 0x10 + ldr r4, [sp, 0x20] + ldr r5, [sp, 0x24] + ldr r6, [sp, 0x28] + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + str r4, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + movs r4, 0 + str r4, [sp, 0xC] + bl sub_8198348 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x10 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81983AC + + thumb_func_start sub_81983EC +sub_81983EC: @ 81983EC + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x14 + mov r8, r0 + adds r6, r1, 0 + ldr r4, [sp, 0x28] + ldr r5, [sp, 0x2C] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r6, 24 + lsrs r6, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + adds r0, r6, 0 + movs r1, 0x1 + str r2, [sp, 0xC] + str r3, [sp, 0x10] + bl GetMenuCursorDimensionByFont + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + mov r0, r8 + adds r1, r6, 0 + ldr r2, [sp, 0xC] + ldr r3, [sp, 0x10] + bl sub_81983AC + lsls r0, 24 + lsrs r0, 24 + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81983EC + + thumb_func_start RedrawMenuCursor +@ void RedrawMenuCursor(s8 oldPos, s8 newPos) +RedrawMenuCursor: @ 8198448 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0xC + adds r6, r0, 0 + mov r8, r1 + lsls r6, 24 + lsrs r6, 24 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r5, =gUnknown_0203CD90 + ldrb r0, [r5, 0x6] + movs r1, 0 + bl GetMenuCursorDimensionByFont + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r5, 0x6] + movs r1, 0x1 + bl GetMenuCursorDimensionByFont + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r5, 0x5] + mov r9, r1 + ldrb r2, [r5] + ldrb r1, [r5, 0x8] + adds r3, r1, 0 + muls r3, r6 + ldrb r6, [r5, 0x1] + adds r3, r6 + lsls r3, 16 + lsrs r3, 16 + str r4, [sp] + str r0, [sp, 0x4] + mov r0, r9 + movs r1, 0x11 + bl FillWindowPixelRect + ldrb r0, [r5, 0x5] + ldrb r1, [r5, 0x6] + ldr r2, =gUnknown_085EE498 + ldrb r3, [r5] + ldrb r4, [r5, 0x8] + mov r6, r8 + muls r6, r4 + adds r4, r6, 0 + ldrb r5, [r5, 0x1] + adds r4, r5 + lsls r4, 24 + lsrs r4, 24 + str r4, [sp] + movs r4, 0 + str r4, [sp, 0x4] + str r4, [sp, 0x8] + bl PrintTextOnWindow + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end RedrawMenuCursor + + thumb_func_start MoveMenuCursor +@ s8 MoveMenuCursor(s8 cursorDelta) +MoveMenuCursor: @ 81984D8 + push {r4,r5,lr} + ldr r1, =gUnknown_0203CD90 + ldrb r5, [r1, 0x2] + movs r2, 0x2 + ldrsb r2, [r1, r2] + lsls r0, 24 + asrs r3, r0, 24 + adds r2, r3 + movs r0, 0x3 + ldrsb r0, [r1, r0] + adds r4, r1, 0 + cmp r2, r0 + bge _081984FC + ldrb r0, [r4, 0x4] + b _0819850A + .pool +_081984FC: + movs r0, 0x4 + ldrsb r0, [r4, r0] + cmp r2, r0 + ble _08198508 + ldrb r0, [r4, 0x3] + b _0819850A +_08198508: + adds r0, r3, r5 +_0819850A: + strb r0, [r4, 0x2] + ldrb r1, [r4, 0x2] + adds r0, r5, 0 + bl RedrawMenuCursor + ldrb r0, [r4, 0x2] + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end MoveMenuCursor + + thumb_func_start MoveMenuCursorNoWrapAround +@ s8 MoveMenuCursorNoWrapAround(s8 cursorDelta) +MoveMenuCursorNoWrapAround: @ 819851C + push {r4,r5,lr} + ldr r1, =gUnknown_0203CD90 + ldrb r5, [r1, 0x2] + movs r2, 0x2 + ldrsb r2, [r1, r2] + lsls r0, 24 + asrs r3, r0, 24 + adds r2, r3 + movs r0, 0x3 + ldrsb r0, [r1, r0] + adds r4, r1, 0 + cmp r2, r0 + bge _08198540 + ldrb r0, [r4, 0x3] + b _0819854E + .pool +_08198540: + movs r0, 0x4 + ldrsb r0, [r4, r0] + cmp r2, r0 + ble _0819854C + ldrb r0, [r4, 0x4] + b _0819854E +_0819854C: + adds r0, r3, r5 +_0819854E: + strb r0, [r4, 0x2] + ldrb r1, [r4, 0x2] + adds r0, r5, 0 + bl RedrawMenuCursor + ldrb r0, [r4, 0x2] + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end MoveMenuCursorNoWrapAround + + thumb_func_start GetMenuCursorPos +GetMenuCursorPos: @ 8198560 + ldr r0, =gUnknown_0203CD90 + ldrb r0, [r0, 0x2] + bx lr + .pool + thumb_func_end GetMenuCursorPos + + thumb_func_start ProcessMenuInput +ProcessMenuInput: @ 819856C + push {r4,lr} + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08198598 + ldr r4, =gUnknown_0203CD90 + ldrb r0, [r4, 0xB] + cmp r0, 0 + bne _08198588 + movs r0, 0x5 + bl PlaySE +_08198588: + movs r0, 0x2 + ldrsb r0, [r4, r0] + b _081985D2 + .pool +_08198598: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081985A6 + movs r0, 0x1 + negs r0, r0 + b _081985D2 +_081985A6: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081985BA + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + negs r0, r0 + b _081985CA +_081985BA: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081985CE + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 +_081985CA: + bl MoveMenuCursor +_081985CE: + movs r0, 0x2 + negs r0, r0 +_081985D2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end ProcessMenuInput + + thumb_func_start ProcessMenuInputNoWrapAround +@ int ProcessMenuInputNoWrapAround() +ProcessMenuInputNoWrapAround: @ 81985D8 + push {r4-r6,lr} + ldr r4, =gUnknown_0203CD90 + ldrb r5, [r4, 0x2] + adds r6, r5, 0 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08198608 + ldrb r0, [r4, 0xB] + cmp r0, 0 + bne _081985F8 + movs r0, 0x5 + bl PlaySE +_081985F8: + movs r0, 0x2 + ldrsb r0, [r4, r0] + b _08198650 + .pool +_08198608: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08198616 + movs r0, 0x1 + negs r0, r0 + b _08198650 +_08198616: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08198630 + movs r0, 0x1 + negs r0, r0 + bl MoveMenuCursorNoWrapAround + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + beq _0819864C + b _08198646 +_08198630: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0819864C + movs r0, 0x1 + bl MoveMenuCursorNoWrapAround + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + beq _0819864C +_08198646: + movs r0, 0x5 + bl PlaySE +_0819864C: + movs r0, 0x2 + negs r0, r0 +_08198650: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end ProcessMenuInputNoWrapAround + + thumb_func_start ProcessMenuInput_other +ProcessMenuInput_other: @ 8198658 + push {r4,lr} + ldr r2, =gMain + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08198684 + ldr r4, =gUnknown_0203CD90 + ldrb r0, [r4, 0xB] + cmp r0, 0 + bne _08198674 + movs r0, 0x5 + bl PlaySE +_08198674: + movs r0, 0x2 + ldrsb r0, [r4, r0] + b _081986BC + .pool +_08198684: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08198692 + movs r0, 0x1 + negs r0, r0 + b _081986BC +_08198692: + ldrh r0, [r2, 0x30] + movs r1, 0xF0 + ands r1, r0 + cmp r1, 0x40 + bne _081986A8 + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + negs r0, r0 + b _081986B4 +_081986A8: + cmp r1, 0x80 + bne _081986B8 + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 +_081986B4: + bl MoveMenuCursor +_081986B8: + movs r0, 0x2 + negs r0, r0 +_081986BC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end ProcessMenuInput_other + + thumb_func_start ProcessMenuInputNoWrapAround_other +ProcessMenuInputNoWrapAround_other: @ 81986C4 + push {r4-r6,lr} + ldr r4, =gUnknown_0203CD90 + ldrb r5, [r4, 0x2] + adds r6, r5, 0 + ldr r2, =gMain + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081986F4 + ldrb r0, [r4, 0xB] + cmp r0, 0 + bne _081986E4 + movs r0, 0x5 + bl PlaySE +_081986E4: + movs r0, 0x2 + ldrsb r0, [r4, r0] + b _0819873A + .pool +_081986F4: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08198702 + movs r0, 0x1 + negs r0, r0 + b _0819873A +_08198702: + ldrh r0, [r2, 0x30] + movs r1, 0xF0 + ands r1, r0 + cmp r1, 0x40 + bne _0819871E + movs r0, 0x1 + negs r0, r0 + bl MoveMenuCursorNoWrapAround + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + beq _08198736 + b _08198730 +_0819871E: + cmp r1, 0x80 + bne _08198736 + movs r0, 0x1 + bl MoveMenuCursorNoWrapAround + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + beq _08198736 +_08198730: + movs r0, 0x5 + bl PlaySE +_08198736: + movs r0, 0x2 + negs r0, r0 +_0819873A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end ProcessMenuInputNoWrapAround_other + + thumb_func_start PrintTextArray +PrintTextArray: @ 8198740 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + ldr r4, [sp, 0x2C] + ldr r5, [sp, 0x30] + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + lsls r4, 24 + lsrs r7, r4, 24 + lsls r5, 24 + lsrs r5, 24 + movs r4, 0 + cmp r4, r5 + bcs _081987A4 +_08198774: + lsls r0, r4, 3 + ldr r1, [sp, 0x34] + adds r0, r1 + ldr r2, [r0] + adds r0, r7, 0 + muls r0, r4 + add r0, r8 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r6, 0 + mov r1, r10 + mov r3, r9 + bl PrintTextOnWindow + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _08198774 +_081987A4: + adds r0, r6, 0 + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end PrintTextArray + + thumb_func_start sub_81987BC +sub_81987BC: @ 81987BC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + ldr r4, [sp, 0x40] + ldr r5, [sp, 0x44] + ldr r6, [sp, 0x4C] + ldr r7, [sp, 0x50] + mov r8, r7 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x14] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x18] + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x1C] + lsls r4, 24 + lsrs r4, 24 + mov r10, r4 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + mov r9, r6 + mov r0, r8 + lsls r0, 24 + lsrs r6, r0, 24 + movs r4, 0 + cmp r4, r5 + bcs _0819883C +_08198804: + lsls r0, r4, 3 + ldr r1, [sp, 0x48] + adds r0, r1 + ldr r2, [r0] + mov r0, r10 + muls r0, r4 + ldr r1, [sp, 0x1C] + adds r0, r1, r0 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + mov r0, r9 + str r0, [sp, 0xC] + str r6, [sp, 0x10] + adds r0, r7, 0 + ldr r1, [sp, 0x14] + ldr r3, [sp, 0x18] + bl sub_8199F74 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _08198804 +_0819883C: + adds r0, r7, 0 + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81987BC + + thumb_func_start sub_8198854 +sub_8198854: @ 8198854 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + mov r8, r0 + adds r6, r1, 0 + adds r4, r2, 0 + adds r5, r3, 0 + ldr r7, [sp, 0x24] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r6, 24 + lsrs r6, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + adds r0, r6, 0 + movs r1, 0 + bl GetFontAttribute + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + str r4, [sp] + str r5, [sp, 0x4] + str r7, [sp, 0x8] + mov r0, r8 + adds r1, r6, 0 + movs r3, 0x1 + bl PrintTextArray + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8198854 + + thumb_func_start AddItemMenuActionTextPrinters +AddItemMenuActionTextPrinters: @ 81988A4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + adds r6, r1, 0 + mov r8, r2 + ldr r1, [sp, 0x38] + mov r9, r1 + ldr r1, [sp, 0x3C] + ldr r2, [sp, 0x40] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x10] + lsls r6, 24 + lsrs r6, 24 + mov r4, r8 + lsls r4, 24 + lsrs r4, 24 + mov r8, r4 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x14] + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + lsrs r7, r2, 24 + mov r0, sp + ldrb r1, [r0, 0x10] + strb r1, [r0, 0x4] + strb r6, [r0, 0x5] + adds r0, r6, 0 + movs r1, 0x5 + bl GetFontAttribute + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xC] + movs r5, 0xF + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xC] + adds r0, r6, 0 + movs r1, 0x6 + bl GetFontAttribute + mov r3, sp + adds r1, r5, 0 + ands r1, r0 + ldrb r2, [r3, 0xD] + movs r4, 0x10 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0xD] + adds r0, r6, 0 + movs r1, 0x7 + bl GetFontAttribute + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xD] + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xD] + adds r0, r6, 0 + movs r1, 0x4 + bl GetFontAttribute + mov r1, sp + ands r5, r0 + ldrb r0, [r1, 0xC] + ands r4, r0 + orrs r4, r5 + strb r4, [r1, 0xC] + mov r0, sp + mov r2, r9 + strb r2, [r0, 0xA] + adds r0, r6, 0 + movs r1, 0x3 + bl GetFontAttribute + mov r1, sp + strb r0, [r1, 0xB] + mov r0, sp + mov r4, r8 + strb r4, [r0, 0x6] + strb r4, [r0, 0x8] + movs r4, 0 + cmp r4, r7 + bcs _0819899E + mov r5, sp +_0819896E: + ldr r1, [sp, 0x48] + adds r0, r1, r4 + ldrb r0, [r0] + lsls r0, 3 + ldr r2, [sp, 0x44] + adds r0, r2 + ldr r0, [r0] + str r0, [sp] + mov r0, r10 + muls r0, r4 + ldr r1, [sp, 0x14] + adds r0, r1, r0 + strb r0, [r5, 0x7] + strb r0, [r5, 0x9] + mov r0, sp + movs r1, 0xFF + movs r2, 0 + bl AddTextPrinter + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r7 + bcc _0819896E +_0819899E: + ldr r0, [sp, 0x10] + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end AddItemMenuActionTextPrinters + + thumb_func_start sub_81989B8 +sub_81989B8: @ 81989B8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + mov r9, r0 + adds r4, r1, 0 + adds r6, r2, 0 + mov r8, r3 + ldr r7, [sp, 0x30] + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r4, 24 + lsrs r4, 24 + lsls r6, 24 + lsrs r6, 24 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + adds r0, r4, 0 + movs r1, 0 + bl GetFontAttribute + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r4, 0 + movs r1, 0x2 + bl GetFontAttribute + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + str r6, [sp, 0x4] + mov r0, r8 + str r0, [sp, 0x8] + str r7, [sp, 0xC] + ldr r0, [sp, 0x34] + str r0, [sp, 0x10] + mov r0, r9 + adds r1, r4, 0 + adds r2, r5, 0 + movs r3, 0x1 + bl AddItemMenuActionTextPrinters + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81989B8 + + thumb_func_start SetWindowTemplateFields +@ void SetWindowTemplateFields(WindowTemplate *template, char bg_id, char x, char y, char w, char h, char a7, s16 a8) +SetWindowTemplateFields: @ 8198A24 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, [sp, 0x18] + ldr r5, [sp, 0x1C] + ldr r6, [sp, 0x20] + ldr r7, [sp, 0x24] + mov r8, r7 + strb r1, [r0] + strb r2, [r0, 0x1] + strb r3, [r0, 0x2] + strb r4, [r0, 0x3] + strb r5, [r0, 0x4] + strb r6, [r0, 0x5] + mov r1, r8 + strh r1, [r0, 0x6] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end SetWindowTemplateFields + + thumb_func_start sub_8198A50 +sub_8198A50: @ 8198A50 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x18 + mov r8, r0 + ldr r0, [sp, 0x2C] + ldr r4, [sp, 0x30] + ldr r5, [sp, 0x34] + ldr r6, [sp, 0x38] + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 16 + lsrs r6, 16 + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + str r6, [sp, 0xC] + add r0, sp, 0x10 + bl SetWindowTemplateFields + ldr r0, [sp, 0x10] + ldr r1, [sp, 0x14] + mov r2, r8 + str r0, [r2] + str r1, [r2, 0x4] + mov r0, r8 + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r2} + bx r2 + thumb_func_end sub_8198A50 + + thumb_func_start sub_8198AA4 +sub_8198AA4: @ 8198AA4 + push {r4-r6,lr} + sub sp, 0x18 + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + ldr r0, [sp, 0x28] + ldr r1, [sp, 0x2C] + ldr r2, [sp, 0x30] + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 16 + lsrs r2, 16 + str r3, [sp] + str r0, [sp, 0x4] + str r1, [sp, 0x8] + str r2, [sp, 0xC] + add r0, sp, 0x10 + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl SetWindowTemplateFields + add r0, sp, 0x10 + bl AddWindow + lsls r0, 16 + lsrs r0, 16 + add sp, 0x18 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8198AA4 + + thumb_func_start sub_8198AF8 +sub_8198AF8: @ 8198AF8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + adds r6, r1, 0 + mov r8, r2 + mov r9, r3 + ldr r4, [sp, 0x3C] + ldr r5, [sp, 0x40] + ldr r1, [sp, 0x44] + mov r10, r1 + lsls r6, 24 + lsrs r6, 24 + mov r1, r8 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + mov r1, r9 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + mov r1, r10 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + ldr r7, =gUnknown_0203CD9F + bl AddWindow + strb r0, [r7] + ldrb r0, [r7] + movs r1, 0x1 + adds r2, r4, 0 + adds r3, r5, 0 + bl SetWindowBorderStyle + ldr r0, =gUnknown_085EE491 + str r0, [sp, 0xC] + add r1, sp, 0xC + ldrb r0, [r7] + strb r0, [r1, 0x4] + adds r0, r1, 0 + strb r6, [r0, 0x5] + adds r0, r6, 0 + movs r1, 0 + bl GetFontAttribute + add r1, sp, 0xC + add r0, r8 + strb r0, [r1, 0x6] + adds r0, r1, 0 + mov r1, r9 + strb r1, [r0, 0x7] + adds r1, r0, 0 + ldrb r0, [r0, 0x6] + strb r0, [r1, 0x8] + adds r0, r1, 0 + ldrb r0, [r0, 0x7] + strb r0, [r1, 0x9] + adds r0, r6, 0 + movs r1, 0x5 + bl GetFontAttribute + add r3, sp, 0xC + lsls r0, 4 + ldrb r2, [r3, 0xC] + movs r5, 0xF + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xC] + adds r0, r6, 0 + movs r1, 0x6 + bl GetFontAttribute + add r3, sp, 0xC + adds r1, r5, 0 + ands r1, r0 + ldrb r2, [r3, 0xD] + movs r4, 0x10 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0xD] + adds r0, r6, 0 + movs r1, 0x7 + bl GetFontAttribute + add r3, sp, 0xC + lsls r0, 4 + ldrb r2, [r3, 0xD] + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xD] + adds r0, r6, 0 + movs r1, 0x4 + bl GetFontAttribute + add r1, sp, 0xC + ands r5, r0 + ldrb r0, [r1, 0xC] + ands r4, r0 + orrs r4, r5 + strb r4, [r1, 0xC] + adds r0, r6, 0 + movs r1, 0x2 + bl GetFontAttribute + add r1, sp, 0xC + strb r0, [r1, 0xA] + adds r0, r6, 0 + movs r1, 0x3 + bl GetFontAttribute + add r1, sp, 0xC + strb r0, [r1, 0xB] + adds r0, r1, 0 + movs r1, 0xFF + movs r2, 0 + bl AddTextPrinter + adds r0, r6, 0 + movs r1, 0x1 + bl GetFontAttribute + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r7] + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + mov r0, r10 + str r0, [sp, 0x8] + adds r0, r1, 0 + adds r1, r6, 0 + mov r2, r8 + mov r3, r9 + bl sub_81983AC + 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_8198AF8 + + thumb_func_start sub_8198C34 +sub_8198C34: @ 8198C34 + push {lr} + sub sp, 0xC + lsls r1, 24 + lsrs r1, 24 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 24 + lsrs r3, 24 + str r2, [sp] + str r3, [sp, 0x4] + movs r2, 0 + str r2, [sp, 0x8] + movs r3, 0x1 + bl sub_8198AF8 + add sp, 0xC + pop {r0} + bx r0 + thumb_func_end sub_8198C34 + + thumb_func_start sub_8198C58 +sub_8198C58: @ 8198C58 + push {r4,lr} + bl ProcessMenuInputNoWrapAround + lsls r0, 24 + asrs r4, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _08198C6E + bl sub_8198C78 +_08198C6E: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8198C58 + + thumb_func_start sub_8198C78 +sub_8198C78: @ 8198C78 + push {r4,lr} + ldr r4, =gUnknown_0203CD9F + ldrb r0, [r4] + movs r1, 0x1 + bl sub_8198070 + ldrb r0, [r4] + bl RemoveWindow + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8198C78 + + thumb_func_start sub_8198C94 +sub_8198C94: @ 8198C94 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + ldr r4, [sp, 0x40] + ldr r5, [sp, 0x44] + ldr r6, [sp, 0x48] + ldr r7, [sp, 0x4C] + mov r8, r7 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0xC] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x10] + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x14] + lsls r4, 24 + lsrs r4, 24 + str r4, [sp, 0x18] + lsls r5, 24 + lsrs r5, 24 + str r5, [sp, 0x1C] + lsls r6, 24 + lsrs r6, 24 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r5, 0 + cmp r5, r9 + bcs _08198D3A +_08198CE0: + movs r4, 0 + adds r1, r5, 0x1 + mov r8, r1 + cmp r4, r6 + bcs _08198D30 + ldr r7, [sp, 0x1C] + adds r0, r7, 0 + muls r0, r5 + ldr r1, [sp, 0x14] + adds r0, r1, r0 + lsls r0, 24 + lsrs r7, r0, 24 +_08198CF8: + adds r0, r5, 0 + muls r0, r6 + adds r0, r4 + lsls r0, 3 + ldr r1, [sp, 0x50] + adds r0, r1 + ldr r2, [r0] + ldr r0, [sp, 0x18] + adds r3, r0, 0 + muls r3, r4 + ldr r1, [sp, 0x10] + adds r3, r1, r3 + lsls r3, 24 + lsrs r3, 24 + str r7, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + mov r0, r10 + ldr r1, [sp, 0xC] + bl PrintTextOnWindow + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r6 + bcc _08198CF8 +_08198D30: + mov r7, r8 + lsls r0, r7, 24 + lsrs r5, r0, 24 + cmp r5, r9 + bcc _08198CE0 +_08198D3A: + mov r0, r10 + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8198C94 + + thumb_func_start sub_8198D54 +sub_8198D54: @ 8198D54 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x18 + mov r9, r0 + mov r8, r1 + adds r4, r2, 0 + adds r5, r3, 0 + ldr r6, [sp, 0x34] + ldr r3, [sp, 0x38] + ldr r7, [sp, 0x3C] + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + mov r0, r8 + 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 + lsls r3, 24 + lsrs r3, 24 + movs r1, 0 + str r3, [sp, 0x14] + bl GetFontAttribute + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + str r4, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + ldr r3, [sp, 0x14] + str r3, [sp, 0xC] + str r7, [sp, 0x10] + mov r0, r9 + mov r1, r8 + movs r3, 0 + bl sub_8198C94 + add sp, 0x18 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8198D54 + + thumb_func_start sub_8198DBC +sub_8198DBC: @ 8198DBC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + ldr r4, [sp, 0x40] + ldr r5, [sp, 0x44] + ldr r6, [sp, 0x48] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x10] + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x14] + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x18] + lsls r4, 24 + lsrs r4, 24 + str r4, [sp, 0x1C] + lsls r5, 24 + lsrs r5, 24 + mov r8, r5 + lsls r6, 24 + lsrs r6, 24 + mov r10, r6 + mov r0, sp + ldrb r1, [r0, 0x10] + strb r1, [r0, 0x4] + strb r7, [r0, 0x5] + adds r0, r7, 0 + movs r1, 0x5 + bl GetFontAttribute + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xC] + movs r5, 0xF + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xC] + adds r0, r7, 0 + movs r1, 0x6 + bl GetFontAttribute + mov r3, sp + adds r1, r5, 0 + ands r1, r0 + ldrb r2, [r3, 0xD] + movs r4, 0x10 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0xD] + adds r0, r7, 0 + movs r1, 0x7 + bl GetFontAttribute + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xD] + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xD] + adds r0, r7, 0 + movs r1, 0x4 + bl GetFontAttribute + mov r1, sp + ands r5, r0 + ldrb r0, [r1, 0xC] + ands r4, r0 + orrs r4, r5 + strb r4, [r1, 0xC] + adds r0, r7, 0 + movs r1, 0x2 + bl GetFontAttribute + mov r1, sp + strb r0, [r1, 0xA] + adds r0, r7, 0 + movs r1, 0x3 + bl GetFontAttribute + mov r1, sp + strb r0, [r1, 0xB] + movs r6, 0 + cmp r6, r10 + bcs _08198EDE +_08198E7A: + movs r5, 0 + adds r2, r6, 0x1 + mov r9, r2 + cmp r5, r8 + bcs _08198ED4 + mov r4, sp +_08198E86: + mov r0, r8 + muls r0, r6 + adds r0, r5 + ldr r1, [sp, 0x50] + adds r0, r1, r0 + ldrb r0, [r0] + lsls r0, 3 + ldr r2, [sp, 0x4C] + adds r0, r2 + ldr r0, [r0] + str r0, [sp] + ldr r1, [sp, 0x1C] + adds r0, r1, 0 + muls r0, r5 + ldr r2, [sp, 0x14] + adds r0, r2, r0 + strb r0, [r4, 0x6] + adds r0, r7, 0 + movs r1, 0x1 + bl GetFontAttribute + adds r1, r6, 0 + muls r1, r0 + ldr r0, [sp, 0x18] + adds r1, r0, r1 + strb r1, [r4, 0x7] + ldrb r0, [r4, 0x6] + strb r0, [r4, 0x8] + strb r1, [r4, 0x9] + mov r0, sp + movs r1, 0xFF + movs r2, 0 + bl AddTextPrinter + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r8 + bcc _08198E86 +_08198ED4: + mov r1, r9 + lsls r0, r1, 24 + lsrs r6, r0, 24 + cmp r6, r10 + bcc _08198E7A +_08198EDE: + ldr r0, [sp, 0x10] + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8198DBC + + thumb_func_start sub_8198EF8 +sub_8198EF8: @ 8198EF8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x18 + mov r8, r0 + adds r3, r1, 0 + adds r4, r2, 0 + ldr r5, [sp, 0x30] + ldr r6, [sp, 0x34] + ldr r7, [sp, 0x38] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + adds r0, r3, 0 + movs r1, 0 + str r3, [sp, 0x14] + bl GetFontAttribute + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + str r4, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + str r7, [sp, 0xC] + ldr r0, [sp, 0x3C] + str r0, [sp, 0x10] + mov r0, r8 + ldr r3, [sp, 0x14] + adds r1, r3, 0 + movs r3, 0 + bl sub_8198DBC + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8198EF8 + + thumb_func_start sub_8198F58 +sub_8198F58: @ 8198F58 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, [sp, 0x20] + mov r12, r4 + ldr r4, [sp, 0x24] + mov r8, r4 + ldr r4, [sp, 0x28] + mov r9, r4 + ldr r4, [sp, 0x2C] + mov r10, r4 + ldr r4, [sp, 0x30] + ldr r5, [sp, 0x34] + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r7, r5, 24 + ldr r5, =gUnknown_0203CD90 + movs r6, 0 + strb r2, [r5] + strb r3, [r5, 0x1] + strb r6, [r5, 0x3] + subs r4, 0x1 + strb r4, [r5, 0x4] + strb r0, [r5, 0x5] + strb r1, [r5, 0x6] + mov r0, r12 + strb r0, [r5, 0x7] + mov r4, r8 + strb r4, [r5, 0x8] + mov r0, r9 + strb r0, [r5, 0x9] + mov r4, r10 + strb r4, [r5, 0xA] + cmp r7, 0 + blt _08198FAC + movs r0, 0x4 + ldrsb r0, [r5, r0] + cmp r7, r0 + ble _08198FB4 +_08198FAC: + strb r6, [r5, 0x2] + b _08198FB6 + .pool +_08198FB4: + strb r7, [r5, 0x2] +_08198FB6: + movs r0, 0 + movs r1, 0 + bl sub_8199134 + ldr r0, =gUnknown_0203CD90 + ldrb r0, [r0, 0x2] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8198F58 + + thumb_func_start sub_8198FD4 +sub_8198FD4: @ 8198FD4 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0x20 + mov r9, r0 + mov r8, r1 + mov r10, r2 + ldr r6, [sp, 0x3C] + ldr r4, [sp, 0x40] + ldr r5, [sp, 0x44] + ldr r2, [sp, 0x48] + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + mov r0, r10 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + lsls r3, 24 + lsrs r3, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r2, 24 + lsrs r2, 24 + mov r0, r8 + movs r1, 0x1 + str r2, [sp, 0x18] + str r3, [sp, 0x1C] + bl GetMenuCursorDimensionByFont + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + muls r1, r5 + lsls r1, 24 + lsrs r1, 24 + str r6, [sp] + str r0, [sp, 0x4] + str r4, [sp, 0x8] + str r5, [sp, 0xC] + str r1, [sp, 0x10] + ldr r2, [sp, 0x18] + str r2, [sp, 0x14] + mov r0, r9 + mov r1, r8 + mov r2, r10 + ldr r3, [sp, 0x1C] + bl sub_8198F58 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8198FD4 + + thumb_func_start sub_8199060 +sub_8199060: @ 8199060 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + mov r8, r0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r0, r1, 24 + lsrs r7, r0, 24 + ldr r5, =gUnknown_0203CD90 + ldrb r0, [r5, 0x6] + movs r1, 0 + bl GetMenuCursorDimensionByFont + mov r9, r0 + mov r1, r9 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + ldrb r0, [r5, 0x6] + movs r1, 0x1 + bl GetMenuCursorDimensionByFont + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + ldrb r0, [r5, 0x9] + mov r10, r0 + mov r0, r8 + mov r1, r10 + bl __umodsi3 + ldrb r1, [r5, 0x7] + adds r4, r1, 0 + muls r4, r0 + ldrb r1, [r5] + adds r4, r1 + lsls r4, 24 + lsrs r4, 24 + mov r0, r8 + mov r1, r10 + bl __udivsi3 + ldrb r1, [r5, 0x8] + adds r3, r1, 0 + muls r3, r0 + ldrb r0, [r5, 0x1] + adds r3, r0 + lsls r3, 24 + lsrs r3, 24 + ldrb r0, [r5, 0x5] + mov r1, r9 + str r1, [sp] + str r6, [sp, 0x4] + movs r1, 0x11 + adds r2, r4, 0 + bl FillWindowPixelRect + ldrb r6, [r5, 0x9] + adds r0, r7, 0 + adds r1, r6, 0 + bl __umodsi3 + ldrb r1, [r5, 0x7] + adds r4, r1, 0 + muls r4, r0 + ldrb r0, [r5] + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r7, 0 + adds r1, r6, 0 + bl __udivsi3 + ldrb r1, [r5, 0x8] + adds r3, r1, 0 + muls r3, r0 + ldrb r1, [r5, 0x1] + adds r3, r1 + lsls r3, 24 + lsrs r3, 24 + ldrb r0, [r5, 0x5] + ldrb r1, [r5, 0x6] + ldr r2, =gUnknown_085EE498 + str r3, [sp] + movs r3, 0 + str r3, [sp, 0x4] + str r3, [sp, 0x8] + adds r3, r4, 0 + bl PrintTextOnWindow + 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_8199060 + + thumb_func_start sub_8199134 +sub_8199134: @ 8199134 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + ldr r1, =gUnknown_0203CD90 + ldrb r2, [r1, 0x2] + mov r8, r2 + lsls r0, 24 + asrs r6, r0, 24 + adds r5, r1, 0 + cmp r6, 0 + beq _0819918A + movs r7, 0x2 + ldrsb r7, [r5, r7] + ldrb r4, [r5, 0x9] + adds r0, r7, 0 + adds r1, r4, 0 + bl __modsi3 + adds r0, r6 + cmp r0, 0 + bge _08199174 + adds r0, r4, 0 + adds r0, 0xFF + add r0, r8 + b _08199188 + .pool +_08199174: + cmp r0, r4 + blt _08199184 + adds r0, r7, 0 + adds r1, r4, 0 + bl __divsi3 + muls r0, r4 + b _08199188 +_08199184: + mov r1, r8 + adds r0, r6, r1 +_08199188: + strb r0, [r5, 0x2] +_0819918A: + mov r2, r9 + lsls r0, r2, 24 + asrs r6, r0, 24 + cmp r6, 0 + beq _081991CE + movs r0, 0x2 + ldrsb r0, [r5, r0] + ldrb r4, [r5, 0x9] + adds r1, r4, 0 + bl __divsi3 + adds r1, r0, r6 + cmp r1, 0 + bge _081991B2 + ldrb r0, [r5, 0xA] + subs r0, 0x1 + muls r0, r4 + ldrb r1, [r5, 0x2] + adds r0, r1 + b _081991CC +_081991B2: + ldrb r0, [r5, 0xA] + cmp r1, r0 + blt _081991C4 + subs r0, 0x1 + adds r1, r4, 0 + muls r1, r0 + ldrb r0, [r5, 0x2] + subs r0, r1 + b _081991CC +_081991C4: + adds r0, r4, 0 + muls r0, r6 + ldrb r2, [r5, 0x2] + adds r0, r2 +_081991CC: + strb r0, [r5, 0x2] +_081991CE: + movs r1, 0x2 + ldrsb r1, [r5, r1] + movs r0, 0x4 + ldrsb r0, [r5, r0] + cmp r1, r0 + bgt _081991E4 + ldrb r1, [r5, 0x2] + mov r0, r8 + bl sub_8199060 + b _081991E8 +_081991E4: + mov r0, r8 + strb r0, [r5, 0x2] +_081991E8: + ldrb r0, [r5, 0x2] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8199134 + + thumb_func_start sub_81991F8 +sub_81991F8: @ 81991F8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + ldr r1, =gUnknown_0203CD90 + ldrb r7, [r1, 0x2] + lsls r0, 24 + asrs r4, r0, 24 + adds r5, r1, 0 + cmp r4, 0 + beq _0819922C + movs r0, 0x2 + ldrsb r0, [r5, r0] + ldrb r6, [r5, 0x9] + adds r1, r6, 0 + bl __modsi3 + adds r0, r4 + cmp r0, 0 + blt _0819922C + cmp r0, r6 + bge _0819922C + adds r0, r4, r7 + strb r0, [r5, 0x2] +_0819922C: + mov r1, r8 + lsls r0, r1, 24 + asrs r4, r0, 24 + cmp r4, 0 + beq _08199258 + movs r0, 0x2 + ldrsb r0, [r5, r0] + ldrb r6, [r5, 0x9] + adds r1, r6, 0 + bl __divsi3 + adds r0, r4 + cmp r0, 0 + blt _08199258 + ldrb r1, [r5, 0xA] + cmp r0, r1 + bge _08199258 + adds r0, r6, 0 + muls r0, r4 + ldrb r1, [r5, 0x2] + adds r0, r1 + strb r0, [r5, 0x2] +_08199258: + movs r1, 0x2 + ldrsb r1, [r5, r1] + movs r0, 0x4 + ldrsb r0, [r5, r0] + cmp r1, r0 + bgt _08199274 + ldrb r1, [r5, 0x2] + adds r0, r7, 0 + bl sub_8199060 + b _08199276 + .pool +_08199274: + strb r7, [r5, 0x2] +_08199276: + ldrb r0, [r5, 0x2] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81991F8 + + thumb_func_start sub_8199284 +sub_8199284: @ 8199284 + push {r4,lr} + ldr r4, =gMain + ldrh r1, [r4, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081992AC + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_0203CD90 + ldrb r0, [r0, 0x2] + lsls r0, 24 + asrs r0, 24 + b _0819932C + .pool +_081992AC: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081992BA + movs r0, 0x1 + negs r0, r0 + b _0819932C +_081992BA: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081992D0 + movs r0, 0x5 + bl PlaySE + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + b _08199324 +_081992D0: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081992E4 + movs r0, 0x5 + bl PlaySE + movs r0, 0 + movs r1, 0x1 + b _08199324 +_081992E4: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _081992F8 + bl GetLRKeysState + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08199304 +_081992F8: + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + negs r0, r0 + b _08199322 +_08199304: + ldrh r1, [r4, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _0819931A + bl GetLRKeysState + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08199328 +_0819931A: + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 +_08199322: + movs r1, 0 +_08199324: + bl sub_8199134 +_08199328: + movs r0, 0x2 + negs r0, r0 +_0819932C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8199284 + + thumb_func_start sub_8199334 +sub_8199334: @ 8199334 + push {r4-r6,lr} + ldr r5, =gUnknown_0203CD90 + ldrb r4, [r5, 0x2] + ldr r6, =gMain + ldrh r1, [r6, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0819935C + movs r0, 0x5 + bl PlaySE + movs r0, 0x2 + ldrsb r0, [r5, r0] + b _081993D2 + .pool +_0819935C: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0819936A + movs r0, 0x1 + negs r0, r0 + b _081993D2 +_0819936A: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0819937A + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + b _081993BC +_0819937A: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08199388 + movs r0, 0 + movs r1, 0x1 + b _081993BC +_08199388: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _0819939C + bl GetLRKeysState + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081993A2 +_0819939C: + movs r0, 0x1 + negs r0, r0 + b _081993BA +_081993A2: + ldrh r1, [r6, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _081993B8 + bl GetLRKeysState + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _081993CE +_081993B8: + movs r0, 0x1 +_081993BA: + movs r1, 0 +_081993BC: + bl sub_81991F8 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + beq _081993CE + movs r0, 0x5 + bl PlaySE +_081993CE: + movs r0, 0x2 + negs r0, r0 +_081993D2: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8199334 + + thumb_func_start sub_81993D8 +sub_81993D8: @ 81993D8 + push {r4,r5,lr} + ldr r4, =gMain + ldrh r1, [r4, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08199400 + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_0203CD90 + ldrb r0, [r0, 0x2] + lsls r0, 24 + asrs r0, 24 + b _0819947C + .pool +_08199400: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0819940E + movs r0, 0x1 + negs r0, r0 + b _0819947C +_0819940E: + ldrh r0, [r4, 0x30] + movs r5, 0xF0 + adds r1, r5, 0 + ands r1, r0 + cmp r1, 0x40 + bne _08199428 + movs r0, 0x5 + bl PlaySE + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + b _08199474 +_08199428: + cmp r1, 0x80 + bne _08199438 + movs r0, 0x5 + bl PlaySE + movs r0, 0 + movs r1, 0x1 + b _08199474 +_08199438: + cmp r1, 0x20 + beq _08199448 + bl sub_812210C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08199454 +_08199448: + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + negs r0, r0 + b _08199472 +_08199454: + ldrh r1, [r4, 0x30] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0x10 + beq _0819946A + bl sub_812210C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08199478 +_0819946A: + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 +_08199472: + movs r1, 0 +_08199474: + bl sub_8199134 +_08199478: + movs r0, 0x2 + negs r0, r0 +_0819947C: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81993D8 + + thumb_func_start sub_8199484 +sub_8199484: @ 8199484 + push {r4-r6,lr} + ldr r6, =gUnknown_0203CD90 + ldrb r4, [r6, 0x2] + ldr r5, =gMain + ldrh r1, [r5, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081994AC + movs r0, 0x5 + bl PlaySE + movs r0, 0x2 + ldrsb r0, [r6, r0] + b _0819951E + .pool +_081994AC: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081994BA + movs r0, 0x1 + negs r0, r0 + b _0819951E +_081994BA: + ldrh r0, [r5, 0x30] + movs r6, 0xF0 + adds r1, r6, 0 + ands r1, r0 + cmp r1, 0x40 + bne _081994CE + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + b _08199508 +_081994CE: + cmp r1, 0x80 + bne _081994D8 + movs r0, 0 + movs r1, 0x1 + b _08199508 +_081994D8: + cmp r1, 0x20 + beq _081994E8 + bl sub_812210C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081994EE +_081994E8: + movs r0, 0x1 + negs r0, r0 + b _08199506 +_081994EE: + ldrh r1, [r5, 0x30] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0x10 + beq _08199504 + bl sub_812210C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _0819951A +_08199504: + movs r0, 0x1 +_08199506: + movs r1, 0 +_08199508: + bl sub_81991F8 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + beq _0819951A + movs r0, 0x5 + bl PlaySE +_0819951A: + movs r0, 0x2 + negs r0, r0 +_0819951E: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8199484 + + thumb_func_start InitMenuInUpperLeftCorner +@ int InitMenuInUpperLeftCorner(s8 windowId, s8 numItems, u8 initialCursorPos, bool doNotPlaySoundWhenAPressed) +InitMenuInUpperLeftCorner: @ 8199524 + push {r4-r6,lr} + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r5, r2, 24 + ldr r4, =gUnknown_0203CD90 + movs r6, 0 + strb r6, [r4] + movs r2, 0x1 + strb r2, [r4, 0x1] + strb r6, [r4, 0x3] + subs r1, 0x1 + strb r1, [r4, 0x4] + strb r0, [r4, 0x5] + strb r2, [r4, 0x6] + movs r0, 0x10 + strb r0, [r4, 0x8] + strb r3, [r4, 0xB] + cmp r5, 0 + blt _08199554 + movs r0, 0x4 + ldrsb r0, [r4, r0] + cmp r5, r0 + ble _0819955C +_08199554: + strb r6, [r4, 0x2] + b _0819955E + .pool +_0819955C: + strb r5, [r4, 0x2] +_0819955E: + movs r0, 0 + bl MoveMenuCursor + lsls r0, 24 + lsrs r0, 24 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end InitMenuInUpperLeftCorner + + thumb_func_start InitMenuInUpperLeftCornerPlaySoundWhenAPressed +InitMenuInUpperLeftCornerPlaySoundWhenAPressed: @ 8199570 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + movs r3, 0 + bl InitMenuInUpperLeftCorner + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end InitMenuInUpperLeftCornerPlaySoundWhenAPressed + + thumb_func_start PrintMenuTable +PrintMenuTable: @ 819958C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 24 + lsrs r7, r1, 24 + movs r5, 0 + cmp r5, r7 + bcs _081995D0 + movs r6, 0x80 + lsls r6, 17 + adds r4, r2, 0 +_081995AA: + ldr r2, [r4] + lsrs r0, r6, 24 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + mov r0, r8 + movs r1, 0x1 + movs r3, 0x8 + bl PrintTextOnWindow + movs r0, 0x80 + lsls r0, 21 + adds r6, r0 + adds r4, 0x8 + adds r5, 0x1 + cmp r5, r7 + bcc _081995AA +_081995D0: + mov r0, r8 + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end PrintMenuTable + + thumb_func_start sub_81995E4 +sub_81995E4: @ 81995E4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + mov r9, r2 + mov r8, r3 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + mov r0, sp + movs r1, 0 + mov r10, r1 + strb r6, [r0, 0x4] + mov r1, sp + movs r0, 0x1 + strb r0, [r1, 0x5] + movs r1, 0x5 + bl GetFontAttribute + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xC] + movs r5, 0xF + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xC] + movs r0, 0x1 + movs r1, 0x6 + bl GetFontAttribute + mov r3, sp + adds r1, r5, 0 + ands r1, r0 + ldrb r2, [r3, 0xD] + movs r4, 0x10 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0xD] + movs r0, 0x1 + movs r1, 0x7 + bl GetFontAttribute + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xD] + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xD] + movs r0, 0x1 + movs r1, 0x4 + bl GetFontAttribute + mov r1, sp + ands r5, r0 + ldrb r0, [r1, 0xC] + ands r4, r0 + orrs r4, r5 + strb r4, [r1, 0xC] + mov r0, sp + mov r1, r10 + strb r1, [r0, 0xA] + strb r1, [r0, 0xB] + movs r1, 0x8 + strb r1, [r0, 0x6] + strb r1, [r0, 0x8] + movs r4, 0 + cmp r4, r7 + bcs _081996A6 + mov r5, sp +_0819967C: + mov r1, r8 + adds r0, r1, r4 + ldrb r0, [r0] + lsls r0, 3 + add r0, r9 + ldr r0, [r0] + str r0, [sp] + lsls r0, r4, 4 + adds r0, 0x1 + strb r0, [r5, 0x7] + strb r0, [r5, 0x9] + mov r0, sp + movs r1, 0xFF + movs r2, 0 + bl AddTextPrinter + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r7 + bcc _0819967C +_081996A6: + adds r0, r6, 0 + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81995E4 + + thumb_func_start CreateYesNoMenu +@ void CreateYesNoMenu(struct WindowTemplate *windowTemplate, u16 borderFirstTileNum, u8 borderPalette, u8 initialCursorPos) +CreateYesNoMenu: @ 81996C0 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x10 + adds r4, r1, 0 + adds r5, r2, 0 + adds r6, r3, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + ldr r1, =gUnknown_0203CD9F + mov r8, r1 + bl AddWindow + mov r2, r8 + strb r0, [r2] + ldrb r0, [r2] + movs r1, 0x1 + adds r2, r4, 0 + adds r3, r5, 0 + bl SetWindowBorderStyle + ldr r0, =gUnknown_085EE491 + str r0, [sp] + mov r1, sp + mov r2, r8 + ldrb r0, [r2] + movs r2, 0 + mov r9, r2 + strb r0, [r1, 0x4] + mov r0, sp + movs r2, 0x1 + strb r2, [r0, 0x5] + movs r0, 0x8 + strb r0, [r1, 0x6] + mov r0, sp + strb r2, [r0, 0x7] + ldrb r0, [r0, 0x6] + strb r0, [r1, 0x8] + mov r0, sp + ldrb r0, [r0, 0x7] + strb r0, [r1, 0x9] + movs r0, 0x1 + movs r1, 0x5 + bl GetFontAttribute + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xC] + movs r5, 0xF + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xC] + movs r0, 0x1 + movs r1, 0x6 + bl GetFontAttribute + mov r3, sp + adds r1, r5, 0 + ands r1, r0 + ldrb r2, [r3, 0xD] + movs r4, 0x10 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0xD] + movs r0, 0x1 + movs r1, 0x7 + bl GetFontAttribute + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xD] + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xD] + movs r0, 0x1 + movs r1, 0x4 + bl GetFontAttribute + mov r1, sp + ands r5, r0 + ldrb r0, [r1, 0xC] + ands r4, r0 + orrs r4, r5 + strb r4, [r1, 0xC] + mov r0, sp + mov r1, r9 + strb r1, [r0, 0xA] + strb r1, [r0, 0xB] + movs r1, 0xFF + movs r2, 0 + bl AddTextPrinter + mov r2, r8 + ldrb r0, [r2] + movs r1, 0x2 + adds r2, r6, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end CreateYesNoMenu + + thumb_func_start sub_81997AC +sub_81997AC: @ 81997AC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0xC] + lsls r2, 24 + lsrs r6, r2, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x10] + movs r7, 0 + cmp r7, r3 + bcs _08199824 +_081997D4: + movs r4, 0 + adds r0, r7, 0x1 + mov r9, r0 + cmp r4, r6 + bcs _0819981C + lsls r0, r7, 4 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r5, 0x80 + lsls r5, 20 +_081997EC: + adds r0, r7, 0 + muls r0, r6 + adds r0, r4 + lsls r0, 3 + ldr r1, [sp, 0x34] + adds r0, r1 + ldr r2, [r0] + lsrs r3, r5, 24 + mov r0, r8 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + mov r0, r10 + movs r1, 0x1 + bl PrintTextOnWindow + ldr r1, [sp, 0xC] + lsls r0, r1, 24 + adds r5, r0 + adds r4, 0x1 + cmp r4, r6 + bcc _081997EC +_0819981C: + mov r7, r9 + ldr r4, [sp, 0x10] + cmp r7, r4 + bcc _081997D4 +_08199824: + mov r0, r10 + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81997AC + + thumb_func_start sub_819983C +sub_819983C: @ 819983C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x10] + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x14] + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r3, 24 + mov r10, r3 + mov r0, sp + movs r6, 0 + ldrb r1, [r0, 0x10] + strb r1, [r0, 0x4] + mov r1, sp + movs r0, 0x1 + strb r0, [r1, 0x5] + movs r1, 0x5 + bl GetFontAttribute + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xC] + movs r5, 0xF + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xC] + movs r0, 0x1 + movs r1, 0x6 + bl GetFontAttribute + mov r3, sp + adds r1, r5, 0 + ands r1, r0 + ldrb r2, [r3, 0xD] + movs r4, 0x10 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0xD] + movs r0, 0x1 + movs r1, 0x7 + bl GetFontAttribute + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xD] + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xD] + movs r0, 0x1 + movs r1, 0x4 + bl GetFontAttribute + mov r1, sp + ands r5, r0 + ldrb r0, [r1, 0xC] + ands r4, r0 + orrs r4, r5 + strb r4, [r1, 0xC] + mov r0, sp + strb r6, [r0, 0xA] + strb r6, [r0, 0xB] + movs r7, 0 + cmp r7, r10 + bcs _0819992A +_081998D6: + movs r5, 0 + adds r2, r7, 0x1 + mov r9, r2 + cmp r5, r8 + bcs _08199920 + mov r4, sp + lsls r0, r7, 4 + adds r6, r0, 0x1 +_081998E6: + mov r0, r8 + muls r0, r7 + adds r0, r5 + ldr r1, [sp, 0x3C] + adds r0, r1, r0 + ldrb r0, [r0] + lsls r0, 3 + ldr r2, [sp, 0x38] + adds r0, r2 + ldr r0, [r0] + str r0, [sp] + ldr r1, [sp, 0x14] + adds r0, r1, 0 + muls r0, r5 + adds r0, 0x8 + strb r0, [r4, 0x6] + strb r6, [r4, 0x7] + strb r0, [r4, 0x8] + strb r6, [r4, 0x9] + mov r0, sp + movs r1, 0xFF + movs r2, 0 + bl AddTextPrinter + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r8 + bcc _081998E6 +_08199920: + mov r2, r9 + lsls r0, r2, 24 + lsrs r7, r0, 24 + cmp r7, r10 + bcc _081998D6 +_0819992A: + ldr r0, [sp, 0x10] + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819983C + + thumb_func_start sub_8199944 +sub_8199944: @ 8199944 + push {r4-r7,lr} + ldr r4, [sp, 0x14] + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r7, r4, 24 + ldr r6, =gUnknown_0203CD90 + movs r4, 0 + mov r12, r4 + mov r4, r12 + strb r4, [r6] + movs r5, 0x1 + strb r5, [r6, 0x1] + strb r4, [r6, 0x3] + adds r4, r2, 0 + muls r4, r3 + subs r4, 0x1 + strb r4, [r6, 0x4] + strb r0, [r6, 0x5] + strb r5, [r6, 0x6] + strb r1, [r6, 0x7] + movs r0, 0x10 + strb r0, [r6, 0x8] + strb r2, [r6, 0x9] + strb r3, [r6, 0xA] + cmp r7, 0 + blt _08199986 + movs r0, 0x4 + ldrsb r0, [r6, r0] + cmp r7, r0 + ble _08199990 +_08199986: + mov r0, r12 + strb r0, [r6, 0x2] + b _08199992 + .pool +_08199990: + strb r7, [r6, 0x2] +_08199992: + movs r0, 0 + movs r1, 0 + bl sub_8199134 + ldr r0, =gUnknown_0203CD90 + ldrb r0, [r0, 0x2] + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8199944 + + thumb_func_start clear_scheduled_bg_copies_to_vram +@ void clear_scheduled_bg_copies_to_vram() +clear_scheduled_bg_copies_to_vram: @ 81999A8 + push {lr} + ldr r0, =gUnknown_0203CDA4 + movs r1, 0 + movs r2, 0x4 + bl memset + pop {r0} + bx r0 + .pool + thumb_func_end clear_scheduled_bg_copies_to_vram + + thumb_func_start schedule_bg_copy_tilemap_to_vram +@ void schedule_bg_copy_tilemap_to_vram(u8 bg_id) +schedule_bg_copy_tilemap_to_vram: @ 81999BC + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0203CDA4 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + bx lr + .pool + thumb_func_end schedule_bg_copy_tilemap_to_vram + + thumb_func_start do_scheduled_bg_tilemap_copies_to_vram +@ void do_scheduled_bg_tilemap_copies_to_vram() +do_scheduled_bg_tilemap_copies_to_vram: @ 81999D0 + push {r4,lr} + ldr r4, =gUnknown_0203CDA4 + ldrb r0, [r4] + cmp r0, 0x1 + bne _081999E4 + movs r0, 0 + bl CopyBgTilemapBufferToVram + movs r0, 0 + strb r0, [r4] +_081999E4: + ldrb r0, [r4, 0x1] + cmp r0, 0x1 + bne _081999F4 + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + movs r0, 0 + strb r0, [r4, 0x1] +_081999F4: + ldrb r0, [r4, 0x2] + cmp r0, 0x1 + bne _08199A04 + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + movs r0, 0 + strb r0, [r4, 0x2] +_08199A04: + ldrb r0, [r4, 0x3] + cmp r0, 0x1 + bne _08199A14 + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + movs r0, 0 + strb r0, [r4, 0x3] +_08199A14: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end do_scheduled_bg_tilemap_copies_to_vram + + thumb_func_start reset_temp_tile_data_buffers +@ void reset_temp_tile_data_buffers() +reset_temp_tile_data_buffers: @ 8199A20 + push {lr} + ldr r3, =gUnknown_0203CDA8 + ldr r1, =gUnknown_0203CDAC + movs r2, 0 + adds r0, r1, 0 + adds r0, 0x7C +_08199A2C: + str r2, [r0] + subs r0, 0x4 + cmp r0, r1 + bge _08199A2C + movs r0, 0 + strh r0, [r3] + pop {r0} + bx r0 + .pool + thumb_func_end reset_temp_tile_data_buffers + + thumb_func_start free_temp_tile_data_buffers_if_possible +free_temp_tile_data_buffers_if_possible: @ 8199A44 + push {r4-r6,lr} + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _08199A88 + ldr r1, =gUnknown_0203CDA8 + ldrh r0, [r1] + cmp r0, 0 + beq _08199A7C + movs r4, 0 + ldrh r1, [r1] + cmp r4, r1 + bge _08199A76 + ldr r5, =gUnknown_0203CDAC + movs r6, 0 +_08199A64: + ldr r0, [r5] + bl Free + stm r5!, {r6} + adds r4, 0x1 + ldr r0, =gUnknown_0203CDA8 + ldrh r0, [r0] + cmp r4, r0 + blt _08199A64 +_08199A76: + ldr r1, =gUnknown_0203CDA8 + movs r0, 0 + strh r0, [r1] +_08199A7C: + movs r0, 0 + b _08199A8A + .pool +_08199A88: + movs r0, 0x1 +_08199A8A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end free_temp_tile_data_buffers_if_possible + + thumb_func_start decompress_and_copy_tile_data_to_vram +@ int decompress_and_copy_tile_data_to_vram(u8 bg_id, int src, int size, u16 offset, u8 mode) +decompress_and_copy_tile_data_to_vram: @ 8199A90 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + adds r4, r1, 0 + adds r5, r2, 0 + ldr r1, [sp, 0x24] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r3, 16 + lsrs r3, 16 + mov r9, r3 + lsls r1, 24 + lsrs r7, r1, 24 + ldr r6, =gUnknown_0203CDA8 + ldrh r0, [r6] + cmp r0, 0x1F + bhi _08199AF8 + adds r0, r4, 0 + add r1, sp, 0x4 + bl malloc_and_decompress + adds r4, r0, 0 + cmp r5, 0 + bne _08199AC8 + ldr r5, [sp, 0x4] +_08199AC8: + cmp r4, 0 + beq _08199AEC + lsls r2, r5, 16 + lsrs r2, 16 + str r7, [sp] + mov r0, r8 + adds r1, r4, 0 + mov r3, r9 + bl copy_decompressed_tile_data_to_vram + ldr r2, =gUnknown_0203CDAC + ldrh r0, [r6] + adds r1, r0, 0x1 + strh r1, [r6] + lsls r0, 16 + lsrs r0, 14 + adds r0, r2 + str r4, [r0] +_08199AEC: + adds r0, r4, 0 + b _08199AFA + .pool +_08199AF8: + movs r0, 0 +_08199AFA: + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end decompress_and_copy_tile_data_to_vram + + thumb_func_start copy_decompressed_tile_data_to_vram_autofree +@ void copy_decompressed_tile_data_to_vram_autofree(u8 bg_id, int src, u16 size, u16 offset, u8 mode) +copy_decompressed_tile_data_to_vram_autofree: @ 8199B08 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + adds r5, r2, 0 + ldr r2, [sp, 0x24] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r3, 16 + lsrs r3, 16 + mov r9, r3 + lsls r2, 24 + lsrs r7, r2, 24 + adds r0, r1, 0 + add r1, sp, 0x4 + bl malloc_and_decompress + adds r6, r0, 0 + cmp r5, 0 + bne _08199B36 + ldr r5, [sp, 0x4] +_08199B36: + cmp r6, 0 + beq _08199B6E + ldr r0, =task_free_buf_after_copying_tile_data_to_vram + movs r1, 0 + bl CreateTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r2, r5, 16 + lsrs r2, 16 + str r7, [sp] + mov r0, r8 + adds r1, r6, 0 + mov r3, r9 + bl copy_decompressed_tile_data_to_vram + ldr r2, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r2 + strh r0, [r1, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + adds r2, r6, 0 + bl SetWordTaskArg +_08199B6E: + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end copy_decompressed_tile_data_to_vram_autofree + + thumb_func_start task_free_buf_after_copying_tile_data_to_vram +@ void task_free_buf_after_copying_tile_data_to_vram(int task_id) +task_free_buf_after_copying_tile_data_to_vram: @ 8199B84 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0x8 + ldrsh r0, [r0, r1] + bl CheckForSpaceForDma3Request + lsls r0, 16 + cmp r0, 0 + bne _08199BB4 + adds r0, r4, 0 + movs r1, 0x1 + bl GetWordTaskArg + bl Free + adds r0, r4, 0 + bl DestroyTask +_08199BB4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end task_free_buf_after_copying_tile_data_to_vram + + thumb_func_start malloc_and_decompress +@ void *malloc_and_decompress(void *src, int *size) +malloc_and_decompress: @ 8199BC0 + push {r4,r5,lr} + adds r5, r0, 0 + ldrb r0, [r5, 0x1] + strb r0, [r1] + ldrb r0, [r5, 0x2] + strb r0, [r1, 0x1] + ldrb r0, [r5, 0x3] + strb r0, [r1, 0x2] + movs r0, 0 + strb r0, [r1, 0x3] + ldr r0, [r1] + bl Alloc + adds r4, r0, 0 + cmp r4, 0 + beq _08199BE8 + adds r0, r5, 0 + adds r1, r4, 0 + bl LZ77UnCompWram +_08199BE8: + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end malloc_and_decompress + + thumb_func_start copy_decompressed_tile_data_to_vram +@ s16 copy_decompressed_tile_data_to_vram(u8 bg_id, int src, u16 size, u16 offset, u8 mode) +copy_decompressed_tile_data_to_vram: @ 8199BF0 + push {r4,lr} + adds r4, r1, 0 + ldr r1, [sp, 0x8] + lsls r0, 24 + lsrs r0, 24 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 16 + lsrs r3, 16 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0 + beq _08199C18 + cmp r1, 0x1 + beq _08199C20 + ldr r0, =0x0000ffff + b _08199C2A + .pool +_08199C18: + adds r1, r4, 0 + bl LoadBgTiles + b _08199C26 +_08199C20: + adds r1, r4, 0 + bl LoadBgTilemap +_08199C26: + lsls r0, 16 + lsrs r0, 16 +_08199C2A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end copy_decompressed_tile_data_to_vram + + thumb_func_start sub_8199C30 +sub_8199C30: @ 8199C30 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r5, r2, 0 + ldr r4, [sp, 0x28] + ldr r2, [sp, 0x2C] + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + lsls r5, 24 + lsrs r5, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x4] + lsls r4, 24 + lsrs r4, 24 + lsls r2, 24 + lsrs r2, 24 + mov r10, r2 + bl GetBgTilemapBuffer + mov r8, r0 + adds r0, r5, r4 + cmp r5, r0 + bge _08199CA8 + mov r9, r0 +_08199C6E: + ldr r3, [sp] + ldr r1, [sp, 0x4] + adds r0, r3, r1 + adds r7, r5, 0x1 + cmp r3, r0 + bge _08199CA0 + lsls r6, r5, 5 + ldr r1, =0x00000fff + mov r12, r1 + mov r1, r10 + lsls r5, r1, 12 + adds r4, r0, 0 +_08199C86: + adds r1, r6, r3 + lsls r1, 1 + add r1, r8 + ldrh r2, [r1] + mov r0, r12 + ands r0, r2 + orrs r0, r5 + strh r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r4 + blt _08199C86 +_08199CA0: + lsls r0, r7, 24 + lsrs r5, r0, 24 + cmp r5, r9 + blt _08199C6E +_08199CA8: + 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_8199C30 + + thumb_func_start sub_8199CBC +sub_8199CBC: @ 8199CBC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r10, r1 + ldr r1, [sp, 0x24] + ldr r4, [sp, 0x28] + lsls r0, 24 + lsrs r0, 24 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp] + lsls r1, 24 + lsrs r5, r1, 24 + lsls r4, 24 + lsrs r4, 24 + mov r8, r4 + bl GetBgTilemapBuffer + adds r7, r0, 0 + movs r0, 0 + cmp r0, r8 + bcs _08199D2A +_08199CF4: + movs r2, 0 + adds r6, r0, 0x1 + cmp r2, r5 + bcs _08199D22 + adds r4, r0, 0 + muls r4, r5 + ldr r1, [sp] + adds r0, r1 + lsls r3, r0, 5 +_08199D06: + adds r1, r4, r2 + lsls r1, 1 + add r1, r10 + adds r0, r3, r2 + add r0, r9 + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r5 + bcc _08199D06 +_08199D22: + lsls r0, r6, 24 + lsrs r0, 24 + cmp r0, r8 + bcc _08199CF4 +_08199D2A: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8199CBC + + thumb_func_start sub_8199D3C +sub_8199D3C: @ 8199D3C + push {r4-r7,lr} + adds r6, r0, 0 + adds r5, r1, 0 + ldr r0, [sp, 0x14] + adds r4, r2, 0 + muls r4, r3 + cmp r0, 0x1 + bne _08199D64 + adds r3, r6, 0 + movs r2, 0 + cmp r2, r4 + bge _08199D8C +_08199D54: + adds r1, r3, r2 + ldrb r0, [r1] + adds r0, r5 + strb r0, [r1] + adds r2, 0x1 + cmp r2, r4 + blt _08199D54 + b _08199D8C +_08199D64: + cmp r4, 0 + ble _08199D8C + movs r0, 0xFC + lsls r0, 8 + mov r12, r0 + ldr r0, =0x000003ff + adds r7, r0, 0 + adds r3, r6, 0 + adds r2, r4, 0 +_08199D76: + ldrh r0, [r3] + mov r1, r12 + ands r1, r0 + adds r0, r5 + ands r0, r7 + orrs r1, r0 + strh r1, [r3] + adds r3, 0x2 + subs r2, 0x1 + cmp r2, 0 + bne _08199D76 +_08199D8C: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8199D3C + + thumb_func_start sub_8199D98 +sub_8199D98: @ 8199D98 + push {lr} + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x3 + 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 ChangeBgY + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + pop {r0} + bx r0 + thumb_func_end sub_8199D98 + + thumb_func_start sub_8199DF0 +sub_8199DF0: @ 8199DF0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r8, r2 + mov r9, r3 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + movs r1, 0x4 + bl GetBgAttribute + lsls r0, 16 + movs r7, 0x40 + cmp r0, 0 + bne _08199E16 + movs r7, 0x20 +_08199E16: + adds r0, r5, 0 + movs r1, 0x1 + bl GetBgAttribute + adds r4, r0, 0 + adds r0, r5, 0 + movs r1, 0xA + bl GetBgAttribute + lsls r4, 16 + lsrs r4, 2 + lsls r0, 16 + lsrs r0, 16 + add r0, r8 + muls r0, r7 + adds r4, r0 + lsls r0, r6, 24 + lsls r1, r6, 16 + orrs r0, r1 + lsls r1, r6, 8 + orrs r0, r1 + orrs r0, r6 + movs r1, 0xC0 + lsls r1, 19 + adds r4, r1 + mov r2, r9 + muls r2, r7 + lsls r2, 16 + lsrs r2, 16 + adds r1, r4, 0 + movs r3, 0x1 + bl RequestDma3Fill + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8199DF0 + + thumb_func_start box_print +box_print: @ 8199E64 + push {r4-r6,lr} + sub sp, 0x10 + adds r4, r1, 0 + ldr r6, [sp, 0x20] + ldr r5, [sp, 0x24] + ldr r1, [sp, 0x28] + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + str r1, [sp] + mov r1, sp + strb r0, [r1, 0x4] + mov r0, sp + strb r4, [r0, 0x5] + strb r2, [r0, 0x6] + strb r3, [r0, 0x7] + ldrb r0, [r0, 0x6] + strb r0, [r1, 0x8] + mov r0, sp + ldrb r0, [r0, 0x7] + strb r0, [r1, 0x9] + adds r0, r4, 0 + movs r1, 0x2 + bl GetFontAttribute + mov r1, sp + strb r0, [r1, 0xA] + adds r0, r4, 0 + movs r1, 0x3 + bl GetFontAttribute + mov r1, sp + strb r0, [r1, 0xB] + mov r3, sp + ldrb r2, [r3, 0xC] + movs r1, 0x10 + negs r1, r1 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3, 0xC] + mov r2, sp + ldrb r0, [r6, 0x1] + lsls r0, 4 + movs r4, 0xF + strb r0, [r2, 0xC] + ldrb r2, [r6] + adds r0, r4, 0 + ands r0, r2 + ldrb r2, [r3, 0xD] + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xD] + mov r2, sp + ldrb r0, [r6, 0x2] + lsls r0, 4 + ands r1, r4 + orrs r1, r0 + strb r1, [r2, 0xD] + mov r0, sp + adds r1, r5, 0 + movs r2, 0 + bl AddTextPrinter + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end box_print + + thumb_func_start AddTextPrinterParametrized2 +@ void AddTextPrinterParametrized2(u8 windowId, u8 fontId, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, struct TextColor *color, u8 speed, u8 *str) +AddTextPrinterParametrized2: @ 8199EEC + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x10 + adds r5, r1, 0 + ldr r1, [sp, 0x28] + mov r8, r1 + ldr r1, [sp, 0x2C] + mov r9, r1 + ldr r6, [sp, 0x30] + ldr r1, [sp, 0x34] + ldr r4, [sp, 0x38] + str r4, [sp] + mov r4, sp + strb r0, [r4, 0x4] + mov r0, sp + strb r5, [r0, 0x5] + strb r2, [r0, 0x6] + strb r3, [r0, 0x7] + mov r2, sp + ldrb r0, [r0, 0x6] + strb r0, [r2, 0x8] + mov r0, sp + ldrb r0, [r0, 0x7] + strb r0, [r2, 0x9] + mov r0, sp + mov r2, r8 + strb r2, [r0, 0xA] + mov r2, r9 + strb r2, [r0, 0xB] + ldrb r3, [r4, 0xC] + movs r2, 0x10 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r4, 0xC] + mov r3, sp + ldrb r0, [r6, 0x1] + lsls r0, 4 + movs r5, 0xF + strb r0, [r3, 0xC] + ldrb r3, [r6] + adds r0, r5, 0 + ands r0, r3 + ldrb r3, [r4, 0xD] + ands r2, r3 + orrs r2, r0 + strb r2, [r4, 0xD] + mov r3, sp + ldrb r0, [r6, 0x2] + lsls r0, 4 + ands r2, r5 + orrs r2, r0 + strb r2, [r3, 0xD] + lsls r1, 24 + lsrs r1, 24 + mov r0, sp + movs r2, 0 + bl AddTextPrinter + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end AddTextPrinterParametrized2 + + thumb_func_start sub_8199F74 +sub_8199F74: @ 8199F74 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + adds r6, r1, 0 + ldr r4, [sp, 0x2C] + ldr r1, [sp, 0x30] + mov r8, r1 + ldr r7, [sp, 0x34] + ldr r5, [sp, 0x38] + ldr r1, [sp, 0x3C] + mov r9, r1 + lsls r6, 24 + lsrs r6, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + mov r1, r8 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + str r2, [sp] + mov r1, sp + strb r0, [r1, 0x4] + mov r0, sp + strb r6, [r0, 0x5] + strb r3, [r0, 0x6] + strb r4, [r0, 0x7] + strb r3, [r0, 0x8] + strb r4, [r0, 0x9] + strb r5, [r0, 0xA] + mov r1, r9 + strb r1, [r0, 0xB] + mov r2, sp + ldrb r1, [r2, 0xC] + movs r5, 0x10 + negs r5, r5 + adds r0, r5, 0 + ands r0, r1 + strb r0, [r2, 0xC] + adds r0, r6, 0 + movs r1, 0x5 + bl GetFontAttribute + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xC] + movs r4, 0xF + adds r1, r4, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xC] + adds r0, r6, 0 + movs r1, 0x6 + bl GetFontAttribute + mov r2, sp + adds r1, r4, 0 + ands r1, r0 + ldrb r0, [r2, 0xD] + ands r5, r0 + orrs r5, r1 + strb r5, [r2, 0xD] + adds r0, r6, 0 + movs r1, 0x7 + bl GetFontAttribute + mov r2, sp + lsls r0, 4 + ldrb r1, [r2, 0xD] + ands r4, r1 + orrs r4, r0 + strb r4, [r2, 0xD] + mov r0, sp + mov r1, r8 + adds r2, r7, 0 + bl AddTextPrinter + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8199F74 + + thumb_func_start sub_819A024 +sub_819A024: @ 819A024 + push {r4-r7,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r7, r0, 24 + lsls r2, 16 + lsrs r4, r2, 16 + lsls r3, 16 + lsrs r5, r3, 16 + movs r2, 0 + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldrb r0, [r3] + ldr r6, =gStringVar4 + cmp r0, 0xFF + beq _0819A04C +_0819A042: + adds r2, 0x1 + adds r0, r3, r2 + ldrb r0, [r0] + cmp r0, 0xFF + bne _0819A042 +_0819A04C: + adds r0, r6, 0 + bl StringExpandPlaceholders + lsls r3, r4, 24 + lsrs r3, 24 + lsls r0, r5, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r7, 0 + movs r1, 0x1 + adds r2, r6, 0 + bl PrintTextOnWindow + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819A024 + + thumb_func_start sub_819A080 +sub_819A080: @ 819A080 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + str r0, [sp] + str r1, [sp, 0x4] + ldr r0, [sp, 0x48] + ldr r4, [sp, 0x4C] + ldr r1, [sp, 0x50] + ldr r5, [sp, 0x54] + lsls r2, 16 + lsrs r2, 16 + str r2, [sp, 0x8] + lsls r3, 16 + lsrs r3, 16 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0xC] + lsls r4, 16 + lsrs r4, 16 + lsls r1, 16 + lsrs r1, 16 + lsls r5, 16 + lsrs r5, 16 + ldr r2, [sp, 0x4] + ldrh r0, [r2, 0x4] + ldr r2, [sp, 0xC] + subs r0, r2 + ldr r2, [sp, 0x8] + adds r2, r1, r2 + str r2, [sp, 0x10] + cmp r0, r1 + bge _0819A0CC + ldr r1, [sp, 0x8] + adds r0, r1 + str r0, [sp, 0x10] +_0819A0CC: + ldr r2, [sp, 0x4] + ldrh r1, [r2, 0x6] + subs r0, r1, r4 + cmp r0, r5 + bge _0819A0DE + adds r0, r3, r1 + subs r0, r4 + str r0, [sp, 0x14] + b _0819A0E2 +_0819A0DE: + adds r5, r3, r5 + str r5, [sp, 0x14] +_0819A0E2: + ldr r0, [sp] + ldrh r1, [r0, 0x4] + movs r2, 0x7 + adds r0, r1, 0 + ands r0, r2 + adds r1, r0 + asrs r1, 3 + str r1, [sp, 0x18] + ldr r0, [sp, 0x4] + ldrh r1, [r0, 0x4] + adds r0, r1, 0 + ands r0, r2 + adds r1, r0 + asrs r1, 3 + str r1, [sp, 0x1C] + mov r12, r3 + mov r8, r4 + ldr r1, [sp, 0x14] + cmp r12, r1 + blt _0819A10C + b _0819A24A +_0819A10C: + ldr r5, [sp, 0x8] + ldr r6, [sp, 0xC] + mov r2, r12 + adds r2, 0x1 + str r2, [sp, 0x20] + mov r0, r8 + adds r0, 0x1 + str r0, [sp, 0x24] + ldr r1, [sp, 0x10] + cmp r5, r1 + blt _0819A124 + b _0819A23A +_0819A124: + movs r7, 0x1 + movs r2, 0xF0 + mov r10, r2 + movs r0, 0xF + mov r9, r0 +_0819A12E: + asrs r0, r5, 1 + movs r1, 0x3 + ands r0, r1 + ldr r2, [sp] + ldr r1, [r2] + adds r1, r0 + asrs r0, r5, 3 + lsls r0, 5 + adds r1, r0 + mov r2, r12 + asrs r0, r2, 3 + ldr r2, [sp, 0x18] + muls r0, r2 + lsls r0, 5 + adds r1, r0 + mov r2, r12 + lsls r0, r2, 29 + lsrs r0, 27 + adds r3, r1, r0 + asrs r0, r6, 1 + movs r1, 0x3 + ands r0, r1 + ldr r2, [sp, 0x4] + ldr r1, [r2] + adds r1, r0 + asrs r0, r6, 3 + lsls r0, 5 + adds r1, r0 + mov r2, r8 + asrs r0, r2, 3 + ldr r2, [sp, 0x1C] + muls r0, r2 + lsls r0, 5 + adds r1, r0 + mov r2, r8 + lsls r0, r2, 29 + lsrs r0, 27 + adds r4, r1, r0 + adds r0, r4, 0 + ands r0, r7 + cmp r0, 0 + beq _0819A1DA + subs r4, 0x1 + adds r0, r6, 0 + ands r0, r7 + cmp r0, 0 + beq _0819A1B2 + ldrh r0, [r4] + ldr r2, =0x00000fff + ands r2, r0 + adds r0, r5, 0 + ands r0, r7 + cmp r0, 0 + beq _0819A1A8 + ldrb r1, [r3] + mov r0, r10 + ands r0, r1 + lsls r0, 8 + b _0819A22A + .pool +_0819A1A8: + ldrb r1, [r3] + mov r0, r9 + ands r0, r1 + lsls r0, 12 + b _0819A22A +_0819A1B2: + ldrh r0, [r4] + ldr r2, =0x0000f0ff + ands r2, r0 + adds r0, r5, 0 + ands r0, r7 + cmp r0, 0 + beq _0819A1D0 + ldrb r1, [r3] + mov r0, r10 + ands r0, r1 + lsls r0, 4 + b _0819A22A + .pool +_0819A1D0: + ldrb r1, [r3] + mov r0, r9 + ands r0, r1 + lsls r0, 8 + b _0819A22A +_0819A1DA: + adds r0, r6, 0 + ands r0, r7 + cmp r0, 0 + beq _0819A206 + ldrh r0, [r4] + ldr r2, =0x0000ff0f + ands r2, r0 + adds r0, r5, 0 + ands r0, r7 + cmp r0, 0 + beq _0819A1FC + ldrb r1, [r3] + mov r0, r10 + b _0819A228 + .pool +_0819A1FC: + ldrb r1, [r3] + mov r0, r9 + ands r0, r1 + lsls r0, 4 + b _0819A22A +_0819A206: + ldrh r0, [r4] + ldr r2, =0x0000fff0 + ands r2, r0 + adds r0, r5, 0 + ands r0, r7 + cmp r0, 0 + beq _0819A224 + ldrb r1, [r3] + mov r0, r10 + ands r0, r1 + lsrs r0, 4 + b _0819A22A + .pool +_0819A224: + ldrb r1, [r3] + mov r0, r9 +_0819A228: + ands r0, r1 +_0819A22A: + orrs r2, r0 + strh r2, [r4] + adds r5, 0x1 + adds r6, 0x1 + ldr r0, [sp, 0x10] + cmp r5, r0 + bge _0819A23A + b _0819A12E +_0819A23A: + ldr r1, [sp, 0x20] + mov r12, r1 + ldr r2, [sp, 0x24] + mov r8, r2 + ldr r0, [sp, 0x14] + cmp r12, r0 + bge _0819A24A + b _0819A10C +_0819A24A: + 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_819A080 + + thumb_func_start sub_819A25C +sub_819A25C: @ 819A25C + push {r4,lr} + adds r4, r0, 0 + adds r0, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, 16 + lsrs r0, 16 + bl sub_80D30B0 + adds r1, r4, 0 + movs r2, 0x20 + bl LoadPalette + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_819A25C + + thumb_func_start sub_819A27C +sub_819A27C: @ 819A27C + push {r4-r6,lr} + sub sp, 0x8 + adds r6, r0, 0 + adds r0, r1, 0 + adds r1, r2, 0 + adds r4, r3, 0 + ldr r5, [sp, 0x18] + lsls r6, 24 + lsrs r6, 24 + lsls r0, 16 + lsrs r0, 16 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + movs r2, 0x1 + bl sub_80D2EDC + adds r1, r0, 0 + movs r0, 0x20 + str r0, [sp] + str r0, [sp, 0x4] + adds r0, r6, 0 + adds r2, r4, 0 + adds r3, r5, 0 + bl BlitBitmapToWindow + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_819A27C + + thumb_func_start sub_819A2BC +sub_819A2BC: @ 819A2BC + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x1 + beq _0819A2DC + cmp r1, 0x1 + ble _0819A2D2 + cmp r1, 0x2 + beq _0819A2E4 +_0819A2D2: + ldr r0, =gUnknown_08DC4318 + b _0819A2E6 + .pool +_0819A2DC: + ldr r0, =gUnknown_08DC4338 + b _0819A2E6 + .pool +_0819A2E4: + ldr r0, =gUnknown_08DC4358 +_0819A2E6: + adds r1, r2, 0 + movs r2, 0x20 + bl LoadPalette + pop {r0} + bx r0 + .pool + thumb_func_end sub_819A2BC + + thumb_func_start blit_move_info_icon +@ void blit_move_info_icon(u8 windowId, u8 a2, u16 x, u16 y) +blit_move_info_icon: @ 819A2F8 + push {r4,r5,lr} + sub sp, 0x18 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 16 + lsrs r3, 16 + ldr r4, =gUnknown_0860F0D4 + lsrs r1, 22 + adds r1, r4 + ldrh r5, [r1, 0x2] + lsls r5, 5 + ldr r4, =gUnknown_08DC4378 + adds r5, r4 + movs r4, 0x80 + str r4, [sp] + str r4, [sp, 0x4] + str r2, [sp, 0x8] + str r3, [sp, 0xC] + ldrb r2, [r1] + str r2, [sp, 0x10] + ldrb r1, [r1, 0x1] + str r1, [sp, 0x14] + adds r1, r5, 0 + movs r2, 0 + movs r3, 0 + bl BlitBitmapRectToWindow + add sp, 0x18 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end blit_move_info_icon + + thumb_func_start sub_819A344 +sub_819A344: @ 819A344 + push {r4-r7,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r2, 24 + lsrs r2, 24 + adds r5, r1, 0 + movs r1, 0xFC + strb r1, [r5] + adds r5, 0x1 + movs r0, 0x1 + strb r0, [r5] + adds r5, 0x1 + strb r2, [r5] + adds r5, 0x1 + strb r1, [r5] + adds r5, 0x1 + movs r0, 0x3 + strb r0, [r5] + adds r5, 0x1 + adds r2, 0x1 + strb r2, [r5] + adds r5, 0x1 + cmp r3, 0x4 + bhi _0819A43C + lsls r0, r3, 2 + ldr r1, =_0819A384 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0819A384: + .4byte _0819A398 + .4byte _0819A3A8 + .4byte _0819A3D6 + .4byte _0819A404 + .4byte _0819A414 +_0819A398: + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + adds r0, r5, 0 + bl StringCopy + b _0819A43C + .pool +_0819A3A8: + bl IsNationalPokedexEnabled + cmp r0, 0 + beq _0819A3B8 + movs r0, 0x1 + bl pokedex_count + b _0819A3BE +_0819A3B8: + movs r0, 0x1 + bl sub_80C0844 +_0819A3BE: + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r5, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + adds r5, r0, 0 + movs r0, 0xFF + strb r0, [r5] + b _0819A43C +_0819A3D6: + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldrh r1, [r0, 0xE] + adds r0, r5, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + adds r5, r0, 0 + movs r0, 0xF0 + strb r0, [r5] + adds r5, 0x1 + ldr r0, [r4] + ldrb r1, [r0, 0x10] + adds r0, r5, 0 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalStringN + b _0819A43C + .pool +_0819A404: + ldr r0, =gMapHeader + ldrb r1, [r0, 0x14] + adds r0, r5, 0 + bl sub_81245DC + b _0819A43C + .pool +_0819A414: + ldr r4, =0x00000867 + movs r6, 0 + adds r7, r5, 0x1 +_0819A41A: + lsls r0, r4, 16 + lsrs r0, 16 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0819A42A + adds r6, 0x1 +_0819A42A: + adds r4, 0x1 + ldr r0, =0x0000086e + cmp r4, r0 + ble _0819A41A + adds r0, r6, 0 + subs r0, 0x5F + strb r0, [r5] + movs r0, 0xFF + strb r0, [r7] +_0819A43C: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819A344 + + thumb_func_start sub_819A44C +sub_819A44C: @ 819A44C + push {r4,r5,lr} + adds r5, r0, 0 + ldrb r4, [r5, 0x5] + lsrs r4, 4 + movs r0, 0x65 + bl IndexOfSpritePaletteTag + lsls r0, 24 + lsls r4, 16 + lsrs r4, 16 + lsrs r0, 24 + cmp r4, r0 + bne _0819A4BA + adds r0, r5, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0819A4B0 + ldrh r1, [r5, 0x2E] + movs r2, 0x2E + ldrsh r0, [r5, r2] + cmp r0, 0 + beq _0819A484 + subs r0, r1, 0x1 + strh r0, [r5, 0x2E] + b _0819A4C2 +_0819A484: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x5 + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + bne _0819A4A6 + adds r0, r5, 0 + movs r1, 0 + bl StartSpriteAnim + movs r0, 0x20 + strh r0, [r5, 0x2E] + b _0819A4C2 +_0819A4A6: + adds r0, r5, 0 + movs r1, 0x1 + bl StartSpriteAnim + b _0819A4C2 +_0819A4B0: + adds r0, r5, 0 + movs r1, 0x1 + bl StartSpriteAnimIfDifferent + b _0819A4C2 +_0819A4BA: + adds r0, r5, 0 + movs r1, 0 + bl StartSpriteAnimIfDifferent +_0819A4C2: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_819A44C + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/menu_indicators.s b/asm/menu_indicators.s new file mode 100755 index 000000000..b923b53d0 --- /dev/null +++ b/asm/menu_indicators.s @@ -0,0 +1,1442 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_81AF08C +sub_81AF08C: @ 81AF08C + 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 r2, r1, r0 + cmp r3, 0x10 + bhi _081AF154 + lsls r0, r3, 2 + ldr r1, =_081AF0B8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081AF0B8: + .4byte _081AF0FC + .4byte _081AF0FC + .4byte _081AF100 + .4byte _081AF104 + .4byte _081AF108 + .4byte _081AF10C + .4byte _081AF110 + .4byte _081AF114 + .4byte _081AF118 + .4byte _081AF11C + .4byte _081AF122 + .4byte _081AF12A + .4byte _081AF130 + .4byte _081AF138 + .4byte _081AF140 + .4byte _081AF146 + .4byte _081AF14E +_081AF0FC: + ldr r0, [r2, 0x4] + b _081AF158 +_081AF100: + ldrh r0, [r2, 0xC] + b _081AF158 +_081AF104: + ldrh r0, [r2, 0xE] + b _081AF158 +_081AF108: + ldrb r0, [r2, 0x10] + b _081AF158 +_081AF10C: + ldrb r0, [r2, 0x11] + b _081AF158 +_081AF110: + ldrb r0, [r2, 0x12] + b _081AF158 +_081AF114: + ldrb r0, [r2, 0x13] + b _081AF158 +_081AF118: + ldrb r0, [r2, 0x14] + b _081AF124 +_081AF11C: + ldrb r0, [r2, 0x14] + lsrs r0, 4 + b _081AF158 +_081AF122: + ldrb r0, [r2, 0x15] +_081AF124: + lsls r0, 28 + lsrs r0, 28 + b _081AF158 +_081AF12A: + ldrb r0, [r2, 0x15] + lsrs r0, 4 + b _081AF158 +_081AF130: + ldrb r0, [r2, 0x16] + lsls r0, 29 + lsrs r0, 29 + b _081AF158 +_081AF138: + ldrb r0, [r2, 0x16] + lsls r0, 26 + lsrs r0, 29 + b _081AF158 +_081AF140: + ldrb r0, [r2, 0x16] + lsrs r0, 6 + b _081AF158 +_081AF146: + ldrb r0, [r2, 0x17] + lsls r0, 26 + lsrs r0, 26 + b _081AF158 +_081AF14E: + ldrb r0, [r2, 0x17] + lsrs r0, 6 + b _081AF158 +_081AF154: + movs r0, 0x1 + negs r0, r0 +_081AF158: + pop {r1} + bx r1 + thumb_func_end sub_81AF08C + + thumb_func_start sub_81AF15C +sub_81AF15C: @ 81AF15C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r3, r1, r0 + cmp r4, 0x10 + bhi _081AF25C + lsls r0, r4, 2 + ldr r1, =_081AF188 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081AF188: + .4byte _081AF1CC + .4byte _081AF1CC + .4byte _081AF1D0 + .4byte _081AF1D4 + .4byte _081AF1D8 + .4byte _081AF1DC + .4byte _081AF1E0 + .4byte _081AF1E4 + .4byte _081AF1E8 + .4byte _081AF1F4 + .4byte _081AF202 + .4byte _081AF20E + .4byte _081AF21C + .4byte _081AF228 + .4byte _081AF236 + .4byte _081AF244 + .4byte _081AF250 +_081AF1CC: + str r2, [r3, 0x4] + b _081AF25C +_081AF1D0: + strh r2, [r3, 0xC] + b _081AF25C +_081AF1D4: + strh r2, [r3, 0xE] + b _081AF25C +_081AF1D8: + strb r2, [r3, 0x10] + b _081AF25C +_081AF1DC: + strb r2, [r3, 0x11] + b _081AF25C +_081AF1E0: + strb r2, [r3, 0x12] + b _081AF25C +_081AF1E4: + strb r2, [r3, 0x13] + b _081AF25C +_081AF1E8: + movs r0, 0xF + ands r2, r0 + ldrb r1, [r3, 0x14] + movs r0, 0x10 + negs r0, r0 + b _081AF1FA +_081AF1F4: + lsls r2, 4 + ldrb r1, [r3, 0x14] + movs r0, 0xF +_081AF1FA: + ands r0, r1 + orrs r0, r2 + strb r0, [r3, 0x14] + b _081AF25C +_081AF202: + movs r0, 0xF + ands r2, r0 + ldrb r1, [r3, 0x15] + movs r0, 0x10 + negs r0, r0 + b _081AF214 +_081AF20E: + lsls r2, 4 + ldrb r1, [r3, 0x15] + movs r0, 0xF +_081AF214: + ands r0, r1 + orrs r0, r2 + strb r0, [r3, 0x15] + b _081AF25C +_081AF21C: + movs r0, 0x7 + ands r2, r0 + ldrb r1, [r3, 0x16] + movs r0, 0x8 + negs r0, r0 + b _081AF23C +_081AF228: + movs r0, 0x7 + ands r2, r0 + lsls r2, 3 + ldrb r1, [r3, 0x16] + movs r0, 0x39 + negs r0, r0 + b _081AF23C +_081AF236: + lsls r2, 6 + ldrb r1, [r3, 0x16] + movs r0, 0x3F +_081AF23C: + ands r0, r1 + orrs r0, r2 + strb r0, [r3, 0x16] + b _081AF25C +_081AF244: + movs r0, 0x3F + ands r2, r0 + ldrb r1, [r3, 0x17] + movs r0, 0x40 + negs r0, r0 + b _081AF256 +_081AF250: + lsls r2, 6 + ldrb r1, [r3, 0x17] + movs r0, 0x3F +_081AF256: + ands r0, r1 + orrs r0, r2 + strb r0, [r3, 0x17] +_081AF25C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81AF15C + + thumb_func_start sub_81AF264 +sub_81AF264: @ 81AF264 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _081AF276 + cmp r0, 0x1 + beq _081AF28A + b _081AF2E4 +_081AF276: + ldrh r1, [r4, 0x30] + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartSpriteAnim + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _081AF2E4 +_081AF28A: + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _081AF29A + cmp r0, 0x1 + beq _081AF2C0 + ldrh r2, [r4, 0x38] + b _081AF2DE +_081AF29A: + movs r0, 0x34 + ldrsh r3, [r4, r0] + ldr r1, =gSineTable + ldrh r2, [r4, 0x38] + lsls r0, r2, 24 + lsrs r0, 23 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + muls r0, r3 + cmp r0, 0 + bge _081AF2B4 + adds r0, 0xFF +_081AF2B4: + asrs r0, 8 + strh r0, [r4, 0x24] + b _081AF2DE + .pool +_081AF2C0: + movs r0, 0x34 + ldrsh r3, [r4, r0] + ldr r1, =gSineTable + ldrh r2, [r4, 0x38] + lsls r0, r2, 24 + lsrs r0, 23 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + muls r0, r3 + cmp r0, 0 + bge _081AF2DA + adds r0, 0xFF +_081AF2DA: + asrs r0, 8 + strh r0, [r4, 0x26] +_081AF2DE: + ldrh r0, [r4, 0x36] + adds r0, r2, r0 + strh r0, [r4, 0x38] +_081AF2E4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AF264 + + thumb_func_start AddScrollIndicatorArrowObject +AddScrollIndicatorArrowObject: @ 81AF2F0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x18 + adds r6, r0, 0 + ldr r5, [sp, 0x30] + lsls r6, 24 + lsrs r6, 24 + mov r8, r6 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r5, 16 + lsrs r5, 16 + mov r12, r5 + mov r4, sp + ldr r0, =gUnknown_08614244 + ldm r0!, {r5-r7} + stm r4!, {r5-r7} + ldm r0!, {r5-r7} + stm r4!, {r5-r7} + mov r0, sp + movs r4, 0 + strh r3, [r0] + mov r3, r12 + strh r3, [r0, 0x2] + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gSprites + lsls r3, r0, 4 + adds r3, r0 + lsls r3, 2 + adds r3, r1 + adds r5, r3, 0 + adds r5, 0x3E + ldrb r1, [r5] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r5] + strh r4, [r3, 0x2E] + ldr r1, =gUnknown_086141FC + mov r5, r8 + lsls r6, r5, 2 + adds r6, r1 + ldrb r2, [r6] + lsls r1, r2, 28 + lsrs r1, 28 + strh r1, [r3, 0x30] + lsrs r2, 4 + strh r2, [r3, 0x32] + ldrb r1, [r6, 0x1] + strh r1, [r3, 0x34] + ldrh r1, [r6, 0x2] + strh r1, [r3, 0x36] + strh r4, [r3, 0x38] + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end AddScrollIndicatorArrowObject + + thumb_func_start AddScrollIndicatorArrowPair +AddScrollIndicatorArrowPair: @ 81AF380 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + adds r6, r0, 0 + mov r9, r1 + ldr r0, =gUnknown_086142C8 + str r0, [sp, 0x4] + ldr r5, =0xffff0000 + ldr r0, [sp, 0x8] + ands r0, r5 + movs r1, 0x80 + lsls r1, 1 + orrs r0, r1 + ldrh r1, [r6, 0xA] + lsls r1, 16 + ldr r4, =0x0000ffff + ands r0, r4 + orrs r0, r1 + str r0, [sp, 0x8] + add r0, sp, 0x4 + bl LoadCompressedObjectPic + ldrh r2, [r6, 0xC] + cmp r2, r4 + bne _081AF3DC + ldr r0, =gUnknown_086142A8 + ldrb r1, [r6, 0xE] + lsls r1, 20 + movs r2, 0x80 + lsls r2, 17 + adds r1, r2 + lsrs r1, 16 + movs r2, 0x20 + bl LoadPalette + b _081AF3EE + .pool +_081AF3DC: + ldr r0, =gUnknown_086142A8 + str r0, [sp, 0xC] + add r0, sp, 0xC + ldr r1, [r0, 0x4] + ands r1, r5 + orrs r1, r2 + str r1, [r0, 0x4] + bl LoadSpritePalette +_081AF3EE: + ldr r0, =Task_ScrollIndicatorArrowPair + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r7, r0, r1 + movs r0, 0 + strb r0, [r7] + mov r0, r9 + str r0, [r7, 0x4] + ldrh r0, [r6, 0x6] + strh r0, [r7, 0x8] + ldrh r0, [r6, 0x8] + strh r0, [r7, 0xA] + ldrh r0, [r6, 0xA] + strh r0, [r7, 0xE] + ldrh r0, [r6, 0xC] + strh r0, [r7, 0x10] + ldrb r0, [r6] + ldrb r1, [r6, 0x1] + ldrb r2, [r6, 0x2] + ldrh r3, [r6, 0xA] + ldrh r4, [r6, 0xC] + str r4, [sp] + bl AddScrollIndicatorArrowObject + strb r0, [r7, 0xC] + ldrb r0, [r6, 0x3] + ldrb r1, [r6, 0x4] + ldrb r2, [r6, 0x5] + ldrh r3, [r6, 0xA] + ldrh r4, [r6, 0xC] + str r4, [sp] + bl AddScrollIndicatorArrowObject + strb r0, [r7, 0xD] + ldrh r1, [r6, 0xC] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _081AF47C + ldr r5, =gSprites + ldrb r0, [r7, 0xC] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r3, [r6, 0xE] + lsls r3, 4 + ldrb r4, [r1, 0x5] + movs r2, 0xF + adds r0, r2, 0 + ands r0, r4 + orrs r0, r3 + strb r0, [r1, 0x5] + ldrb r1, [r7, 0xD] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r1, [r6, 0xE] + lsls r1, 4 + ldrb r3, [r0, 0x5] + ands r2, r3 + orrs r2, r1 + strb r2, [r0, 0x5] +_081AF47C: + mov r0, r8 + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end AddScrollIndicatorArrowPair + + thumb_func_start AddScrollIndicatorArrowPairParametrized +AddScrollIndicatorArrowPairParametrized: @ 81AF4A0 + push {r4,lr} + adds r4, r1, 0 + subs r0, 0x2 + cmp r0, 0x1 + bhi _081AF4C4 + ldr r0, =gUnknown_0203CE8C + movs r1, 0x2 + strb r1, [r0] + strb r4, [r0, 0x1] + strb r2, [r0, 0x2] + movs r1, 0x3 + strb r1, [r0, 0x3] + strb r4, [r0, 0x4] + strb r3, [r0, 0x5] + b _081AF4D6 + .pool +_081AF4C4: + ldr r0, =gUnknown_0203CE8C + movs r1, 0 + strb r1, [r0] + strb r2, [r0, 0x1] + strb r4, [r0, 0x2] + movs r1, 0x1 + strb r1, [r0, 0x3] + strb r3, [r0, 0x4] + strb r4, [r0, 0x5] +_081AF4D6: + adds r2, r0, 0 + movs r1, 0 + movs r0, 0 + strh r0, [r2, 0x6] + ldr r0, [sp, 0x8] + strh r0, [r2, 0x8] + ldr r0, [sp, 0xC] + strh r0, [r2, 0xA] + ldr r0, [sp, 0x10] + strh r0, [r2, 0xC] + strb r1, [r2, 0xE] + adds r0, r2, 0 + ldr r1, [sp, 0x14] + bl AddScrollIndicatorArrowPair + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end AddScrollIndicatorArrowPairParametrized + + thumb_func_start Task_ScrollIndicatorArrowPair +Task_ScrollIndicatorArrowPair: @ 81AF504 + 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 r4, r1, r0 + ldr r0, [r4, 0x4] + ldrh r5, [r0] + ldrh r0, [r4, 0x8] + cmp r5, r0 + bne _081AF548 + ldr r0, =0x0000ffff + cmp r5, r0 + beq _081AF548 + ldr r3, =gSprites + ldrb r1, [r4, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + b _081AF55E + .pool +_081AF548: + ldr r3, =gSprites + ldrb r1, [r4, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 +_081AF55E: + strb r1, [r0] + ldrh r0, [r4, 0xA] + cmp r5, r0 + bne _081AF580 + ldrb r1, [r4, 0xD] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + b _081AF594 + .pool +_081AF580: + ldrb r1, [r4, 0xD] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 +_081AF594: + strb r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end Task_ScrollIndicatorArrowPair + + thumb_func_start Task_ScrollIndicatorArrowPairOnMainMenu +Task_ScrollIndicatorArrowPairOnMainMenu: @ 81AF59C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r4, r1, r0 + movs r1, 0x1E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _081AF5E8 + ldr r3, =gSprites + ldrb r1, [r4, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + ldrb r1, [r4, 0xD] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + b _081AF612 + .pool +_081AF5E8: + ldr r3, =gSprites + ldrb r1, [r4, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldrb r1, [r4, 0xD] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 +_081AF612: + strb r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end Task_ScrollIndicatorArrowPairOnMainMenu + + thumb_func_start RemoveScrollIndicatorArrowPair +RemoveScrollIndicatorArrowPair: @ 81AF620 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r5, r0, r1 + ldrh r0, [r5, 0xE] + ldr r4, =0x0000ffff + cmp r0, r4 + beq _081AF63E + bl FreeSpriteTilesByTag +_081AF63E: + ldrh r0, [r5, 0x10] + cmp r0, r4 + beq _081AF648 + bl FreeSpritePaletteByTag +_081AF648: + ldrb r1, [r5, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =gSprites + adds r0, r4 + bl DestroySprite + ldrb r1, [r5, 0xD] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl DestroySprite + adds r0, r6, 0 + bl DestroyTask + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end RemoveScrollIndicatorArrowPair + + thumb_func_start ListMenuAddCursorObjectInternal +ListMenuAddCursorObjectInternal: @ 81AF680 + push {lr} + cmp r1, 0 + beq _081AF68A + cmp r1, 0x1 + beq _081AF690 +_081AF68A: + bl ListMenuAddRedOutlineCursorObject + b _081AF694 +_081AF690: + bl ListMenuAddRedArrowCursorObject +_081AF694: + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end ListMenuAddCursorObjectInternal + + thumb_func_start ListMenuUpdateCursorObject +@ void ListMenuUpdateCursorObject(u8 taskId, u16 x, u16 y, u32 a4) +ListMenuUpdateCursorObject: @ 81AF69C + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + cmp r3, 0 + beq _081AF6B4 + cmp r3, 0x1 + beq _081AF6BA + b _081AF6BE +_081AF6B4: + bl ListMenuUpdateRedOutlineCursorObject + b _081AF6BE +_081AF6BA: + bl ListMenuUpdateRedArrowCursorObject +_081AF6BE: + pop {r0} + bx r0 + thumb_func_end ListMenuUpdateCursorObject + + thumb_func_start ListMenuRemoveCursorObject +ListMenuRemoveCursorObject: @ 81AF6C4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r1, 0 + beq _081AF6D4 + cmp r1, 0x1 + beq _081AF6DA + b _081AF6DE +_081AF6D4: + bl ListMenuRemoveRedOutlineCursorObject + b _081AF6DE +_081AF6DA: + bl ListMenuRemoveRedArrowCursorObject +_081AF6DE: + pop {r0} + bx r0 + thumb_func_end ListMenuRemoveCursorObject + + thumb_func_start Task_RedOutlineCursor +Task_RedOutlineCursor: @ 81AF6E4 + bx lr + thumb_func_end Task_RedOutlineCursor + + thumb_func_start ListMenuGetRedOutlineCursorSpriteCount +ListMenuGetRedOutlineCursorSpriteCount: @ 81AF6E8 + push {lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r1, 16 + movs r3, 0x4 + cmp r0, 0x10 + bls _081AF708 + movs r2, 0x8 + subs r0, 0x8 + cmp r2, r0 + bge _081AF708 +_081AF700: + adds r3, 0x2 + adds r2, 0x8 + cmp r2, r0 + blt _081AF700 +_081AF708: + cmp r1, 0x10 + bls _081AF71C + movs r2, 0x8 + subs r1, 0x8 + cmp r2, r1 + bge _081AF71C +_081AF714: + adds r3, 0x2 + adds r2, 0x8 + cmp r2, r1 + blt _081AF714 +_081AF71C: + lsls r0, r3, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end ListMenuGetRedOutlineCursorSpriteCount + + thumb_func_start ListMenuSetUpRedOutlineCursorSpriteOamTable +ListMenuSetUpRedOutlineCursorSpriteOamTable: @ 81AF724 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r3, r2, 0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + ldr r0, =gUnknown_0861425C + ldr r0, [r0] + str r0, [r3] + movs r1, 0x88 + strb r1, [r3] + strb r1, [r3, 0x1] + ldr r0, =gUnknown_08614260 + ldr r0, [r0] + str r0, [r3, 0x4] + mov r2, r8 + adds r2, 0x80 + strb r2, [r3, 0x4] + strb r1, [r3, 0x5] + ldr r0, =gUnknown_08614274 + ldr r0, [r0] + str r0, [r3, 0x8] + strb r1, [r3, 0x8] + mov r4, r9 + adds r4, 0x80 + strb r4, [r3, 0x9] + ldr r0, =gUnknown_08614278 + ldr r0, [r0] + str r0, [r3, 0xC] + strb r2, [r3, 0xC] + strb r4, [r3, 0xD] + movs r0, 0x4 + mov r12, r0 + mov r2, r8 + cmp r2, 0x10 + bls _081AF7B8 + movs r2, 0x8 + mov r5, r8 + subs r5, 0x8 + cmp r2, r5 + bge _081AF7B8 + ldr r0, =gUnknown_08614264 + ldr r0, [r0] + str r0, [sp] + ldr r0, =gUnknown_08614270 + ldr r6, [r0] + adds r1, r3, 0 + adds r1, 0x10 + movs r7, 0x88 + mov r10, r7 +_081AF796: + ldr r0, [sp] + str r0, [r1] + adds r0, r2, 0 + subs r0, 0x78 + strb r0, [r1] + mov r7, r10 + strb r7, [r1, 0x1] + adds r1, 0x4 + str r6, [r1] + strb r0, [r1] + strb r4, [r1, 0x1] + adds r1, 0x4 + movs r0, 0x2 + add r12, r0 + adds r2, 0x8 + cmp r2, r5 + blt _081AF796 +_081AF7B8: + mov r2, r9 + cmp r2, 0x10 + bls _081AF7F6 + movs r1, 0x8 + mov r4, r9 + subs r4, 0x8 + cmp r1, r4 + bge _081AF7F6 + ldr r0, =gUnknown_08614268 + ldr r6, [r0] + ldr r0, =gUnknown_0861426C + ldr r5, [r0] + mov r7, r12 + lsls r0, r7, 2 + adds r2, r0, r3 + movs r7, 0x88 + mov r3, r8 + adds r3, 0x80 +_081AF7DC: + str r6, [r2] + strb r7, [r2] + adds r0, r1, 0 + subs r0, 0x78 + strb r0, [r2, 0x1] + adds r2, 0x4 + str r5, [r2] + strb r3, [r2] + strb r0, [r2, 0x1] + adds r2, 0x4 + adds r1, 0x8 + cmp r1, r4 + blt _081AF7DC +_081AF7F6: + 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 ListMenuSetUpRedOutlineCursorSpriteOamTable + + thumb_func_start ListMenuAddRedOutlineCursorObject +ListMenuAddRedOutlineCursorObject: @ 81AF828 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x28 + adds r6, r0, 0 + ldr r0, =gUnknown_08614338 + str r0, [sp, 0x18] + ldr r5, =0xffff0000 + add r0, sp, 0x18 + ldr r1, [r0, 0x4] + ands r1, r5 + movs r2, 0x80 + lsls r2, 1 + orrs r1, r2 + ldrh r2, [r6, 0x6] + lsls r2, 16 + ldr r3, =0x0000ffff + ands r1, r3 + orrs r1, r2 + str r1, [r0, 0x4] + bl LoadCompressedObjectPic + ldrh r2, [r6, 0x8] + ldr r7, =0x0000ffff + cmp r2, r7 + bne _081AF884 + ldr r0, =gUnknown_086142A8 + ldrb r1, [r6, 0xA] + lsls r1, 20 + movs r2, 0x80 + lsls r2, 17 + adds r1, r2 + lsrs r1, 16 + movs r2, 0x20 + bl LoadPalette + b _081AF896 + .pool +_081AF884: + ldr r0, =gUnknown_086142A8 + str r0, [sp, 0x20] + add r0, sp, 0x20 + ldr r1, [r0, 0x4] + ands r1, r5 + orrs r1, r2 + str r1, [r0, 0x4] + bl LoadSpritePalette +_081AF896: + ldr r0, =Task_RedOutlineCursor + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r5, r0, r1 + ldrh r0, [r6, 0x6] + movs r3, 0 + mov r8, r3 + strh r0, [r5, 0xE] + ldrh r0, [r6, 0x8] + strh r0, [r5, 0x10] + ldrh r0, [r6, 0x2] + ldrh r1, [r6, 0x4] + bl ListMenuGetRedOutlineCursorSpriteCount + strb r0, [r5] + ldrb r0, [r5] + lsls r0, 2 + bl Alloc + adds r2, r0, 0 + str r2, [r5, 0x8] + str r2, [r5, 0x4] + ldrh r0, [r6, 0x2] + ldrh r1, [r6, 0x4] + bl ListMenuSetUpRedOutlineCursorSpriteOamTable + mov r1, sp + ldr r0, =gDummySpriteTemplate + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + mov r1, sp + ldrh r0, [r6, 0x6] + strh r0, [r1] + ldrh r0, [r6, 0x8] + strh r0, [r1, 0x2] + ldrb r1, [r6] + adds r1, 0x78 + ldrb r2, [r6, 0x1] + adds r2, 0x78 + mov r0, sp + movs r3, 0 + bl CreateSprite + strb r0, [r5, 0xC] + ldrb r1, [r5, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r7, =gSprites + adds r0, r7 + adds r1, r5, 0 + bl SetSubspriteTables + ldrb r0, [r5, 0xC] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x5] + ldrb r1, [r5, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + adds r0, 0x43 + mov r1, r8 + strb r1, [r0] + ldrb r1, [r5, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + adds r0, 0x42 + ldrb r2, [r0] + movs r1, 0x40 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + ldrh r1, [r6, 0x8] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _081AF96E + ldrb r0, [r5, 0xC] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + ldrb r2, [r6, 0xA] + lsls r2, 4 + ldrb r3, [r1, 0x5] + movs r0, 0xF + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0x5] +_081AF96E: + adds r0, r4, 0 + add sp, 0x28 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end ListMenuAddRedOutlineCursorObject + + thumb_func_start ListMenuUpdateRedOutlineCursorObject +@ void ListMenuUpdateRedOutlineCursorObject(u8 taskId, u16 x, u16 y) +ListMenuUpdateRedOutlineCursorObject: @ 81AF994 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + lsls r3, r0, 2 + adds r3, r0 + lsls r3, 3 + ldr r0, =gTasks + 0x8 + adds r3, r0 + ldr r5, =gSprites + ldrb r4, [r3, 0xC] + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r5 + adds r1, 0x78 + strh r1, [r0, 0x20] + ldrb r1, [r3, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r2, 0x78 + strh r2, [r0, 0x22] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ListMenuUpdateRedOutlineCursorObject + + thumb_func_start ListMenuRemoveRedOutlineCursorObject +ListMenuRemoveRedOutlineCursorObject: @ 81AF9D8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + ldr r0, [r4, 0x8] + bl Free + ldrh r0, [r4, 0xE] + ldr r6, =0x0000ffff + cmp r0, r6 + beq _081AF9FC + bl FreeSpriteTilesByTag +_081AF9FC: + ldrh r0, [r4, 0x10] + cmp r0, r6 + beq _081AFA06 + bl FreeSpritePaletteByTag +_081AFA06: + ldrb r1, [r4, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + bl DestroySprite + adds r0, r5, 0 + bl DestroyTask + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end ListMenuRemoveRedOutlineCursorObject + + thumb_func_start ObjectCB_RedArrowCursor +ObjectCB_RedArrowCursor: @ 81AFA30 + push {lr} + adds r2, r0, 0 + ldr r1, =gSineTable + ldrh r3, [r2, 0x2E] + lsls r0, r3, 24 + lsrs r0, 23 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bge _081AFA48 + adds r0, 0x3F +_081AFA48: + asrs r0, 6 + strh r0, [r2, 0x24] + adds r0, r3, 0 + adds r0, 0x8 + strh r0, [r2, 0x2E] + pop {r0} + bx r0 + .pool + thumb_func_end ObjectCB_RedArrowCursor + + thumb_func_start Task_RedArrowCursor +Task_RedArrowCursor: @ 81AFA5C + bx lr + thumb_func_end Task_RedArrowCursor + + thumb_func_start ListMenuAddRedArrowCursorObject +ListMenuAddRedArrowCursorObject: @ 81AFA60 + push {r4-r7,lr} + sub sp, 0x28 + adds r5, r0, 0 + ldr r0, =gUnknown_08614378 + str r0, [sp, 0x18] + ldr r6, =0xffff0000 + add r0, sp, 0x18 + ldr r1, [r0, 0x4] + ands r1, r6 + movs r2, 0x80 + orrs r1, r2 + ldrh r2, [r5, 0x6] + lsls r2, 16 + ldr r4, =0x0000ffff + ands r1, r4 + orrs r1, r2 + str r1, [r0, 0x4] + bl LoadCompressedObjectPic + ldrh r2, [r5, 0x8] + cmp r2, r4 + bne _081AFAB4 + ldr r0, =gUnknown_086142A8 + ldrb r1, [r5, 0xA] + lsls r1, 20 + movs r2, 0x80 + lsls r2, 17 + adds r1, r2 + lsrs r1, 16 + movs r2, 0x20 + bl LoadPalette + b _081AFAC6 + .pool +_081AFAB4: + ldr r0, =gUnknown_086142A8 + str r0, [sp, 0x20] + add r0, sp, 0x20 + ldr r1, [r0, 0x4] + ands r1, r6 + orrs r1, r2 + str r1, [r0, 0x4] + bl LoadSpritePalette +_081AFAC6: + ldr r0, =Task_RedArrowCursor + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + ldrh r0, [r5, 0x6] + strh r0, [r4, 0x2] + ldrh r0, [r5, 0x8] + strh r0, [r4, 0x4] + mov r1, sp + ldr r0, =gUnknown_08614290 + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + mov r1, sp + ldrh r0, [r5, 0x6] + strh r0, [r1] + ldrh r0, [r5, 0x8] + strh r0, [r1, 0x2] + ldrb r1, [r5] + ldrb r2, [r5, 0x1] + mov r0, sp + movs r3, 0 + bl CreateSprite + strb r0, [r4] + ldr r3, =gSprites + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r2, 0x8 + strh r2, [r0, 0x24] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r2, [r0, 0x26] + ldrh r1, [r5, 0x8] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _081AFB46 + ldrb r0, [r4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r2, [r5, 0xA] + lsls r2, 4 + ldrb r3, [r1, 0x5] + movs r0, 0xF + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0x5] +_081AFB46: + adds r0, r6, 0 + add sp, 0x28 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end ListMenuAddRedArrowCursorObject + + thumb_func_start ListMenuUpdateRedArrowCursorObject +@ void ListMenuUpdateRedArrowCursorObject(u8 taskId, u16 x, u16 y) +ListMenuUpdateRedArrowCursorObject: @ 81AFB68 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r3, r0, 2 + adds r3, r0 + lsls r3, 3 + ldr r0, =gTasks + 0x8 + adds r3, r0 + ldr r5, =gSprites + ldrb r4, [r3] + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r5 + strh r1, [r0, 0x20] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r2, [r0, 0x22] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ListMenuUpdateRedArrowCursorObject + + thumb_func_start ListMenuRemoveRedArrowCursorObject +ListMenuRemoveRedArrowCursorObject: @ 81AFBA0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + ldrh r0, [r4, 0x2] + ldr r6, =0x0000ffff + cmp r0, r6 + beq _081AFBBE + bl FreeSpriteTilesByTag +_081AFBBE: + ldrh r0, [r4, 0x4] + cmp r0, r6 + beq _081AFBC8 + bl FreeSpritePaletteByTag +_081AFBC8: + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + bl DestroySprite + adds r0, r5, 0 + bl DestroyTask + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end ListMenuRemoveRedArrowCursorObject + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/new_menu_helpers.s b/asm/new_menu_helpers.s new file mode 100755 index 000000000..d79f7df32 --- /dev/null +++ b/asm/new_menu_helpers.s @@ -0,0 +1,1178 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_8197184 +sub_8197184: @ 8197184 + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl GetWindowAttribute + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0860EA6C + movs r2, 0x80 + lsls r2, 1 + lsls r4, 16 + lsrs r4, 16 + adds r3, r4, 0 + bl LoadBgTiles + ldr r0, =gUnknown_0860EA4C + lsls r5, 20 + lsrs r5, 16 + adds r1, r5, 0 + movs r2, 0x20 + bl LoadPalette + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8197184 + + thumb_func_start sub_81971C4 +sub_81971C4: @ 81971C4 + push {lr} + bl sub_819645C + pop {r0} + bx r0 + thumb_func_end sub_81971C4 + + thumb_func_start sub_81971D0 +sub_81971D0: @ 81971D0 + push {lr} + ldr r0, =gUnknown_0860F098 + bl InitWindows + ldr r0, =gUnknown_0203CD8C + movs r1, 0xFF + strb r1, [r0] + ldr r0, =gUnknown_0203CD8D + strb r1, [r0] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81971D0 + + thumb_func_start sub_81971F4 +sub_81971F4: @ 81971F4 + push {lr} + bl FreeAllWindowBuffers + pop {r0} + bx r0 + thumb_func_end sub_81971F4 + + thumb_func_start sub_8197200 +sub_8197200: @ 8197200 + push {lr} + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + bl DeactivateAllTextPrinters + bl sub_81973A4 + pop {r0} + bx r0 + thumb_func_end sub_8197200 + + thumb_func_start sub_8197224 +sub_8197224: @ 8197224 + push {lr} + bl RunTextPrinters + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_8197224 + + thumb_func_start AddTextPrinterParametrized +@ u16 AddTextPrinterParametrized(u8 windowId, u8 fontId, u8 *str, u8 speed, void ( *callback)(u16, struct TextPrinter *), u8 fgColor, u8 bgColor, u8 shadowColor) +AddTextPrinterParametrized: @ 8197238 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + ldr r7, [sp, 0x28] + ldr r4, [sp, 0x2C] + mov r8, r4 + ldr r5, [sp, 0x30] + ldr r6, [sp, 0x34] + lsls r3, 24 + lsrs r3, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + str r2, [sp] + mov r2, sp + movs r4, 0 + strb r0, [r2, 0x4] + mov r0, sp + strb r1, [r0, 0x5] + strb r4, [r0, 0x6] + movs r1, 0x1 + strb r1, [r0, 0x7] + strb r4, [r0, 0x8] + strb r1, [r0, 0x9] + strb r4, [r0, 0xA] + strb r4, [r0, 0xB] + mov r4, sp + ldrb r2, [r4, 0xC] + subs r1, 0x11 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r4, 0xC] + mov r0, sp + mov r2, r8 + lsls r2, 4 + movs r4, 0xF + strb r2, [r0, 0xC] + mov r2, sp + ands r5, r4 + ldrb r0, [r2, 0xD] + ands r1, r0 + orrs r1, r5 + strb r1, [r2, 0xD] + mov r0, sp + lsrs r6, 20 + ands r1, r4 + orrs r1, r6 + strb r1, [r0, 0xD] + ldr r2, =gTextFlags + ldrb r1, [r2] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + mov r0, sp + adds r1, r3, 0 + adds r2, r7, 0 + bl AddTextPrinter + lsls r0, 16 + lsrs r0, 16 + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end AddTextPrinterParametrized + + thumb_func_start AddTextPrinterForMessage +@ void AddTextPrinterForMessage(u8 allowSkippingDelayWithButtonPress) +AddTextPrinterForMessage: @ 81972C4 + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + ldr r3, =gTextFlags + movs r4, 0x1 + ands r0, r4 + ldrb r2, [r3] + movs r1, 0x2 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3] + bl sav2_get_text_speed + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + ldr r2, =gStringVar4 + str r5, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x3 + str r0, [sp, 0xC] + movs r0, 0 + movs r1, 0x1 + bl AddTextPrinterParametrized + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end AddTextPrinterForMessage + + thumb_func_start AddTextPrinterForMessage_2 +@ void AddTextPrinterForMessage_2(u8 allowSkippingDelayWithButtonPress) +AddTextPrinterForMessage_2: @ 8197310 + push {r4,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + ldr r3, =gTextFlags + movs r4, 0x1 + ands r0, r4 + ldrb r2, [r3] + movs r1, 0x2 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3] + bl sav2_get_text_speed + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + ldr r2, =gStringVar4 + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x3 + str r0, [sp, 0xC] + movs r0, 0 + movs r1, 0x1 + bl AddTextPrinterParametrized + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end AddTextPrinterForMessage_2 + + thumb_func_start AddTextPrinterWithCustomSpeedForMessage +@ void AddTextPrinterWithCustomSpeedForMessage(u8 allowSkippingDelayWithButtonPress, u8 speed) +AddTextPrinterWithCustomSpeedForMessage: @ 819735C + push {r4,r5,lr} + sub sp, 0x10 + adds r3, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r3, 24 + lsrs r3, 24 + ldr r4, =gTextFlags + movs r5, 0x1 + ands r0, r5 + ldrb r2, [r4] + movs r1, 0x2 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r4] + ldr r2, =gStringVar4 + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x3 + str r0, [sp, 0xC] + movs r0, 0 + movs r1, 0x1 + bl AddTextPrinterParametrized + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end AddTextPrinterWithCustomSpeedForMessage + + thumb_func_start sub_81973A4 +sub_81973A4: @ 81973A4 + push {lr} + movs r1, 0x80 + lsls r1, 2 + movs r0, 0 + movs r2, 0xF0 + bl copy_textbox_border_tile_patterns_to_vram + movs r1, 0x85 + lsls r1, 2 + movs r0, 0 + movs r2, 0xE0 + bl sub_809882C + pop {r0} + bx r0 + thumb_func_end sub_81973A4 + + thumb_func_start sub_81973C4 +sub_81973C4: @ 81973C4 + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =sub_81975F4 + adds r0, r5, 0 + bl CallWindowFunction + adds r0, r5, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + adds r0, r5, 0 + bl PutWindowTilemap + cmp r4, 0x1 + bne _081973F2 + adds r0, r5, 0 + movs r1, 0x3 + bl CopyWindowToVram +_081973F2: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81973C4 + + thumb_func_start sub_81973FC +sub_81973FC: @ 81973FC + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =sub_81974A4 + adds r0, r5, 0 + bl CallWindowFunction + adds r0, r5, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + adds r0, r5, 0 + bl PutWindowTilemap + cmp r4, 0x1 + bne _0819742A + adds r0, r5, 0 + movs r1, 0x3 + bl CopyWindowToVram +_0819742A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81973FC + + thumb_func_start sub_8197434 +sub_8197434: @ 8197434 + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =sub_8197804 + adds r0, r5, 0 + bl CallWindowFunction + adds r0, r5, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + adds r0, r5, 0 + bl ClearWindowTilemap + cmp r4, 0x1 + bne _08197462 + adds r0, r5, 0 + movs r1, 0x3 + bl CopyWindowToVram +_08197462: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8197434 + + thumb_func_start sub_819746C +sub_819746C: @ 819746C + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =sub_81977BC + adds r0, r5, 0 + bl CallWindowFunction + adds r0, r5, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + adds r0, r5, 0 + bl ClearWindowTilemap + cmp r4, 0x1 + bne _0819749A + adds r0, r5, 0 + movs r1, 0x3 + bl CopyWindowToVram +_0819749A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819746C + + thumb_func_start sub_81974A4 +sub_81974A4: @ 81974A4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + adds r4, r2, 0 + ldr r2, [sp, 0x3C] + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsls r4, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x10] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x14] + movs r3, 0x85 + lsls r3, 2 + lsrs r0, r1, 24 + str r0, [sp, 0xC] + movs r2, 0xFF + lsls r2, 24 + adds r2, r1 + mov r8, r2 + lsrs r2, 24 + lsrs r0, r4, 24 + mov r9, r0 + movs r0, 0xFF + lsls r0, 24 + adds r4, r0 + lsrs r4, 24 + movs r5, 0x1 + str r5, [sp] + str r5, [sp, 0x4] + movs r6, 0xE + str r6, [sp, 0x8] + adds r0, r7, 0 + adds r1, r3, 0 + adds r3, r4, 0 + bl FillBgTilemapBufferRect + ldr r1, =0x00000215 + ldr r2, [sp, 0x10] + str r2, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + adds r0, r7, 0 + ldr r2, [sp, 0xC] + adds r3, r4, 0 + bl FillBgTilemapBufferRect + ldr r1, =0x00000216 + ldr r3, [sp, 0xC] + ldr r2, [sp, 0x10] + adds r0, r3, r2 + lsls r0, 24 + mov r10, r0 + lsrs r2, r0, 24 + str r5, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + adds r0, r7, 0 + adds r3, r4, 0 + bl FillBgTilemapBufferRect + mov r5, r9 + ldr r0, [sp, 0x14] + add r0, r9 + cmp r9, r0 + bge _08197578 + mov r3, r8 + str r3, [sp, 0x18] + movs r6, 0x1 + movs r0, 0xE + mov r8, r0 +_0819753E: + lsls r4, r5, 24 + lsrs r4, 24 + str r6, [sp] + str r6, [sp, 0x4] + mov r2, r8 + str r2, [sp, 0x8] + adds r0, r7, 0 + ldr r1, =0x00000217 + ldr r3, [sp, 0x18] + lsrs r2, r3, 24 + adds r3, r4, 0 + bl FillBgTilemapBufferRect + str r6, [sp] + str r6, [sp, 0x4] + mov r0, r8 + str r0, [sp, 0x8] + adds r0, r7, 0 + ldr r1, =0x00000219 + mov r3, r10 + lsrs r2, r3, 24 + adds r3, r4, 0 + bl FillBgTilemapBufferRect + adds r5, 0x1 + ldr r0, [sp, 0x14] + add r0, r9 + cmp r5, r0 + blt _0819753E +_08197578: + ldr r1, =0x0000021a + ldr r2, [sp, 0xC] + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldr r4, [sp, 0x14] + add r4, r9 + lsls r4, 24 + lsrs r4, 24 + movs r5, 0x1 + str r5, [sp] + str r5, [sp, 0x4] + movs r6, 0xE + str r6, [sp, 0x8] + adds r0, r7, 0 + adds r3, r4, 0 + bl FillBgTilemapBufferRect + ldr r1, =0x0000021b + ldr r0, [sp, 0x10] + str r0, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + adds r0, r7, 0 + ldr r2, [sp, 0xC] + adds r3, r4, 0 + bl FillBgTilemapBufferRect + movs r1, 0x87 + lsls r1, 2 + ldr r3, [sp, 0xC] + ldr r0, [sp, 0x10] + adds r2, r3, r0 + lsls r2, 24 + lsrs r2, 24 + str r5, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + adds r0, r7, 0 + adds r3, r4, 0 + bl FillBgTilemapBufferRect + 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_81974A4 + + thumb_func_start sub_81975F4 +sub_81975F4: @ 81975F4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + adds r6, r0, 0 + adds r5, r2, 0 + mov r8, r3 + ldr r2, [sp, 0x44] + lsls r6, 24 + lsrs r6, 24 + lsls r0, r1, 24 + lsls r5, 24 + mov r1, r8 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r1, r2, 24 + lsrs r1, 24 + str r1, [sp, 0x10] + ldr r1, =0x00000201 + lsrs r2, r0, 24 + str r2, [sp, 0xC] + movs r3, 0xFE + lsls r3, 24 + adds r2, r0, r3 + lsrs r2, 24 + str r2, [sp, 0x14] + lsrs r0, r5, 24 + mov r10, r0 + movs r2, 0xFF + lsls r2, 24 + adds r5, r2 + lsrs r5, 24 + movs r4, 0x1 + str r4, [sp] + str r4, [sp, 0x4] + movs r3, 0xF + mov r9, r3 + str r3, [sp, 0x8] + adds r0, r6, 0 + ldr r2, [sp, 0x14] + adds r3, r5, 0 + bl FillBgTilemapBufferRect + ldr r1, =0x00000203 + ldr r0, [sp, 0xC] + subs r0, 0x1 + lsls r2, r0, 24 + lsrs r2, 24 + str r2, [sp, 0x18] + str r4, [sp] + str r4, [sp, 0x4] + mov r0, r9 + str r0, [sp, 0x8] + adds r0, r6, 0 + adds r3, r5, 0 + bl FillBgTilemapBufferRect + movs r1, 0x81 + lsls r1, 2 + mov r0, r8 + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x1C] + str r0, [sp] + str r4, [sp, 0x4] + mov r2, r9 + str r2, [sp, 0x8] + adds r0, r6, 0 + ldr r2, [sp, 0xC] + adds r3, r5, 0 + bl FillBgTilemapBufferRect + ldr r1, =0x00000205 + ldr r7, [sp, 0xC] + add r7, r8 + subs r0, r7, 0x1 + lsls r2, r0, 24 + lsrs r2, 24 + str r2, [sp, 0x20] + str r4, [sp] + str r4, [sp, 0x4] + mov r3, r9 + str r3, [sp, 0x8] + adds r0, r6, 0 + adds r3, r5, 0 + bl FillBgTilemapBufferRect + ldr r1, =0x00000206 + lsls r2, r7, 24 + lsrs r7, r2, 24 + str r4, [sp] + str r4, [sp, 0x4] + mov r0, r9 + str r0, [sp, 0x8] + adds r0, r6, 0 + adds r2, r7, 0 + adds r3, r5, 0 + bl FillBgTilemapBufferRect + ldr r1, =0x00000207 + str r4, [sp] + movs r5, 0x5 + str r5, [sp, 0x4] + mov r2, r9 + str r2, [sp, 0x8] + adds r0, r6, 0 + ldr r2, [sp, 0x14] + mov r3, r10 + bl FillBgTilemapBufferRect + ldr r1, =0x00000209 + add r8, r4 + mov r3, r8 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp] + str r5, [sp, 0x4] + mov r0, r9 + str r0, [sp, 0x8] + adds r0, r6, 0 + ldr r2, [sp, 0x18] + mov r3, r10 + bl FillBgTilemapBufferRect + ldr r1, =0x0000020a + str r4, [sp] + str r5, [sp, 0x4] + mov r2, r9 + str r2, [sp, 0x8] + adds r0, r6, 0 + adds r2, r7, 0 + mov r3, r10 + bl FillBgTilemapBufferRect + ldr r1, =0x00000a01 + ldr r3, [sp, 0x10] + add r10, r3 + mov r0, r10 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + str r4, [sp] + str r4, [sp, 0x4] + mov r2, r9 + str r2, [sp, 0x8] + adds r0, r6, 0 + ldr r2, [sp, 0x14] + mov r3, r10 + bl FillBgTilemapBufferRect + ldr r1, =0x00000a03 + str r4, [sp] + str r4, [sp, 0x4] + mov r3, r9 + str r3, [sp, 0x8] + adds r0, r6, 0 + ldr r2, [sp, 0x18] + mov r3, r10 + bl FillBgTilemapBufferRect + ldr r1, =0x00000a04 + ldr r0, [sp, 0x1C] + str r0, [sp] + str r4, [sp, 0x4] + mov r2, r9 + str r2, [sp, 0x8] + adds r0, r6, 0 + ldr r2, [sp, 0xC] + mov r3, r10 + bl FillBgTilemapBufferRect + ldr r1, =0x00000a05 + str r4, [sp] + str r4, [sp, 0x4] + mov r3, r9 + str r3, [sp, 0x8] + adds r0, r6, 0 + ldr r2, [sp, 0x20] + mov r3, r10 + bl FillBgTilemapBufferRect + ldr r1, =0x00000a06 + str r4, [sp] + str r4, [sp, 0x4] + mov r0, r9 + str r0, [sp, 0x8] + adds r0, r6, 0 + adds r2, r7, 0 + mov r3, r10 + bl FillBgTilemapBufferRect + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81975F4 + + thumb_func_start sub_81977BC +sub_81977BC: @ 81977BC + push {r4,r5,lr} + sub sp, 0xC + adds r4, r1, 0 + adds r5, r2, 0 + ldr r1, [sp, 0x18] + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsls r5, 24 + lsls r3, 24 + lsls r1, 24 + movs r2, 0xFF + lsls r2, 24 + adds r4, r2 + lsrs r4, 24 + adds r5, r2 + lsrs r5, 24 + movs r2, 0x80 + lsls r2, 18 + adds r3, r2 + lsrs r3, 24 + str r3, [sp] + adds r1, r2 + lsrs r1, 24 + str r1, [sp, 0x4] + movs r1, 0xE + str r1, [sp, 0x8] + movs r1, 0 + adds r2, r4, 0 + adds r3, r5, 0 + bl FillBgTilemapBufferRect + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81977BC + + thumb_func_start sub_8197804 +sub_8197804: @ 8197804 + push {r4,r5,lr} + sub sp, 0xC + adds r4, r1, 0 + adds r5, r2, 0 + ldr r1, [sp, 0x18] + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsls r5, 24 + lsls r3, 24 + lsls r1, 24 + movs r2, 0xFD + lsls r2, 24 + adds r4, r2 + lsrs r4, 24 + movs r2, 0xFF + lsls r2, 24 + adds r5, r2 + lsrs r5, 24 + movs r2, 0xC0 + lsls r2, 19 + adds r3, r2 + lsrs r3, 24 + str r3, [sp] + movs r2, 0x80 + lsls r2, 18 + adds r1, r2 + lsrs r1, 24 + str r1, [sp, 0x4] + movs r1, 0xE + str r1, [sp, 0x8] + movs r1, 0 + adds r2, r4, 0 + adds r3, r5, 0 + bl FillBgTilemapBufferRect + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8197804 + + thumb_func_start SetStandardWindowBorderStyle +@ void SetStandardWindowBorderStyle(u8 windowId, bool copyToVram) +SetStandardWindowBorderStyle: @ 8197854 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + movs r2, 0x85 + lsls r2, 2 + movs r3, 0xE + bl SetWindowBorderStyle + pop {r0} + bx r0 + thumb_func_end SetStandardWindowBorderStyle + + thumb_func_start sub_819786C +sub_819786C: @ 819786C + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + movs r6, 0x80 + lsls r6, 2 + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0xF0 + bl copy_textbox_border_tile_patterns_to_vram + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + movs r3, 0xF + bl sub_8197B1C + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_819786C + + thumb_func_start sub_819789C +sub_819789C: @ 819789C + push {lr} + ldr r0, =gUnknown_0860F074 + movs r1, 0xE0 + movs r2, 0x14 + bl LoadPalette + pop {r0} + bx r0 + .pool + thumb_func_end sub_819789C + + thumb_func_start sub_81978B0 +sub_81978B0: @ 81978B0 + push {lr} + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r0, =gUnknown_0860F074 + movs r2, 0x14 + bl LoadPalette + pop {r0} + bx r0 + .pool + thumb_func_end sub_81978B0 + + thumb_func_start sub_81978C8 +sub_81978C8: @ 81978C8 + ldr r0, =gUnknown_0860F074 + bx lr + .pool + thumb_func_end sub_81978C8 + + thumb_func_start sub_81978D0 +sub_81978D0: @ 81978D0 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xF + bls _081978DC + movs r1, 0 +_081978DC: + ldr r0, =gUnknown_0860F074 + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + pop {r1} + bx r1 + .pool + thumb_func_end sub_81978D0 + + thumb_func_start DisplayItemMessageOnField +@ void DisplayItemMessageOnField(u8 taskId, u8 *str, void ( *callback)(u8 taskId)) +DisplayItemMessageOnField: @ 81978EC + push {r4-r6,lr} + sub sp, 0x10 + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_81973A4 + bl sav2_get_text_speed + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x80 + lsls r2, 2 + movs r1, 0x1 + str r1, [sp] + str r0, [sp, 0x4] + str r5, [sp, 0x8] + str r6, [sp, 0xC] + adds r0, r4, 0 + movs r1, 0 + movs r3, 0xF + bl DisplayMessageAndContinueTask + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end DisplayItemMessageOnField + + thumb_func_start sub_8197930 +sub_8197930: @ 8197930 + push {lr} + ldr r0, =gUnknown_0860F0A8 + movs r1, 0x85 + lsls r1, 2 + movs r2, 0xE + movs r3, 0 + bl CreateYesNoMenu + pop {r0} + bx r0 + .pool + thumb_func_end sub_8197930 + + thumb_func_start sub_8197948 +sub_8197948: @ 8197948 + push {lr} + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =gUnknown_0860F0A8 + movs r1, 0x85 + lsls r1, 2 + movs r2, 0xE + bl CreateYesNoMenu + pop {r0} + bx r0 + .pool + thumb_func_end sub_8197948 + + thumb_func_start sub_8197964 +sub_8197964: @ 8197964 + push {lr} + ldr r0, =gTextFlags + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _08197988 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldrb r0, [r0, 0x14] + lsls r0, 29 + lsrs r0, 29 + b _0819798A + .pool +_08197988: + movs r0, 0x1 +_0819798A: + pop {r1} + bx r1 + thumb_func_end sub_8197964 + + thumb_func_start sav2_get_text_speed +sav2_get_text_speed: @ 8197990 + push {lr} + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldrb r1, [r2, 0x14] + lsls r0, r1, 29 + lsrs r0, 29 + cmp r0, 0x2 + bls _081979AC + movs r0, 0x8 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x14] +_081979AC: + bl sub_8197964 + ldr r1, =gUnknown_0860F094 + adds r0, r1 + ldrb r0, [r0] + pop {r1} + bx r1 + .pool + thumb_func_end sav2_get_text_speed + + thumb_func_start sub_81979C4 +sub_81979C4: @ 81979C4 + push {r4,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r1, r0, 24 + ldr r4, =gUnknown_0203CD8C + ldrb r0, [r4] + cmp r0, 0xFF + bne _081979F6 + lsls r0, r1, 25 + movs r1, 0x80 + lsls r1, 18 + adds r0, r1 + lsrs r0, 24 + str r0, [sp] + movs r0, 0xF + str r0, [sp, 0x4] + ldr r0, =0x00000139 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x16 + movs r2, 0x1 + movs r3, 0x7 + bl sub_8198AA4 + strb r0, [r4] +_081979F6: + ldrb r0, [r4] + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81979C4 + + thumb_func_start GetStartMenuWindowId +GetStartMenuWindowId: @ 8197A08 + ldr r0, =gUnknown_0203CD8C + ldrb r0, [r0] + bx lr + .pool + thumb_func_end GetStartMenuWindowId + + thumb_func_start remove_start_menu_window_maybe +remove_start_menu_window_maybe: @ 8197A14 + push {r4,lr} + ldr r4, =gUnknown_0203CD8C + ldrb r0, [r4] + cmp r0, 0xFF + beq _08197A26 + bl RemoveWindow + movs r0, 0xFF + strb r0, [r4] +_08197A26: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end remove_start_menu_window_maybe + + thumb_func_start sub_8197A30 +sub_8197A30: @ 8197A30 + movs r0, 0x80 + lsls r0, 2 + bx lr + thumb_func_end sub_8197A30 + + thumb_func_start sub_8197A38 +sub_8197A38: @ 8197A38 + movs r0, 0x85 + lsls r0, 2 + bx lr + thumb_func_end sub_8197A38 + + thumb_func_start AddMapNamePopUpWindow +AddMapNamePopUpWindow: @ 8197A40 + push {r4,lr} + sub sp, 0xC + ldr r4, =gUnknown_0203CD8D + ldrb r0, [r4] + cmp r0, 0xFF + bne _08197A66 + movs r0, 0x3 + str r0, [sp] + movs r0, 0xE + str r0, [sp, 0x4] + adds r0, 0xF9 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + movs r3, 0xA + bl sub_8198AA4 + strb r0, [r4] +_08197A66: + ldrb r0, [r4] + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end AddMapNamePopUpWindow + + thumb_func_start GetMapNamePopUpWindowId +GetMapNamePopUpWindowId: @ 8197A74 + ldr r0, =gUnknown_0203CD8D + ldrb r0, [r0] + bx lr + .pool + thumb_func_end GetMapNamePopUpWindowId + + thumb_func_start RemoveMapNamePopUpWindow +RemoveMapNamePopUpWindow: @ 8197A80 + push {r4,lr} + ldr r4, =gUnknown_0203CD8D + ldrb r0, [r4] + cmp r0, 0xFF + beq _08197A92 + bl RemoveWindow + movs r0, 0xFF + strb r0, [r4] +_08197A92: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end RemoveMapNamePopUpWindow + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/party_menu.s b/asm/party_menu.s new file mode 100755 index 000000000..cf00d63c1 --- /dev/null +++ b/asm/party_menu.s @@ -0,0 +1,17828 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_81B01B0 +sub_81B01B0: @ 81B01B0 + push {lr} + bl RunTasks + bl AnimateSprites + bl BuildOamBuffer + bl do_scheduled_bg_tilemap_copies_to_vram + bl UpdatePaletteFade + pop {r0} + bx r0 + thumb_func_end sub_81B01B0 + + thumb_func_start sub_81B01CC +sub_81B01CC: @ 81B01CC + push {lr} + bl LoadOam + bl ProcessSpriteCopyRequests + bl TransferPlttBuffer + pop {r0} + bx r0 + thumb_func_end sub_81B01CC + + thumb_func_start c2_811EBD0 +c2_811EBD0: @ 81B01E0 + push {lr} +_081B01E2: + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B0206 + bl sub_81B020C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B0206 + bl sub_81221AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B01E2 +_081B0206: + pop {r0} + bx r0 + thumb_func_end c2_811EBD0 + + thumb_func_start sub_81B020C +sub_81B020C: @ 81B020C + push {r4,lr} + sub sp, 0x4 + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0x16 + bls _081B0222 + b _081B0498 +_081B0222: + lsls r0, 2 + ldr r1, =_081B0234 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081B0234: + .4byte _081B0290 + .4byte _081B02AC + .4byte _081B02B2 + .4byte _081B02D4 + .4byte _081B02DA + .4byte _081B02EC + .4byte _081B02FE + .4byte _081B0310 + .4byte _081B0338 + .4byte _081B0354 + .4byte _081B0368 + .4byte _081B038C + .4byte _081B03A0 + .4byte _081B03A6 + .4byte _081B03B8 + .4byte _081B03BE + .4byte _081B03E0 + .4byte _081B0400 + .4byte _081B0414 + .4byte _081B0428 + .4byte _081B0430 + .4byte _081B044C + .4byte _081B0474 +_081B0290: + bl SetVBlankHBlankCallbacksToNull + bl sub_8121DA0 + bl clear_scheduled_bg_copies_to_vram + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .pool +_081B02AC: + bl remove_some_task + b _081B0484 +_081B02B2: + bl ResetPaletteFade + ldr r2, =gPaletteFade + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .pool +_081B02D4: + bl ResetSpriteData + b _081B0484 +_081B02DA: + bl FreeAllSpritePalettes + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .pool +_081B02EC: + bl sub_81221AC + lsls r0, 24 + cmp r0, 0 + beq _081B02F8 + b _081B0484 +_081B02F8: + bl ResetTasks + b _081B0484 +_081B02FE: + bl sub_81B209C + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .pool +_081B0310: + bl sub_81B0550 + lsls r0, 24 + cmp r0, 0 + bne _081B0322 + bl sub_81B04BC + movs r0, 0x1 + b _081B04B2 +_081B0322: + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + b _081B0484 + .pool +_081B0338: + bl sub_81B05C8 + lsls r0, 24 + cmp r0, 0 + bne _081B0344 + b _081B04B0 +_081B0344: + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .pool +_081B0354: + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0x8] + lsls r0, 26 + lsrs r0, 30 + bl sub_81B239C + b _081B0484 + .pool +_081B0368: + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0x8] + lsls r0, 26 + lsrs r0, 30 + bl sub_81B0740 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + b _081B0484 + .pool +_081B038C: + bl sub_81B5D30 + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .pool +_081B03A0: + bl sub_81B6040 + b _081B0484 +_081B03A6: + bl sub_81B6160 + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .pool +_081B03B8: + bl sub_80D2F04 + b _081B0484 +_081B03BE: + bl party_menu_add_per_mon_objects + lsls r0, 24 + cmp r0, 0 + bne _081B03CA + b _081B04B0 +_081B03CA: + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + b _081B0484 + .pool +_081B03E0: + bl sub_81B0DA0 + lsls r0, 24 + cmp r0, 0 + beq _081B04B0 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + b _081B0484 + .pool +_081B0400: + bl sub_81B0F28 + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .pool +_081B0414: + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 31 + lsrs r0, 31 + bl sub_81B2428 + b _081B0484 + .pool +_081B0428: + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + b _081B048C +_081B0430: + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + ldr r0, [r0] + movs r1, 0 + bl CreateTask + ldr r0, [r4] + ldrh r0, [r0, 0xA] + lsrs r0, 2 + bl display_pokemon_menu_message + b _081B0484 + .pool +_081B044C: + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl BlendPalettes + ldr r2, =gPaletteFade + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x8] + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .pool +_081B0474: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade +_081B0484: + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 +_081B048C: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _081B04B0 + .pool +_081B0498: + ldr r0, =sub_81B01CC + bl SetVBlankCallback + ldr r0, =sub_81B01B0 + bl SetMainCallback2 + movs r0, 0x1 + b _081B04B2 + .pool +_081B04B0: + movs r0, 0 +_081B04B2: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B020C + + thumb_func_start sub_81B04BC +sub_81B04BC: @ 81B04BC + push {lr} + sub sp, 0x4 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + ldr r0, =sub_81B04F8 + movs r1, 0 + bl CreateTask + ldr r0, =sub_81B01CC + bl SetVBlankCallback + ldr r0, =sub_81B01B0 + bl SetMainCallback2 + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B04BC + + thumb_func_start sub_81B04F8 +sub_81B04F8: @ 81B04F8 + 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 _081B051C + ldr r0, =gUnknown_0203CEC8 + ldr r0, [r0] + bl SetMainCallback2 + bl sub_81B06F4 + adds r0, r4, 0 + bl DestroyTask +_081B051C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B04F8 + + thumb_func_start reset_brm +reset_brm: @ 81B052C + ldr r0, =gUnknown_0203CEC4 + movs r1, 0 + str r1, [r0] + ldr r0, =gUnknown_0203CEE4 + str r1, [r0] + ldr r0, =gUnknown_0203CEDC + str r1, [r0] + ldr r0, =gUnknown_0203CEE0 + str r1, [r0] + bx lr + .pool + thumb_func_end reset_brm + + thumb_func_start sub_81B0550 +sub_81B0550: @ 81B0550 + push {r4,r5,lr} + ldr r5, =gUnknown_0203CEE4 + movs r4, 0x80 + lsls r4, 4 + adds r0, r4, 0 + bl Alloc + str r0, [r5] + cmp r0, 0 + beq _081B05C0 + movs r1, 0 + adds r2, r4, 0 + bl memset + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_086156B8 + movs r0, 0 + movs r2, 0x3 + bl InitBgsFromTemplates + ldr r1, [r5] + movs r0, 0x1 + bl SetBgTilemapBuffer + bl sub_8121E10 + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x1 + b _081B05C2 + .pool +_081B05C0: + movs r0, 0 +_081B05C2: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81B0550 + + thumb_func_start sub_81B05C8 +sub_81B05C8: @ 81B05C8 + push {r4,lr} + sub sp, 0x4 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x7 + bhi _081B06B0 + lsls r0, 2 + ldr r1, =_081B05F0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081B05F0: + .4byte _081B0610 + .4byte _081B0638 + .4byte _081B0658 + .4byte _081B0684 + .4byte _081B0688 + .4byte _081B068C + .4byte _081B0690 + .4byte _081B0694 +_081B0610: + ldr r4, =gUnknown_0203CEE0 + ldr r0, =gUnknown_08D967EC + mov r1, sp + bl malloc_and_decompress + adds r1, r0, 0 + str r1, [r4] + ldr r2, [sp] + lsls r2, 16 + lsrs r2, 16 + movs r0, 0x1 + movs r3, 0 + bl LoadBgTiles + b _081B069A + .pool +_081B0638: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _081B06B4 + ldr r0, =gUnknown_08D96BA0 + ldr r1, =gUnknown_0203CEE4 + ldr r1, [r1] + bl LZDecompressWram + b _081B069A + .pool +_081B0658: + ldr r0, =gUnknown_08D96AB4 + movs r2, 0xB0 + lsls r2, 1 + movs r1, 0 + bl LoadCompressedPalette + ldr r0, =gPlttBufferUnfaded + ldr r4, =gUnknown_0203CEC4 + ldr r1, [r4] + adds r1, 0x18 + movs r2, 0xB0 + bl CpuSet + ldr r1, [r4] + b _081B069E + .pool +_081B0684: + movs r0, 0x4 + b _081B0696 +_081B0688: + movs r0, 0x5 + b _081B0696 +_081B068C: + movs r0, 0x6 + b _081B0696 +_081B0690: + movs r0, 0x7 + b _081B0696 +_081B0694: + movs r0, 0x8 +_081B0696: + bl sub_81B06C0 +_081B069A: + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] +_081B069E: + movs r0, 0x86 + lsls r0, 2 + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _081B06B4 + .pool +_081B06B0: + movs r0, 0x1 + b _081B06B6 +_081B06B4: + movs r0, 0 +_081B06B6: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B05C8 + + thumb_func_start sub_81B06C0 +sub_81B06C0: @ 81B06C0 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 28 + ldr r5, =gPlttBufferUnfaded + 0x60 + lsrs r4, 23 + adds r1, r5, 0 + subs r1, 0x60 + adds r1, r4, r1 + adds r0, r5, 0 + movs r2, 0x10 + bl CpuSet + ldr r0, =gPlttBufferFaded + adds r4, r0 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x10 + bl CpuSet + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B06C0 + + thumb_func_start sub_81B06F4 +sub_81B06F4: @ 81B06F4 + push {lr} + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + cmp r0, 0 + beq _081B0702 + bl Free +_081B0702: + ldr r0, =gUnknown_0203CEE4 + ldr r0, [r0] + cmp r0, 0 + beq _081B070E + bl Free +_081B070E: + ldr r0, =gUnknown_0203CEE0 + ldr r0, [r0] + cmp r0, 0 + beq _081B071A + bl Free +_081B071A: + ldr r0, =gUnknown_0203CEDC + ldr r0, [r0] + cmp r0, 0 + beq _081B0726 + bl Free +_081B0726: + bl FreeAllWindowBuffers + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B06F4 + + thumb_func_start sub_81B0740 +sub_81B0740: @ 81B0740 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, =gUnknown_0203CEDC + movs r0, 0x60 + bl Alloc + str r0, [r4] + movs r5, 0 + lsls r0, r7, 1 + adds r0, r7 + lsls r0, 4 + mov r8, r0 + movs r6, 0xFF + mov r9, r4 +_081B0764: + ldr r2, [r4] + lsls r3, r5, 4 + adds r2, r3, r2 + ldr r0, =gUnknown_086156E4 + mov r12, r0 + str r0, [r2] + lsls r0, r5, 3 + ldr r1, =gUnknown_08615704 + adds r0, r1 + add r0, r8 + str r0, [r2, 0x4] + strb r5, [r2, 0x8] + ldr r1, [r4] + adds r1, r3, r1 + ldrb r0, [r1, 0x9] + orrs r0, r6 + strb r0, [r1, 0x9] + ldr r1, [r4] + adds r1, r3, r1 + ldrb r0, [r1, 0xA] + orrs r0, r6 + strb r0, [r1, 0xA] + ldr r1, [r4] + adds r1, r3, r1 + ldrb r0, [r1, 0xB] + orrs r0, r6 + strb r0, [r1, 0xB] + ldr r0, [r4] + adds r3, r0 + ldrb r0, [r3, 0xC] + orrs r0, r6 + strb r0, [r3, 0xC] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _081B0764 + mov r1, r9 + ldr r0, [r1] + mov r1, r12 + subs r1, 0x20 + str r1, [r0] + cmp r7, 0x3 + bne _081B07CC + str r1, [r0, 0x30] + b _081B07D2 + .pool +_081B07CC: + cmp r7, 0 + beq _081B07D2 + str r1, [r0, 0x10] +_081B07D2: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B0740 + + thumb_func_start sub_81B07E0 +sub_81B07E0: @ 81B07E0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gUnknown_0203CEC8 + ldrb r1, [r0, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x5 + bne _081B085C + cmp r5, 0x2 + bls _081B085C + adds r0, r5, 0 + bl sub_81B0CEC + ldr r0, =gUnknown_02022FF8 + subs r1, r5, 0x3 + lsls r1, 5 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _081B0828 + ldr r0, =gUnknown_0203CEDC + lsls r4, r5, 4 + ldr r0, [r0] + adds r0, r4 + movs r1, 0x40 + bl sub_81B2748 + b _081B0836 + .pool +_081B0828: + ldr r0, =gUnknown_0203CEDC + lsls r4, r5, 4 + ldr r0, [r0] + adds r0, r4 + movs r1, 0x8 + bl sub_81B2748 +_081B0836: + adds r5, r4, 0 + ldr r4, =gUnknown_0203CEDC + ldr r0, [r4] + adds r0, r5, r0 + ldrb r0, [r0, 0x8] + movs r1, 0x2 + bl CopyWindowToVram + ldr r0, [r4] + adds r0, r5, r0 + ldrb r0, [r0, 0x8] + bl PutWindowTilemap + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + b _081B093E + .pool +_081B085C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + bne _081B089C + ldr r4, =gUnknown_0203CEDC + ldr r0, [r4] + lsls r5, 4 + adds r0, r5, r0 + ldrb r0, [r0, 0x8] + bl sub_81B2720 + ldr r0, [r4] + adds r0, r5 + movs r1, 0x40 + bl sub_81B2748 + ldr r0, [r4] + adds r0, r5, r0 + ldrb r0, [r0, 0x8] + movs r1, 0x2 + bl CopyWindowToVram + b _081B092C + .pool +_081B089C: + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0x8] + movs r1, 0xF + ands r1, r0 + cmp r1, 0x7 + bne _081B08B4 + adds r0, r5, 0 + bl sub_81B0B60 + b _081B08F6 + .pool +_081B08B4: + cmp r1, 0x2 + bne _081B08C0 + adds r0, r5, 0 + bl sub_81B0B08 + b _081B08F6 +_081B08C0: + cmp r1, 0x4 + bne _081B08CC + adds r0, r5, 0 + bl sub_81B0A9C + b _081B08F6 +_081B08CC: + cmp r1, 0xB + bne _081B08D8 + adds r0, r5, 0 + bl sub_81B0B98 + b _081B08F6 +_081B08D8: + cmp r1, 0xC + bne _081B08E4 + adds r0, r5, 0 + bl sub_81B0BC4 + b _081B08F6 +_081B08E4: + adds r0, r5, 0 + bl sub_81B0BFC + lsls r0, 24 + cmp r0, 0 + bne _081B08F6 + adds r0, r5, 0 + bl sub_81B0948 +_081B08F6: + ldr r2, =gUnknown_0203CEC8 + ldrb r1, [r2, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x5 + bne _081B0910 + adds r0, r5, 0 + movs r1, 0 + bl sub_81B0FCC + b _081B092A + .pool +_081B0910: + movs r0, 0x9 + ldrsb r0, [r2, r0] + cmp r0, r5 + bne _081B0922 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_81B0FCC + b _081B092A +_081B0922: + adds r0, r5, 0 + movs r1, 0 + bl sub_81B0FCC +_081B092A: + lsls r5, 4 +_081B092C: + ldr r0, =gUnknown_0203CEDC + ldr r0, [r0] + adds r0, r5, r0 + ldrb r0, [r0, 0x8] + bl PutWindowTilemap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram +_081B093E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B07E0 + + thumb_func_start sub_81B0948 +sub_81B0948: @ 81B0948 + push {r4-r7,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x64 + adds r1, r4, 0 + muls r1, r0 + ldr r0, =gPlayerParty + adds r7, r1, r0 + adds r0, r7, 0 + movs r1, 0x2D + bl GetMonData + adds r2, r0, 0 + cmp r2, 0 + beq _081B09A0 + ldr r6, =gUnknown_0203CEDC + ldr r0, [r6] + lsls r5, r4, 4 + adds r0, r5, r0 + ldr r2, [r0] + ldrb r0, [r0, 0x8] + movs r1, 0 + str r1, [sp] + movs r1, 0x1 + str r1, [sp, 0x4] + ldr r4, [r2] + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl _call_via_r4 + ldr r1, [r6] + adds r1, r5 + adds r0, r7, 0 + movs r2, 0 + bl sub_81B2A70 + b _081B0A02 + .pool +_081B09A0: + ldr r5, =gUnknown_0203CEDC + ldr r0, [r5] + lsls r4, 4 + adds r0, r4, r0 + ldr r1, [r0] + ldrb r0, [r0, 0x8] + str r2, [sp] + str r2, [sp, 0x4] + ldr r6, [r1] + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl _call_via_r6 + ldr r1, [r5] + adds r1, r4 + adds r0, r7, 0 + movs r2, 0 + bl sub_81B2A70 + ldr r1, [r5] + adds r1, r4 + adds r0, r7, 0 + movs r2, 0 + bl sub_81B2AC8 + ldr r1, [r5] + adds r1, r4 + adds r0, r7, 0 + movs r2, 0 + bl sub_81B2B8C + ldr r1, [r5] + adds r1, r4 + adds r0, r7, 0 + movs r2, 0 + bl sub_81B2CD4 + ldr r1, [r5] + adds r1, r4 + adds r0, r7, 0 + movs r2, 0 + bl sub_81B2D74 + ldr r1, [r5] + adds r1, r4 + adds r0, r7, 0 + bl sub_81B2E28 +_081B0A02: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B0948 + + thumb_func_start sub_81B0A10 +sub_81B0A10: @ 81B0A10 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + movs r1, 0x64 + adds r2, r0, 0 + muls r2, r1 + ldr r1, =gPlayerParty + adds r6, r2, r1 + ldr r7, =gUnknown_0203CEDC + ldr r1, [r7] + lsls r5, r0, 4 + adds r1, r5, r1 + ldr r2, [r1] + ldrb r0, [r1, 0x8] + movs r1, 0 + str r1, [sp] + movs r1, 0x1 + str r1, [sp, 0x4] + ldr r4, [r2] + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl _call_via_r4 + ldr r1, [r7] + adds r1, r5 + adds r0, r6, 0 + movs r2, 0 + bl sub_81B2A70 + adds r0, r6, 0 + movs r1, 0x2D + bl GetMonData + cmp r0, 0 + bne _081B0A7C + ldr r1, [r7] + adds r1, r5 + adds r0, r6, 0 + movs r2, 0 + bl sub_81B2AC8 + ldr r1, [r7] + adds r1, r5 + adds r0, r6, 0 + movs r2, 0 + bl sub_81B2B8C +_081B0A7C: + ldr r1, [r7] + adds r1, r5 + mov r0, r8 + movs r2, 0 + bl sub_81B2FA8 + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B0A10 + + thumb_func_start sub_81B0A9C +sub_81B0A9C: @ 81B0A9C + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r6, =gUnknown_0203CEF8 + bl sub_81B85AC + lsls r0, 24 + cmp r0, 0 + bne _081B0AD6 + adds r0, r5, 0 + movs r1, 0x7 + bl sub_81B0A10 + b _081B0B02 + .pool +_081B0AC8: + adds r1, r4, 0x2 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl sub_81B0A10 + b _081B0B02 +_081B0AD6: + movs r4, 0 + b _081B0AEE +_081B0ADA: + adds r1, r6, r4 + ldrb r0, [r1] + cmp r0, 0 + beq _081B0AE8 + subs r0, 0x1 + cmp r0, r5 + beq _081B0AC8 +_081B0AE8: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081B0AEE: + bl sub_81B8830 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bcc _081B0ADA + adds r0, r5, 0 + movs r1, 0x1 + bl sub_81B0A10 +_081B0B02: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81B0A9C + + thumb_func_start sub_81B0B08 +sub_81B0B08: @ 81B0B08 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + adds r0, r1 + bl sub_80DAE0C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bhi _081B0B5A + lsls r0, 2 + ldr r1, =_081B0B34 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081B0B34: + .4byte _081B0B48 + .4byte _081B0B52 + .4byte _081B0B52 + .4byte _081B0B48 + .4byte _081B0B48 +_081B0B48: + adds r0, r4, 0 + movs r1, 0x7 + bl sub_81B0A10 + b _081B0B5A +_081B0B52: + adds r0, r4, 0 + movs r1, 0x6 + bl sub_81B0A10 +_081B0B5A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B0B08 + + thumb_func_start sub_81B0B60 +sub_81B0B60: @ 81B0B60 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + adds r0, r1 + bl GetNumberOfRelearnableMoves + lsls r0, 24 + cmp r0, 0 + bne _081B0B88 + adds r0, r4, 0 + movs r1, 0x9 + bl sub_81B0A10 + b _081B0B90 + .pool +_081B0B88: + adds r0, r4, 0 + movs r1, 0x8 + bl sub_81B0A10 +_081B0B90: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B0B60 + + thumb_func_start sub_81B0B98 +sub_81B0B98: @ 81B0B98 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_81B218C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B0BB6 + adds r0, r4, 0 + movs r1, 0x6 + bl sub_81B0A10 + b _081B0BBE +_081B0BB6: + adds r0, r4, 0 + movs r1, 0x7 + bl sub_81B0A10 +_081B0BBE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B0B98 + + thumb_func_start sub_81B0BC4 +sub_81B0BC4: @ 81B0BC4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xC + bl GetMonData + cmp r0, 0 + beq _081B0BEC + adds r0, r4, 0 + movs r1, 0xB + bl sub_81B0A10 + b _081B0BF4 + .pool +_081B0BEC: + adds r0, r4, 0 + movs r1, 0xC + bl sub_81B0A10 +_081B0BF4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B0BC4 + + thumb_func_start sub_81B0BFC +sub_81B0BFC: @ 81B0BFC + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =gPlayerParty + adds r6, r1, r0 + ldr r0, =gScriptItemId + ldrh r4, [r0] + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0xB] + cmp r0, 0xC + bne _081B0C40 + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] + ldr r0, =gSpecialVar_0x8005 + ldrb r2, [r0] + adds r0, r5, 0 + movs r1, 0 + bl sub_81B0C94 + b _081B0C8A + .pool +_081B0C40: + cmp r0, 0x3 + bne _081B0C56 + adds r0, r4, 0 + bl CheckIfItemIsTMHMOrEvolutionStone + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B0C5A + cmp r0, 0x2 + beq _081B0C66 +_081B0C56: + movs r0, 0 + b _081B0C8C +_081B0C5A: + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_81B0C94 + b _081B0C8A +_081B0C66: + adds r0, r6, 0 + movs r1, 0x2D + bl GetMonData + cmp r0, 0 + bne _081B0C82 + adds r0, r6, 0 + movs r1, 0x3 + adds r2, r4, 0 + bl GetEvolutionTargetSpecies + lsls r0, 16 + cmp r0, 0 + bne _081B0C56 +_081B0C82: + adds r0, r5, 0 + movs r1, 0 + bl sub_81B0A10 +_081B0C8A: + movs r0, 0x1 +_081B0C8C: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81B0BFC + + thumb_func_start sub_81B0C94 +sub_81B0C94: @ 81B0C94 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x64 + muls r0, r4 + ldr r3, =gPlayerParty + adds r0, r3 + bl sub_81B22D8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _081B0CD2 + cmp r0, 0x2 + bgt _081B0CC4 + cmp r0, 0x1 + beq _081B0CC8 + b _081B0CDC + .pool +_081B0CC4: + cmp r0, 0x3 + bne _081B0CDC +_081B0CC8: + adds r0, r4, 0 + movs r1, 0x9 + bl sub_81B0A10 + b _081B0CE4 +_081B0CD2: + adds r0, r4, 0 + movs r1, 0xA + bl sub_81B0A10 + b _081B0CE4 +_081B0CDC: + adds r0, r4, 0 + movs r1, 0x8 + bl sub_81B0A10 +_081B0CE4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B0C94 + + thumb_func_start sub_81B0CEC +sub_81B0CEC: @ 81B0CEC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0203CEDC + lsls r2, r0, 4 + ldr r1, [r1] + adds r6, r1, r2 + subs r0, 0x3 + lsls r0, 24 + ldr r5, =gUnknown_02022FF8 + lsrs r0, 19 + mov r8, r0 + adds r7, r0, r5 + ldrh r0, [r7] + cmp r0, 0 + bne _081B0D24 + ldrb r0, [r6, 0x8] + bl sub_81B2720 + b _081B0D8E + .pool +_081B0D24: + ldr r2, [r6] + ldrb r0, [r6, 0x8] + movs r1, 0 + str r1, [sp] + str r1, [sp, 0x4] + ldr r4, [r2] + movs r2, 0 + movs r3, 0 + bl _call_via_r4 + ldr r4, =gStringVar1 + adds r5, 0x4 + add r5, r8 + adds r0, r4, 0 + adds r1, r5, 0 + bl StringCopy + adds r0, r4, 0 + bl StringGetEnd10 + adds r0, r4, 0 + bl sub_81DB52C + ldrb r0, [r6, 0x8] + ldr r3, [r6] + adds r3, 0x4 + adds r1, r4, 0 + movs r2, 0 + bl sub_81B2A3C + ldrb r0, [r7, 0xF] + adds r1, r6, 0 + bl sub_81B2B40 + ldrb r0, [r7, 0x1C] + ldrh r1, [r7] + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_81B2BF4 + ldrh r0, [r7, 0x10] + adds r1, r6, 0 + bl sub_81B2D3C + ldrh r0, [r7, 0x12] + adds r1, r6, 0 + bl sub_81B2DDC + ldrh r0, [r7, 0x10] + ldrh r1, [r7, 0x12] + adds r2, r6, 0 + bl sub_81B2E64 +_081B0D8E: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B0CEC + + thumb_func_start sub_81B0DA0 +sub_81B0DA0: @ 81B0DA0 + push {r4,r5,lr} + ldr r5, =gUnknown_0203CEC4 + ldr r0, [r5] + movs r4, 0x86 + lsls r4, 2 + adds r0, r4 + ldrb r0, [r0] + bl sub_81B07E0 + ldr r1, [r5] + adds r1, r4 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + beq _081B0DCC + movs r0, 0 + b _081B0DCE + .pool +_081B0DCC: + movs r0, 0x1 +_081B0DCE: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81B0DA0 + + thumb_func_start sub_81B0DD4 +sub_81B0DD4: @ 81B0DD4 + lsls r0, 16 + ldr r1, =gUnknown_0203CEE0 + lsrs r0, 11 + ldr r1, [r1] + adds r1, r0 + adds r0, r1, 0 + bx lr + .pool + thumb_func_end sub_81B0DD4 + + thumb_func_start party_menu_add_per_mon_objects_internal +party_menu_add_per_mon_objects_internal: @ 81B0DE8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =gUnknown_0203CEC8 + ldrb r1, [r0, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x5 + bne _081B0E98 + cmp r7, 0x2 + bls _081B0E98 + subs r0, r7, 0x3 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r0, =gUnknown_02022FF8 + mov r9, r0 + mov r2, r10 + lsls r2, 5 + mov r8, r2 + mov r6, r8 + add r6, r9 + ldrh r0, [r6] + cmp r0, 0 + beq _081B0EDC + mov r1, r9 + adds r1, 0x18 + add r1, r8 + ldr r1, [r1] + ldr r4, =gUnknown_0203CEDC + lsls r5, r7, 4 + ldr r2, [r4] + adds r2, r5 + movs r3, 0 + str r3, [sp] + bl party_menu_link_mon_icon_anim + ldrh r0, [r6] + ldrh r1, [r6, 0x2] + ldr r2, [r4] + adds r2, r5 + bl party_menu_link_mon_held_item_object + ldrh r0, [r6] + ldr r1, [r4] + adds r1, r5 + bl party_menu_link_mon_pokeball_object + ldrh r0, [r6, 0x10] + cmp r0, 0 + bne _081B0E68 + movs r3, 0x7 + b _081B0E78 + .pool +_081B0E68: + mov r0, r9 + adds r0, 0x14 + add r0, r8 + ldr r0, [r0] + bl pokemon_ailments_get_primary + lsls r0, 24 + lsrs r3, r0, 24 +_081B0E78: + ldr r1, =gUnknown_02022FF8 + mov r2, r10 + lsls r0, r2, 5 + adds r0, r1 + ldrh r0, [r0] + ldr r1, =gUnknown_0203CEDC + ldr r2, [r1] + adds r2, r5 + adds r1, r3, 0 + bl party_menu_link_mon_status_condition_object + b _081B0EDC + .pool +_081B0E98: + movs r0, 0x64 + adds r1, r7, 0 + muls r1, r0 + ldr r0, =gPlayerParty + adds r6, r1, r0 + adds r0, r6, 0 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B0EDC + ldr r4, =gUnknown_0203CEDC + lsls r5, r7, 4 + ldr r1, [r4] + adds r1, r5 + adds r0, r6, 0 + adds r2, r7, 0 + bl party_menu_icon_anim + ldr r1, [r4] + adds r1, r5 + adds r0, r6, 0 + bl party_menu_held_item_object + ldr r1, [r4] + adds r1, r5 + adds r0, r6, 0 + bl party_menu_pokeball_object + ldr r1, [r4] + adds r1, r5 + adds r0, r6, 0 + bl party_menu_status_condition_object +_081B0EDC: + 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 party_menu_add_per_mon_objects_internal + + thumb_func_start party_menu_add_per_mon_objects +party_menu_add_per_mon_objects: @ 81B0EF4 + push {r4,r5,lr} + ldr r5, =gUnknown_0203CEC4 + ldr r0, [r5] + movs r4, 0x86 + lsls r4, 2 + adds r0, r4 + ldrb r0, [r0] + bl party_menu_add_per_mon_objects_internal + ldr r1, [r5] + adds r1, r4 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + beq _081B0F20 + movs r0, 0 + b _081B0F22 + .pool +_081B0F20: + movs r0, 0x1 +_081B0F22: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end party_menu_add_per_mon_objects + + thumb_func_start sub_81B0F28 +sub_81B0F28: @ 81B0F28 + push {r4,lr} + sub sp, 0xC + ldr r0, =gUnknown_0203CEC8 + ldrb r1, [r0, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x5 + bne _081B0F54 + movs r0, 0x7 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x1 + str r0, [sp, 0x8] + movs r1, 0xE + movs r2, 0x17 + movs r3, 0x11 + bl FillBgTilemapBufferRect + b _081B0FBC + .pool +_081B0F54: + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + ldrb r0, [r0, 0x8] + lsls r0, 31 + cmp r0, 0 + beq _081B0F94 + movs r0, 0xBF + movs r1, 0x88 + bl sub_81B5F74 + ldr r3, [r4] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x7F + ands r0, r1 + lsls r0, 4 + ldrh r2, [r3, 0x8] + ldr r1, =0xfffff80f + ands r1, r2 + orrs r1, r0 + strh r1, [r3, 0x8] + bl sub_81B120C + movs r0, 0xBF + movs r1, 0x98 + bl sub_81B5F74 + b _081B0F9C + .pool +_081B0F94: + movs r0, 0xC6 + movs r1, 0x94 + bl sub_81B5F34 +_081B0F9C: + ldr r3, [r4] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x7F + ands r0, r1 + lsls r0, 11 + ldr r1, [r3, 0x8] + ldr r2, =0xfffc07ff + ands r1, r2 + orrs r1, r0 + str r1, [r3, 0x8] + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0x9] + movs r1, 0x1 + bl sub_81B0FCC +_081B0FBC: + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B0F28 + + thumb_func_start sub_81B0FCC +sub_81B0FCC: @ 81B0FCC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + cmp r7, 0x6 + beq _081B1038 + cmp r7, 0x7 + beq _081B1074 + movs r0, 0x64 + muls r0, r7 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B10E8 + ldr r6, =gUnknown_0203CEDC + lsls r5, r7, 4 + ldr r4, [r6] + adds r4, r5 + adds r0, r7, 0 + mov r1, r8 + bl sub_81B10F8 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_81B2748 + ldr r0, [r6] + adds r0, r5, r0 + ldrb r0, [r0, 0x9] + mov r1, r8 + bl sub_81B5B6C + ldr r0, [r6] + adds r5, r0 + ldrb r0, [r5, 0xB] + mov r1, r8 + bl sub_81B5F98 + b _081B10E8 + .pool +_081B1038: + mov r0, r8 + cmp r0, 0 + bne _081B1052 + movs r0, 0x2 + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r1, 0x17 + movs r2, 0x10 + movs r3, 0x7 + bl sub_8199C30 + b _081B1064 +_081B1052: + movs r0, 0x2 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x1 + movs r1, 0x17 + movs r2, 0x10 + movs r3, 0x7 + bl sub_8199C30 +_081B1064: + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrh r0, [r0, 0x8] + lsls r0, 21 + b _081B10DA + .pool +_081B1074: + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 31 + cmp r0, 0 + bne _081B10A6 + mov r0, r8 + cmp r0, 0 + bne _081B1098 + movs r0, 0x2 + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r1, 0x17 + movs r2, 0x11 + b _081B10B8 + .pool +_081B1098: + movs r0, 0x2 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x1 + movs r1, 0x17 + movs r2, 0x11 + b _081B10B8 +_081B10A6: + mov r0, r8 + cmp r0, 0 + bne _081B10C0 + movs r0, 0x2 + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r1, 0x17 + movs r2, 0x12 +_081B10B8: + movs r3, 0x7 + bl sub_8199C30 + b _081B10D2 +_081B10C0: + movs r0, 0x2 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x1 + movs r1, 0x17 + movs r2, 0x12 + movs r3, 0x7 + bl sub_8199C30 +_081B10D2: + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldr r0, [r0, 0x8] + lsls r0, 14 +_081B10DA: + lsrs r0, 25 + mov r1, r8 + bl sub_81B5F98 + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram +_081B10E8: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B0FCC + + thumb_func_start sub_81B10F8 +sub_81B10F8: @ 81B10F8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r1, 24 + movs r4, 0 + cmp r1, 0x1 + bne _081B110A + movs r4, 0x1 +_081B110A: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x39 + bl GetMonData + cmp r0, 0 + bne _081B1120 + movs r0, 0x2 + orrs r4, r0 +_081B1120: + adds r0, r5, 0 + bl sub_81B118C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B1136 + movs r0, 0x8 + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_081B1136: + ldr r0, =gUnknown_0203CEC8 + ldrb r1, [r0, 0xB] + adds r2, r0, 0 + cmp r1, 0x9 + bne _081B1148 + movs r0, 0x10 + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_081B1148: + cmp r1, 0x8 + bne _081B1164 + movs r0, 0x9 + ldrsb r0, [r2, r0] + cmp r5, r0 + beq _081B115C + movs r0, 0xA + ldrsb r0, [r2, r0] + cmp r5, r0 + bne _081B1164 +_081B115C: + movs r0, 0x4 + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_081B1164: + ldrb r0, [r2, 0xB] + cmp r0, 0xA + bne _081B117A + movs r0, 0x9 + ldrsb r0, [r2, r0] + cmp r5, r0 + bne _081B117A + movs r0, 0x20 + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_081B117A: + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B10F8 + + thumb_func_start sub_81B118C +sub_81B118C: @ 81B118C + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =gUnknown_0203CEC8 + ldrb r1, [r0, 0x8] + movs r0, 0x30 + ands r0, r1 + cmp r0, 0x20 + bne _081B11B4 + cmp r2, 0x1 + beq _081B11AA + cmp r2, 0x4 + beq _081B11AA + cmp r2, 0x5 + bne _081B11B4 +_081B11AA: + movs r0, 0x1 + b _081B11F8 + .pool +_081B11B4: + cmp r2, 0x2 + bhi _081B11F6 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _081B11F6 + ldr r0, =gMain + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B11F6 + adds r0, r2, 0 + bl sub_81B8F38 + ldr r1, =gBattleStruct + ldr r1, [r1] + movs r2, 0xA8 + lsls r2, 2 + adds r1, r2 + ldrb r1, [r1] + lsls r0, 24 + lsrs r0, 24 + asrs r1, r0 + movs r0, 0x1 + ands r1, r0 + cmp r1, 0 + bne _081B11F8 +_081B11F6: + movs r0, 0 +_081B11F8: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B118C + + thumb_func_start sub_81B120C +sub_81B120C: @ 81B120C + push {r4-r6,lr} + sub sp, 0xC + ldr r1, =gUnknown_086157C4 + movs r6, 0x7 + str r6, [sp] + movs r5, 0x2 + str r5, [sp, 0x4] + movs r4, 0x11 + str r4, [sp, 0x8] + movs r0, 0x1 + movs r2, 0x17 + movs r3, 0x10 + bl CopyToBgTilemapBufferRect_ChangePalette + ldr r1, =gUnknown_086157E0 + str r6, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x1 + movs r2, 0x17 + movs r3, 0x12 + bl CopyToBgTilemapBufferRect_ChangePalette + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B120C + + thumb_func_start sub_81B1250 +sub_81B1250: @ 81B1250 + push {lr} + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x49 + ands r0, r1 + cmp r0, 0x49 + bne _081B1280 + ldr r0, =gMain + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B1280 + movs r0, 0x1 + b _081B1282 + .pool +_081B1280: + movs r0, 0 +_081B1282: + pop {r1} + bx r1 + thumb_func_end sub_81B1250 + + thumb_func_start sub_81B1288 +sub_81B1288: @ 81B1288 + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r1, 0 + movs r0, 0x64 + bl Alloc + adds r5, r0, 0 + adds r1, r4, 0 + movs r2, 0x64 + bl memcpy + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0x64 + bl memcpy + adds r0, r6, 0 + adds r1, r5, 0 + movs r2, 0x64 + bl memcpy + adds r0, r5, 0 + bl Free + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81B1288 + + thumb_func_start sub_81B12C0 +sub_81B12C0: @ 81B12C0 + 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, =c3_0811FAB4 + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B12C0 + + thumb_func_start c3_0811FAB4 +c3_0811FAB4: @ 81B12F8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B134C + ldr r4, =gUnknown_0203CEC8 + ldrb r1, [r4, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x1 + bne _081B131A + bl sub_81B9080 +_081B131A: + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldr r0, [r0, 0x4] + cmp r0, 0 + beq _081B1338 + bl SetMainCallback2 + b _081B133E + .pool +_081B1338: + ldr r0, [r4] + bl SetMainCallback2 +_081B133E: + bl ResetSpriteData + bl sub_81B06F4 + adds r0, r5, 0 + bl DestroyTask +_081B134C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end c3_0811FAB4 + + thumb_func_start brm_get_pokemon_selection +brm_get_pokemon_selection: @ 81B1354 + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0x9] + bx lr + .pool + thumb_func_end brm_get_pokemon_selection + + thumb_func_start sub_81B1360 +sub_81B1360: @ 81B1360 + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0x8] + lsls r0, 28 + lsrs r0, 28 + bx lr + .pool + thumb_func_end sub_81B1360 + + thumb_func_start sub_81B1370 +sub_81B1370: @ 81B1370 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B13E0 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B13E0 + bl sub_81B13EC + adds r4, r0, 0 + bl sub_81B1760 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + beq _081B13C0 + cmp r0, 0x2 + bgt _081B13B0 + cmp r0, 0x1 + beq _081B13B6 + b _081B13E0 + .pool +_081B13B0: + cmp r0, 0x8 + beq _081B13CA + b _081B13E0 +_081B13B6: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81B140C + b _081B13E0 +_081B13C0: + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_81B15D0 + b _081B13E0 +_081B13CA: + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 31 + cmp r0, 0 + beq _081B13E0 + movs r0, 0x5 + bl PlaySE + bl sub_81B4F88 +_081B13E0: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B1370 + + thumb_func_start sub_81B13EC +sub_81B13EC: @ 81B13EC + push {lr} + ldr r0, =gUnknown_0203CEC8 + ldrb r1, [r0, 0xB] + cmp r1, 0x8 + beq _081B13FA + cmp r1, 0xA + bne _081B1404 +_081B13FA: + adds r0, 0xA + b _081B1406 + .pool +_081B1404: + adds r0, 0x9 +_081B1406: + pop {r1} + bx r1 + thumb_func_end sub_81B13EC + + thumb_func_start sub_81B140C +sub_81B140C: @ 81B140C + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0x6 + bne _081B142C + ldr r0, =gUnknown_0203CEC8 + ldr r1, [r0, 0x4] + adds r0, r5, 0 + bl _call_via_r1 + b _081B159E + .pool +_081B142C: + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0xB] + subs r0, 0x3 + cmp r0, 0xA + bls _081B1438 + b _081B1592 +_081B1438: + lsls r0, 2 + ldr r1, =_081B144C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081B144C: + .4byte _081B149C + .4byte _081B1592 + .4byte _081B1538 + .4byte _081B1538 + .4byte _081B1510 + .4byte _081B1560 + .4byte _081B1592 + .4byte _081B1478 + .4byte _081B156E + .4byte _081B14E8 + .4byte _081B157C +_081B1478: + adds r0, r4, 0 + bl sub_81B15A4 + lsls r0, 24 + cmp r0, 0 + bne _081B1486 + b _081B159E +_081B1486: + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + adds r0, 0xD + bl sub_81B302C + adds r0, r5, 0 + bl sub_81615A8 + b _081B159E + .pool +_081B149C: + adds r0, r4, 0 + bl sub_81B15A4 + lsls r0, 24 + cmp r0, 0 + bne _081B14AA + b _081B159E +_081B14AA: + ldr r0, =gUnknown_0203CEC8 + ldrb r1, [r0, 0x8] + movs r0, 0xF + ands r0, r1 + ldr r2, =gUnknown_0203CEC4 + cmp r0, 0x1 + bne _081B14BE + ldr r1, [r2] + ldr r0, =sub_81B9140 + str r0, [r1, 0x4] +_081B14BE: + ldr r0, [r2] + adds r0, 0xD + bl sub_81B302C + ldr r0, =gUnknown_03006328 + ldr r1, =sub_81B6794 + ldr r2, [r0] + adds r0, r5, 0 + bl _call_via_r2 + b _081B159E + .pool +_081B14E8: + adds r0, r4, 0 + bl sub_81B15A4 + lsls r0, 24 + cmp r0, 0 + beq _081B159E + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + adds r0, 0xD + bl sub_81B302C + adds r0, r5, 0 + bl sub_81B7E4C + b _081B159E + .pool +_081B1510: + adds r0, r4, 0 + bl sub_81B15A4 + lsls r0, 24 + cmp r0, 0 + beq _081B159E + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + adds r0, 0xD + bl sub_81B302C + adds r0, r5, 0 + bl sub_81B8474 + b _081B159E + .pool +_081B1538: + adds r0, r4, 0 + bl sub_81B15A4 + lsls r0, 24 + cmp r0, 0 + beq _081B159E + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + adds r0, 0xD + bl sub_81B302C + adds r0, r5, 0 + bl sub_81B7FAC + b _081B159E + .pool +_081B1560: + movs r0, 0x5 + bl PlaySE + adds r0, r5, 0 + bl sub_81B3938 + b _081B159E +_081B156E: + movs r0, 0x5 + bl PlaySE + adds r0, r5, 0 + bl sub_81B12C0 + b _081B159E +_081B157C: + adds r0, r4, 0 + bl sub_81B15A4 + lsls r0, 24 + cmp r0, 0 + beq _081B159E + ldrb r1, [r4] + adds r0, r5, 0 + bl sub_81B21AC + b _081B159E +_081B1592: + movs r0, 0x5 + bl PlaySE + adds r0, r5, 0 + bl sub_81B36FC +_081B159E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81B140C + + thumb_func_start sub_81B15A4 +sub_81B15A4: @ 81B15A4 + push {lr} + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x2D + bl GetMonData + cmp r0, 0x1 + beq _081B15C4 + movs r0, 0x1 + b _081B15CC + .pool +_081B15C4: + movs r0, 0x20 + bl PlaySE + movs r0, 0 +_081B15CC: + pop {r1} + bx r1 + thumb_func_end sub_81B15A4 + + thumb_func_start sub_81B15D0 +sub_81B15D0: @ 81B15D0 + push {r4,r5,lr} + adds r5, r1, 0 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0xB] + cmp r0, 0x8 + beq _081B1602 + cmp r0, 0x8 + bgt _081B15F0 + cmp r0, 0x1 + beq _081B15FA + b _081B161E + .pool +_081B15F0: + cmp r0, 0xA + beq _081B1602 + cmp r0, 0xD + beq _081B1610 + b _081B161E +_081B15FA: + movs r0, 0x20 + bl PlaySE + b _081B1652 +_081B1602: + movs r0, 0x5 + bl PlaySE + adds r0, r4, 0 + bl sub_81B407C + b _081B1652 +_081B1610: + movs r0, 0x5 + bl PlaySE + adds r0, r4, 0 + bl sub_81B2210 + b _081B1652 +_081B161E: + movs r0, 0x5 + bl PlaySE + adds r0, r4, 0 + bl sub_81B1660 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B1652 + bl sub_81221AC + lsls r0, 24 + cmp r0, 0 + bne _081B1642 + ldr r1, =gSpecialVar_0x8004 + movs r0, 0x7 + strh r0, [r1] +_081B1642: + ldr r0, =gUnknown_0203CEE8 + movs r1, 0 + strb r1, [r0] + movs r0, 0x7 + strb r0, [r5] + adds r0, r4, 0 + bl sub_81B12C0 +_081B1652: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B15D0 + + thumb_func_start sub_81B1660 +sub_81B1660: @ 81B1660 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0x8] + movs r1, 0xF + ands r1, r0 + cmp r1, 0x2 + bne _081B1680 + ldr r5, =gUnknown_085EA110 + b _081B168A + .pool +_081B1680: + cmp r1, 0x4 + bne _081B168A + bl sub_81B88BC + adds r5, r0, 0 +_081B168A: + cmp r5, 0 + beq _081B16CC + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + adds r0, 0xD + bl sub_81B302C + ldr r4, =gStringVar4 + adds r0, r4, 0 + adds r1, r5, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B16D4 + str r1, [r0] + movs r0, 0x1 + b _081B16CE + .pool +_081B16CC: + movs r0, 0 +_081B16CE: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81B1660 + + thumb_func_start sub_81B16D4 +sub_81B16D4: @ 81B16D4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B16F8 + bl sub_81B334C + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B1708 + str r0, [r1] +_081B16F8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B16D4 + + thumb_func_start sub_81B1708 +sub_81B1708: @ 81B1708 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B172E + cmp r1, 0 + bgt _081B1728 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B174C + b _081B1758 +_081B1728: + cmp r1, 0x1 + beq _081B1752 + b _081B1758 +_081B172E: + ldr r0, =gUnknown_0203CEE8 + strb r1, [r0] + ldr r1, =gUnknown_0203CEC8 + movs r0, 0x7 + strb r0, [r1, 0x9] + bl sub_81B8558 + adds r0, r4, 0 + bl sub_81B12C0 + b _081B1758 + .pool +_081B174C: + movs r0, 0x5 + bl PlaySE +_081B1752: + adds r0, r4, 0 + bl sub_81B1C1C +_081B1758: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B1708 + + thumb_func_start sub_81B1760 +sub_81B1760: @ 81B1760 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gMain + ldrh r1, [r0, 0x30] + adds r3, r0, 0 + cmp r1, 0x20 + beq _081B178E + cmp r1, 0x20 + bgt _081B177C + cmp r1, 0x10 + beq _081B1792 + b _081B1796 + .pool +_081B177C: + cmp r1, 0x40 + beq _081B1786 + cmp r1, 0x80 + beq _081B178A + b _081B1796 +_081B1786: + movs r1, 0xFF + b _081B17B2 +_081B178A: + movs r1, 0x1 + b _081B17B2 +_081B178E: + movs r1, 0xFE + b _081B17B2 +_081B1792: + movs r1, 0x2 + b _081B17B2 +_081B1796: + bl sub_812210C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B17AA + cmp r0, 0x2 + beq _081B17AE + movs r1, 0 + b _081B17B0 +_081B17AA: + movs r1, 0xFF + b _081B17B0 +_081B17AE: + movs r1, 0x1 +_081B17B0: + ldr r3, =gMain +_081B17B2: + ldrh r2, [r3, 0x2E] + movs r0, 0x8 + ands r0, r2 + cmp r0, 0 + beq _081B17C4 + movs r0, 0x8 + b _081B17F0 + .pool +_081B17C4: + lsls r0, r1, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B17D6 + adds r0, r4, 0 + bl sub_81B17F8 + movs r0, 0 + b _081B17F0 +_081B17D6: + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + beq _081B17EA + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0x7 + bne _081B17EA + movs r0, 0x2 + b _081B17F0 +_081B17EA: + ldrh r1, [r3, 0x2E] + movs r0, 0x3 + ands r0, r1 +_081B17F0: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B1760 + + thumb_func_start sub_81B17F8 +sub_81B17F8: @ 81B17F8 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldrb r4, [r5] + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0x8] + lsls r0, 26 + lsrs r0, 30 + cmp r0, 0 + bne _081B1820 + lsls r1, 24 + asrs r1, 24 + adds r0, r5, 0 + bl sub_81B1854 + b _081B182A + .pool +_081B1820: + lsls r1, 24 + asrs r1, 24 + adds r0, r5, 0 + bl sub_81B195C +_081B182A: + movs r1, 0 + ldrsb r1, [r5, r1] + lsls r4, 24 + asrs r0, r4, 24 + cmp r1, r0 + beq _081B184C + movs r0, 0x5 + bl PlaySE + lsrs r0, r4, 24 + movs r1, 0 + bl sub_81B0FCC + ldrb r0, [r5] + movs r1, 0x1 + bl sub_81B0FCC +_081B184C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81B17F8 + + thumb_func_start sub_81B1854 +sub_81B1854: @ 81B1854 + push {r4,lr} + adds r4, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B187A + cmp r1, r0 + bgt _081B1870 + subs r0, 0x1 + cmp r1, r0 + beq _081B1924 + b _081B1952 +_081B1870: + cmp r1, 0x1 + beq _081B18C0 + cmp r1, 0x2 + beq _081B18F8 + b _081B1952 +_081B187A: + ldrb r0, [r4] + movs r1, 0 + ldrsb r1, [r4, r1] + cmp r1, 0 + bne _081B1888 + movs r0, 0x7 + b _081B1950 +_081B1888: + cmp r1, 0x6 + bne _081B1898 + ldr r0, =gPlayerPartyCount + ldrb r0, [r0] + subs r0, 0x1 + b _081B1950 + .pool +_081B1898: + cmp r1, 0x7 + bne _081B18BC + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 31 + cmp r0, 0 + beq _081B18B0 + movs r0, 0x6 + b _081B1950 + .pool +_081B18B0: + ldr r0, =gPlayerPartyCount + ldrb r0, [r0] + subs r0, 0x1 + b _081B1950 + .pool +_081B18BC: + subs r0, 0x1 + b _081B1950 +_081B18C0: + ldrb r2, [r4] + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0x7 + beq _081B194E + movs r1, 0 + ldrsb r1, [r4, r1] + ldr r0, =gPlayerPartyCount + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + bne _081B18F4 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 31 + cmp r0, 0 + beq _081B18F0 + movs r0, 0x6 + b _081B1950 + .pool +_081B18F0: + movs r0, 0x7 + b _081B1950 +_081B18F4: + adds r0, r2, 0x1 + b _081B1950 +_081B18F8: + ldr r0, =gPlayerPartyCount + ldrb r0, [r0] + cmp r0, 0x1 + beq _081B1952 + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0 + bne _081B1952 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 28 + lsrs r0, 29 + cmp r0, 0 + bne _081B1950 + movs r0, 0x1 + b _081B1950 + .pool +_081B1924: + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0 + beq _081B1952 + cmp r0, 0x6 + beq _081B1952 + cmp r0, 0x7 + beq _081B1952 + ldr r0, =gUnknown_0203CEC4 + ldr r3, [r0] + movs r1, 0 + ldrsb r1, [r4, r1] + movs r0, 0x7 + ands r1, r0 + lsls r1, 1 + ldrb r2, [r3, 0x8] + movs r0, 0xF + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x8] +_081B194E: + movs r0, 0 +_081B1950: + strb r0, [r4] +_081B1952: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B1854 + + thumb_func_start sub_81B195C +sub_81B195C: @ 81B195C + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r2, r1, 24 + asrs r5, r1, 24 + movs r6, 0x1 + negs r6, r6 + cmp r5, r6 + beq _081B1988 + cmp r5, r6 + bgt _081B197E + movs r0, 0x2 + negs r0, r0 + cmp r5, r0 + bne _081B197C + b _081B1A9C +_081B197C: + b _081B1AF4 +_081B197E: + cmp r5, 0x1 + beq _081B19E4 + cmp r5, 0x2 + beq _081B1A24 + b _081B1AF4 +_081B1988: + ldrb r1, [r4] + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0 + bne _081B1996 + movs r0, 0x7 + b _081B1AF2 +_081B1996: + cmp r0, 0x6 + bne _081B19A8 + ldr r0, =gPlayerPartyCount + ldrb r0, [r0] + subs r0, 0x1 + b _081B1AF2 + .pool +_081B19A8: + cmp r0, 0x7 + bne _081B19C4 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 31 + cmp r0, 0 + beq _081B19C0 + movs r0, 0x6 + b _081B1AF2 + .pool +_081B19C0: + subs r0, r1, 0x1 + strb r0, [r4] +_081B19C4: + movs r0, 0 + ldrsb r0, [r4, r0] + lsls r1, r2, 24 + asrs r1, 24 + bl sub_81B1B00 + lsls r0, 24 + lsrs r2, r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _081B19E0 + b _081B1AF4 +_081B19E0: + strb r2, [r4] + b _081B1AF4 +_081B19E4: + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0x6 + bne _081B19F0 + movs r0, 0x7 + b _081B1AF2 +_081B19F0: + cmp r0, 0x7 + bne _081B19F8 + movs r0, 0 + b _081B1AF2 +_081B19F8: + movs r0, 0 + ldrsb r0, [r4, r0] + movs r1, 0x1 + bl sub_81B1B00 + lsls r0, 24 + lsrs r2, r0, 24 + asrs r0, 24 + cmp r0, r6 + bne _081B19E0 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 31 + cmp r0, 0 + beq _081B1A20 + movs r0, 0x6 + b _081B1AF2 + .pool +_081B1A20: + movs r0, 0x7 + b _081B1AF2 +_081B1A24: + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0 + bne _081B1A5C + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 28 + lsrs r6, r0, 29 + cmp r6, 0x3 + bne _081B1A54 + ldr r0, =gPlayerParty + 300 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B1AF4 + strb r6, [r4] + b _081B1AF4 + .pool +_081B1A54: + ldr r0, =gPlayerParty + 200 + b _081B1A70 + .pool +_081B1A5C: + cmp r0, 0x1 + bne _081B1AF4 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 28 + lsrs r5, r0, 29 + cmp r5, 0x5 + bne _081B1A88 + ldr r0, =gPlayerParty + 500 +_081B1A70: + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B1AF4 + strb r5, [r4] + b _081B1AF4 + .pool +_081B1A88: + ldr r0, =gPlayerParty + 400 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B1AF4 + movs r0, 0x4 + b _081B1AF2 + .pool +_081B1A9C: + ldrb r1, [r4] + subs r0, r1, 0x2 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _081B1ACC + ldr r0, =gUnknown_0203CEC4 + ldr r3, [r0] + movs r1, 0 + ldrsb r1, [r4, r1] + movs r0, 0x7 + ands r1, r0 + lsls r1, 1 + ldrb r2, [r3, 0x8] + movs r0, 0xF + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x8] + movs r0, 0 + b _081B1AF2 + .pool +_081B1ACC: + subs r0, r1, 0x4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _081B1AF4 + ldr r0, =gUnknown_0203CEC4 + ldr r3, [r0] + movs r1, 0 + ldrsb r1, [r4, r1] + movs r0, 0x7 + ands r1, r0 + lsls r1, 1 + ldrb r2, [r3, 0x8] + movs r0, 0xF + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x8] + movs r0, 0x1 +_081B1AF2: + strb r0, [r4] +_081B1AF4: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B195C + + thumb_func_start sub_81B1B00 +sub_81B1B00: @ 81B1B00 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + asrs r6, r1, 24 +_081B1B0A: + lsls r0, r5, 24 + asrs r0, 24 + adds r0, r6 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, r5, 24 + lsrs r0, r1, 24 + cmp r0, 0x5 + bhi _081B1B38 + asrs r4, r1, 24 + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B1B0A + adds r0, r4, 0 + b _081B1B3C + .pool +_081B1B38: + movs r0, 0x1 + negs r0, r0 +_081B1B3C: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81B1B00 + + thumb_func_start GetMonNickname +@ u8 *GetMonNickname(struct pokemon *mon, u8 *dest) +GetMonNickname: @ 81B1B44 + push {r4,lr} + adds r4, r1, 0 + movs r1, 0x2 + adds r2, r4, 0 + bl GetMonData + adds r0, r4, 0 + bl StringGetEnd10 + pop {r4} + pop {r1} + bx r1 + thumb_func_end GetMonNickname + + thumb_func_start sub_81B1B5C +sub_81B1B5C: @ 81B1B5C + push {r4,lr} + lsls r4, r1, 24 + lsrs r4, 24 + bl sub_81B3300 + ldr r0, =sub_81B1B8C + movs r1, 0x1 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B1B5C + + thumb_func_start sub_81B1B8C +sub_81B1B8C: @ 81B1B8C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + movs r0, 0x6 + bl sub_8121F20 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + beq _081B1BC8 + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _081B1BC2 + movs r0, 0x6 + movs r1, 0 + bl sub_8198070 + movs r0, 0x6 + bl ClearWindowTilemap +_081B1BC2: + adds r0, r5, 0 + bl DestroyTask +_081B1BC8: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B1B8C + + thumb_func_start sub_81B1BD4 +sub_81B1BD4: @ 81B1BD4 + push {lr} + ldr r0, =sub_81B1B8C + bl FuncIsActiveTask + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B1BD4 + + thumb_func_start sub_81B1BE8 +sub_81B1BE8: @ 81B1BE8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B1C0E + movs r0, 0 + 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] +_081B1C0E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B1BE8 + + thumb_func_start sub_81B1C1C +sub_81B1C1C: @ 81B1C1C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B1C74 + movs r0, 0x6 + movs r1, 0 + bl sub_8198070 + movs r0, 0x6 + bl ClearWindowTilemap + bl sub_81221AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B1C60 + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B1BE8 + b _081B1C72 + .pool +_081B1C60: + movs r0, 0 + bl display_pokemon_menu_message + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B1370 +_081B1C72: + str r0, [r1] +_081B1C74: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B1C1C + + thumb_func_start sub_81B1C84 +sub_81B1C84: @ 81B1C84 + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + ldr r1, =gStringVar1 + bl GetMonNickname + ldr r1, =gStringVar2 + adds r0, r4, 0 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E991B + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B1C84 + + thumb_func_start sub_81B1CD0 +sub_81B1CD0: @ 81B1CD0 + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + ldr r1, =gStringVar1 + bl GetMonNickname + ldr r1, =gStringVar2 + adds r0, r4, 0 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E999D + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B1CD0 + + thumb_func_start sub_81B1D1C +sub_81B1D1C: @ 81B1D1C + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + ldr r1, =gStringVar1 + bl GetMonNickname + ldr r1, =gStringVar2 + adds r0, r4, 0 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E993A + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B1D1C + + thumb_func_start sub_81B1D68 +sub_81B1D68: @ 81B1D68 + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + lsls r0, 16 + lsrs r0, 16 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + ldr r1, =gStringVar1 + bl CopyItemName + ldr r1, =gStringVar2 + adds r0, r4, 0 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E99DB + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B1D68 + + thumb_func_start sub_81B1DB8 +sub_81B1DB8: @ 81B1DB8 + push {r4-r7,lr} + sub sp, 0x4 + adds r6, r0, 0 + lsls r5, r1, 16 + lsrs r4, r5, 16 + adds r7, r4, 0 + adds r0, r4, 0 + bl itemid_is_mail + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B1DE2 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80D4420 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _081B1DF6 +_081B1DE2: + mov r0, sp + strb r7, [r0] + mov r1, sp + lsrs r0, r5, 24 + strb r0, [r1, 0x1] + adds r0, r6, 0 + movs r1, 0xC + mov r2, sp + bl SetMonData +_081B1DF6: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B1DB8 + + thumb_func_start sub_81B1E00 +sub_81B1E00: @ 81B1E00 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + mov r1, sp + strh r0, [r1] + cmp r0, 0 + bne _081B1E1C + movs r0, 0 + b _081B1E3E +_081B1E1C: + movs r1, 0x1 + bl AddBagItem + lsls r0, 24 + cmp r0, 0 + beq _081B1E3C + movs r1, 0 + mov r0, sp + strh r1, [r0] + adds r0, r4, 0 + movs r1, 0xC + mov r2, sp + bl SetMonData + movs r0, 0x2 + b _081B1E3E +_081B1E3C: + movs r0, 0x1 +_081B1E3E: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B1E00 + + thumb_func_start pokemon_item_not_removed +pokemon_item_not_removed: @ 81B1E48 + push {lr} + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9A69 + bl StringExpandPlaceholders + pop {r0} + bx r0 + .pool + thumb_func_end pokemon_item_not_removed + + thumb_func_start sub_81B1E60 +sub_81B1E60: @ 81B1E60 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r7, r0, r1 + ldrh r0, [r7, 0x4] + ldrh r1, [r7] + adds r0, r1 + strh r0, [r7] + ldrh r0, [r7, 0x6] + subs r0, 0x1 + strh r0, [r7, 0x6] + movs r2, 0x8 + ldrsh r0, [r7, r2] + movs r5, 0x64 + muls r0, r5 + ldr r4, =gPlayerParty + adds r0, r4 + movs r1, 0x39 + adds r2, r7, 0 + bl SetMonData + movs r3, 0x8 + ldrsh r2, [r7, r3] + adds r0, r2, 0 + muls r0, r5 + adds r0, r4 + ldr r6, =gUnknown_0203CEDC + lsls r2, 4 + ldr r1, [r6] + adds r1, r2 + movs r2, 0x1 + bl sub_81B2CD4 + movs r0, 0x8 + ldrsh r2, [r7, r0] + adds r0, r2, 0 + muls r0, r5 + adds r0, r4 + lsls r2, 4 + ldr r1, [r6] + adds r1, r2 + bl sub_81B2E28 + movs r1, 0x6 + ldrsh r0, [r7, r1] + cmp r0, 0 + beq _081B1EDC + movs r2, 0 + ldrsh r1, [r7, r2] + cmp r1, 0 + beq _081B1EDC + movs r3, 0x2 + ldrsh r0, [r7, r3] + cmp r1, r0 + bne _081B1EFE +_081B1EDC: + movs r0, 0 + ldrsh r1, [r7, r0] + movs r2, 0xA + ldrsh r0, [r7, r2] + cmp r1, r0 + ble _081B1EF8 + ldr r0, =gStringVar2 + movs r3, 0xA + ldrsh r2, [r7, r3] + subs r1, r2 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN +_081B1EF8: + mov r0, r8 + bl SwitchTaskToFollowupFunc +_081B1EFE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B1E60 + + thumb_func_start sub_81B1F18 +sub_81B1F18: @ 81B1F18 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r8, r0 + mov r9, r1 + adds r5, r2, 0 + mov r10, r3 + ldr r7, [sp, 0x20] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r5, 24 + lsrs r5, 24 + mov r0, r10 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + movs r0, 0x64 + mov r6, r9 + muls r6, r0 + ldr r0, =gPlayerParty + adds r6, r0 + mov r0, r8 + lsls r4, r0, 2 + add r4, r8 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + adds r0, r6, 0 + movs r1, 0x39 + bl GetMonData + strh r0, [r4] + adds r0, r6, 0 + movs r1, 0x3A + bl GetMonData + strh r0, [r4, 0x2] + lsls r5, 24 + asrs r5, 24 + strh r5, [r4, 0x4] + mov r0, r10 + strh r0, [r4, 0x6] + mov r0, r9 + strh r0, [r4, 0x8] + ldrh r0, [r4] + strh r0, [r4, 0xA] + ldr r1, =sub_81B1E60 + mov r0, r8 + adds r2, r7, 0 + bl SetTaskFuncWithFollowupFunc + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B1F18 + + thumb_func_start sub_81B1FA8 +sub_81B1FA8: @ 81B1FA8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r3, r0, r1 + cmp r5, 0x5 + bhi _081B200A + lsls r0, r5, 2 + ldr r1, =_081B1FD4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081B1FD4: + .4byte _081B1FEC + .4byte _081B1FF2 + .4byte _081B1FF6 + .4byte _081B1FFA + .4byte _081B1FFE + .4byte _081B2002 +_081B1FEC: + strh r2, [r3] + strh r2, [r3, 0xA] + b _081B200A +_081B1FF2: + strh r2, [r3, 0x2] + b _081B200A +_081B1FF6: + strh r2, [r3, 0x4] + b _081B200A +_081B1FFA: + strh r2, [r3, 0x6] + b _081B200A +_081B1FFE: + strh r2, [r3, 0x8] + b _081B200A +_081B2002: + ldr r1, =sub_81B1E60 + adds r0, r4, 0 + bl SetTaskFuncWithFollowupFunc +_081B200A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B1FA8 + + thumb_func_start pokemon_ailments_get_primary +pokemon_ailments_get_primary: @ 81B2014 + push {lr} + adds r1, r0, 0 + movs r0, 0x88 + ands r0, r1 + cmp r0, 0 + beq _081B2024 + movs r0, 0x1 + b _081B2056 +_081B2024: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081B2030 + movs r0, 0x2 + b _081B2056 +_081B2030: + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + beq _081B203C + movs r0, 0x3 + b _081B2056 +_081B203C: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _081B2048 + movs r0, 0x4 + b _081B2056 +_081B2048: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _081B2054 + movs r0, 0 + b _081B2056 +_081B2054: + movs r0, 0x5 +_081B2056: + pop {r1} + bx r1 + thumb_func_end pokemon_ailments_get_primary + + thumb_func_start sub_81B205C +@ u8 sub_81B205C(struct pokemon *mon, int a2, void *a3) +sub_81B205C: @ 81B205C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x39 + bl GetMonData + cmp r0, 0 + bne _081B206E + movs r0, 0x7 + b _081B2096 +_081B206E: + adds r0, r4, 0 + movs r1, 0x37 + bl GetMonData + bl pokemon_ailments_get_primary + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _081B2096 + adds r0, r4, 0 + movs r1, 0 + bl CheckPartyPokerus + lsls r0, 24 + cmp r0, 0 + bne _081B2094 + movs r0, 0 + b _081B2096 +_081B2094: + movs r0, 0x6 +_081B2096: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B205C + + thumb_func_start sub_81B209C +sub_81B209C: @ 81B209C + push {r4,r5,lr} + ldr r2, =gUnknown_0203CEC8 + ldrb r1, [r2, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0xB + bne _081B2126 + adds r5, r2, 0 + adds r5, 0xE + movs r0, 0 + strh r0, [r2, 0xE] + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0 + bne _081B20FC + movs r4, 0 + ldr r0, =gPlayerPartyCount + ldrb r0, [r0] + cmp r4, r0 + bcs _081B2126 +_081B20C4: + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + adds r0, r1 + bl sub_81B2134 + lsls r0, 16 + lsrs r0, 16 + lsls r0, r4 + ldrh r1, [r5] + adds r0, r1 + strh r0, [r5] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gPlayerPartyCount + ldrb r0, [r0] + cmp r4, r0 + bcc _081B20C4 + b _081B2126 + .pool +_081B20FC: + movs r4, 0 + b _081B211E +_081B2100: + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + adds r0, r1 + bl sub_81B2164 + lsls r0, 16 + lsrs r0, 16 + lsls r0, r4 + ldrh r1, [r5] + adds r0, r1 + strh r0, [r5] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081B211E: + ldr r0, =gPlayerPartyCount + ldrb r0, [r0] + cmp r4, r0 + bcc _081B2100 +_081B2126: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B209C + + thumb_func_start sub_81B2134 +sub_81B2134: @ 81B2134 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2D + bl GetMonData + cmp r0, 0x1 + beq _081B215A + adds r0, r4, 0 + movs r1, 0xB + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + bl sub_802C908 + cmp r0, 0 + beq _081B215A + movs r0, 0x1 + b _081B215C +_081B215A: + movs r0, 0 +_081B215C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B2134 + + thumb_func_start sub_81B2164 +sub_81B2164: @ 81B2164 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2D + bl GetMonData + cmp r0, 0x1 + beq _081B2182 + adds r0, r4, 0 + movs r1, 0xB + bl GetMonData + cmp r0, 0x55 + bne _081B2182 + movs r0, 0x1 + b _081B2184 +_081B2182: + movs r0, 0 +_081B2184: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B2164 + + thumb_func_start sub_81B218C +sub_81B218C: @ 81B218C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0203CEC8 + movs r2, 0xE + ldrsh r1, [r1, r2] + asrs r1, r0 + movs r0, 0x1 + ands r1, r0 + cmp r1, 0 + bne _081B21A4 + movs r0, 0 +_081B21A4: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B218C + + thumb_func_start sub_81B21AC +sub_81B21AC: @ 81B21AC + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + adds r0, r5, 0 + bl sub_81B218C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B21DC + movs r0, 0x5 + bl PlaySE + ldr r0, =gSpecialVar_0x8004 + strh r5, [r0] + adds r0, r4, 0 + bl sub_81B12C0 + b _081B21FE + .pool +_081B21DC: + movs r0, 0x20 + bl PlaySE + ldr r0, =gUnknown_085EA0EE + 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_81B1C1C + str r1, [r0] +_081B21FE: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B21AC + + thumb_func_start sub_81B2210 +sub_81B2210: @ 81B2210 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_085EA110 + movs r1, 0x1 + 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_81B2248 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2210 + + thumb_func_start sub_81B2248 +sub_81B2248: @ 81B2248 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B226C + bl sub_81B334C + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B227C + str r0, [r1] +_081B226C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2248 + + thumb_func_start sub_81B227C +sub_81B227C: @ 81B227C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B22A2 + cmp r1, 0 + bgt _081B229C + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B22B4 + b _081B22C8 +_081B229C: + cmp r1, 0x1 + beq _081B22BA + b _081B22C8 +_081B22A2: + ldr r1, =gSpecialVar_0x8004 + movs r0, 0x7 + strh r0, [r1] + adds r0, r4, 0 + bl sub_81B12C0 + b _081B22C8 + .pool +_081B22B4: + movs r0, 0x5 + bl PlaySE +_081B22BA: + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B1C1C + str r0, [r1] +_081B22C8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B227C + + thumb_func_start sub_81B22D8 +sub_81B22D8: @ 81B22D8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + lsls r1, 16 + lsrs r4, r1, 16 + adds r7, r4, 0 + lsls r2, 24 + lsrs r6, r2, 24 + mov r8, r6 + movs r1, 0x2D + bl GetMonData + cmp r0, 0 + beq _081B22FA + movs r0, 0x3 + b _081B2356 +_081B22FA: + movs r0, 0x90 + lsls r0, 1 + cmp r4, r0 + bls _081B231C + adds r1, r4, 0 + subs r1, 0x21 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl CanMonLearnTMHM + cmp r0, 0 + beq _081B2334 + adds r0, r7, 0 + bl ItemIdToBattleMoveId + b _081B233E +_081B231C: + adds r0, r5, 0 + movs r1, 0xB + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl sub_81B2370 + lsls r0, 24 + cmp r0, 0 + bne _081B2338 +_081B2334: + movs r0, 0x1 + b _081B2356 +_081B2338: + mov r0, r8 + bl sub_81B2360 +_081B233E: + lsls r0, 16 + lsrs r1, r0, 16 + adds r0, r5, 0 + bl pokemon_has_move + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B2354 + movs r0, 0 + b _081B2356 +_081B2354: + movs r0, 0x2 +_081B2356: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81B22D8 + + thumb_func_start sub_81B2360 +sub_81B2360: @ 81B2360 + lsls r0, 24 + ldr r1, =gUnknown_0861500C + lsrs r0, 23 + adds r0, r1 + ldrh r0, [r0] + bx lr + .pool + thumb_func_end sub_81B2360 + + thumb_func_start sub_81B2370 +sub_81B2370: @ 81B2370 + push {lr} + lsls r0, 16 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gUnknown_08615048 + lsrs r0, 14 + adds r0, r2 + movs r2, 0x1 + lsls r2, r1 + ldr r0, [r0] + ands r0, r2 + cmp r0, 0 + bne _081B2394 + movs r0, 0 + b _081B2396 + .pool +_081B2394: + movs r0, 0x1 +_081B2396: + pop {r1} + bx r1 + thumb_func_end sub_81B2370 + + thumb_func_start sub_81B239C +sub_81B239C: @ 81B239C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x1 + beq _081B23C4 + cmp r0, 0x1 + bgt _081B23B2 + cmp r0, 0 + beq _081B23B8 + b _081B23DC +_081B23B2: + cmp r1, 0x2 + beq _081B23D0 + b _081B23DC +_081B23B8: + ldr r0, =gUnknown_08615810 + bl InitWindows + b _081B23E2 + .pool +_081B23C4: + ldr r0, =gUnknown_08615850 + bl InitWindows + b _081B23E2 + .pool +_081B23D0: + ldr r0, =gUnknown_08615890 + bl InitWindows + b _081B23E2 + .pool +_081B23DC: + ldr r0, =gUnknown_086158D0 + bl InitWindows +_081B23E2: + bl DeactivateAllTextPrinters + movs r4, 0 +_081B23E8: + adds r0, r4, 0 + movs r1, 0 + bl FillWindowPixelBuffer + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _081B23E8 + movs r0, 0 + movs r1, 0x4F + movs r2, 0xD0 + bl sub_809882C + bl sub_8098C64 + movs r1, 0xE0 + movs r2, 0x20 + bl LoadPalette + ldr r0, =gUnknown_0860F074 + movs r1, 0xF0 + movs r2, 0x20 + bl LoadPalette + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B239C + + thumb_func_start sub_81B2428 +sub_81B2428: @ 81B2428 + push {r4-r6,lr} + sub sp, 0x14 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =gUnknown_0203CEC8 + ldrb r1, [r0, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x5 + bne _081B243E + b _081B2554 +_081B243E: + cmp r2, 0x1 + bne _081B24B4 + ldr r0, =gUnknown_08615918 + bl AddWindow + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r5, =gText_Confirm + movs r0, 0 + adds r1, r5, 0 + movs r2, 0x30 + bl GetStringCenterAlignXOffset + lsls r0, 24 + lsrs r2, r0, 24 + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + ldr r0, =gUnknown_086157FC + str r0, [sp, 0x8] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0xC] + str r5, [sp, 0x10] + adds r0, r4, 0 + movs r1, 0 + movs r3, 0x1 + bl AddTextPrinterParametrized2 + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x2 + bl CopyWindowToVram + ldr r0, =gUnknown_08615910 + bl AddWindow + lsls r0, 24 + lsrs r5, r0, 24 + movs r6, 0 + b _081B24C0 + .pool +_081B24B4: + ldr r0, =gUnknown_08615908 + bl AddWindow + lsls r0, 24 + lsrs r5, r0, 24 + movs r6, 0x3 +_081B24C0: + adds r0, r5, 0 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r0, =gUnknown_0203CEC8 + ldrb r1, [r0, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0xA + beq _081B2514 + ldr r4, =gText_Cancel + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x30 + bl GetStringCenterAlignXOffset + lsls r0, 24 + lsrs r2, r0, 24 + adds r2, r6 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gUnknown_086157FC + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + adds r0, r5, 0 + movs r1, 0 + movs r3, 0x1 + bl box_print + b _081B2540 + .pool +_081B2514: + ldr r4, =gText_Cancel2 + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x30 + bl GetStringCenterAlignXOffset + lsls r0, 24 + lsrs r2, r0, 24 + adds r2, r6 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gUnknown_086157FC + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + adds r0, r5, 0 + movs r1, 0 + movs r3, 0x1 + bl box_print +_081B2540: + adds r0, r5, 0 + bl PutWindowTilemap + adds r0, r5, 0 + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram +_081B2554: + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2428 + + thumb_func_start sub_81B2564 +sub_81B2564: @ 81B2564 + lsls r0, 24 + ldr r1, =gUnknown_0203CEC4 + lsrs r0, 23 + adds r0, 0x18 + ldr r1, [r1] + adds r1, r0 + adds r0, r1, 0 + bx lr + .pool + thumb_func_end sub_81B2564 + + thumb_func_start sub_81B2578 +sub_81B2578: @ 81B2578 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + str r1, [sp, 0xC] + ldr r1, [sp, 0x4C] + ldr r4, [sp, 0x50] + ldr r5, [sp, 0x54] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x8] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x10] + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x14] + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x18] + lsls r4, 24 + lsrs r6, r4, 24 + lsls r5, 24 + lsrs r5, 24 + mov r10, r5 + mov r0, r10 + muls r0, r6 + lsls r0, 5 + bl AllocZeroed + mov r9, r0 + cmp r0, 0 + beq _081B2646 + movs r5, 0 + ldr r0, [sp, 0x14] + lsls r0, 19 + str r0, [sp, 0x1C] + ldr r1, [sp, 0x18] + lsls r1, 19 + str r1, [sp, 0x20] + lsls r2, r6, 19 + str r2, [sp, 0x24] + mov r0, r10 + lsls r0, 19 + str r0, [sp, 0x28] + cmp r5, r10 + bcs _081B2624 +_081B25DA: + movs r4, 0 + adds r1, r5, 0x1 + mov r8, r1 + cmp r4, r6 + bcs _081B261A + ldr r2, [sp, 0x18] + adds r0, r2, r5 + ldr r2, [sp, 0x10] + adds r1, r0, 0 + muls r1, r2 + adds r7, r1, 0 +_081B25F0: + ldr r1, [sp, 0x14] + adds r0, r1, r4 + adds r0, r7 + ldr r2, [sp, 0xC] + adds r0, r2, r0 + ldrb r0, [r0] + bl sub_81B0DD4 + adds r1, r5, 0 + muls r1, r6 + adds r1, r4 + lsls r1, 5 + add r1, r9 + movs r2, 0x10 + bl CpuSet + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r6 + bcc _081B25F0 +_081B261A: + mov r1, r8 + lsls r0, r1, 24 + lsrs r5, r0, 24 + cmp r5, r10 + bcc _081B25DA +_081B2624: + ldr r0, [sp, 0x1C] + lsrs r2, r0, 16 + ldr r1, [sp, 0x20] + lsrs r3, r1, 16 + ldr r1, [sp, 0x24] + lsrs r0, r1, 16 + str r0, [sp] + ldr r1, [sp, 0x28] + lsrs r0, r1, 16 + str r0, [sp, 0x4] + ldr r0, [sp, 0x8] + mov r1, r9 + bl BlitBitmapToWindow + mov r0, r9 + bl Free +_081B2646: + add sp, 0x2C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B2578 + + thumb_func_start sub_81B2658 +sub_81B2658: @ 81B2658 + push {r4-r6,lr} + sub sp, 0xC + ldr r4, [sp, 0x1C] + ldr r5, [sp, 0x20] + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + cmp r3, 0 + bne _081B2684 + cmp r4, 0 + bne _081B2684 + movs r3, 0xA + movs r4, 0x7 +_081B2684: + cmp r5, 0 + bne _081B26A0 + ldr r1, =gUnknown_08615988 + str r2, [sp] + str r3, [sp, 0x4] + str r4, [sp, 0x8] + movs r2, 0xA + adds r3, r6, 0 + bl sub_81B2578 + b _081B26B0 + .pool +_081B26A0: + ldr r1, =gUnknown_086159CE + str r2, [sp] + str r3, [sp, 0x4] + str r4, [sp, 0x8] + movs r2, 0xA + adds r3, r6, 0 + bl sub_81B2578 +_081B26B0: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2658 + + thumb_func_start sub_81B26BC +sub_81B26BC: @ 81B26BC + push {r4-r6,lr} + sub sp, 0xC + ldr r4, [sp, 0x1C] + ldr r5, [sp, 0x20] + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + cmp r3, 0 + bne _081B26E8 + cmp r4, 0 + bne _081B26E8 + movs r3, 0x12 + movs r4, 0x3 +_081B26E8: + cmp r5, 0 + bne _081B2704 + ldr r1, =gUnknown_08615A14 + str r2, [sp] + str r3, [sp, 0x4] + str r4, [sp, 0x8] + movs r2, 0x12 + adds r3, r6, 0 + bl sub_81B2578 + b _081B2714 + .pool +_081B2704: + ldr r1, =gUnknown_08615A4A + str r2, [sp] + str r3, [sp, 0x4] + str r4, [sp, 0x8] + movs r2, 0x12 + adds r3, r6, 0 + bl sub_81B2578 +_081B2714: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B26BC + + thumb_func_start sub_81B2720 +sub_81B2720: @ 81B2720 + push {lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_08615A80 + movs r2, 0 + str r2, [sp] + movs r2, 0x12 + str r2, [sp, 0x4] + movs r2, 0x3 + str r2, [sp, 0x8] + movs r2, 0x12 + movs r3, 0 + bl sub_81B2578 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2720 + + thumb_func_start sub_81B2748 +sub_81B2748: @ 81B2748 + push {r4-r7,lr} + lsls r1, 24 + lsrs r4, r1, 24 + adds r5, r4, 0 + ldrb r0, [r0, 0x8] + movs r1, 0x5 + bl GetWindowAttribute + lsls r0, 28 + lsrs r6, r0, 24 + adds r7, r6, 0 + movs r0, 0x40 + ands r0, r4 + cmp r0, 0 + beq _081B277C + ldr r5, =gUnknown_08615AF1 + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615AC0 + b _081B297E + .pool +_081B277C: + movs r0, 0x20 + ands r0, r4 + cmp r0, 0 + beq _081B27D8 + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _081B2794 + ldr r5, =gUnknown_08615ADF + b _081B2942 + .pool +_081B2794: + ldr r5, =gUnknown_08615ADF + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615ABA + ldrb r1, [r4] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldr r5, =gUnknown_08615AEE + b _081B2976 + .pool +_081B27D8: + movs r0, 0x10 + ands r0, r4 + cmp r0, 0 + beq _081B2824 + ldr r5, =gUnknown_08615ADF + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615ABA + ldrb r1, [r4] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldr r5, =gUnknown_08615AEE + b _081B2976 + .pool +_081B2824: + movs r0, 0x4 + ands r0, r4 + cmp r0, 0 + beq _081B2880 + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _081B283C + ldr r5, =gUnknown_08615ADF + b _081B2942 + .pool +_081B283C: + ldr r5, =gUnknown_08615ADF + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615ABA + ldrb r1, [r4] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldr r5, =gUnknown_08615AEE + b _081B2976 + .pool +_081B2880: + movs r0, 0x2 + ands r0, r4 + cmp r0, 0 + beq _081B28DC + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _081B2898 + ldr r5, =gUnknown_08615ADC + b _081B2942 + .pool +_081B2898: + ldr r5, =gUnknown_08615AD3 + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615ABA + ldrb r1, [r4] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldr r5, =gUnknown_08615AE8 + b _081B2976 + .pool +_081B28DC: + movs r0, 0x8 + ands r0, r4 + cmp r0, 0 + beq _081B2938 + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _081B28F4 + ldr r5, =gUnknown_08615AD9 + b _081B2942 + .pool +_081B28F4: + ldr r5, =gUnknown_08615AD0 + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615ABA + ldrb r1, [r4] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldr r5, =gUnknown_08615AE5 + b _081B2976 + .pool +_081B2938: + movs r0, 0x1 + ands r5, r0 + cmp r5, 0 + beq _081B29BC + ldr r5, =gUnknown_08615AD6 +_081B2942: + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615ABA + ldrb r1, [r4] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldr r5, =gUnknown_08615AEB +_081B2976: + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615ABD +_081B297E: + ldrb r1, [r4] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + b _081B2A24 + .pool +_081B29BC: + ldr r5, =gUnknown_08615ACD + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615ABA + ldrb r1, [r4] + adds r1, r7 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r7 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r7 + movs r2, 0x2 + bl LoadPalette + ldr r5, =gUnknown_08615AE2 + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615ABD + ldrb r1, [r4] + adds r1, r7 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r7 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r7 + movs r2, 0x2 + bl LoadPalette +_081B2A24: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2748 + + thumb_func_start sub_81B2A3C +sub_81B2A3C: @ 81B2A3C + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + lsls r2, 24 + lsrs r2, 24 + ldrb r5, [r3] + ldrb r3, [r3, 0x1] + lsls r4, r2, 1 + adds r4, r2 + ldr r2, =gUnknown_086157FC + adds r4, r2 + str r4, [sp] + movs r2, 0 + str r2, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0 + adds r2, r5, 0 + bl box_print + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2A3C + + thumb_func_start sub_81B2A70 +sub_81B2A70: @ 81B2A70 + push {r4-r7,lr} + sub sp, 0x14 + adds r7, r0, 0 + adds r6, r1, 0 + lsls r2, 24 + lsrs r4, r2, 24 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B2AC0 + cmp r4, 0x1 + bne _081B2AAA + ldr r5, [r6] + ldrb r0, [r6, 0x8] + ldrb r1, [r5, 0x4] + lsrs r1, 3 + ldrb r2, [r5, 0x5] + lsrs r2, 3 + ldrb r3, [r5, 0x6] + lsrs r3, 3 + ldrb r4, [r5, 0x7] + lsrs r4, 3 + str r4, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r4, [r5] + bl _call_via_r4 +_081B2AAA: + adds r0, r7, 0 + add r1, sp, 0x8 + bl GetMonNickname + ldrb r0, [r6, 0x8] + ldr r3, [r6] + adds r3, 0x4 + add r1, sp, 0x8 + movs r2, 0 + bl sub_81B2A3C +_081B2AC0: + add sp, 0x14 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B2A70 + + thumb_func_start sub_81B2AC8 +sub_81B2AC8: @ 81B2AC8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r6, r0, 0 + adds r7, r1, 0 + lsls r2, 24 + lsrs r4, r2, 24 + mov r8, r4 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B2B34 + adds r0, r6, 0 + bl sub_81B205C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _081B2AF6 + cmp r0, 0x6 + bne _081B2B34 +_081B2AF6: + cmp r4, 0 + beq _081B2B1C + ldr r5, [r7] + ldrb r0, [r7, 0x8] + ldrb r1, [r5, 0x8] + lsrs r1, 3 + ldrb r2, [r5, 0x9] + lsrs r2, 3 + adds r2, 0x1 + ldrb r3, [r5, 0xA] + lsrs r3, 3 + ldrb r4, [r5, 0xB] + lsrs r4, 3 + str r4, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r4, [r5] + bl _call_via_r4 +_081B2B1C: + mov r0, r8 + cmp r0, 0x2 + beq _081B2B34 + adds r0, r6, 0 + movs r1, 0x38 + bl GetMonData + lsls r0, 24 + lsrs r0, 24 + adds r1, r7, 0 + bl sub_81B2B40 +_081B2B34: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B2AC8 + + thumb_func_start sub_81B2B40 +sub_81B2B40: @ 81B2B40 + push {r4-r6,lr} + adds r2, r0, 0 + adds r6, r1, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r5, =gStringVar2 + adds r0, r5, 0 + adds r1, r2, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar1 + ldr r1, =gText_LevelSymbol + adds r0, r4, 0 + bl StringCopy + adds r0, r4, 0 + adds r1, r5, 0 + bl StringAppend + ldrb r0, [r6, 0x8] + ldr r3, [r6] + adds r3, 0x8 + adds r1, r4, 0 + movs r2, 0 + bl sub_81B2A3C + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2B40 + + thumb_func_start sub_81B2B8C +sub_81B2B8C: @ 81B2B8C + push {r4-r7,lr} + sub sp, 0x14 + adds r6, r0, 0 + adds r7, r1, 0 + lsls r2, 24 + lsrs r2, 24 + cmp r2, 0x1 + bne _081B2BBE + ldr r5, [r7] + ldrb r0, [r7, 0x8] + ldrb r1, [r5, 0xC] + lsrs r1, 3 + ldrb r2, [r5, 0xD] + lsrs r2, 3 + adds r2, 0x1 + ldrb r3, [r5, 0xE] + lsrs r3, 3 + ldrb r4, [r5, 0xF] + lsrs r4, 3 + str r4, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r4, [r5] + bl _call_via_r4 +_081B2BBE: + adds r0, r6, 0 + add r1, sp, 0x8 + bl GetMonNickname + adds r0, r6, 0 + bl GetMonGender + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + movs r1, 0xB + bl GetMonData + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + add r2, sp, 0x8 + adds r3, r7, 0 + bl sub_81B2BF4 + add sp, 0x14 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B2B8C + + thumb_func_start sub_81B2BF4 +sub_81B2BF4: @ 81B2BF4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r9, r2 + adds r7, r3, 0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 16 + lsrs r4, r1, 16 + adds r5, r4, 0 + ldrb r0, [r7, 0x8] + movs r1, 0x5 + bl GetWindowAttribute + lsls r0, 28 + lsrs r6, r0, 24 + cmp r4, 0 + beq _081B2CBA + cmp r4, 0x20 + beq _081B2C24 + cmp r4, 0x1D + bne _081B2C38 +_081B2C24: + movs r0, 0xB + adds r1, r5, 0 + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + mov r0, r9 + bl StringCompare + cmp r0, 0 + beq _081B2CBA +_081B2C38: + mov r0, r8 + cmp r0, 0 + beq _081B2C48 + cmp r0, 0xFE + beq _081B2C88 + b _081B2CBA + .pool +_081B2C48: + ldr r5, =gUnknown_08615AC3 + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615AB6 + ldrb r1, [r4] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r7, 0x8] + ldr r1, =gText_MaleSymbol + ldr r3, [r7] + adds r3, 0xC + movs r2, 0x2 + bl sub_81B2A3C + b _081B2CBA + .pool +_081B2C88: + ldr r5, =gUnknown_08615AC5 + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615AB6 + ldrb r1, [r4] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r7, 0x8] + ldr r1, =gText_FemaleSymbol + ldr r3, [r7] + adds r3, 0xC + movs r2, 0x2 + bl sub_81B2A3C +_081B2CBA: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2BF4 + + thumb_func_start sub_81B2CD4 +sub_81B2CD4: @ 81B2CD4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r7, r0, 0 + adds r6, r1, 0 + lsls r2, 24 + lsrs r4, r2, 24 + mov r8, r4 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B2D2E + cmp r4, 0 + beq _081B2D16 + ldr r5, [r6] + ldrb r0, [r6, 0x8] + ldrb r1, [r5, 0x10] + lsrs r1, 3 + ldrb r2, [r5, 0x11] + lsrs r2, 3 + adds r2, 0x1 + ldrb r3, [r5, 0x12] + lsrs r3, 3 + ldrb r4, [r5, 0x13] + lsrs r4, 3 + str r4, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r4, [r5] + bl _call_via_r4 +_081B2D16: + mov r0, r8 + cmp r0, 0x2 + beq _081B2D2E + adds r0, r7, 0 + movs r1, 0x39 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl sub_81B2D3C +_081B2D2E: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B2CD4 + + thumb_func_start sub_81B2D3C +sub_81B2D3C: @ 81B2D3C + push {r4,r5,lr} + adds r2, r0, 0 + adds r4, r1, 0 + lsls r2, 16 + lsrs r2, 16 + ldr r5, =gStringVar1 + adds r0, r5, 0 + adds r1, r2, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + movs r1, 0xBA + strb r1, [r0] + movs r1, 0xFF + strb r1, [r0, 0x1] + ldrb r0, [r4, 0x8] + ldr r3, [r4] + adds r3, 0x10 + adds r1, r5, 0 + movs r2, 0 + bl sub_81B2A3C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2D3C + + thumb_func_start sub_81B2D74 +sub_81B2D74: @ 81B2D74 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r7, r0, 0 + adds r6, r1, 0 + lsls r2, 24 + lsrs r4, r2, 24 + mov r8, r4 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B2DD0 + cmp r4, 0 + beq _081B2DB8 + ldr r5, [r6] + ldrb r0, [r6, 0x8] + ldrb r1, [r5, 0x14] + lsrs r1, 3 + adds r1, 0x1 + ldrb r2, [r5, 0x15] + lsrs r2, 3 + adds r2, 0x1 + ldrb r3, [r5, 0x16] + lsrs r3, 3 + ldrb r4, [r5, 0x17] + lsrs r4, 3 + str r4, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r4, [r5] + bl _call_via_r4 +_081B2DB8: + mov r0, r8 + cmp r0, 0x2 + beq _081B2DD0 + adds r0, r7, 0 + movs r1, 0x3A + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl sub_81B2DDC +_081B2DD0: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B2D74 + + thumb_func_start sub_81B2DDC +sub_81B2DDC: @ 81B2DDC + push {r4-r6,lr} + adds r2, r0, 0 + adds r6, r1, 0 + lsls r2, 16 + lsrs r2, 16 + ldr r5, =gStringVar2 + adds r0, r5, 0 + adds r1, r2, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar1 + ldr r1, =gText_Slash + adds r0, r4, 0 + bl StringCopy + adds r0, r4, 0 + adds r1, r5, 0 + bl StringAppend + ldrb r0, [r6, 0x8] + ldr r3, [r6] + adds r3, 0x14 + adds r1, r4, 0 + movs r2, 0 + bl sub_81B2A3C + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2DDC + + thumb_func_start sub_81B2E28 +sub_81B2E28: @ 81B2E28 + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B2E5C + adds r0, r5, 0 + movs r1, 0x39 + bl GetMonData + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0x3A + bl GetMonData + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + adds r2, r6, 0 + bl sub_81B2E64 +_081B2E5C: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81B2E28 + + thumb_func_start sub_81B2E64 +sub_81B2E64: @ 81B2E64 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + adds r6, r2, 0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + ldrb r0, [r6, 0x8] + movs r1, 0x5 + bl GetWindowAttribute + lsls r0, 28 + lsrs r7, r0, 24 + mov r1, r8 + lsls r0, r1, 16 + asrs r0, 16 + mov r2, r9 + lsls r1, r2, 16 + asrs r1, 16 + bl sub_8075060 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _081B2EB0 + cmp r0, 0x2 + blt _081B2EE0 + cmp r0, 0x4 + bgt _081B2EE0 + ldr r5, =gUnknown_08615AC7 + b _081B2EB2 + .pool +_081B2EB0: + ldr r5, =gUnknown_08615AC9 +_081B2EB2: + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615AB8 + ldrb r1, [r4] + adds r1, r7 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r7 + movs r2, 0x2 + bl LoadPalette + b _081B2F04 + .pool +_081B2EE0: + ldr r5, =gUnknown_08615ACB + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615AB8 + ldrb r1, [r4] + adds r1, r7 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r7 + movs r2, 0x2 + bl LoadPalette +_081B2F04: + mov r1, r8 + lsls r0, r1, 16 + asrs r0, 16 + mov r2, r9 + lsls r1, r2, 16 + asrs r1, 16 + ldr r2, [r6] + ldrb r2, [r2, 0x1A] + bl sub_8075034 + lsls r0, 24 + lsrs r5, r0, 24 + ldrb r0, [r6, 0x8] + ldr r4, =gUnknown_08615AB8 + ldrb r1, [r4, 0x1] + ldr r3, [r6] + ldrb r2, [r3, 0x18] + ldrb r3, [r3, 0x19] + str r5, [sp] + movs r7, 0x1 + str r7, [sp, 0x4] + bl FillWindowPixelRect + ldrb r0, [r6, 0x8] + ldrb r1, [r4] + ldr r3, [r6] + ldrb r2, [r3, 0x18] + ldrb r3, [r3, 0x19] + adds r3, 0x1 + str r5, [sp] + movs r4, 0x2 + str r4, [sp, 0x4] + bl FillWindowPixelRect + ldr r1, [r6] + ldrb r0, [r1, 0x1A] + cmp r5, r0 + beq _081B2F88 + ldrb r0, [r6, 0x8] + ldrb r2, [r1, 0x18] + adds r2, r5 + ldrb r3, [r1, 0x19] + ldrb r1, [r1, 0x1A] + subs r1, r5 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + str r7, [sp, 0x4] + movs r1, 0xD + bl FillWindowPixelRect + ldrb r0, [r6, 0x8] + ldr r1, [r6] + ldrb r2, [r1, 0x18] + adds r2, r5 + ldrb r3, [r1, 0x19] + adds r3, 0x1 + ldrb r1, [r1, 0x1A] + subs r1, r5 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + str r4, [sp, 0x4] + movs r1, 0x2 + bl FillWindowPixelRect +_081B2F88: + ldrb r0, [r6, 0x8] + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2E64 + + thumb_func_start sub_81B2FA8 +sub_81B2FA8: @ 81B2FA8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + adds r6, r1, 0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r2, 24 + lsrs r7, r2, 24 + cmp r7, 0 + beq _081B2FF2 + ldr r5, [r6] + ldrb r1, [r5, 0x1C] + movs r4, 0x7 + adds r0, r1, 0 + ands r0, r4 + ldrb r2, [r5, 0x1E] + adds r0, r2 + adds r3, r0, 0x7 + asrs r3, 3 + ldrb r2, [r5, 0x1D] + adds r0, r2, 0 + ands r0, r4 + ldrb r4, [r5, 0x1F] + adds r0, r4 + adds r4, r0, 0x7 + ldrb r0, [r6, 0x8] + lsrs r1, 3 + lsrs r2, 3 + lsrs r4, 3 + str r4, [sp] + movs r4, 0x1 + str r4, [sp, 0x4] + ldr r4, [r5] + bl _call_via_r4 +_081B2FF2: + cmp r7, 0x2 + beq _081B3018 + ldrb r0, [r6, 0x8] + ldr r1, [r6] + ldrb r2, [r1, 0x1C] + ldrb r3, [r1, 0x1D] + ldr r1, =gUnknown_086157FC + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + ldr r4, =gUnknown_08615B60 + mov r5, r8 + lsls r1, r5, 2 + adds r1, r4 + ldr r1, [r1] + str r1, [sp, 0x8] + movs r1, 0x1 + bl box_print +_081B3018: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2FA8 + + thumb_func_start sub_81B302C +sub_81B302C: @ 81B302C + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4] + cmp r0, 0xFF + beq _081B304C + movs r1, 0 + bl sub_8198070 + ldrb r0, [r4] + bl RemoveWindow + movs r0, 0xFF + strb r0, [r4] + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram +_081B304C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B302C + + thumb_func_start display_pokemon_menu_message +display_pokemon_menu_message: @ 81B3054 + push {r4-r6,lr} + sub sp, 0xC + adds r6, r0, 0 + ldr r0, =gUnknown_0203CEC4 + ldr r4, [r0] + adds r5, r4, 0 + adds r5, 0xD + ldrb r0, [r4, 0xD] + cmp r0, 0xFF + beq _081B306E + adds r0, r5, 0 + bl sub_81B302C +_081B306E: + cmp r6, 0x7F + beq _081B313C + adds r0, r6, 0 + subs r0, 0x15 + cmp r0, 0x5 + bhi _081B30D4 + lsls r0, 2 + ldr r1, =_081B308C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081B308C: + .4byte _081B30A4 + .4byte _081B30BC + .4byte _081B30BC + .4byte _081B30AC + .4byte _081B30B4 + .4byte _081B30C4 +_081B30A4: + ldr r0, =gUnknown_08615928 + b _081B30C6 + .pool +_081B30AC: + ldr r0, =gUnknown_08615930 + b _081B30C6 + .pool +_081B30B4: + ldr r0, =gUnknown_08615938 + b _081B30C6 + .pool +_081B30BC: + ldr r0, =gUnknown_08615940 + b _081B30C6 + .pool +_081B30C4: + ldr r0, =gUnknown_08615948 +_081B30C6: + bl AddWindow + strb r0, [r5] + b _081B30DC + .pool +_081B30D4: + ldr r0, =gUnknown_08615920 + bl AddWindow + strb r0, [r4, 0xD] +_081B30DC: + cmp r6, 0 + bne _081B3104 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 31 + cmp r0, 0 + beq _081B30F8 + movs r6, 0x2 + b _081B3104 + .pool +_081B30F8: + bl sub_81B314C + lsls r0, 24 + cmp r0, 0 + bne _081B3104 + movs r6, 0x1 +_081B3104: + ldrb r0, [r5] + movs r1, 0 + movs r2, 0x4F + movs r3, 0xD + bl SetWindowBorderStyle + ldr r4, =gStringVar4 + ldr r1, =gUnknown_08615AF4 + lsls r0, r6, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r4, 0 + bl StringExpandPlaceholders + ldrb r0, [r5] + movs r1, 0x1 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0 + bl PrintTextOnWindow + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram +_081B313C: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end display_pokemon_menu_message + + thumb_func_start sub_81B314C +sub_81B314C: @ 81B314C + push {r4-r7,lr} + ldr r7, =gPlayerParty + movs r6, 0 + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0xB] + cmp r0, 0x1 + bne _081B3168 +_081B315A: + movs r0, 0x1 + b _081B31AA + .pool +_081B3168: + movs r5, 0 +_081B316A: + movs r0, 0x64 + muls r0, r5 + adds r4, r7, r0 + adds r0, r4, 0 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B319A + adds r0, r4, 0 + movs r1, 0x39 + bl GetMonData + cmp r0, 0 + bne _081B3194 + adds r0, r4, 0 + movs r1, 0x2D + bl GetMonData + cmp r0, 0 + beq _081B319A +_081B3194: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_081B319A: + cmp r6, 0x1 + bhi _081B315A + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _081B316A + movs r0, 0 +_081B31AA: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81B314C + + thumb_func_start sub_81B31B0 +sub_81B31B0: @ 81B31B0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x1C + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + beq _081B320C + cmp r4, 0x1 + bgt _081B31CC + cmp r4, 0 + beq _081B31D2 + b _081B321C +_081B31CC: + cmp r4, 0x2 + beq _081B3214 + b _081B321C +_081B31D2: + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + ldrb r0, [r1, 0x17] + lsls r0, 1 + movs r3, 0x13 + subs r3, r0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0xA + str r0, [sp] + ldrb r0, [r1, 0x17] + lsls r0, 25 + lsrs r0, 24 + str r0, [sp, 0x4] + movs r0, 0xE + str r0, [sp, 0x8] + ldr r0, =0x000002e9 + str r0, [sp, 0xC] + add r0, sp, 0x14 + movs r1, 0x2 + movs r2, 0x13 + bl SetWindowTemplateFields + b _081B3226 + .pool +_081B320C: + ldr r0, =gUnknown_08615950 + b _081B321E + .pool +_081B3214: + ldr r0, =gUnknown_08615958 + b _081B321E + .pool +_081B321C: + ldr r0, =gUnknown_08615960 +_081B321E: + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0x14] + str r1, [sp, 0x18] +_081B3226: + add r0, sp, 0x14 + bl AddWindow + ldr r6, =gUnknown_0203CEC4 + ldr r1, [r6] + strb r0, [r1, 0xC] + ldr r0, [r6] + ldrb r0, [r0, 0xC] + movs r1, 0 + movs r2, 0x4F + movs r3, 0xD + bl SetWindowBorderStyle + cmp r4, 0x3 + bne _081B3250 + ldr r0, [r6] + b _081B32E2 + .pool +_081B3250: + movs r0, 0x1 + movs r1, 0 + bl GetMenuCursorDimensionByFont + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r0, 0x1 + movs r1, 0x2 + bl GetFontAttribute + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r5, 0 + ldr r0, [r6] + ldrb r0, [r0, 0x17] + cmp r5, r0 + bcs _081B32CA + adds r7, r6, 0 + movs r6, 0 +_081B327A: + ldr r1, [r7] + adds r0, r1, 0 + adds r0, 0xF + adds r4, r0, r5 + ldrb r0, [r4] + movs r2, 0x3 + cmp r0, 0x12 + bls _081B328C + movs r2, 0x4 +_081B328C: + ldrb r0, [r1, 0xC] + lsls r3, r5, 4 + adds r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + mov r1, r8 + str r1, [sp] + str r6, [sp, 0x4] + lsls r1, r2, 1 + adds r1, r2 + ldr r2, =gUnknown_086157FC + adds r1, r2 + str r1, [sp, 0x8] + str r6, [sp, 0xC] + ldr r2, =gUnknown_08615C08 + ldrb r1, [r4] + lsls r1, 3 + adds r1, r2 + ldr r1, [r1] + str r1, [sp, 0x10] + movs r1, 0x1 + mov r2, r9 + bl AddTextPrinterParametrized2 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, [r7] + ldrb r0, [r0, 0x17] + cmp r5, r0 + bcc _081B327A +_081B32CA: + ldr r4, =gUnknown_0203CEC4 + ldr r1, [r4] + ldrb r0, [r1, 0xC] + ldrb r1, [r1, 0x17] + movs r2, 0 + movs r3, 0x1 + bl InitMenuInUpperLeftCorner + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, [r4] +_081B32E2: + ldrb r0, [r0, 0xC] + add sp, 0x1C + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B31B0 + + thumb_func_start sub_81B3300 +sub_81B3300: @ 81B3300 + push {r4,lr} + sub sp, 0x10 + adds r4, r0, 0 + movs r0, 0x6 + movs r1, 0 + movs r2, 0x4F + movs r3, 0xD + bl SetWindowBorderStyle + ldr r2, =gTextFlags + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + bl sav2_get_text_speed + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x1 + str r0, [sp, 0x8] + movs r0, 0x3 + str r0, [sp, 0xC] + movs r0, 0x6 + movs r1, 0x1 + adds r2, r4, 0 + bl AddTextPrinterParametrized + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B3300 + + thumb_func_start sub_81B334C +sub_81B334C: @ 81B334C + push {lr} + ldr r0, =gUnknown_08615968 + movs r1, 0x4F + movs r2, 0xD + movs r3, 0 + bl CreateYesNoMenu + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B334C + + thumb_func_start sub_81B3364 +sub_81B3364: @ 81B3364 + push {r4,lr} + ldr r0, =gUnknown_08615970 + bl AddWindow + ldr r4, =gUnknown_0203CEC4 + ldr r1, [r4] + strb r0, [r1, 0xC] + ldr r0, [r4] + ldrb r0, [r0, 0xC] + movs r1, 0 + movs r2, 0x4F + movs r3, 0xD + bl SetWindowBorderStyle + ldr r0, [r4] + ldrb r0, [r0, 0xC] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B3364 + + thumb_func_start sub_81B3394 +sub_81B3394: @ 81B3394 + push {r4,lr} + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + ldrb r0, [r0, 0xC] + bl ClearWindowTilemap + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B3394 + + thumb_func_start sub_81B33B4 +sub_81B33B4: @ 81B33B4 + push {r4,lr} + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + cmp r2, 0 + bne _081B33C8 + bl sub_81B3414 + b _081B3400 +_081B33C8: + ldr r4, =gUnknown_0203CEC4 + ldr r1, [r4] + ldr r0, =gUnknown_08615D70 + adds r0, r2, r0 + ldrb r0, [r0] + strb r0, [r1, 0x17] + movs r3, 0 + ldr r0, [r4] + ldrb r0, [r0, 0x17] + cmp r3, r0 + bcs _081B3400 + ldr r1, =gUnknown_08615D38 + lsls r0, r2, 2 + adds r2, r0, r1 +_081B33E4: + ldr r1, [r4] + adds r1, 0xF + adds r1, r3 + ldr r0, [r2] + adds r0, r3 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, [r4] + ldrb r0, [r0, 0x17] + cmp r3, r0 + bcc _081B33E4 +_081B3400: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B33B4 + + thumb_func_start sub_81B3414 +sub_81B3414: @ 81B3414 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r9, r0 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + ldr r2, =gUnknown_0203CEC4 + ldr r1, [r2] + movs r0, 0 + strb r0, [r1, 0x17] + ldr r1, [r2] + adds r0, r1, 0 + adds r0, 0xF + adds r1, 0x17 + movs r2, 0 + bl AppendToList + movs r7, 0 + ldr r0, =gUnknown_08615D7E + ldrh r0, [r0] + str r0, [sp] +_081B3446: + movs r4, 0 + adds r0, r7, 0x1 + mov r8, r0 + ldr r1, [sp] + cmp r1, 0xE + beq _081B34A0 + movs r0, 0x64 + mov r6, r10 + muls r6, r0 + ldr r5, =gUnknown_08615D7E +_081B345A: + mov r1, r9 + adds r0, r1, r6 + adds r1, r7, 0 + adds r1, 0xD + bl GetMonData + lsls r1, r4, 1 + adds r1, r5 + ldrh r1, [r1] + cmp r0, r1 + bne _081B3490 + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xF + adds r1, 0x17 + adds r2, r4, 0 + adds r2, 0x13 + lsls r2, 24 + lsrs r2, 24 + bl AppendToList + b _081B34A0 + .pool +_081B3490: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 1 + adds r0, r5 + ldrh r0, [r0] + cmp r0, 0xE + bne _081B345A +_081B34A0: + mov r1, r8 + lsls r0, r1, 24 + lsrs r7, r0, 24 + cmp r7, 0x3 + bls _081B3446 + bl InBattlePike + lsls r0, 24 + cmp r0, 0 + bne _081B3518 + mov r0, r9 + adds r0, 0x64 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B34D2 + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xF + adds r1, 0x17 + movs r2, 0x1 + bl AppendToList +_081B34D2: + movs r0, 0x64 + mov r1, r10 + muls r1, r0 + adds r0, r1, 0 + add r0, r9 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _081B3508 + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xF + adds r1, 0x17 + movs r2, 0x6 + bl AppendToList + b _081B3518 + .pool +_081B3508: + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xF + adds r1, 0x17 + movs r2, 0x3 + bl AppendToList +_081B3518: + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xF + adds r1, 0x17 + movs r2, 0x2 + bl AppendToList + 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_81B3414 + + thumb_func_start sub_81B353C +sub_81B353C: @ 81B353C + push {r4,lr} + adds r4, r0, 0 + ldr r1, =gUnknown_0203CEC8 + ldrb r0, [r1, 0x8] + lsls r0, 28 + lsrs r0, 28 + adds r2, r1, 0 + cmp r0, 0xC + bhi _081B35FE + lsls r0, 2 + ldr r1, =_081B3560 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081B3560: + .4byte _081B3594 + .4byte _081B35B0 + .4byte _081B35FE + .4byte _081B35FE + .4byte _081B35BC + .4byte _081B35FE + .4byte _081B35DC + .4byte _081B35FE + .4byte _081B35EE + .4byte _081B35F2 + .4byte _081B35F6 + .4byte _081B35FE + .4byte _081B35FA +_081B3594: + bl InMultiBattleRoom + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B35AC + adds r0, r4, 0 + movs r1, 0x2D + bl GetMonData + cmp r0, 0 + beq _081B35FE +_081B35AC: + movs r1, 0x1 + b _081B3600 +_081B35B0: + adds r0, r4, 0 + bl sub_81B8A2C + lsls r0, 24 + lsrs r1, r0, 24 + b _081B3600 +_081B35BC: + movs r0, 0x9 + ldrsb r0, [r2, r0] + bl sub_81B856C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _081B35D4 + cmp r0, 0x1 + beq _081B35D8 + movs r1, 0x7 + b _081B3600 +_081B35D4: + movs r1, 0x4 + b _081B3600 +_081B35D8: + movs r1, 0x5 + b _081B3600 +_081B35DC: + adds r0, r4, 0 + movs r1, 0x2D + bl GetMonData + movs r1, 0x6 + cmp r0, 0 + beq _081B3600 + movs r1, 0x7 + b _081B3600 +_081B35EE: + movs r1, 0xA + b _081B3600 +_081B35F2: + movs r1, 0xB + b _081B3600 +_081B35F6: + movs r1, 0xC + b _081B3600 +_081B35FA: + movs r1, 0xD + b _081B3600 +_081B35FE: + movs r1, 0 +_081B3600: + adds r0, r1, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B353C + + thumb_func_start sub_81B3608 +sub_81B3608: @ 81B3608 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r4, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r4, r1] + movs r0, 0x64 + muls r0, r1 + ldr r7, =gPlayerParty + adds r5, r0, r7 + ldr r1, =gStringVar1 + adds r0, r5, 0 + bl GetMonNickname + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + adds r0, 0xD + bl sub_81B302C + ldrb r1, [r4, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0xC + beq _081B3674 + ldrb r4, [r4, 0x9] + adds r0, r5, 0 + bl sub_81B353C + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r7, 0 + adds r1, r4, 0 + bl sub_81B33B4 + movs r0, 0 + bl sub_81B31B0 + movs r0, 0x15 + bl display_pokemon_menu_message + b _081B36EA + .pool +_081B3674: + adds r0, r5, 0 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0 + bne _081B36C0 + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9980 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B469C + str r1, [r0] + movs r0, 0 + b _081B36EC + .pool +_081B36C0: + ldrb r4, [r4, 0x9] + adds r0, r5, 0 + bl sub_81B353C + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r7, 0 + adds r1, r4, 0 + bl sub_81B33B4 + movs r0, 0x1 + bl sub_81B31B0 + ldr r1, =gStringVar2 + adds r0, r6, 0 + bl CopyItemName + movs r0, 0x1A + bl display_pokemon_menu_message +_081B36EA: + movs r0, 0x1 +_081B36EC: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B3608 + + thumb_func_start sub_81B36FC +sub_81B36FC: @ 81B36FC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_81B3608 + lsls r0, 24 + cmp r0, 0 + beq _081B3720 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0xFF + strh r1, [r0, 0x8] + ldr r1, =sub_81B3730 + str r1, [r0] +_081B3720: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B36FC + + thumb_func_start sub_81B3730 +sub_81B3730: @ 81B3730 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B37EE + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B37EE + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r5, r0, r1 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrb r0, [r0, 0x17] + cmp r0, 0x3 + bhi _081B3774 + bl ProcessMenuInputNoWrapAround_other + b _081B3778 + .pool +_081B3774: + bl ProcessMenuInput_other +_081B3778: + lsls r0, 24 + lsrs r4, r0, 24 + bl GetMenuCursorPos + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5] + lsls r0, r4, 24 + asrs r5, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r5, r0 + beq _081B37EE + adds r0, 0x1 + cmp r5, r0 + bne _081B37CC + movs r0, 0x5 + bl PlaySE + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xE + bl sub_81B302C + ldr r2, =gUnknown_08615C08 + ldr r0, [r4] + ldrb r1, [r0, 0x17] + adds r0, r1 + ldrb r0, [r0, 0xE] + lsls r0, 3 + adds r2, 0x4 + adds r0, r2 + ldr r1, [r0] + adds r0, r6, 0 + bl _call_via_r1 + b _081B37EE + .pool +_081B37CC: + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xE + bl sub_81B302C + ldr r1, =gUnknown_08615C08 + ldr r0, [r4] + adds r0, 0xF + adds r0, r5 + ldrb r0, [r0] + lsls r0, 3 + adds r1, 0x4 + adds r0, r1 + ldr r1, [r0] + adds r0, r6, 0 + bl _call_via_r1 +_081B37EE: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B3730 + + thumb_func_start sub_81B37FC +sub_81B37FC: @ 81B37FC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + ldr r0, =sub_81B3828 + str r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_81B12C0 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B37FC + + thumb_func_start sub_81B3828 +sub_81B3828: @ 81B3828 + push {r4,lr} + sub sp, 0x4 + ldr r4, =gUnknown_0203CEC8 + ldrb r1, [r4, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x1 + bne _081B3868 + bl pokemon_change_order + ldr r1, =gPlayerParty + ldrb r2, [r4, 0x9] + ldr r0, =gPlayerPartyCount + ldrb r3, [r0] + subs r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =sub_81B3894 + str r0, [sp] + movs r0, 0x1 + bl sub_81BF8EC + b _081B3880 + .pool +_081B3868: + ldr r1, =gPlayerParty + ldrb r2, [r4, 0x9] + ldr r0, =gPlayerPartyCount + ldrb r3, [r0] + subs r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =sub_81B3894 + str r0, [sp] + movs r0, 0 + bl sub_81BF8EC +_081B3880: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B3828 + + thumb_func_start sub_81B3894 +sub_81B3894: @ 81B3894 + push {lr} + sub sp, 0xC + ldr r2, =gPaletteFade + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + ldr r3, =gUnknown_0203CEC8 + ldr r0, =gUnknown_0203CF20 + ldrb r0, [r0] + strb r0, [r3, 0x9] + ldrb r0, [r3, 0x8] + lsls r0, 28 + lsrs r0, 28 + ldrb r2, [r3, 0xB] + movs r1, 0x15 + str r1, [sp] + ldr r1, =sub_81B36FC + str r1, [sp, 0x4] + ldr r1, [r3] + str r1, [sp, 0x8] + movs r1, 0xFF + movs r3, 0x1 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B3894 + + thumb_func_start brm_switch +brm_switch: @ 81B38DC + push {r4-r6,lr} + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + movs r0, 0x5 + bl PlaySE + ldr r5, =gUnknown_0203CEC8 + movs r0, 0x8 + strb r0, [r5, 0xB] + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + movs r0, 0x3 + bl display_pokemon_menu_message + ldrb r0, [r5, 0x9] + movs r1, 0x1 + bl sub_81B0FCC + ldrb r0, [r5, 0x9] + strb r0, [r5, 0xA] + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1370 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end brm_switch + + thumb_func_start sub_81B3938 +sub_81B3938: @ 81B3938 + push {r4-r7,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r6, r0, r1 + ldr r3, =gUnknown_0203CEC8 + movs r1, 0xA + ldrsb r1, [r3, r1] + movs r0, 0x9 + ldrsb r0, [r3, r0] + cmp r1, r0 + bne _081B3968 + adds r0, r7, 0 + bl sub_81B407C + b _081B3ABA + .pool +_081B3968: + add r2, sp, 0x8 + movs r0, 0x9 + ldrsb r0, [r3, r0] + ldr r1, =gUnknown_0203CEDC + ldr r1, [r1] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x8] + movs r4, 0 + strb r0, [r2] + adds r0, r2, 0 + ldrb r0, [r0] + movs r1, 0x1 + bl GetWindowAttribute + strh r0, [r6] + add r0, sp, 0x8 + ldrb r0, [r0] + movs r1, 0x2 + bl GetWindowAttribute + strh r0, [r6, 0x2] + add r0, sp, 0x8 + ldrb r0, [r0] + movs r1, 0x3 + bl GetWindowAttribute + strh r0, [r6, 0x4] + add r0, sp, 0x8 + ldrb r0, [r0] + movs r1, 0x4 + bl GetWindowAttribute + strh r0, [r6, 0x6] + strh r4, [r6, 0x10] + movs r1, 0x4 + ldrsh r0, [r6, r1] + cmp r0, 0xA + bne _081B39C4 + movs r2, 0x1 + negs r2, r2 + adds r0, r2, 0 + b _081B39C6 + .pool +_081B39C4: + movs r0, 0x1 +_081B39C6: + strh r0, [r6, 0x14] + add r2, sp, 0x8 + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0xA] + lsls r0, 24 + asrs r0, 24 + ldr r1, =gUnknown_0203CEDC + ldr r1, [r1] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x8] + movs r4, 0 + strb r0, [r2, 0x1] + adds r0, r2, 0 + ldrb r0, [r0, 0x1] + movs r1, 0x1 + bl GetWindowAttribute + strh r0, [r6, 0x8] + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + movs r1, 0x2 + bl GetWindowAttribute + strh r0, [r6, 0xA] + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + movs r1, 0x3 + bl GetWindowAttribute + strh r0, [r6, 0xC] + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + movs r1, 0x4 + bl GetWindowAttribute + strh r0, [r6, 0xE] + strh r4, [r6, 0x12] + movs r1, 0xC + ldrsh r0, [r6, r1] + cmp r0, 0xA + bne _081B3A2C + movs r2, 0x1 + negs r2, r2 + adds r0, r2, 0 + b _081B3A2E + .pool +_081B3A2C: + movs r0, 0x1 +_081B3A2E: + strh r0, [r6, 0x16] + ldr r4, =gUnknown_0203CEF0 + movs r0, 0x4 + ldrsh r1, [r6, r0] + movs r2, 0x6 + ldrsh r0, [r6, r2] + lsls r0, 1 + muls r0, r1 + bl Alloc + str r0, [r4] + ldr r5, =gUnknown_0203CEF4 + movs r0, 0xC + ldrsh r1, [r6, r0] + movs r2, 0xE + ldrsh r0, [r6, r2] + lsls r0, 1 + muls r0, r1 + bl Alloc + str r0, [r5] + ldr r1, [r4] + ldrb r2, [r6] + ldrb r3, [r6, 0x2] + ldrb r0, [r6, 0x4] + str r0, [sp] + ldrb r0, [r6, 0x6] + str r0, [sp, 0x4] + movs r0, 0 + bl sub_8199CBC + ldr r1, [r5] + ldrb r2, [r6, 0x8] + ldrb r3, [r6, 0xA] + ldrb r0, [r6, 0xC] + str r0, [sp] + ldrb r0, [r6, 0xE] + str r0, [sp, 0x4] + movs r0, 0 + bl sub_8199CBC + add r0, sp, 0x8 + ldrb r0, [r0] + bl ClearWindowTilemap + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + bl ClearWindowTilemap + ldr r4, =gUnknown_0203CEC8 + movs r0, 0x9 + strb r0, [r4, 0xB] + ldrb r0, [r4, 0x9] + movs r1, 0x1 + bl sub_81B0FCC + ldrb r0, [r4, 0xA] + movs r1, 0x1 + bl sub_81B0FCC + adds r0, r7, 0 + bl sub_81B3CC0 + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B3D48 + str r1, [r0] +_081B3ABA: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B3938 + + thumb_func_start sub_81B3AD8 +sub_81B3AD8: @ 81B3AD8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r2, 0 + mov r12, r3 + ldr r7, [sp, 0x18] + lsls r0, 16 + lsrs r3, r0, 16 + adds r5, r3, 0 + lsls r1, 16 + lsrs r2, r1, 16 + mov r8, r2 + lsls r0, r3, 16 + asrs r1, r0, 16 + lsls r0, r2, 16 + asrs r0, 16 + adds r4, r1, r0 + cmp r4, 0 + blt _081B3B02 + cmp r1, 0x1F + ble _081B3B06 +_081B3B02: + movs r0, 0 + b _081B3B34 +_081B3B06: + cmp r1, 0 + bge _081B3B1A + negs r0, r1 + strb r0, [r6] + movs r0, 0 + mov r1, r12 + strb r0, [r1] + adds r0, r2, r3 + strb r0, [r7] + b _081B3B32 +_081B3B1A: + movs r0, 0 + strb r0, [r6] + mov r0, r12 + strb r5, [r0] + cmp r4, 0x1F + ble _081B3B2E + movs r0, 0x20 + subs r0, r5 + strb r0, [r7] + b _081B3B32 +_081B3B2E: + mov r1, r8 + strb r1, [r7] +_081B3B32: + movs r0, 0x1 +_081B3B34: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81B3AD8 + + thumb_func_start sub_81B3B40 +sub_81B3B40: @ 81B3B40 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x34 + str r0, [sp, 0x28] + ldr r0, [sp, 0x54] + ldr r4, [sp, 0x58] + lsls r2, 16 + lsrs r2, 16 + mov r9, r2 + lsls r3, 16 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + lsls r4, 16 + lsrs r4, 16 + str r4, [sp, 0x30] + lsls r1, 16 + asrs r7, r1, 16 + lsrs r0, r3, 16 + str r0, [sp, 0x2C] + asrs r3, 16 + mov r8, r3 + mov r5, sp + adds r5, 0x25 + mov r6, sp + adds r6, 0x26 + str r6, [sp] + adds r0, r7, 0 + mov r1, r8 + add r2, sp, 0x24 + adds r3, r5, 0 + bl sub_81B3AD8 + lsls r0, 24 + cmp r0, 0 + beq _081B3BFA + ldrb r2, [r5] + mov r1, r9 + lsls r0, r1, 24 + lsrs r0, 24 + mov r9, r0 + ldrb r0, [r6] + str r0, [sp] + mov r1, r10 + lsls r0, r1, 24 + lsrs r4, r0, 24 + str r4, [sp, 0x4] + movs r0, 0 + movs r1, 0 + mov r3, r9 + bl FillBgTilemapBufferRect_Palette0 + ldr r1, [sp, 0x30] + lsls r0, r1, 16 + asrs r0, 16 + adds r0, r7, r0 + lsls r0, 16 + asrs r0, 16 + str r6, [sp] + mov r1, r8 + add r2, sp, 0x24 + adds r3, r5, 0 + bl sub_81B3AD8 + lsls r0, 24 + cmp r0, 0 + beq _081B3BFA + add r0, sp, 0x24 + ldrb r2, [r0] + ldr r1, [sp, 0x2C] + lsls r0, r1, 24 + lsrs r0, 24 + str r0, [sp] + str r4, [sp, 0x4] + ldrb r0, [r5] + str r0, [sp, 0x8] + mov r0, r9 + str r0, [sp, 0xC] + ldrb r0, [r6] + str r0, [sp, 0x10] + str r4, [sp, 0x14] + movs r0, 0x11 + str r0, [sp, 0x18] + movs r0, 0 + str r0, [sp, 0x1C] + str r0, [sp, 0x20] + ldr r1, [sp, 0x28] + movs r3, 0 + bl CopyRectToBgTilemapBufferRect +_081B3BFA: + add sp, 0x34 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B3B40 + + thumb_func_start sub_81B3C0C +sub_81B3C0C: @ 81B3C0C + push {r4,lr} + ldr r4, =gSprites + ldrb r2, [r0, 0xB] + lsls r3, r2, 4 + adds r3, r2 + lsls r3, 2 + adds r3, r4 + lsls r1, 16 + asrs r1, 13 + ldrh r2, [r3, 0x24] + adds r2, r1 + strh r2, [r3, 0x24] + ldrb r3, [r0, 0xA] + lsls r2, r3, 4 + adds r2, r3 + lsls r2, 2 + adds r2, r4 + ldrh r3, [r2, 0x24] + adds r3, r1 + strh r3, [r2, 0x24] + ldrb r3, [r0, 0x9] + lsls r2, r3, 4 + adds r2, r3 + lsls r2, 2 + adds r2, r4 + ldrh r3, [r2, 0x24] + adds r3, r1 + strh r3, [r2, 0x24] + ldrb r2, [r0, 0xC] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r4 + ldrh r2, [r0, 0x24] + adds r2, r1 + strh r2, [r0, 0x24] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B3C0C + + thumb_func_start sub_81B3C60 +sub_81B3C60: @ 81B3C60 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r4, r1, r0 + movs r1, 0x14 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _081B3C8E + ldr r2, =gUnknown_0203CEDC + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + lsls r1, 4 + ldr r0, [r2] + adds r0, r1 + movs r2, 0x14 + ldrsh r1, [r4, r2] + bl sub_81B3C0C +_081B3C8E: + movs r1, 0x16 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _081B3CAC + ldr r2, =gUnknown_0203CEDC + ldr r0, =gUnknown_0203CEC8 + movs r1, 0xA + ldrsb r1, [r0, r1] + lsls r1, 4 + ldr r0, [r2] + adds r0, r1 + movs r2, 0x16 + ldrsh r1, [r4, r2] + bl sub_81B3C0C +_081B3CAC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B3C60 + + thumb_func_start sub_81B3CC0 +sub_81B3CC0: @ 81B3CC0 + push {r4-r6,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r5, r1, r0 + movs r1, 0x14 + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _081B3D00 + ldr r0, =gUnknown_0203CEF0 + ldr r0, [r0] + ldrh r1, [r5, 0x10] + ldrh r2, [r5] + adds r1, r2 + lsls r1, 16 + asrs r1, 16 + movs r3, 0x2 + ldrsh r2, [r5, r3] + movs r4, 0x4 + ldrsh r3, [r5, r4] + movs r6, 0x6 + ldrsh r4, [r5, r6] + str r4, [sp] + movs r6, 0x14 + ldrsh r4, [r5, r6] + str r4, [sp, 0x4] + bl sub_81B3B40 +_081B3D00: + movs r1, 0x16 + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _081B3D2E + ldr r0, =gUnknown_0203CEF4 + ldr r0, [r0] + ldrh r1, [r5, 0x12] + ldrh r2, [r5, 0x8] + adds r1, r2 + lsls r1, 16 + asrs r1, 16 + movs r3, 0xA + ldrsh r2, [r5, r3] + movs r4, 0xC + ldrsh r3, [r5, r4] + movs r6, 0xE + ldrsh r4, [r5, r6] + str r4, [sp] + movs r6, 0x16 + ldrsh r4, [r5, r6] + str r4, [sp, 0x4] + bl sub_81B3B40 +_081B3D2E: + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B3CC0 + + thumb_func_start sub_81B3D48 +sub_81B3D48: @ 81B3D48 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r7, r0, 3 + ldr r0, =gTasks + 0x8 + mov r8, r0 + adds r6, r7, r0 + adds r0, r4, 0 + bl sub_81B3CC0 + adds r0, r4, 0 + bl sub_81B3C60 + ldrh r1, [r6, 0x14] + ldrh r2, [r6, 0x10] + adds r1, r2 + strh r1, [r6, 0x10] + ldrh r0, [r6, 0x16] + ldrh r3, [r6, 0x12] + adds r0, r3 + strh r0, [r6, 0x12] + add r2, sp, 0x8 + ldrh r0, [r6] + adds r0, r1 + strh r0, [r2] + adds r1, r2, 0 + ldrh r0, [r6, 0x12] + ldrh r3, [r6, 0x8] + adds r2, r0, r3 + strh r2, [r1, 0x2] + adds r0, r1, 0 + ldrh r0, [r0] + cmp r0, 0x21 + bls _081B3E3A + lsls r0, r2, 16 + lsrs r0, 16 + cmp r0, 0x21 + bls _081B3E3A + movs r1, 0x14 + ldrsh r0, [r6, r1] + negs r0, r0 + strh r0, [r6, 0x14] + movs r2, 0x16 + ldrsh r0, [r6, r2] + negs r0, r0 + strh r0, [r6, 0x16] + bl swap_pokemon_and_oams + ldr r4, =gUnknown_0203CEC8 + ldrb r0, [r4, 0x9] + bl sub_81B0948 + ldrb r0, [r4, 0xA] + bl sub_81B0948 + movs r0, 0x9 + ldrsb r0, [r4, r0] + ldr r5, =gUnknown_0203CEDC + ldr r1, [r5] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x8] + bl PutWindowTilemap + movs r0, 0xA + ldrsb r0, [r4, r0] + ldr r1, [r5] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x8] + bl PutWindowTilemap + ldr r0, =gUnknown_0203CEF0 + ldr r1, [r0] + ldrb r2, [r6] + ldrb r3, [r6, 0x2] + ldrb r0, [r6, 0x4] + str r0, [sp] + ldrb r0, [r6, 0x6] + str r0, [sp, 0x4] + movs r0, 0 + bl sub_8199CBC + ldr r0, =gUnknown_0203CEF4 + ldr r1, [r0] + ldrb r2, [r6, 0x8] + ldrb r3, [r6, 0xA] + ldrb r0, [r6, 0xC] + str r0, [sp] + ldrb r0, [r6, 0xE] + str r0, [sp, 0x4] + movs r0, 0 + bl sub_8199CBC + movs r0, 0x9 + ldrsb r0, [r4, r0] + ldr r1, [r5] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x8] + bl ClearWindowTilemap + movs r0, 0xA + ldrsb r0, [r4, r0] + ldr r1, [r5] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x8] + bl ClearWindowTilemap + mov r0, r8 + subs r0, 0x8 + adds r0, r7, r0 + ldr r1, =sub_81B3E60 + str r1, [r0] +_081B3E3A: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B3D48 + + thumb_func_start sub_81B3E60 +sub_81B3E60: @ 81B3E60 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + adds r0, r6, 0 + bl sub_81B3CC0 + adds r0, r6, 0 + bl sub_81B3C60 + movs r1, 0x14 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081B3EE4 + movs r2, 0x16 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _081B3EE4 + ldr r5, =gUnknown_0203CEC8 + movs r0, 0x9 + ldrsb r0, [r5, r0] + ldr r4, =gUnknown_0203CEDC + ldr r1, [r4] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x8] + bl PutWindowTilemap + movs r0, 0xA + ldrsb r0, [r5, r0] + ldr r1, [r4] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x8] + bl PutWindowTilemap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, =gUnknown_0203CEF0 + ldr r0, [r0] + bl Free + ldr r0, =gUnknown_0203CEF4 + ldr r0, [r0] + bl Free + adds r0, r6, 0 + bl sub_81B407C + b _081B3F08 + .pool +_081B3EE4: + ldrh r1, [r4, 0x14] + ldrh r0, [r4, 0x10] + adds r1, r0 + strh r1, [r4, 0x10] + ldrh r0, [r4, 0x16] + ldrh r2, [r4, 0x12] + adds r0, r2 + strh r0, [r4, 0x12] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0 + bne _081B3EFE + strh r1, [r4, 0x14] +_081B3EFE: + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081B3F08 + strh r0, [r4, 0x16] +_081B3F08: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81B3E60 + + thumb_func_start oamt_swap_pos +oamt_swap_pos: @ 81B3F10 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + ldrb r3, [r0] + ldrb r2, [r1] + strb r2, [r0] + strb r3, [r1] + ldr r5, =gSprites + ldrb r2, [r0] + lsls r3, r2, 4 + adds r3, r2 + lsls r3, 2 + adds r3, r5 + ldrh r6, [r3, 0x20] + ldrh r2, [r3, 0x22] + mov r8, r2 + ldrh r2, [r3, 0x24] + mov r9, r2 + ldrh r2, [r3, 0x26] + mov r10, r2 + ldrb r4, [r1] + lsls r2, r4, 4 + adds r2, r4 + lsls r2, 2 + adds r2, r5 + ldrh r2, [r2, 0x20] + strh r2, [r3, 0x20] + ldrb r2, [r0] + lsls r3, r2, 4 + adds r3, r2 + lsls r3, 2 + adds r3, r5 + ldrb r4, [r1] + lsls r2, r4, 4 + adds r2, r4 + lsls r2, 2 + adds r2, r5 + ldrh r2, [r2, 0x22] + strh r2, [r3, 0x22] + ldrb r2, [r0] + lsls r3, r2, 4 + adds r3, r2 + lsls r3, 2 + adds r3, r5 + ldrb r4, [r1] + lsls r2, r4, 4 + adds r2, r4 + lsls r2, 2 + adds r2, r5 + ldrh r2, [r2, 0x24] + strh r2, [r3, 0x24] + ldrb r0, [r0] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r5 + ldrb r3, [r1] + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 2 + adds r0, r5 + ldrh r0, [r0, 0x26] + strh r0, [r2, 0x26] + ldrb r2, [r1] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r5 + strh r6, [r0, 0x20] + ldrb r2, [r1] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r5 + mov r2, r8 + strh r2, [r0, 0x22] + ldrb r2, [r1] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r5 + mov r2, r9 + strh r2, [r0, 0x24] + ldrb r1, [r1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + mov r1, r10 + strh r1, [r0, 0x26] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end oamt_swap_pos + + thumb_func_start swap_pokemon_and_oams +swap_pokemon_and_oams: @ 81B3FDC + push {r4-r6,lr} + sub sp, 0x8 + ldr r1, =gUnknown_0203CEDC + ldr r2, =gUnknown_0203CEC8 + movs r3, 0x9 + ldrsb r3, [r2, r3] + lsls r0, r3, 4 + ldr r1, [r1] + adds r0, r1, r0 + str r0, [sp] + ldrb r2, [r2, 0xA] + lsls r2, 24 + asrs r2, 24 + lsls r0, r2, 4 + adds r0, r1, r0 + str r0, [sp, 0x4] + movs r1, 0x64 + adds r4, r3, 0 + muls r4, r1 + ldr r0, =gPlayerParty + adds r4, r0 + adds r5, r2, 0 + muls r5, r1 + adds r5, r0 + movs r0, 0x64 + bl Alloc + adds r6, r0, 0 + adds r1, r4, 0 + movs r2, 0x64 + bl memcpy + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x64 + bl memcpy + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0x64 + bl memcpy + adds r0, r6, 0 + bl Free + ldr r0, [sp] + adds r0, 0xB + ldr r1, [sp, 0x4] + adds r1, 0xB + bl oamt_swap_pos + ldr r0, [sp] + adds r0, 0xA + ldr r1, [sp, 0x4] + adds r1, 0xA + bl oamt_swap_pos + ldr r0, [sp] + adds r0, 0x9 + ldr r1, [sp, 0x4] + adds r1, 0x9 + bl oamt_swap_pos + ldr r0, [sp] + adds r0, 0xC + ldr r1, [sp, 0x4] + adds r1, 0xC + bl oamt_swap_pos + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end swap_pokemon_and_oams + + thumb_func_start sub_81B407C +sub_81B407C: @ 81B407C + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + adds r0, 0xD + bl sub_81B302C + 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, 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] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B407C + + thumb_func_start brm_cancel_1 +brm_cancel_1: @ 81B40D4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x5 + bl PlaySE + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + ldr r0, =gUnknown_0203CEC8 + ldrb r1, [r0, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x6 + bne _081B4110 + movs r0, 0xF + bl display_pokemon_menu_message + b _081B4116 + .pool +_081B4110: + movs r0, 0 + bl display_pokemon_menu_message +_081B4116: + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B1370 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end brm_cancel_1 + + thumb_func_start sub_81B4134 +sub_81B4134: @ 81B4134 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + movs r0, 0x5 + bl PlaySE + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + ldr r0, =gPlayerParty + ldr r1, =gUnknown_0203CEC8 + ldrb r1, [r1, 0x9] + movs r2, 0x8 + bl sub_81B33B4 + movs r0, 0x1 + bl sub_81B31B0 + movs r0, 0x18 + bl display_pokemon_menu_message + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0xFF + strh r1, [r0, 0x8] + ldr r1, =sub_81B3730 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4134 + + thumb_func_start sub_81B4198 +sub_81B4198: @ 81B4198 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + ldr r0, =sub_81B41C4 + str r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_81B12C0 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4198 + + thumb_func_start sub_81B41C4 +sub_81B41C4: @ 81B41C4 + push {lr} + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + bne _081B41E0 + ldr r2, =c2_8123744 + movs r0, 0x2 + movs r1, 0x5 + bl GoToBagMenu + b _081B41E8 + .pool +_081B41E0: + ldr r1, =c2_8123744 + movs r0, 0x2 + bl sub_81C4F98 +_081B41E8: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B41C4 + + thumb_func_start c2_8123744 +c2_8123744: @ 81B41F0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + ldr r6, =gScriptItemId + ldrh r0, [r6] + cmp r0, 0 + bne _081B4224 + ldr r3, =gUnknown_0203CEC8 + ldrb r0, [r3, 0x8] + lsls r0, 28 + lsrs r0, 28 + ldrb r2, [r3, 0xB] + movs r1, 0x7F + str r1, [sp] + ldr r1, =sub_81B36FC + str r1, [sp, 0x4] + ldr r1, [r3] + b _081B425A + .pool +_081B4224: + ldr r4, =gUnknown_0203CEFC + ldr r5, =gUnknown_0203CEC8 + movs r0, 0x9 + ldrsb r0, [r5, r0] + movs r1, 0x64 + mov r8, r1 + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + ldr r7, =gPlayerParty + adds r0, r7 + movs r1, 0xC + bl GetMonData + strh r0, [r4] + lsls r0, 16 + cmp r0, 0 + beq _081B4278 + ldrb r0, [r5, 0x8] + lsls r0, 28 + lsrs r0, 28 + ldrb r2, [r5, 0xB] + movs r1, 0x7F + str r1, [sp] + ldr r1, =sub_81B4350 + str r1, [sp, 0x4] + ldr r1, [r5] +_081B425A: + str r1, [sp, 0x8] + movs r1, 0xFF + movs r3, 0x1 + bl sub_81B0038 + b _081B42C0 + .pool +_081B4278: + ldrh r0, [r6] + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _081B42A4 + ldrh r0, [r6] + movs r1, 0x1 + bl RemoveBagItem + movs r0, 0x9 + ldrsb r0, [r5, r0] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r7 + ldrh r1, [r6] + bl sub_81B1DB8 + bl sub_81B452C + b _081B42C0 +_081B42A4: + ldrb r0, [r5, 0x8] + lsls r0, 28 + lsrs r0, 28 + ldrb r2, [r5, 0xB] + movs r1, 0x7F + str r1, [sp] + ldr r1, =sub_81B42D0 + str r1, [sp, 0x4] + ldr r1, [r5] + str r1, [sp, 0x8] + movs r1, 0xFF + movs r3, 0x1 + bl sub_81B0038 +_081B42C0: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end c2_8123744 + + thumb_func_start sub_81B42D0 +sub_81B42D0: @ 81B42D0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B432C + ldr r0, =gScriptItemId + ldrh r4, [r0] + ldr r0, =gUnknown_0203CEC8 + mov r8, r0 + ldrb r0, [r0, 0x9] + lsls r0, 24 + asrs r0, 24 + movs r6, 0x64 + muls r0, r6 + ldr r5, =gPlayerParty + adds r0, r5 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl sub_81B1C84 + mov r1, r8 + movs r0, 0x9 + ldrsb r0, [r1, r0] + muls r0, r6 + adds r0, r5 + adds r1, r4, 0 + bl sub_81B1DB8 + adds r0, r4, 0 + movs r1, 0x1 + bl RemoveBagItem + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B469C + str r1, [r0] +_081B432C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B42D0 + + thumb_func_start sub_81B4350 +sub_81B4350: @ 81B4350 + 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 _081B4388 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gUnknown_0203CEFC + ldrh r1, [r1] + movs r2, 0x1 + bl sub_81B1D1C + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B43A8 + str r1, [r0] +_081B4388: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4350 + + thumb_func_start sub_81B43A8 +sub_81B43A8: @ 81B43A8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B43CC + bl sub_81B334C + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B43DC + str r0, [r1] +_081B43CC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B43A8 + + thumb_func_start sub_81B43DC +sub_81B43DC: @ 81B43DC + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B4402 + cmp r1, 0 + bgt _081B43FC + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B44D8 + b _081B44EC +_081B43FC: + cmp r1, 0x1 + beq _081B44DE + b _081B44EC +_081B4402: + ldr r5, =gScriptItemId + ldrh r0, [r5] + movs r1, 0x1 + bl RemoveBagItem + ldr r6, =gUnknown_0203CEFC + ldrh r0, [r6] + movs r1, 0x1 + bl AddBagItem + lsls r0, 24 + cmp r0, 0 + bne _081B4458 + ldrh r0, [r5] + movs r1, 0x1 + bl AddBagItem + ldrh r0, [r6] + bl pokemon_item_not_removed + ldr r0, =gStringVar4 + movs r1, 0 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1C1C + str r1, [r0] + b _081B44EC + .pool +_081B4458: + ldrh r0, [r5] + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _081B4498 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + ldrh r1, [r5] + bl sub_81B1DB8 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B44FC + str r1, [r0] + b _081B44EC + .pool +_081B4498: + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + ldrh r1, [r5] + bl sub_81B1DB8 + ldrh r0, [r5] + ldrh r1, [r6] + movs r2, 0x1 + bl sub_81B1D68 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B469C + str r1, [r0] + b _081B44EC + .pool +_081B44D8: + movs r0, 0x5 + bl PlaySE +_081B44DE: + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B1C1C + str r0, [r1] +_081B44EC: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B43DC + + thumb_func_start sub_81B44FC +sub_81B44FC: @ 81B44FC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B451C + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + ldr r0, =sub_81B452C + str r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_81B12C0 +_081B451C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B44FC + + thumb_func_start sub_81B452C +sub_81B452C: @ 81B452C + push {lr} + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x40 + bl GetMonData + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gSaveBlock1Ptr + lsls r2, r0, 3 + adds r2, r0 + lsls r2, 2 + ldr r0, =0x00002be0 + adds r2, r0 + ldr r1, [r1] + adds r1, r2 + ldr r2, =sub_81B4578 + movs r0, 0x4 + movs r3, 0x3 + bl sub_811A20C + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B452C + + thumb_func_start sub_81B4578 +sub_81B4578: @ 81B4578 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + ldr r6, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r6, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r0, =gScriptResult + ldrh r7, [r0] + cmp r7, 0 + bne _081B45F8 + adds r0, r5, 0 + bl sub_80D4680 + ldr r4, =gUnknown_0203CEFC + adds r0, r5, 0 + movs r1, 0xC + adds r2, r4, 0 + bl SetMonData + ldrh r0, [r4] + movs r1, 0x1 + bl RemoveBagItem + mov r0, r8 + movs r1, 0x1 + bl AddBagItem + ldrb r0, [r6, 0x8] + lsls r0, 28 + lsrs r0, 28 + ldrb r2, [r6, 0xB] + str r7, [sp] + ldr r1, =sub_81B36FC + str r1, [sp, 0x4] + ldr r1, [r6] + str r1, [sp, 0x8] + movs r1, 0xFF + movs r3, 0x1 + bl sub_81B0038 + b _081B4614 + .pool +_081B45F8: + ldrb r0, [r6, 0x8] + lsls r0, 28 + lsrs r0, 28 + ldrb r2, [r6, 0xB] + movs r1, 0x7F + str r1, [sp] + ldr r1, =sub_81B4624 + str r1, [sp, 0x4] + ldr r1, [r6] + str r1, [sp, 0x8] + movs r1, 0xFF + movs r3, 0x1 + bl sub_81B0038 +_081B4614: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4578 + + thumb_func_start sub_81B4624 +sub_81B4624: @ 81B4624 + 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 _081B468A + ldr r1, =gUnknown_0203CEFC + ldrh r0, [r1] + cmp r0, 0 + bne _081B4670 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gScriptItemId + ldrh r1, [r1] + movs r2, 0 + movs r3, 0 + bl sub_81B1C84 + b _081B467C + .pool +_081B4670: + ldr r0, =gScriptItemId + ldrh r0, [r0] + ldrh r1, [r1] + movs r2, 0 + bl sub_81B1D68 +_081B467C: + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B469C + str r0, [r1] +_081B468A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4624 + + thumb_func_start sub_81B469C +sub_81B469C: @ 81B469C + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r4, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r6, r1, r0 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B471C + ldr r5, =gUnknown_0203CEDC + movs r0, 0x9 + ldrsb r0, [r4, r0] + lsls r0, 4 + ldr r1, [r5] + adds r1, r0 + adds r0, r6, 0 + bl sub_81B5C94 + ldrb r1, [r4, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0xC + bne _081B4716 + adds r0, r6, 0 + movs r1, 0xC + bl GetMonData + cmp r0, 0 + beq _081B4704 + movs r0, 0x9 + ldrsb r0, [r4, r0] + lsls r0, 4 + ldr r1, [r5] + adds r1, r0 + movs r0, 0xB + movs r2, 0x1 + bl sub_81B2FA8 + b _081B4716 + .pool +_081B4704: + movs r0, 0x9 + ldrsb r0, [r4, r0] + lsls r0, 4 + ldr r1, [r5] + adds r1, r0 + movs r0, 0xC + movs r2, 0x1 + bl sub_81B2FA8 +_081B4716: + adds r0, r7, 0 + bl sub_81B1C1C +_081B471C: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B469C + + thumb_func_start sub_81B4724 +sub_81B4724: @ 81B4724 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r6, r0, 16 + movs r0, 0x5 + bl PlaySE + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + adds r0, r5, 0 + bl sub_81B1E00 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _081B4788 + cmp r0, 0x1 + beq _081B47AC + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0x1 + bl sub_81B1CD0 + b _081B47BA + .pool +_081B4788: + ldr r1, =gStringVar1 + adds r0, r5, 0 + bl GetMonNickname + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9980 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + b _081B47B4 + .pool +_081B47AC: + adds r0, r6, 0 + bl pokemon_item_not_removed + ldr r0, =gStringVar4 +_081B47B4: + movs r1, 0x1 + bl sub_81B1B5C +_081B47BA: + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, =gTasks + lsls r1, r7, 2 + adds r1, r7 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B469C + str r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4724 + + thumb_func_start sub_81B47E0 +sub_81B47E0: @ 81B47E0 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r7, r1, r0 + adds r0, r7, 0 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r5, r0, 16 + movs r0, 0x5 + bl PlaySE + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + cmp r5, 0 + bne _081B4864 + ldr r1, =gStringVar1 + adds r0, r7, 0 + bl GetMonNickname + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9980 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B469C + b _081B488A + .pool +_081B4864: + ldr r1, =gStringVar1 + adds r0, r5, 0 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9E00 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B48A8 +_081B488A: + str r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B47E0 + + thumb_func_start sub_81B48A8 +sub_81B48A8: @ 81B48A8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B48CC + bl sub_81B334C + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B48DC + str r0, [r1] +_081B48CC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B48A8 + + thumb_func_start sub_81B48DC +sub_81B48DC: @ 81B48DC + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r4, r1, r0 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B491A + cmp r1, 0 + bgt _081B4914 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B4964 + b _081B4978 + .pool +_081B4914: + cmp r1, 0x1 + beq _081B496A + b _081B4978 +_081B491A: + adds r0, r4, 0 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + ldr r1, =gStringVar1 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9E14 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B4988 + str r1, [r0] + b _081B4978 + .pool +_081B4964: + movs r0, 0x5 + bl PlaySE +_081B496A: + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B1C1C + str r0, [r1] +_081B4978: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B48DC + + thumb_func_start sub_81B4988 +sub_81B4988: @ 81B4988 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r6, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r6, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B49EC + movs r1, 0 + mov r0, sp + strh r1, [r0] + adds r0, r5, 0 + movs r1, 0xC + mov r2, sp + bl SetMonData + ldr r4, =gUnknown_0203CEDC + movs r0, 0x9 + ldrsb r0, [r6, r0] + lsls r0, 4 + ldr r1, [r4] + adds r1, r0 + adds r0, r5, 0 + bl sub_81B5C94 + movs r0, 0x9 + ldrsb r0, [r6, r0] + lsls r0, 4 + ldr r1, [r4] + adds r1, r0 + movs r0, 0xC + movs r2, 0x1 + bl sub_81B2FA8 + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1C1C + str r1, [r0] +_081B49EC: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4988 + + thumb_func_start sub_81B4A08 +sub_81B4A08: @ 81B4A08 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + movs r0, 0x5 + bl PlaySE + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + ldr r0, =gPlayerParty + ldr r1, =gUnknown_0203CEC8 + ldrb r1, [r1, 0x9] + movs r2, 0x9 + bl sub_81B33B4 + movs r0, 0x2 + bl sub_81B31B0 + movs r0, 0x19 + bl display_pokemon_menu_message + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0xFF + strh r1, [r0, 0x8] + ldr r1, =sub_81B3730 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4A08 + + thumb_func_start sub_81B4A6C +sub_81B4A6C: @ 81B4A6C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + ldr r0, =sub_81B4A98 + str r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_81B12C0 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4A6C + + thumb_func_start sub_81B4A98 +sub_81B4A98: @ 81B4A98 + push {lr} + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x40 + bl GetMonData + ldr r2, =gSaveBlock1Ptr + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x00002be0 + adds r1, r0 + ldr r0, [r2] + adds r0, r1 + ldr r1, =sub_81B4AE0 + movs r2, 0x1 + bl sub_8121478 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4A98 + + thumb_func_start sub_81B4AE0 +sub_81B4AE0: @ 81B4AE0 + push {lr} + sub sp, 0xC + ldr r2, =gPaletteFade + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + ldr r3, =gUnknown_0203CEC8 + ldrb r0, [r3, 0x8] + lsls r0, 28 + lsrs r0, 28 + ldrb r2, [r3, 0xB] + movs r1, 0x15 + str r1, [sp] + ldr r1, =sub_81B36FC + str r1, [sp, 0x4] + ldr r1, [r3] + str r1, [sp, 0x8] + movs r1, 0xFF + movs r3, 0x1 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4AE0 + + thumb_func_start brm_take_2 +brm_take_2: @ 81B4B20 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl PlaySE + ldr r5, =gUnknown_0203CEC4 + ldr r0, [r5] + adds r0, 0xD + bl sub_81B302C + ldr r0, [r5] + adds r0, 0xC + bl sub_81B302C + ldr r0, =gUnknown_085E9855 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B4B6C + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end brm_take_2 + + thumb_func_start sub_81B4B6C +sub_81B4B6C: @ 81B4B6C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B4B90 + bl sub_81B334C + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B4BA0 + str r0, [r1] +_081B4B90: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4B6C + + thumb_func_start sub_81B4BA0 +sub_81B4BA0: @ 81B4BA0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B4BC6 + cmp r1, 0 + bgt _081B4BC0 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B4C30 + b _081B4C4C +_081B4BC0: + cmp r1, 0x1 + beq _081B4C36 + b _081B4C4C +_081B4BC6: + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + bl sub_80D4700 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _081B4C0C + ldr r0, =gUnknown_085E9877 + movs r1, 0 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B469C + b _081B4C4A + .pool +_081B4C0C: + ldr r0, =gUnknown_085E9897 + movs r1, 0 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1C1C + b _081B4C4A + .pool +_081B4C30: + movs r0, 0x5 + bl PlaySE +_081B4C36: + ldr r0, =gUnknown_085E98B4 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B4C60 +_081B4C4A: + str r1, [r0] +_081B4C4C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4BA0 + + thumb_func_start sub_81B4C60 +sub_81B4C60: @ 81B4C60 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B4C84 + bl sub_81B334C + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B4C94 + str r0, [r1] +_081B4C84: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4C60 + + thumb_func_start sub_81B4C94 +sub_81B4C94: @ 81B4C94 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B4CBE + cmp r1, 0 + bgt _081B4CB8 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B4D50 + b _081B4D64 +_081B4CB8: + cmp r1, 0x1 + beq _081B4D56 + b _081B4D64 +_081B4CBE: + ldr r0, =gUnknown_0203CEC8 + mov r8, r0 + ldrb r0, [r0, 0x9] + lsls r0, 24 + asrs r0, 24 + movs r7, 0x64 + muls r0, r7 + ldr r6, =gPlayerParty + adds r0, r6 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + movs r1, 0x1 + bl AddBagItem + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B4D24 + mov r1, r8 + movs r0, 0x9 + ldrsb r0, [r1, r0] + muls r0, r7 + adds r0, r6 + bl sub_80D4680 + ldr r0, =gUnknown_085E99B8 + movs r1, 0 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B469C + str r1, [r0] + b _081B4D64 + .pool +_081B4D24: + adds r0, r4, 0 + bl pokemon_item_not_removed + ldr r0, =gStringVar4 + movs r1, 0 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1C1C + str r1, [r0] + b _081B4D64 + .pool +_081B4D50: + movs r0, 0x5 + bl PlaySE +_081B4D56: + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B1C1C + str r0, [r1] +_081B4D64: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4C94 + + thumb_func_start sub_81B4D78 +sub_81B4D78: @ 81B4D78 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r5, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r5, r1] + movs r0, 0x64 + muls r0, r1 + ldr r6, =gPlayerParty + adds r7, r0, r6 + movs r0, 0x5 + bl PlaySE + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + ldrb r4, [r5, 0x9] + adds r0, r7, 0 + bl sub_81B353C + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_81B33B4 + ldrb r1, [r5, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0xC + beq _081B4DE4 + movs r0, 0 + bl sub_81B31B0 + movs r0, 0x15 + bl display_pokemon_menu_message + b _081B4E02 + .pool +_081B4DE4: + movs r0, 0x1 + bl sub_81B31B0 + adds r0, r7, 0 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + ldr r1, =gStringVar2 + bl CopyItemName + movs r0, 0x1A + bl display_pokemon_menu_message +_081B4E02: + ldr r1, =gTasks + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0xFF + strh r1, [r0, 0x8] + ldr r1, =sub_81B3730 + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4D78 + + thumb_func_start brm_shift_sendout +brm_shift_sendout: @ 81B4E2C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x5 + bl PlaySE + ldr r5, =gUnknown_0203CEC4 + ldr r0, [r5] + adds r0, 0xC + bl sub_81B302C + bl sub_81B8A7C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B4E5C + adds r0, r4, 0 + bl sub_81B12C0 + b _081B4E7A + .pool +_081B4E5C: + ldr r0, [r5] + adds r0, 0xD + bl sub_81B302C + ldr r0, =gStringVar4 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1C1C + str r1, [r0] +_081B4E7A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end brm_shift_sendout + + thumb_func_start sub_81B4E8C +sub_81B4E8C: @ 81B4E8C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + bl sub_81B8830 + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + cmp r5, r6 + bcs _081B4F36 + ldr r2, =gUnknown_0203CEC8 + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + mov r8, r0 +_081B4EC6: + ldr r0, =gUnknown_0203CEF8 + adds r4, r5, r0 + ldrb r0, [r4] + cmp r0, 0 + bne _081B4F2C + movs r0, 0x5 + str r2, [sp] + bl PlaySE + ldr r2, [sp] + ldrb r0, [r2, 0x9] + adds r0, 0x1 + strb r0, [r4] + adds r0, r5, 0x2 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0203CEDC + ldrb r2, [r2, 0x9] + lsls r2, 24 + asrs r2, 24 + lsls r2, 4 + ldr r1, [r1] + adds r1, r2 + movs r2, 0x1 + bl sub_81B2FA8 + subs r0, r6, 0x1 + cmp r5, r0 + bne _081B4F04 + bl sub_81B4F88 +_081B4F04: + movs r0, 0 + bl display_pokemon_menu_message + ldr r0, =sub_81B1370 + mov r1, r8 + str r0, [r1] + b _081B4F68 + .pool +_081B4F2C: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r6 + bcc _081B4EC6 +_081B4F36: + ldr r0, =gStringVar1 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0x1 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9830 + adds r0, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x20 + bl PlaySE + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1C1C + str r1, [r0] +_081B4F68: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4E8C + + thumb_func_start sub_81B4F88 +sub_81B4F88: @ 81B4F88 + push {r4,lr} + ldr r4, =gUnknown_0203CEC8 + ldrb r0, [r4, 0x9] + movs r1, 0 + bl sub_81B0FCC + movs r0, 0x6 + strb r0, [r4, 0x9] + movs r1, 0x1 + bl sub_81B0FCC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4F88 + + thumb_func_start sub_81B4FA8 +sub_81B4FA8: @ 81B4FA8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r0, 0x5 + bl PlaySE + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + bl sub_81B8830 + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + cmp r4, r5 + bcs _081B502A + ldr r6, =gUnknown_0203CEF8 + subs r2, r5, 0x1 + adds r7, r6, 0 + ldr r3, =gUnknown_0203CEC8 +_081B4FE2: + adds r0, r4, r6 + ldrb r1, [r0] + movs r0, 0x9 + ldrsb r0, [r3, r0] + adds r0, 0x1 + cmp r1, r0 + bne _081B5020 + adds r0, r4, 0 + adds r4, r2, 0 + cmp r0, r4 + bge _081B500C + adds r3, r7, 0 +_081B4FFA: + adds r2, r0, r3 + adds r1, r0, 0x1 + adds r0, r1, r3 + ldrb r0, [r0] + strb r0, [r2] + lsls r1, 24 + lsrs r0, r1, 24 + cmp r0, r4 + blt _081B4FFA +_081B500C: + adds r1, r0, r6 + movs r0, 0 + strb r0, [r1] + b _081B502A + .pool +_081B5020: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _081B4FE2 +_081B502A: + ldr r6, =gUnknown_0203CEDC + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0x9] + lsls r0, 24 + asrs r0, 24 + lsls r0, 4 + ldr r1, [r6] + adds r1, r0 + movs r0, 0x1 + movs r2, 0x1 + bl sub_81B2FA8 + movs r4, 0 + subs r5, 0x1 + mov r0, r8 + lsls r7, r0, 2 + cmp r4, r5 + bge _081B5078 +_081B504E: + ldr r0, =gUnknown_0203CEF8 + adds r1, r4, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _081B506E + adds r0, r4, 0x2 + lsls r0, 24 + lsrs r0, 24 + ldrb r2, [r1] + lsls r2, 4 + subs r2, 0x10 + ldr r1, [r6] + adds r1, r2 + movs r2, 0x1 + bl sub_81B2FA8 +_081B506E: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + blt _081B504E +_081B5078: + movs r0, 0 + bl display_pokemon_menu_message + ldr r0, =gTasks + mov r2, r8 + adds r1, r7, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B1370 + str r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4FA8 + + thumb_func_start sub_81B50AC +sub_81B50AC: @ 81B50AC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl PlaySE + adds r0, r4, 0 + bl sub_81B12C0 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B50AC + + thumb_func_start sub_81B50C8 +sub_81B50C8: @ 81B50C8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =gUnknown_0203CEC8 + mov r9, r0 + ldrb r0, [r0, 0x9] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x64 + mov r8, r1 + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + ldr r4, =gPlayerParty + adds r0, r4 + movs r1, 0x41 + bl GetMonData + adds r6, r0, 0 + lsls r6, 16 + lsrs r6, 16 + mov r1, r9 + movs r0, 0x9 + ldrsb r0, [r1, r0] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r4 + movs r1, 0xB + bl GetMonData + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + mov r1, r9 + movs r0, 0x9 + ldrsb r0, [r1, r0] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r4 + movs r1, 0x50 + bl GetMonData + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_800F7DC + ldr r0, [r0] + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_807A8D0 + cmp r0, 0x1 + beq _081B515C + cmp r0, 0x2 + beq _081B5170 + movs r0, 0x5 + bl PlaySE + adds r0, r7, 0 + bl sub_81B12C0 + b _081B51B0 + .pool +_081B515C: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EA210 + bl StringExpandPlaceholders + b _081B5178 + .pool +_081B5170: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EA234 + bl StringExpandPlaceholders +_081B5178: + movs r0, 0x20 + bl PlaySE + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EA1CA + adds r0, r4, 0 + bl StringAppend + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1C1C + str r1, [r0] +_081B51B0: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B50C8 + + thumb_func_start brm_trade_1 +brm_trade_1: @ 81B51D4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =gUnknown_0203CEC8 + mov r8, r0 + ldrb r0, [r0, 0x9] + lsls r0, 24 + asrs r0, 24 + movs r6, 0x64 + muls r0, r6 + ldr r4, =gPlayerParty + adds r0, r4 + movs r1, 0x41 + bl GetMonData + mov r9, r0 + mov r1, r9 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + mov r1, r8 + movs r0, 0x9 + ldrsb r0, [r1, r0] + muls r0, r6 + adds r0, r4 + movs r1, 0xB + bl GetMonData + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + mov r1, r8 + movs r0, 0x9 + ldrsb r0, [r1, r0] + muls r0, r6 + adds r0, r4 + movs r1, 0x50 + bl GetMonData + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_800F7DC + ldr r0, [r0] + ldr r1, =gUnknown_02022C38 + ldr r1, [r1] + ldr r2, =gUnknown_02022C3C + ldrh r3, [r2] + ldr r2, =gUnknown_02022C3E + ldrb r2, [r2] + str r2, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + mov r2, r9 + bl sub_807A7E0 + cmp r0, 0 + beq _081B52C8 + ldr r5, =gStringVar4 + ldr r1, =gUnknown_08615E0C + subs r0, 0x1 + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r5, 0 + bl StringExpandPlaceholders + movs r0, 0x20 + bl PlaySE + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + ldr r1, =gUnknown_085EA1CA + adds r0, r5, 0 + bl StringAppend + adds r0, r5, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1C1C + str r1, [r0] + b _081B52D4 + .pool +_081B52C8: + movs r0, 0x5 + bl PlaySE + adds r0, r7, 0 + bl sub_81B12C0 +_081B52D4: + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end brm_trade_1 + + thumb_func_start sub_81B52E4 +sub_81B52E4: @ 81B52E4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + ldr r0, =gPlayerParty + ldr r1, =gUnknown_0203CEC8 + ldrb r1, [r1, 0x9] + lsls r1, 24 + asrs r1, 24 + lsls r1, 16 + lsrs r1, 16 + bl sub_807A918 + cmp r0, 0x2 + beq _081B5340 + cmp r0, 0x2 + bgt _081B5328 + cmp r0, 0x1 + beq _081B532E + b _081B5368 + .pool +_081B5328: + cmp r0, 0x3 + beq _081B5354 + b _081B5368 +_081B532E: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EA1E8 + bl StringExpandPlaceholders + b _081B53C0 + .pool +_081B5340: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EA210 + bl StringExpandPlaceholders + b _081B53C0 + .pool +_081B5354: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EA234 + bl StringExpandPlaceholders + b _081B53C0 + .pool +_081B5368: + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + 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_085EA1CD + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B53FC + b _081B53E4 + .pool +_081B53C0: + movs r0, 0x20 + bl PlaySE + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EA1CA + adds r0, r4, 0 + bl StringAppend + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1C1C +_081B53E4: + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B52E4 + + thumb_func_start sub_81B53FC +sub_81B53FC: @ 81B53FC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B5420 + bl sub_81B334C + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B5430 + str r0, [r1] +_081B5420: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B53FC + + thumb_func_start sub_81B5430 +sub_81B5430: @ 81B5430 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B5456 + cmp r1, 0 + bgt _081B5450 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B545E + b _081B546A +_081B5450: + cmp r1, 0x1 + beq _081B5464 + b _081B546A +_081B5456: + adds r0, r4, 0 + bl sub_81B12C0 + b _081B546A +_081B545E: + movs r0, 0x5 + bl PlaySE +_081B5464: + adds r0, r4, 0 + bl sub_81B1C1C +_081B546A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B5430 + + thumb_func_start sub_81B5470 +sub_81B5470: @ 81B5470 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + bl GetMenuCursorPos + ldr r5, =gUnknown_0203CEC4 + ldr r1, [r5] + lsls r0, 24 + lsrs r0, 24 + adds r1, 0xF + adds r1, r0 + ldrb r0, [r1] + subs r0, 0x13 + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x5 + bl PlaySE + ldr r1, =gUnknown_08615D9C + lsls r0, r4, 3 + adds r7, r0, r1 + ldr r0, [r7] + cmp r0, 0 + bne _081B54A2 + b _081B5664 +_081B54A2: + ldr r0, [r5] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r5] + adds r0, 0xD + bl sub_81B302C + bl sub_81221AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B54C6 + bl InUnionRoom + cmp r0, 0x1 + bne _081B54E8 +_081B54C6: + adds r0, r4, 0 + subs r0, 0xB + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _081B54E4 + movs r0, 0xD + bl display_pokemon_menu_message + b _081B5656 + .pool +_081B54E4: + ldrb r0, [r7, 0x4] + b _081B5652 +_081B54E8: + cmp r4, 0x7 + bhi _081B5524 + ldr r1, =0x00000867 + adds r0, r4, r1 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B5524 + ldr r0, =gUnknown_085E97FC + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1C1C + str r1, [r0] + b _081B5664 + .pool +_081B5524: + ldr r1, =gUnknown_08615D9C + lsls r0, r4, 3 + adds r5, r0, r1 + ldr r0, [r5] + bl _call_via_r0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B553A + b _081B563C +_081B553A: + subs r0, r4, 0x5 + cmp r0, 0x7 + bhi _081B5624 + lsls r0, 2 + ldr r1, =_081B5554 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081B5554: + .4byte _081B5614 + .4byte _081B5624 + .4byte _081B5624 + .4byte _081B557C + .4byte _081B55B8 + .4byte _081B5624 + .4byte _081B5574 + .4byte _081B5574 +_081B5574: + adds r0, r6, 0 + bl sub_8161560 + b _081B5664 +_081B557C: + ldr r0, =gSaveBlock1Ptr + ldr r1, [r0] + movs r0, 0x1C + ldrsb r0, [r1, r0] + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1, 0x1D] + lsls r1, 24 + asrs r1, 24 + lsls r1, 16 + lsrs r1, 16 + bl get_mapheader_by_bank_and_number + adds r1, r0, 0 + ldr r0, =gStringVar1 + ldrb r1, [r1, 0x14] + bl sub_81245DC + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EA196 + b _081B55E8 + .pool +_081B55B8: + ldr r0, =gSaveBlock1Ptr + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x24 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 16 + lsrs r0, 16 + adds r1, 0x25 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + lsls r1, 16 + lsrs r1, 16 + bl get_mapheader_by_bank_and_number + adds r1, r0, 0 + ldr r0, =gStringVar1 + ldrb r1, [r1, 0x14] + bl sub_81245DC + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EA16B +_081B55E8: + bl StringExpandPlaceholders + adds r0, r6, 0 + bl sub_81B5674 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 + strh r4, [r0] + b _081B5664 + .pool +_081B5614: + ldr r1, =gUnknown_0203CEC8 + ldr r0, =sub_8124690 + b _081B5628 + .pool +_081B5624: + ldr r1, =gUnknown_0203CEC8 + ldr r0, =c2_exit_to_overworld_2_switch +_081B5628: + str r0, [r1] + adds r0, r6, 0 + bl sub_81B12C0 + b _081B5664 + .pool +_081B563C: + cmp r4, 0x1 + beq _081B564A + cmp r4, 0x4 + bne _081B5650 + bl sub_81B5864 + b _081B5656 +_081B564A: + bl sub_81B57DC + b _081B5656 +_081B5650: + ldrb r0, [r5, 0x4] +_081B5652: + bl display_pokemon_menu_message +_081B5656: + ldr r0, =gTasks + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =task_brm_cancel_1_on_keypad_a_or_b + str r0, [r1] +_081B5664: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B5470 + + thumb_func_start sub_81B5674 +sub_81B5674: @ 81B5674 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gStringVar4 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B56A4 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B5674 + + thumb_func_start sub_81B56A4 +sub_81B56A4: @ 81B56A4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B56C8 + bl sub_81B334C + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B56D8 + str r0, [r1] +_081B56C8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B56A4 + + thumb_func_start sub_81B56D8 +sub_81B56D8: @ 81B56D8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B56FE + cmp r1, 0 + bgt _081B56F8 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B5714 + b _081B572A +_081B56F8: + cmp r1, 0x1 + beq _081B571A + b _081B572A +_081B56FE: + ldr r1, =gUnknown_0203CEC8 + ldr r0, =c2_exit_to_overworld_2_switch + str r0, [r1] + adds r0, r4, 0 + bl sub_81B12C0 + b _081B572A + .pool +_081B5714: + movs r0, 0x5 + bl PlaySE +_081B571A: + ldr r0, =gUnknown_03005DB0 + movs r1, 0 + str r1, [r0] + ldr r0, =gUnknown_0203CEEC + str r1, [r0] + adds r0, r4, 0 + bl sub_81B1C1C +_081B572A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B56D8 + + thumb_func_start hm_add_c3_launch_phase_2 +hm_add_c3_launch_phase_2: @ 81B5738 + push {lr} + bl pal_fill_black + ldr r0, =task_launch_hm_phase_2 + movs r1, 0x8 + bl CreateTask + movs r0, 0x1 + pop {r1} + bx r1 + .pool + thumb_func_end hm_add_c3_launch_phase_2 + + thumb_func_start task_launch_hm_phase_2 +task_launch_hm_phase_2: @ 81B5750 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80ABDFC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B577C + bl brm_get_selected_species + ldr r1, =gUnknown_02038C08 + lsls r0, 16 + lsrs r0, 16 + str r0, [r1] + ldr r0, =gUnknown_0203CEEC + ldr r0, [r0] + bl _call_via_r0 + adds r0, r4, 0 + bl DestroyTask +_081B577C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end task_launch_hm_phase_2 + + thumb_func_start brm_get_selected_species +brm_get_selected_species: @ 81B578C + push {lr} + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xB + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + .pool + thumb_func_end brm_get_selected_species + + thumb_func_start task_brm_cancel_1_on_keypad_a_or_b +task_brm_cancel_1_on_keypad_a_or_b: @ 81B57B4 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081B57CE + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B57D4 +_081B57CE: + adds r0, r2, 0 + bl brm_cancel_1 +_081B57D4: + pop {r0} + bx r0 + .pool + thumb_func_end task_brm_cancel_1_on_keypad_a_or_b + + thumb_func_start sub_81B57DC +sub_81B57DC: @ 81B57DC + push {lr} + ldr r0, =0x00000888 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B57F8 + movs r0, 0xC + bl display_pokemon_menu_message + b _081B57FE + .pool +_081B57F8: + movs r0, 0xD + bl display_pokemon_menu_message +_081B57FE: + pop {r0} + bx r0 + thumb_func_end sub_81B57DC + + thumb_func_start hm_surf_run_dp02scr +hm_surf_run_dp02scr: @ 81B5804 + push {lr} + bl brm_get_pokemon_selection + ldr r1, =gUnknown_02038C08 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + movs r0, 0x9 + bl FieldEffectStart + pop {r0} + bx r0 + .pool + thumb_func_end hm_surf_run_dp02scr + + thumb_func_start sub_81B5820 +sub_81B5820: @ 81B5820 + push {lr} + bl PartyHasMonWithSurf + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B585C + bl IsPlayerFacingSurfableFishableWater + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B585C + ldr r1, =gUnknown_03005DB0 + ldr r0, =hm_add_c3_launch_phase_2 + str r0, [r1] + ldr r1, =gUnknown_0203CEEC + ldr r0, =hm_surf_run_dp02scr + str r0, [r1] + movs r0, 0x1 + b _081B585E + .pool +_081B585C: + movs r0, 0 +_081B585E: + pop {r1} + bx r1 + thumb_func_end sub_81B5820 + + thumb_func_start sub_81B5864 +sub_81B5864: @ 81B5864 + push {lr} + movs r0, 0x8 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + beq _081B587A + movs r0, 0x9 + bl display_pokemon_menu_message + b _081B5880 +_081B587A: + movs r0, 0x8 + bl display_pokemon_menu_message +_081B5880: + pop {r0} + bx r0 + thumb_func_end sub_81B5864 + + thumb_func_start sub_81B5884 +sub_81B5884: @ 81B5884 + push {lr} + ldr r0, =gMapHeader + ldrb r0, [r0, 0x17] + bl is_light_level_1_2_3_or_6 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B58A0 + movs r0, 0 + b _081B58A2 + .pool +_081B58A0: + movs r0, 0x1 +_081B58A2: + pop {r1} + bx r1 + thumb_func_end sub_81B5884 + + thumb_func_start sub_81B58A8 +sub_81B58A8: @ 81B58A8 + push {lr} + sub sp, 0xC + movs r0, 0 + str r0, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =sub_8086194 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B58A8 + + thumb_func_start hm2_waterfall +hm2_waterfall: @ 81B58D4 + push {lr} + bl brm_get_pokemon_selection + ldr r1, =gUnknown_02038C08 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + movs r0, 0x2B + bl FieldEffectStart + pop {r0} + bx r0 + .pool + thumb_func_end hm2_waterfall + + thumb_func_start hm_prepare_waterfall +hm_prepare_waterfall: @ 81B58F0 + push {r4,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl GetXYCoordsOneStepInFrontOfPlayer + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl MetatileBehavior_IsWaterfall + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B594C + bl IsPlayerSurfingNorth + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B594C + ldr r1, =gUnknown_03005DB0 + ldr r0, =hm_add_c3_launch_phase_2 + str r0, [r1] + ldr r1, =gUnknown_0203CEEC + ldr r0, =hm2_waterfall + str r0, [r1] + movs r0, 0x1 + b _081B594E + .pool +_081B594C: + movs r0, 0 +_081B594E: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end hm_prepare_waterfall + + thumb_func_start sub_81B5958 +sub_81B5958: @ 81B5958 + push {lr} + bl brm_get_pokemon_selection + ldr r1, =gUnknown_02038C08 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + movs r0, 0x2C + bl FieldEffectStart + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B5958 + + thumb_func_start sub_81B5974 +sub_81B5974: @ 81B5974 + push {lr} + bl sub_809D1E8 + ldr r1, =gUnknown_02038C08 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1, 0x4] + cmp r0, 0 + bne _081B5990 + movs r0, 0 + b _081B599E + .pool +_081B5990: + ldr r1, =gUnknown_03005DB0 + ldr r0, =hm_add_c3_launch_phase_2 + str r0, [r1] + ldr r1, =gUnknown_0203CEEC + ldr r0, =sub_81B5958 + str r0, [r1] + movs r0, 0x1 +_081B599E: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B5974 + + thumb_func_start party_menu_icon_anim +@ void party_menu_icon_anim(struct pokemon *mon, int a2, int a3) +party_menu_icon_anim: @ 81B59B4 + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r7, r1, 0 + adds r4, r2, 0 + movs r6, 0x1 + bl sub_81B1250 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B59EA + ldr r0, =gMain + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B59EA + ldr r0, =gUnknown_08616020 + adds r0, r4, r0 + ldrb r1, [r0] + eors r1, r6 + negs r0, r1 + orrs r0, r1 + lsrs r6, r0, 31 +_081B59EA: + adds r0, r5, 0 + movs r1, 0x41 + bl GetMonData + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0 + bl GetMonData + adds r1, r0, 0 + str r6, [sp] + adds r0, r4, 0 + adds r2, r7, 0 + movs r3, 0x1 + bl party_menu_link_mon_icon_anim + ldrb r0, [r7, 0x9] + adds r1, r5, 0 + bl sub_81B5B38 + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end party_menu_icon_anim + + thumb_func_start party_menu_link_mon_icon_anim +@ void party_menu_link_mon_icon_anim(u16 speciesId, u32 personality, int a3, char a4, int a5) +party_menu_link_mon_icon_anim: @ 81B5A2C + push {r4-r7,lr} + sub sp, 0xC + adds r6, r1, 0 + adds r4, r2, 0 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r3, 24 + lsrs r7, r3, 24 + cmp r5, 0 + beq _081B5A7A + ldr r1, =sub_80D3014 + ldr r0, [r4, 0x4] + ldrb r2, [r0] + ldrb r3, [r0, 0x1] + movs r0, 0x4 + str r0, [sp] + str r6, [sp, 0x4] + ldr r0, [sp, 0x20] + str r0, [sp, 0x8] + adds r0, r5, 0 + bl sub_80D2CC4 + strb r0, [r4, 0x9] + ldr r2, =gSprites + ldrb r0, [r4, 0x9] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x3 + adds r2, r7, 0 + ands r2, r0 + lsls r2, 2 + ldrb r3, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0x5] +_081B5A7A: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end party_menu_link_mon_icon_anim + + thumb_func_start sub_81B5A8C +sub_81B5A8C: @ 81B5A8C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + adds r0, r1, 0 + adds r1, r2, 0 + bl sub_8075060 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _081B5AEC + cmp r0, 0x2 + bgt _081B5AB4 + cmp r0, 0x1 + beq _081B5B04 + b _081B5B1C +_081B5AB4: + cmp r0, 0x3 + beq _081B5AD4 + cmp r0, 0x4 + bne _081B5B1C + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + movs r1, 0 + bl sub_80D32C8 + b _081B5B2C + .pool +_081B5AD4: + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + movs r1, 0x1 + bl sub_80D32C8 + b _081B5B2C + .pool +_081B5AEC: + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + movs r1, 0x2 + bl sub_80D32C8 + b _081B5B2C + .pool +_081B5B04: + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + movs r1, 0x3 + bl sub_80D32C8 + b _081B5B2C + .pool +_081B5B1C: + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + movs r1, 0x4 + bl sub_80D32C8 +_081B5B2C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B5A8C + + thumb_func_start sub_81B5B38 +sub_81B5B38: @ 81B5B38 + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r6, 0 + movs r1, 0x39 + bl GetMonData + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r6, 0 + movs r1, 0x3A + bl GetMonData + adds r2, r0, 0 + lsls r2, 16 + lsrs r2, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81B5A8C + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81B5B38 + + thumb_func_start sub_81B5B6C +sub_81B5B6C: @ 81B5B6C + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + ldr r5, =gSprites + lsls r0, r4, 4 + adds r0, r4 + lsls r6, r0, 2 + adds r2, r6, r5 + movs r7, 0 + movs r3, 0 + strh r3, [r2, 0x2E] + mov r12, r5 + cmp r1, 0 + bne _081B5BC4 + movs r1, 0x20 + ldrsh r0, [r2, r1] + cmp r0, 0x10 + bne _081B5BA4 + strh r3, [r2, 0x24] + ldr r0, =0x0000fffc + strh r0, [r2, 0x26] + b _081B5BAA + .pool +_081B5BA4: + ldr r0, =0x0000fffc + strh r0, [r2, 0x24] + strh r3, [r2, 0x26] +_081B5BAA: + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + mov r1, r12 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_81B5C08 + b _081B5BD0 + .pool +_081B5BC4: + strh r3, [r2, 0x24] + strh r3, [r2, 0x26] + adds r0, r5, 0 + adds r0, 0x1C + adds r0, r6, r0 + ldr r1, =sub_81B5BDC +_081B5BD0: + str r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B5B6C + + thumb_func_start sub_81B5BDC +sub_81B5BDC: @ 81B5BDC + push {r4,lr} + adds r4, r0, 0 + bl sub_80D30DC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _081B5C02 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081B5C00 + ldr r0, =0x0000fffd + strh r0, [r4, 0x26] + b _081B5C02 + .pool +_081B5C00: + strh r1, [r4, 0x26] +_081B5C02: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B5BDC + + thumb_func_start sub_81B5C08 +sub_81B5C08: @ 81B5C08 + push {lr} + bl sub_80D30DC + pop {r0} + bx r0 + thumb_func_end sub_81B5C08 + + thumb_func_start party_menu_held_item_object +party_menu_held_item_object: @ 81B5C14 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B5C3C + ldr r0, =gUnknown_08615EC0 + ldr r2, [r4, 0x4] + ldrb r1, [r2, 0x2] + ldrb r2, [r2, 0x3] + movs r3, 0 + bl CreateSprite + strb r0, [r4, 0xA] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81B5C94 +_081B5C3C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end party_menu_held_item_object + + thumb_func_start party_menu_link_mon_held_item_object +party_menu_link_mon_held_item_object: @ 81B5C48 + push {r4,r5,lr} + adds r4, r2, 0 + lsls r0, 16 + lsls r1, 16 + lsrs r5, r1, 16 + cmp r0, 0 + beq _081B5C84 + ldr r0, =gUnknown_08615EC0 + ldr r2, [r4, 0x4] + ldrb r1, [r2, 0x2] + ldrb r2, [r2, 0x3] + movs r3, 0 + bl CreateSprite + strb r0, [r4, 0xA] + ldr r2, =gSprites + ldrb r0, [r4, 0xA] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x5] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81B5CB0 +_081B5C84: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end party_menu_link_mon_held_item_object + + thumb_func_start sub_81B5C94 +sub_81B5C94: @ 81B5C94 + push {r4,lr} + adds r4, r1, 0 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl sub_81B5CB0 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B5C94 + + thumb_func_start sub_81B5CB0 +sub_81B5CB0: @ 81B5CB0 + push {r4,lr} + adds r4, r1, 0 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + bne _081B5CD8 + ldr r2, =gSprites + ldrb r1, [r4, 0xA] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + b _081B5D24 + .pool +_081B5CD8: + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _081B5CFC + ldrb r1, [r4, 0xA] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + movs r1, 0x1 + bl StartSpriteAnim + b _081B5D0E + .pool +_081B5CFC: + ldrb r1, [r4, 0xA] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + movs r1, 0 + bl StartSpriteAnim +_081B5D0E: + ldr r2, =gSprites + ldrb r1, [r4, 0xA] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 +_081B5D24: + strb r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B5CB0 + + thumb_func_start sub_81B5D30 +sub_81B5D30: @ 81B5D30 + push {lr} + ldr r0, =gUnknown_08615EB0 + bl LoadSpriteSheet + ldr r0, =gUnknown_08615EB8 + bl LoadSpritePalette + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B5D30 + + thumb_func_start sub_81B5D4C +sub_81B5D4C: @ 81B5D4C + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + lsls r2, 24 + lsrs r2, 24 + cmp r2, 0 + beq _081B5D60 + cmp r2, 0x1 + beq _081B5DA8 + b _081B5DE4 +_081B5D60: + movs r5, 0 + ldrb r0, [r6] + cmp r5, r0 + bcs _081B5DE4 +_081B5D68: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _081B5D94 + adds r0, r7, r5 + ldrb r4, [r0] + adds r0, r1, 0 + bl itemid_is_mail + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_81B5DF0 +_081B5D94: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + ldrb r0, [r6] + cmp r5, r0 + bcc _081B5D68 + b _081B5DE4 + .pool +_081B5DA8: + movs r5, 0 + b _081B5DDE +_081B5DAC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _081B5DD8 + adds r0, r5, r7 + ldrb r4, [r0, 0x6] + adds r0, r1, 0 + bl itemid_is_mail + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_81B5DF0 +_081B5DD8: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_081B5DDE: + ldrb r0, [r6, 0x1] + cmp r5, r0 + bcc _081B5DAC +_081B5DE4: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B5D4C + + thumb_func_start sub_81B5DF0 +sub_81B5DF0: @ 81B5DF0 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + adds r6, r0, 0 + mov r9, r1 + lsls r6, 24 + lsrs r6, 24 + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r0, =gSprites + mov r8, r0 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + add r0, r8 + adds r0, 0x43 + ldrb r3, [r0] + ldr r0, =gUnknown_08615EC0 + subs r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + movs r1, 0xFA + movs r2, 0xAA + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + mov r0, r8 + adds r5, r4, r0 + movs r0, 0x4 + strh r0, [r5, 0x24] + movs r0, 0xA + strh r0, [r5, 0x26] + movs r0, 0x1C + add r8, r0 + add r4, r8 + ldr r0, =sub_81B5E74 + str r0, [r4] + strh r6, [r5, 0x3C] + adds r0, r5, 0 + mov r1, r9 + bl StartSpriteAnim + ldr r1, [r4] + adds r0, r5, 0 + bl _call_via_r1 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B5DF0 + + thumb_func_start sub_81B5E74 +sub_81B5E74: @ 81B5E74 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x3C] + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gSprites + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, r0, r2 + adds r0, r2, 0 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + bge _081B5EA8 + adds r0, r4, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + b _081B5EC6 + .pool +_081B5EA8: + adds r3, r4, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r3] + ldrh r0, [r2, 0x24] + ldrh r1, [r2, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r2, 0x26] + ldrh r2, [r2, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] +_081B5EC6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B5E74 + + thumb_func_start party_menu_pokeball_object +party_menu_pokeball_object: @ 81B5ECC + push {r4,lr} + adds r4, r1, 0 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B5EEA + ldr r0, =gUnknown_08615F08 + ldr r2, [r4, 0x4] + ldrb r1, [r2, 0x6] + ldrb r2, [r2, 0x7] + movs r3, 0x8 + bl CreateSprite + strb r0, [r4, 0xB] +_081B5EEA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end party_menu_pokeball_object + + thumb_func_start party_menu_link_mon_pokeball_object +party_menu_link_mon_pokeball_object: @ 81B5EF4 + push {r4,lr} + adds r4, r1, 0 + lsls r0, 16 + cmp r0, 0 + beq _081B5F24 + ldr r0, =gUnknown_08615F08 + ldr r2, [r4, 0x4] + ldrb r1, [r2, 0x6] + ldrb r2, [r2, 0x7] + movs r3, 0x8 + bl CreateSprite + strb r0, [r4, 0xB] + ldr r2, =gSprites + ldrb r0, [r4, 0xB] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x5] +_081B5F24: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end party_menu_link_mon_pokeball_object + + thumb_func_start sub_81B5F34 +sub_81B5F34: @ 81B5F34 + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + lsls r3, 24 + lsrs r3, 24 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gUnknown_08615F08 + adds r1, r3, 0 + movs r3, 0x8 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gSprites + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r3, [r1, 0x5] + movs r2, 0xD + negs r2, r2 + ands r2, r3 + movs r3, 0x8 + orrs r2, r3 + strb r2, [r1, 0x5] + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B5F34 + + thumb_func_start sub_81B5F74 +sub_81B5F74: @ 81B5F74 + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + lsls r3, 24 + lsrs r3, 24 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gUnknown_08615F78 + adds r1, r3, 0 + movs r3, 0x8 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B5F74 + + thumb_func_start sub_81B5F98 +sub_81B5F98: @ 81B5F98 + push {lr} + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + ldr r2, =gSprites + adds r0, r2 + bl StartSpriteAnim + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B5F98 + + thumb_func_start sub_81B5FBC +sub_81B5FBC: @ 81B5FBC + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r6, r2, 24 + cmp r6, 0 + bne _081B6000 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =gSprites + mov r8, r0 + add r4, r8 + adds r0, r4, 0 + movs r1, 0x2 + bl StartSpriteAnim + lsls r5, r7, 4 + adds r5, r7 + lsls r5, 2 + add r5, r8 + adds r0, r5, 0 + movs r1, 0x4 + bl StartSpriteAnim + strh r6, [r4, 0x26] + strh r6, [r5, 0x26] + b _081B602C + .pool +_081B6000: + lsls r5, r0, 4 + adds r5, r0 + lsls r5, 2 + ldr r0, =gSprites + mov r8, r0 + add r5, r8 + adds r0, r5, 0 + movs r1, 0x3 + bl StartSpriteAnim + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + add r4, r8 + adds r0, r4, 0 + movs r1, 0x5 + bl StartSpriteAnim + ldr r0, =0x0000fffc + strh r0, [r5, 0x26] + movs r0, 0x4 + strh r0, [r4, 0x26] +_081B602C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B5FBC + + thumb_func_start sub_81B6040 +sub_81B6040: @ 81B6040 + push {lr} + ldr r0, =gUnknown_08615EF8 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_08615F70 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_08615F00 + bl LoadCompressedObjectPalette + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6040 + + thumb_func_start party_menu_status_condition_object +party_menu_status_condition_object: @ 81B6064 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B608C + ldr r0, =gUnknown_08616008 + ldr r2, [r4, 0x4] + ldrb r1, [r2, 0x4] + ldrb r2, [r2, 0x5] + movs r3, 0 + bl CreateSprite + strb r0, [r4, 0xC] + adds r0, r5, 0 + adds r1, r4, 0 + bl party_menu_get_status_condition_and_update_object +_081B608C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end party_menu_status_condition_object + + thumb_func_start party_menu_link_mon_status_condition_object +party_menu_link_mon_status_condition_object: @ 81B6098 + push {r4,r5,lr} + adds r4, r2, 0 + lsls r0, 16 + lsls r1, 24 + lsrs r5, r1, 24 + cmp r0, 0 + beq _081B60D4 + ldr r0, =gUnknown_08616008 + ldr r2, [r4, 0x4] + ldrb r1, [r2, 0x4] + ldrb r2, [r2, 0x5] + movs r3, 0 + bl CreateSprite + strb r0, [r4, 0xC] + adds r0, r5, 0 + adds r1, r4, 0 + bl party_menu_update_status_condition_object + ldr r2, =gSprites + ldrb r0, [r4, 0xC] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x5] +_081B60D4: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end party_menu_link_mon_status_condition_object + + thumb_func_start party_menu_get_status_condition_and_update_object +@ void party_menu_get_status_condition_and_update_object(struct pokemon *mon, void *a2, void *a3) +party_menu_get_status_condition_and_update_object: @ 81B60E4 + push {r4,lr} + adds r4, r1, 0 + bl sub_81B205C + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + bl party_menu_update_status_condition_object + pop {r4} + pop {r0} + bx r0 + thumb_func_end party_menu_get_status_condition_and_update_object + + thumb_func_start party_menu_update_status_condition_object +@ void party_menu_update_status_condition_object(u8 a1, void *a2) +party_menu_update_status_condition_object: @ 81B60FC + push {r4,r5,lr} + adds r5, r1, 0 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + beq _081B610C + cmp r2, 0x6 + bne _081B6128 +_081B610C: + ldr r2, =gSprites + ldrb r1, [r5, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + b _081B6152 + .pool +_081B6128: + ldrb r1, [r5, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =gSprites + adds r0, r4 + subs r1, r2, 0x1 + lsls r1, 24 + lsrs r1, 24 + bl StartSpriteAnim + ldrb r1, [r5, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 +_081B6152: + strb r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end party_menu_update_status_condition_object + + thumb_func_start sub_81B6160 +sub_81B6160: @ 81B6160 + push {lr} + ldr r0, =gUnknown_08615FF8 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_08616000 + bl LoadCompressedObjectPalette + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6160 + + thumb_func_start sub_81B617C +sub_81B617C: @ 81B617C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + ldr r0, =c2_815ABFC + mov r8, r0 + ldr r0, =gMain + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B61BC + movs r7, 0x1 + bl sub_81B8984 + lsls r0, 24 + lsrs r6, r0, 24 + b _081B61C0 + .pool +_081B61B0: + ldr r0, =gUnknown_0203CEC8 + strb r5, [r0, 0x9] + b _081B6204 + .pool +_081B61BC: + movs r7, 0 + movs r6, 0 +_081B61C0: + ldr r4, =gScriptItemId + ldrh r0, [r4] + bl GetItemEffectType + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xA + bne _081B621C + ldr r1, =gUnknown_0203CEC8 + movs r0, 0 + strb r0, [r1, 0x9] + movs r5, 0 +_081B61D8: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =gPlayerParty + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B61FA + adds r0, r4, 0 + movs r1, 0x39 + bl GetMonData + cmp r0, 0 + beq _081B61B0 +_081B61FA: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _081B61D8 +_081B6204: + ldr r0, =sub_81B6280 + movs r1, 0x7F + b _081B6230 + .pool +_081B621C: + ldrh r0, [r4] + bl GetPocketByItemId + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x5 + cmp r0, 0x3 + bne _081B622E + movs r1, 0x4 +_081B622E: + ldr r0, =sub_81B1370 +_081B6230: + str r1, [sp] + str r0, [sp, 0x4] + mov r0, r8 + str r0, [sp, 0x8] + adds r0, r7, 0 + adds r1, r6, 0 + movs r2, 0x3 + movs r3, 0x1 + bl sub_81B0038 + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B617C + + thumb_func_start c2_815ABFC +c2_815ABFC: @ 81B6254 + push {lr} + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + bne _081B626C + movs r0, 0xC + movs r1, 0x5 + movs r2, 0 + bl GoToBagMenu + b _081B6276 +_081B626C: + ldr r0, =gUnknown_0203CF30 + ldr r1, [r0] + movs r0, 0x4 + bl sub_81C4F98 +_081B6276: + pop {r0} + bx r0 + .pool + thumb_func_end c2_815ABFC + + thumb_func_start sub_81B6280 +sub_81B6280: @ 81B6280 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B62B2 + ldr r0, =gUnknown_0203CEC8 + ldrb r1, [r0, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x1 + bne _081B62A6 + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + ldr r0, =sub_81B9140 + str r0, [r1, 0x4] +_081B62A6: + ldr r0, =gUnknown_03006328 + ldr r1, =sub_81B6794 + ldr r2, [r0] + adds r0, r3, 0 + bl _call_via_r2 +_081B62B2: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6280 + + thumb_func_start IsHPRecoveryItem +@ bool8 IsHPRecoveryItem(u16 itemId) +IsHPRecoveryItem: @ 81B62D0 + push {lr} + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xAF + bne _081B62EC + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00003214 + adds r0, r1 + b _081B62F6 + .pool +_081B62EC: + ldr r1, =gItemEffectTable + subs r0, 0xD + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] +_081B62F6: + ldrb r1, [r0, 0x4] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _081B6308 + movs r0, 0 + b _081B630A + .pool +_081B6308: + movs r0, 0x1 +_081B630A: + pop {r1} + bx r1 + thumb_func_end IsHPRecoveryItem + + thumb_func_start GetMedicineItemEffectMessage +@ void GetMedicineItemEffectMessage(u16 itemId) +GetMedicineItemEffectMessage: @ 81B6310 + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl GetItemEffectType + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x3 + cmp r0, 0x12 + bls _081B6326 + b _081B64BC +_081B6326: + lsls r0, 2 + ldr r1, =_081B6334 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081B6334: + .4byte _081B6380 + .4byte _081B6394 + .4byte _081B63A8 + .4byte _081B63BC + .4byte _081B63D0 + .4byte _081B63E4 + .4byte _081B63F8 + .4byte _081B64BC + .4byte _081B640C + .4byte _081B6430 + .4byte _081B6420 + .4byte _081B6460 + .4byte _081B6470 + .4byte _081B6450 + .4byte _081B6440 + .4byte _081B64BC + .4byte _081B6494 + .4byte _081B6494 + .4byte _081B64A8 +_081B6380: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9C3E + bl StringExpandPlaceholders + b _081B64C4 + .pool +_081B6394: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9C7C + bl StringExpandPlaceholders + b _081B64C4 + .pool +_081B63A8: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9C8A + bl StringExpandPlaceholders + b _081B64C4 + .pool +_081B63BC: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9CA2 + bl StringExpandPlaceholders + b _081B64C4 + .pool +_081B63D0: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9C5F + bl StringExpandPlaceholders + b _081B64C4 + .pool +_081B63E4: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9DBE + bl StringExpandPlaceholders + b _081B64C4 + .pool +_081B63F8: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9DE1 + bl StringExpandPlaceholders + b _081B64C4 + .pool +_081B640C: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9CE0 + bl StringExpandPlaceholders + b _081B64C4 + .pool +_081B6420: + ldr r0, =gStringVar2 + ldr r1, =gUnknown_085E96E3 + b _081B6474 + .pool +_081B6430: + ldr r0, =gStringVar2 + ldr r1, =gUnknown_085EA33C + b _081B6474 + .pool +_081B6440: + ldr r0, =gStringVar2 + ldr r1, =gUnknown_085EA343 + b _081B6474 + .pool +_081B6450: + ldr r0, =gStringVar2 + ldr r1, =gUnknown_085EA35B + b _081B6474 + .pool +_081B6460: + ldr r0, =gStringVar2 + ldr r1, =gUnknown_085E96E6 + b _081B6474 + .pool +_081B6470: + ldr r0, =gStringVar2 + ldr r1, =gUnknown_085E96EE +_081B6474: + bl StringCopy + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9D25 + bl StringExpandPlaceholders + b _081B64C4 + .pool +_081B6494: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9CF5 + bl StringExpandPlaceholders + b _081B64C4 + .pool +_081B64A8: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9CB7 + bl StringExpandPlaceholders + b _081B64C4 + .pool +_081B64BC: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E96F6 + bl StringExpandPlaceholders +_081B64C4: + pop {r0} + bx r0 + .pool + thumb_func_end GetMedicineItemEffectMessage + + thumb_func_start UsingHPEVItemOnShedinja +@ bool8 UsingHPEVItemOnShedinja(struct pokemon *mon, u16 itemId) +UsingHPEVItemOnShedinja: @ 81B64D0 + push {r4,lr} + adds r4, r0, 0 + lsls r0, r1, 16 + lsrs r0, 16 + bl GetItemEffectType + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xD + bne _081B64FC + adds r0, r4, 0 + movs r1, 0xB + bl GetMonData + ldr r1, =0x0000012f + cmp r0, r1 + bne _081B64FC + movs r0, 0 + b _081B64FE + .pool +_081B64FC: + movs r0, 0x1 +_081B64FE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end UsingHPEVItemOnShedinja + + thumb_func_start IsBlueYellowRedFlute +@ bool8 IsBlueYellowRedFlute(u16 itemId) +IsBlueYellowRedFlute: @ 81B6504 + push {lr} + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x27 + beq _081B6516 + cmp r0, 0x29 + beq _081B6516 + cmp r0, 0x28 + bne _081B651A +_081B6516: + movs r0, 0x1 + b _081B651C +_081B651A: + movs r0, 0 +_081B651C: + pop {r1} + bx r1 + thumb_func_end IsBlueYellowRedFlute + + thumb_func_start ExecuteTableBasedItemEffect__ +@ bool8 ExecuteTableBasedItemEffect__(u8 partyMonIndex, u16 itemId, u8 monMoveIndex) +ExecuteTableBasedItemEffect__: @ 81B6520 + push {r4-r6,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 16 + lsrs r5, r1, 16 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r0, =gMain + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _081B6558 + movs r0, 0x64 + muls r0, r3 + ldr r1, =gPlayerParty + adds r0, r1 + adds r1, r5, 0 + adds r2, r3, 0 + b _081B6572 + .pool +_081B6558: + movs r0, 0x64 + adds r4, r3, 0 + muls r4, r0 + ldr r0, =gPlayerParty + adds r4, r0 + adds r0, r3, 0 + bl sub_81B8F38 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 +_081B6572: + adds r3, r6, 0 + bl ExecuteTableBasedItemEffect_ + lsls r0, 24 + lsrs r0, 24 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end ExecuteTableBasedItemEffect__ + + thumb_func_start ItemUseCB_Medicine +ItemUseCB_Medicine: @ 81B6588 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + str r1, [sp, 0x4] + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r0, 0 + mov r10, r0 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + ldr r0, =gScriptItemId + ldrh r6, [r0] + adds r0, r5, 0 + adds r1, r6, 0 + bl UsingHPEVItemOnShedinja + lsls r0, 24 + cmp r0, 0 + beq _081B6600 + adds r0, r6, 0 + bl IsHPRecoveryItem + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x1 + bne _081B65EE + adds r0, r5, 0 + movs r1, 0x39 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + adds r0, r5, 0 + movs r1, 0x3A + bl GetMonData + cmp r10, r0 + bne _081B65EE + movs r1, 0 + mov r8, r1 +_081B65EE: + ldr r4, =gUnknown_0203CEC8 + ldrb r0, [r4, 0x9] + adds r1, r6, 0 + movs r2, 0 + bl ExecuteTableBasedItemEffect__ + lsls r0, 24 + cmp r0, 0 + beq _081B6624 +_081B6600: + ldr r1, =gUnknown_0203CEE8 + movs r0, 0 + strb r0, [r1] + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_085E96F6 + b _081B66F4 + .pool +_081B6624: + ldr r1, =gUnknown_0203CEE8 + movs r0, 0x1 + strb r0, [r1] + adds r0, r6, 0 + bl IsBlueYellowRedFlute + lsls r0, 24 + cmp r0, 0 + bne _081B6650 + movs r0, 0x1 + bl PlaySE + ldrb r0, [r4, 0xB] + cmp r0, 0xE + beq _081B6656 + adds r0, r6, 0 + movs r1, 0x1 + bl RemoveBagItem + b _081B6656 + .pool +_081B6650: + movs r0, 0x75 + bl PlaySE +_081B6656: + ldr r4, =gUnknown_0203CEDC + ldr r7, =gUnknown_0203CEC8 + movs r0, 0x9 + ldrsb r0, [r7, r0] + lsls r0, 4 + ldr r1, [r4] + adds r1, r0 + adds r0, r5, 0 + bl party_menu_get_status_condition_and_update_object + ldr r2, =gSprites + movs r0, 0x9 + ldrsb r0, [r7, r0] + ldr r1, [r4] + lsls r0, 4 + adds r3, r0, r1 + ldrb r1, [r3, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + bge _081B6694 + adds r0, r5, 0 + adds r1, r3, 0 + movs r2, 0x1 + bl sub_81B2AC8 +_081B6694: + mov r2, r8 + cmp r2, 0x1 + bne _081B66E4 + mov r0, r10 + cmp r0, 0 + bne _081B66A8 + ldrb r0, [r7, 0x9] + movs r1, 0x1 + bl sub_81B0FCC +_081B66A8: + adds r0, r5, 0 + movs r1, 0x39 + bl GetMonData + adds r3, r0, 0 + mov r1, r10 + subs r3, r1 + lsls r3, 16 + asrs r3, 16 + ldrb r1, [r7, 0x9] + ldr r0, =sub_81B672C + str r0, [sp] + mov r0, r9 + movs r2, 0x1 + bl sub_81B1F18 + mov r0, r9 + movs r1, 0 + mov r2, r10 + bl sub_81B1FA8 + b _081B6710 + .pool +_081B66E4: + ldr r1, =gStringVar1 + adds r0, r5, 0 + bl GetMonNickname + adds r0, r6, 0 + bl GetMedicineItemEffectMessage + ldr r0, =gStringVar4 +_081B66F4: + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + mov r2, r9 + lsls r0, r2, 2 + add r0, r9 + lsls r0, 3 + adds r0, r1 + ldr r1, [sp, 0x4] + str r1, [r0] +_081B6710: + 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 ItemUseCB_Medicine + + thumb_func_start sub_81B672C +sub_81B672C: @ 81B672C + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + 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 + bl sub_805EAE8 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B6794 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B672C + + thumb_func_start sub_81B6794 +sub_81B6794: @ 81B6794 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B67BA + ldr r0, =gUnknown_0203CEE8 + ldrb r1, [r0] + cmp r1, 0 + bne _081B67B4 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + str r1, [r0, 0x4] +_081B67B4: + adds r0, r4, 0 + bl sub_81B12C0 +_081B67BA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6794 + + thumb_func_start sub_81B67C8 +sub_81B67C8: @ 81B67C8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + str r1, [sp] + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r4, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r4, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + ldr r0, =gScriptItemId + ldrh r6, [r0] + adds r0, r6, 0 + bl GetItemEffectType + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r5, 0 + movs r1, 0x20 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x4] + adds r0, r5, 0 + adds r1, r7, 0 + bl sub_81B691C + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x8] + ldrb r0, [r4, 0x9] + adds r1, r6, 0 + movs r2, 0 + bl ExecuteTableBasedItemEffect__ + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x20 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + adds r0, r5, 0 + adds r1, r7, 0 + bl sub_81B691C + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + cmp r4, 0 + bne _081B6850 + ldr r0, [sp, 0x4] + cmp r0, r9 + bne _081B6874 + ldr r1, [sp, 0x8] + cmp r1, r8 + bne _081B6874 +_081B6850: + ldr r1, =gUnknown_0203CEE8 + movs r0, 0 + strb r0, [r1] + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_085E96F6 + b _081B68E2 + .pool +_081B6874: + ldr r1, =gUnknown_0203CEE8 + movs r0, 0x1 + strb r0, [r1] + movs r0, 0x1 + bl PlaySE + adds r0, r6, 0 + movs r1, 0x1 + bl RemoveBagItem + ldr r1, =gStringVar1 + adds r0, r5, 0 + bl GetMonNickname + ldr r1, =gStringVar2 + adds r0, r7, 0 + bl option_menu_get_string + ldr r2, [sp, 0x4] + cmp r2, r9 + beq _081B68D8 + ldr r0, [sp, 0x8] + cmp r0, r8 + beq _081B68C4 + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9D45 + bl StringExpandPlaceholders + b _081B68E0 + .pool +_081B68C4: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9D90 + bl StringExpandPlaceholders + b _081B68E0 + .pool +_081B68D8: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9D6D + bl StringExpandPlaceholders +_081B68E0: + ldr r0, =gStringVar4 +_081B68E2: + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + mov r2, r10 + lsls r0, r2, 2 + add r0, r10 + lsls r0, 3 + adds r0, r1 + ldr r1, [sp] + str r1, [r0] + 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_81B67C8 + + thumb_func_start sub_81B691C +sub_81B691C: @ 81B691C + push {r4,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r1, 0 + subs r0, 0xC + cmp r0, 0x5 + bhi _081B6992 + lsls r0, 2 + ldr r1, =_081B693C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081B693C: + .4byte _081B696C + .4byte _081B6954 + .4byte _081B697E + .4byte _081B6984 + .4byte _081B6978 + .4byte _081B6972 +_081B6954: + adds r0, r4, 0 + movs r1, 0xB + bl GetMonData + ldr r1, =0x0000012f + cmp r0, r1 + beq _081B6992 + adds r0, r4, 0 + movs r1, 0x1A + b _081B6988 + .pool +_081B696C: + adds r0, r4, 0 + movs r1, 0x1B + b _081B6988 +_081B6972: + adds r0, r4, 0 + movs r1, 0x1C + b _081B6988 +_081B6978: + adds r0, r4, 0 + movs r1, 0x1D + b _081B6988 +_081B697E: + adds r0, r4, 0 + movs r1, 0x1E + b _081B6988 +_081B6984: + adds r0, r4, 0 + movs r1, 0x1F +_081B6988: + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + b _081B6994 +_081B6992: + movs r0, 0 +_081B6994: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B691C + + thumb_func_start option_menu_get_string +option_menu_get_string: @ 81B699C + push {lr} + adds r2, r1, 0 + lsls r0, 24 + lsrs r0, 24 + subs r0, 0xC + cmp r0, 0x5 + bhi _081B6A08 + lsls r0, 2 + ldr r1, =_081B69B8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081B69B8: + .4byte _081B69D8 + .4byte _081B69D0 + .4byte _081B69F0 + .4byte _081B6A00 + .4byte _081B69E8 + .4byte _081B69E0 +_081B69D0: + ldr r1, =gUnknown_085E96E3 + b _081B69F2 + .pool +_081B69D8: + ldr r1, =gUnknown_085EA33C + b _081B69F2 + .pool +_081B69E0: + ldr r1, =gUnknown_085EA343 + b _081B69F2 + .pool +_081B69E8: + ldr r1, =gUnknown_085EA35B + b _081B69F2 + .pool +_081B69F0: + ldr r1, =gUnknown_085E96E6 +_081B69F2: + adds r0, r2, 0 + bl StringCopy + b _081B6A08 + .pool +_081B6A00: + ldr r1, =gUnknown_085E96EE + adds r0, r2, 0 + bl StringCopy +_081B6A08: + pop {r0} + bx r0 + .pool + thumb_func_end option_menu_get_string + + thumb_func_start sub_81B6A10 +sub_81B6A10: @ 81B6A10 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r7, 0 + movs r0, 0x1 + mov r10, r0 + movs r0, 0x3 + bl sub_81B31B0 + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + movs r0, 0x64 + adds r1, r4, 0 + muls r1, r0 + mov r8, r1 + ldr r0, =gPlayerParty + mov r9, r0 +_081B6A40: + adds r1, r5, 0 + adds r1, 0xD + mov r0, r8 + add r0, r9 + bl GetMonData + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + movs r0, 0xD + adds r2, r4, 0 + muls r2, r0 + ldr r0, =gMoveNames + adds r2, r0 + lsls r0, r5, 4 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r6, 0 + mov r1, r10 + movs r3, 0x8 + bl PrintTextOnWindow + cmp r4, 0 + beq _081B6A82 + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 +_081B6A82: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _081B6A40 + adds r0, r6, 0 + adds r1, r7, 0 + movs r2, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + 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_81B6A10 + + thumb_func_start ether_effect_related_3 +ether_effect_related_3: @ 81B6AB4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + bl ProcessMenuInput + lsls r0, 24 + asrs r1, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r1, r0 + beq _081B6AF0 + adds r0, 0x1 + cmp r1, r0 + bne _081B6AE0 + movs r0, 0x5 + bl PlaySE + adds r0, r4, 0 + bl sub_81B6BB4 + b _081B6AF0 +_081B6AE0: + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + adds r0, 0xD + bl sub_81B302C + adds r0, r5, 0 + bl ether_effect_related_2 +_081B6AF0: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ether_effect_related_3 + + thumb_func_start dp05_ether +dp05_ether: @ 81B6AFC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gScriptItemId + ldrh r0, [r0] + cmp r0, 0xAF + bne _081B6B20 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00003214 + adds r0, r1 + b _081B6B2A + .pool +_081B6B20: + ldr r1, =gItemEffectTable + subs r0, 0xD + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] +_081B6B2A: + ldrb r1, [r0, 0x4] + movs r0, 0x10 + ands r0, r1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _081B6B4C + ldr r0, =gUnknown_0203CEC8 + strh r1, [r0, 0xE] + adds r0, r4, 0 + bl ether_effect_related + b _081B6B6E + .pool +_081B6B4C: + movs r0, 0x5 + bl PlaySE + movs r0, 0x16 + bl display_pokemon_menu_message + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0x9] + bl sub_81B6A10 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =ether_effect_related_3 + str r1, [r0] +_081B6B6E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp05_ether + + thumb_func_start ether_effect_related_2 +ether_effect_related_2: @ 81B6B80 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + adds r0, 0xC + bl sub_81B302C + bl GetMenuCursorPos + ldr r1, =gUnknown_0203CEC8 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1, 0xE] + adds r0, r4, 0 + bl ether_effect_related + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ether_effect_related_2 + + thumb_func_start sub_81B6BB4 +sub_81B6BB4: @ 81B6BB4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, =sub_81B1370 + str r0, [r1] + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + movs r1, 0 + str r1, [r0, 0x4] + adds r0, 0xC + bl sub_81B302C + movs r0, 0x5 + bl display_pokemon_menu_message + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6BB4 + + thumb_func_start ether_effect_related +ether_effect_related: @ 81B6BEC + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + movs r4, 0 + ldr r7, =gUnknown_0203CED6 + ldr r0, =gScriptItemId + ldrh r5, [r0] + movs r0, 0xE + negs r0, r0 + adds r0, r7 + mov r8, r0 + ldrb r0, [r0, 0x9] + ldrb r2, [r7] + adds r1, r5, 0 + bl ExecuteTableBasedItemEffect__ + lsls r0, 24 + cmp r0, 0 + beq _081B6C34 + ldr r0, =gUnknown_0203CEE8 + strb r4, [r0] + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_085E96F6 + b _081B6C7E + .pool +_081B6C34: + ldr r1, =gUnknown_0203CEE8 + movs r0, 0x1 + strb r0, [r1] + mov r0, r8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + adds r4, r1, 0 + muls r4, r0 + ldr r0, =gPlayerParty + adds r4, r0 + movs r0, 0x1 + bl PlaySE + adds r0, r5, 0 + movs r1, 0x1 + bl RemoveBagItem + movs r0, 0 + ldrsh r1, [r7, r0] + adds r1, 0xD + adds r0, r4, 0 + bl GetMonData + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =gStringVar1 + movs r1, 0xD + muls r1, r4 + ldr r2, =gMoveNames + adds r1, r2 + bl StringCopy + adds r0, r5, 0 + bl GetMedicineItemEffectMessage + ldr r0, =gStringVar4 +_081B6C7E: + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B6794 + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end ether_effect_related + + thumb_func_start dp05_pp_up +dp05_pp_up: @ 81B6CC0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl PlaySE + movs r0, 0x17 + bl display_pokemon_menu_message + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0x9] + bl sub_81B6A10 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =ether_effect_related_3 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp05_pp_up + + thumb_func_start ItemIdToBattleMoveId +ItemIdToBattleMoveId: @ 81B6CFC + lsls r0, 16 + ldr r1, =0xfedf0000 + adds r0, r1 + ldr r1, =gUnknown_08616040 + lsrs r0, 15 + adds r0, r1 + ldrh r0, [r0] + bx lr + .pool + thumb_func_end ItemIdToBattleMoveId + + thumb_func_start sub_81B6D14 +sub_81B6D14: @ 81B6D14 + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + movs r1, 0 + ldr r3, =gUnknown_08616040 +_081B6D1E: + adds r0, r1, 0 + adds r0, 0x32 + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + cmp r0, r2 + bne _081B6D34 + movs r0, 0x1 + b _081B6D40 + .pool +_081B6D34: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x7 + bls _081B6D1E + movs r0, 0 +_081B6D40: + pop {r1} + bx r1 + thumb_func_end sub_81B6D14 + + thumb_func_start pokemon_has_move +pokemon_has_move: @ 81B6D44 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r1, 16 + lsrs r5, r1, 16 + movs r4, 0 +_081B6D4E: + adds r1, r4, 0 + adds r1, 0xD + adds r0, r6, 0 + bl GetMonData + cmp r0, r5 + bne _081B6D60 + movs r0, 0x1 + b _081B6D6C +_081B6D60: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _081B6D4E + movs r0, 0 +_081B6D6C: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end pokemon_has_move + + thumb_func_start sub_81B6D74 +sub_81B6D74: @ 81B6D74 + push {r4,lr} + adds r1, r0, 0 + ldr r4, =gStringVar4 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6D74 + + thumb_func_start sub_81B6D98 +sub_81B6D98: @ 81B6D98 + push {r4,lr} + adds r4, r0, 0 + adds r0, r1, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_81B6D74 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B6794 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6D98 + + thumb_func_start sub_81B6DC4 +sub_81B6DC4: @ 81B6DC4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + movs r0, 0x5 + bl PlaySE + ldr r7, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r7, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + movs r0, 0xE + adds r0, r7 + mov r8, r0 + ldr r0, =gScriptItemId + ldrh r4, [r0] + ldr r1, =gStringVar1 + adds r0, r5, 0 + bl GetMonNickname + adds r0, r4, 0 + bl ItemIdToBattleMoveId + strh r0, [r7, 0xE] + ldr r0, =gStringVar2 + movs r1, 0xE + ldrsh r2, [r7, r1] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl StringCopy + movs r0, 0 + mov r1, r8 + strh r0, [r1, 0x2] + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_81B22D8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B6E70 + cmp r0, 0x2 + beq _081B6E78 + ldrh r1, [r7, 0xE] + adds r0, r5, 0 + bl GiveMoveToMon + lsls r0, 16 + ldr r1, =0xffff0000 + cmp r0, r1 + beq _081B6E88 + ldr r0, =gTasks + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B6EB4 + str r0, [r1] + b _081B6E9C + .pool +_081B6E70: + ldr r1, =gUnknown_085E9AB4 + b _081B6E7A + .pool +_081B6E78: + ldr r1, =gUnknown_085E9C00 +_081B6E7A: + adds r0, r6, 0 + bl sub_81B6D98 + b _081B6E9C + .pool +_081B6E88: + ldr r0, =gUnknown_085E9AE9 + bl sub_81B6D74 + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B6FF4 + str r1, [r0] +_081B6E9C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6DC4 + + thumb_func_start sub_81B6EB4 +sub_81B6EB4: @ 81B6EB4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r2, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r2, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + adds r6, r2, 0 + adds r6, 0xE + ldr r0, =gScriptItemId + ldrh r4, [r0] + movs r1, 0x2 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _081B6EF0 + adds r0, r5, 0 + movs r1, 0x4 + bl AdjustFriendship + movs r0, 0xA9 + lsls r0, 1 + cmp r4, r0 + bhi _081B6EF0 + adds r0, r4, 0 + movs r1, 0x1 + bl RemoveBagItem +_081B6EF0: + ldr r1, =gStringVar1 + adds r0, r5, 0 + bl GetMonNickname + ldr r0, =gStringVar2 + movs r1, 0 + ldrsh r2, [r6, r1] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl StringCopy + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9AA5 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B6F60 + str r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6EB4 + + thumb_func_start sub_81B6F60 +sub_81B6F60: @ 81B6F60 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B6F86 + ldr r0, =0x0000016f + bl PlayFanfare + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B6F98 + str r1, [r0] +_081B6F86: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6F60 + + thumb_func_start sub_81B6F98 +sub_81B6F98: @ 81B6F98 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + bl IsFanfareTaskInactive + lsls r0, 24 + cmp r0, 0 + beq _081B6FEA + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r2, 0x1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _081B6FC0 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B6FEA +_081B6FC0: + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x10 + ldrsh r0, [r0, r1] + cmp r0, 0x1 + bne _081B6FDC + adds r0, r4, 0 + bl sub_81B77AC + b _081B6FEA + .pool +_081B6FDC: + cmp r0, 0x2 + bne _081B6FE4 + ldr r0, =gScriptResult + strh r2, [r0] +_081B6FE4: + adds r0, r5, 0 + bl sub_81B12C0 +_081B6FEA: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6F98 + + thumb_func_start sub_81B6FF4 +sub_81B6FF4: @ 81B6FF4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B7018 + bl sub_81B334C + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B7028 + str r0, [r1] +_081B7018: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6FF4 + + thumb_func_start sub_81B7028 +sub_81B7028: @ 81B7028 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B704E + cmp r1, 0 + bgt _081B7048 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B7074 + b _081B7080 +_081B7048: + cmp r1, 0x1 + beq _081B707A + b _081B7080 +_081B704E: + ldr r0, =gUnknown_085E9B96 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B7088 + str r1, [r0] + b _081B7080 + .pool +_081B7074: + movs r0, 0x5 + bl PlaySE +_081B707A: + adds r0, r4, 0 + bl sub_81B7230 +_081B7080: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B7028 + + thumb_func_start sub_81B7088 +sub_81B7088: @ 81B7088 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B70A8 + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + ldr r0, =sub_81B70B8 + str r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_81B12C0 +_081B70A8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B7088 + + thumb_func_start sub_81B70B8 +sub_81B70B8: @ 81B70B8 + push {r4,lr} + sub sp, 0x4 + ldr r0, =gPlayerParty + ldr r4, =gUnknown_0203CEC8 + ldrb r1, [r4, 0x9] + ldr r2, =gPlayerPartyCount + ldrb r2, [r2] + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldr r3, =sub_81B70F0 + ldrh r4, [r4, 0xE] + str r4, [sp] + bl sub_81BFA38 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B70B8 + + thumb_func_start sub_81B70F0 +sub_81B70F0: @ 81B70F0 + push {lr} + sub sp, 0xC + movs r0, 0x7F + str r0, [sp] + ldr r0, =sub_81B711C + str r0, [sp, 0x4] + ldr r0, =gUnknown_0203CEC8 + ldr r0, [r0] + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B70F0 + + thumb_func_start sub_81B711C +sub_81B711C: @ 81B711C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B714E + bl sub_81C1B94 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + beq _081B7148 + adds r0, r4, 0 + bl sub_81B7154 + b _081B714E + .pool +_081B7148: + adds r0, r5, 0 + bl sub_81B7230 +_081B714E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81B711C + + thumb_func_start sub_81B7154 +sub_81B7154: @ 81B7154 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + adds r5, r1, 0 + muls r5, r0 + ldr r0, =gPlayerParty + adds r5, r0 + bl sub_81C1B94 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r1, 0xD + adds r0, r5, 0 + bl GetMonData + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r1, =gStringVar1 + adds r0, r5, 0 + bl GetMonNickname + ldr r0, =gStringVar2 + movs r1, 0xD + muls r1, r4 + ldr r2, =gMoveNames + adds r1, r2 + bl StringCopy + ldr r0, =gUnknown_085E9BB8 + bl sub_81B6D74 + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B71D4 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B7154 + + thumb_func_start sub_81B71D4 +sub_81B71D4: @ 81B71D4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B7220 + ldr r5, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r5, r1] + movs r0, 0x64 + adds r4, r1, 0 + muls r4, r0 + ldr r0, =gPlayerParty + adds r4, r0 + bl sub_81C1B94 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl RemoveMonPPBonus + ldrh r5, [r5, 0xE] + bl sub_81C1B94 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl SetMonMoveSlot + adds r0, r6, 0 + bl sub_81B6EB4 +_081B7220: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B71D4 + + thumb_func_start sub_81B7230 +sub_81B7230: @ 81B7230 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gStringVar2 + ldr r1, =gUnknown_0203CEC8 + movs r3, 0xE + ldrsh r2, [r1, r3] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl StringCopy + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9B5D + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x1 + 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_81B7294 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B7230 + + thumb_func_start sub_81B7294 +sub_81B7294: @ 81B7294 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B72B8 + bl sub_81B334C + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B72C8 + str r0, [r1] +_081B72B8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B7294 + + thumb_func_start sub_81B72C8 +sub_81B72C8: @ 81B72C8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r7, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r7, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r4, r1, r0 + bl sub_8198C58 + lsls r0, 24 + asrs r5, r0, 24 + cmp r5, 0 + beq _081B7306 + cmp r5, 0 + bgt _081B7300 + movs r0, 0x1 + negs r0, r0 + cmp r5, r0 + beq _081B738C + b _081B73C2 + .pool +_081B7300: + cmp r5, 0x1 + beq _081B7392 + b _081B73C2 +_081B7306: + ldr r1, =gStringVar1 + adds r0, r4, 0 + bl GetMonNickname + ldr r0, =gStringVar2 + movs r1, 0xE + ldrsh r2, [r7, r1] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl StringCopy + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9B76 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + movs r3, 0x10 + ldrsh r0, [r7, r3] + cmp r0, 0x1 + bne _081B7368 + ldr r0, =gTasks + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B73E4 + str r0, [r1] + b _081B73C2 + .pool +_081B7368: + cmp r0, 0x2 + bne _081B7370 + ldr r0, =gScriptResult + strh r5, [r0] +_081B7370: + ldr r0, =gTasks + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B6794 + str r0, [r1] + b _081B73C2 + .pool +_081B738C: + movs r0, 0x5 + bl PlaySE +_081B7392: + ldr r1, =gStringVar1 + adds r0, r4, 0 + bl GetMonNickname + ldr r0, =gStringVar2 + ldr r1, =gUnknown_0203CEC8 + movs r3, 0xE + ldrsh r2, [r1, r3] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl StringCopy + ldr r0, =gUnknown_085E9AE9 + bl sub_81B6D74 + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B6FF4 + str r1, [r0] +_081B73C2: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B72C8 + + thumb_func_start sub_81B73E4 +sub_81B73E4: @ 81B73E4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B73FC + adds r0, r4, 0 + bl sub_81B77AC +_081B73FC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B73E4 + + thumb_func_start dp05_rare_candy +dp05_rare_candy: @ 81B7404 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r10, r1 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =gUnknown_0203CEC8 + mov r9, r0 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + ldr r0, =gUnknown_0203CEC4 + ldr r6, [r0] + movs r1, 0x86 + lsls r1, 2 + adds r4, r6, r1 + ldr r2, =gScriptItemId + mov r8, r2 + adds r0, r5, 0 + movs r1, 0x38 + bl GetMonData + cmp r0, 0x64 + beq _081B7478 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81B79A0 + mov r1, r9 + ldrb r0, [r1, 0x9] + mov r2, r8 + ldrh r1, [r2] + movs r2, 0 + bl ExecuteTableBasedItemEffect__ + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x89 + lsls r0, 2 + adds r1, r6, r0 + adds r0, r5, 0 + bl sub_81B79A0 + b _081B747A + .pool +_081B7478: + movs r4, 0x1 +_081B747A: + movs r0, 0x5 + bl PlaySE + cmp r4, 0 + beq _081B74B4 + ldr r1, =gUnknown_0203CEE8 + movs r0, 0 + strb r0, [r1] + ldr r0, =gUnknown_085E96F6 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + mov r1, r10 + b _081B7516 + .pool +_081B74B4: + ldr r1, =gUnknown_0203CEE8 + movs r0, 0x1 + strb r0, [r1] + movs r0, 0 + bl PlayFanfareByFanfareNum + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0x9] + adds r1, r5, 0 + bl sub_81B754C + ldr r0, =gScriptItemId + ldrh r0, [r0] + movs r1, 0x1 + bl RemoveBagItem + ldr r1, =gStringVar1 + adds r0, r5, 0 + bl GetMonNickname + ldr r4, =gStringVar2 + adds r0, r5, 0 + movs r1, 0x38 + bl GetMonData + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9D0A + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B75D4 +_081B7516: + str r1, [r0] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end dp05_rare_candy + + thumb_func_start sub_81B754C +sub_81B754C: @ 81B754C + push {r4-r7,lr} + adds r5, r1, 0 + lsls r0, 24 + lsrs r0, 24 + adds r7, r0, 0 + ldr r6, =gUnknown_0203CEDC + lsls r4, r7, 4 + ldr r1, [r6] + adds r1, r4 + adds r0, r5, 0 + bl party_menu_get_status_condition_and_update_object + ldr r2, =gSprites + ldr r0, [r6] + adds r3, r4, r0 + ldrb r1, [r3, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + bge _081B7588 + adds r0, r5, 0 + adds r1, r3, 0 + movs r2, 0x1 + bl sub_81B2AC8 +_081B7588: + ldr r1, [r6] + adds r1, r4 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_81B2CD4 + ldr r1, [r6] + adds r1, r4 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_81B2D74 + ldr r1, [r6] + adds r1, r4 + adds r0, r5, 0 + bl sub_81B2E28 + ldr r0, [r6] + adds r0, r4, r0 + ldrb r0, [r0, 0x9] + adds r1, r5, 0 + bl sub_81B5B38 + adds r0, r7, 0 + movs r1, 0x1 + bl sub_81B0FCC + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B754C + + thumb_func_start sub_81B75D4 +sub_81B75D4: @ 81B75D4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0 + bl WaitFanfare + lsls r0, 24 + cmp r0, 0 + beq _081B7620 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B7620 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081B7606 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B7620 +_081B7606: + movs r0, 0x5 + bl PlaySE + adds r0, r4, 0 + bl sub_81B767C + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B7634 + str r0, [r1] +_081B7620: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B75D4 + + thumb_func_start sub_81B7634 +sub_81B7634: @ 81B7634 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081B764E + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B7668 +_081B764E: + movs r0, 0x5 + bl PlaySE + adds r0, r4, 0 + bl sub_81B76C8 + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B7704 + str r0, [r1] +_081B7668: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B7634 + + thumb_func_start sub_81B767C +sub_81B767C: @ 81B767C + push {r4,r5,lr} + sub sp, 0x8 + ldr r0, =gUnknown_0203CEC4 + ldr r5, [r0] + movs r0, 0x86 + lsls r0, 2 + adds r4, r5, r0 + bl sub_81B3364 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x18] + ldrh r0, [r4, 0x18] + movs r1, 0x89 + lsls r1, 2 + adds r2, r5, r1 + movs r1, 0x2 + str r1, [sp] + movs r1, 0x3 + str r1, [sp, 0x4] + adds r1, r4, 0 + movs r3, 0x1 + bl sub_81D3640 + ldrb r0, [r4, 0x18] + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B767C + + thumb_func_start sub_81B76C8 +sub_81B76C8: @ 81B76C8 + push {r4,lr} + sub sp, 0x4 + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + movs r0, 0x86 + lsls r0, 2 + adds r4, r1, r0 + ldrh r0, [r4, 0x18] + movs r2, 0x89 + lsls r2, 2 + adds r1, r2 + movs r2, 0x3 + str r2, [sp] + movs r2, 0x1 + movs r3, 0x2 + bl sub_81D3784 + ldrb r0, [r4, 0x18] + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B76C8 + + thumb_func_start sub_81B7704 +sub_81B7704: @ 81B7704 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0 + bl WaitFanfare + lsls r0, 24 + cmp r0, 0 + beq _081B77A6 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r6, 0x1 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _081B772C + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B77A6 +_081B772C: + bl sub_81B3394 + ldr r4, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r4, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x1 + bl MonTryLearningNewMove + lsls r0, 16 + lsrs r1, r0, 16 + strh r6, [r4, 0x10] + ldr r0, =0x0000fffe + cmp r1, r0 + beq _081B7788 + cmp r1, r0 + bgt _081B776C + cmp r1, 0 + beq _081B7778 + b _081B77A0 + .pool +_081B776C: + ldr r0, =0x0000ffff + cmp r1, r0 + beq _081B7780 + b _081B77A0 + .pool +_081B7778: + adds r0, r5, 0 + bl sub_81B7810 + b _081B77A6 +_081B7780: + adds r0, r5, 0 + bl sub_81B787C + b _081B77A6 +_081B7788: + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B77AC + str r0, [r1] + b _081B77A6 + .pool +_081B77A0: + adds r0, r5, 0 + bl sub_81B7910 +_081B77A6: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81B7704 + + thumb_func_start sub_81B77AC +sub_81B77AC: @ 81B77AC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0 + bl MonTryLearningNewMove + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, =0x0000fffe + cmp r1, r0 + beq _081B780A + cmp r1, r0 + bgt _081B77E8 + cmp r1, 0 + beq _081B77F4 + b _081B7804 + .pool +_081B77E8: + ldr r0, =0x0000ffff + cmp r1, r0 + beq _081B77FC + b _081B7804 + .pool +_081B77F4: + adds r0, r4, 0 + bl sub_81B7810 + b _081B780A +_081B77FC: + adds r0, r4, 0 + bl sub_81B787C + b _081B780A +_081B7804: + adds r0, r4, 0 + bl sub_81B7910 +_081B780A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B77AC + + thumb_func_start sub_81B7810 +sub_81B7810: @ 81B7810 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r6, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r6, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r7, r1, r0 + adds r0, r7, 0 + movs r1, 0 + movs r2, 0 + bl GetEvolutionTargetSpecies + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _081B7860 + bl sub_81B06F4 + ldr r0, =gUnknown_030061E8 + ldr r1, [r6] + str r1, [r0] + ldrb r3, [r6, 0x9] + adds r0, r7, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_813DA40 + adds r0, r5, 0 + bl DestroyTask + b _081B786E + .pool +_081B7860: + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B6794 + str r0, [r1] +_081B786E: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B7810 + + thumb_func_start sub_81B787C +sub_81B787C: @ 81B787C + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_0203CEC8 + mov r8, r0 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gStringVar1 + bl GetMonNickname + ldr r0, =gStringVar2 + ldr r6, =gMoveToLearn + ldrh r2, [r6] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl StringCopy + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9AE9 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldrh r0, [r6] + mov r1, r8 + strh r0, [r1, 0xE] + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B6FF4 + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B787C + + thumb_func_start sub_81B7910 +sub_81B7910: @ 81B7910 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r6, r0, 0 + adds r5, r1, 0 + lsls r6, 24 + lsrs r6, 24 + lsls r5, 16 + lsrs r5, 16 + ldr r0, =gUnknown_0203CEC8 + mov r8, r0 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gStringVar1 + bl GetMonNickname + ldr r0, =gStringVar2 + movs r1, 0xD + muls r1, r5 + ldr r2, =gMoveNames + adds r1, r2 + bl StringCopy + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9AA5 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + mov r0, r8 + strh r5, [r0, 0xE] + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B6F60 + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B7910 + + thumb_func_start sub_81B79A0 +sub_81B79A0: @ 81B79A0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r1, 0x3A + bl GetMonData + strh r0, [r5] + adds r0, r4, 0 + movs r1, 0x3B + bl GetMonData + strh r0, [r5, 0x2] + adds r0, r4, 0 + movs r1, 0x3C + bl GetMonData + strh r0, [r5, 0x4] + adds r0, r4, 0 + movs r1, 0x3E + bl GetMonData + strh r0, [r5, 0x8] + adds r0, r4, 0 + movs r1, 0x3F + bl GetMonData + strh r0, [r5, 0xA] + adds r0, r4, 0 + movs r1, 0x3D + bl GetMonData + strh r0, [r5, 0x6] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81B79A0 + + thumb_func_start sub_81B79E8 +sub_81B79E8: @ 81B79E8 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0203CEC4 + ldr r2, [r1] + movs r3, 0x86 + lsls r3, 2 + adds r1, r2, r3 + movs r3, 0 + strh r3, [r1] + ldr r4, =0x0000021a + adds r1, r2, r4 + strh r3, [r1] + ldr r1, =gUnknown_0203CEC8 + ldrb r1, [r1, 0x9] + lsls r1, 24 + asrs r1, 24 + movs r3, 0x87 + lsls r3, 2 + adds r2, r3 + strh r1, [r2] + bl sub_81B7A28 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B79E8 + + thumb_func_start sub_81B7A28 +sub_81B7A28: @ 81B7A28 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + mov r8, r4 + ldr r6, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r6, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B7A6E + adds r0, r5, 0 + movs r1, 0x39 + bl GetMonData + lsls r0, 16 + lsrs r7, r0, 16 + ldrb r0, [r6, 0x9] + ldr r1, =gScriptItemId + ldrh r1, [r1] + movs r2, 0 + bl ExecuteTableBasedItemEffect__ + lsls r0, 24 + cmp r0, 0 + beq _081B7A94 +_081B7A6E: + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =task_intro_gamefreak + str r0, [r1] + b _081B7B2A + .pool +_081B7A94: + movs r0, 0x1 + bl PlaySE + ldr r4, =gUnknown_0203CEDC + movs r0, 0x9 + ldrsb r0, [r6, r0] + lsls r0, 4 + ldr r1, [r4] + adds r1, r0 + adds r0, r5, 0 + bl party_menu_get_status_condition_and_update_object + ldr r2, =gSprites + movs r0, 0x9 + ldrsb r0, [r6, r0] + ldr r1, [r4] + lsls r0, 4 + adds r3, r0, r1 + ldrb r1, [r3, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + bge _081B7AD6 + adds r0, r5, 0 + adds r1, r3, 0 + movs r2, 0x1 + bl sub_81B2AC8 +_081B7AD6: + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + movs r1, 0x87 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0 + bl sub_81B0FCC + ldrb r0, [r6, 0x9] + movs r1, 0x1 + bl sub_81B0FCC + adds r0, r5, 0 + movs r1, 0x39 + bl GetMonData + adds r3, r0, 0 + subs r3, r7 + lsls r3, 16 + asrs r3, 16 + ldrb r1, [r6, 0x9] + ldr r0, =sub_81B7C10 + str r0, [sp] + mov r0, r8 + movs r2, 0x1 + bl sub_81B1F18 + mov r0, r8 + movs r1, 0 + adds r2, r7, 0 + bl sub_81B1FA8 + ldr r0, [r4] + movs r2, 0x86 + lsls r2, 2 + adds r1, r0, r2 + movs r2, 0x1 + strh r2, [r1] + ldr r1, =0x0000021a + adds r0, r1 + strh r2, [r0] +_081B7B2A: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B7A28 + + thumb_func_start task_intro_gamefreak +task_intro_gamefreak: @ 81B7B4C + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B7C0A + ldr r5, =gUnknown_0203CEC4 + ldr r2, [r5] + movs r0, 0x86 + lsls r0, 2 + adds r1, r2, r0 + movs r3, 0 + ldrsh r0, [r1, r3] + ldr r3, =gUnknown_0203CEC8 + cmp r0, 0x1 + bne _081B7B82 + movs r0, 0 + strh r0, [r1] + movs r1, 0x9 + ldrsb r1, [r3, r1] + movs r6, 0x87 + lsls r6, 2 + adds r0, r2, r6 + strh r1, [r0] +_081B7B82: + ldrb r0, [r3, 0x9] + adds r0, 0x1 + strb r0, [r3, 0x9] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x6 + bne _081B7C04 + ldr r0, [r5] + ldr r1, =0x0000021a + adds r0, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + cmp r1, 0 + bne _081B7BC8 + ldr r0, =gUnknown_0203CEE8 + strb r1, [r0] + ldr r0, =gUnknown_085E96F6 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + b _081B7BD8 + .pool +_081B7BC8: + ldr r1, =gUnknown_0203CEE8 + movs r0, 0x1 + strb r0, [r1] + ldr r0, =gScriptItemId + ldrh r0, [r0] + movs r1, 0x1 + bl RemoveBagItem +_081B7BD8: + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B6794 + str r1, [r0] + ldr r1, =gUnknown_0203CEC8 + movs r0, 0 + strb r0, [r1, 0x9] + b _081B7C0A + .pool +_081B7C04: + adds r0, r4, 0 + bl sub_81B7A28 +_081B7C0A: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end task_intro_gamefreak + + thumb_func_start sub_81B7C10 +sub_81B7C10: @ 81B7C10 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + 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, =task_intro_gamefreak + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B7C10 + + thumb_func_start sub_81B7C74 +sub_81B7C74: @ 81B7C74 + push {r4-r6,lr} + adds r6, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x5 + bl PlaySE + ldr r2, =gUnknown_030061E8 + ldr r1, =gUnknown_0203CEC8 + ldr r0, [r1] + str r0, [r2] + ldrb r0, [r1, 0x9] + ldr r4, =gScriptItemId + ldrh r1, [r4] + movs r2, 0 + bl ExecuteTableBasedItemEffect__ + lsls r0, 24 + cmp r0, 0 + beq _081B7CD8 + ldr r1, =gUnknown_0203CEE8 + movs r0, 0 + strb r0, [r1] + ldr r0, =gUnknown_085E96F6 + movs r1, 0x1 + 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 + str r6, [r0] + b _081B7CE4 + .pool +_081B7CD8: + ldrh r0, [r4] + movs r1, 0x1 + bl RemoveBagItem + bl sub_81B06F4 +_081B7CE4: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81B7C74 + + thumb_func_start GetItemEffectType +@ u8 GetItemEffectType(u16 itemId) +GetItemEffectType: @ 81B7CEC + push {r4,r5,lr} + lsls r0, 16 + lsrs r1, r0, 16 + adds r2, r1, 0 + subs r2, 0xD + lsls r0, r2, 16 + lsrs r0, 16 + cmp r0, 0xA5 + bls _081B7D00 + b _081B7E40 +_081B7D00: + cmp r1, 0xAF + bne _081B7D18 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00003214 + adds r4, r0, r1 + b _081B7D20 + .pool +_081B7D18: + ldr r1, =gItemEffectTable + lsls r0, r2, 2 + adds r0, r1 + ldr r4, [r0] +_081B7D20: + ldrb r1, [r4] + movs r5, 0x3F + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _081B7D42 + ldrb r0, [r4, 0x1] + cmp r0, 0 + bne _081B7D42 + ldrb r0, [r4, 0x2] + cmp r0, 0 + bne _081B7D42 + ldrb r3, [r4, 0x3] + movs r0, 0x80 + ands r0, r3 + cmp r0, 0 + beq _081B7D4C +_081B7D42: + movs r0, 0 + b _081B7E46 + .pool +_081B7D4C: + movs r2, 0x40 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _081B7D5A + movs r0, 0xA + b _081B7E46 +_081B7D5A: + adds r0, r2, 0 + ands r0, r3 + cmp r0, 0 + beq _081B7D66 + movs r0, 0x1 + b _081B7E46 +_081B7D66: + adds r2, r5, 0 + ands r2, r3 + cmp r2, 0 + bne _081B7D74 + lsrs r0, r1, 7 + cmp r0, 0 + beq _081B7DB6 +_081B7D74: + cmp r2, 0x20 + bne _081B7D7C + movs r0, 0x4 + b _081B7E46 +_081B7D7C: + cmp r2, 0x10 + bne _081B7D84 + movs r0, 0x3 + b _081B7E46 +_081B7D84: + cmp r2, 0x8 + bne _081B7D8C + movs r0, 0x5 + b _081B7E46 +_081B7D8C: + cmp r2, 0x4 + bne _081B7D94 + movs r0, 0x6 + b _081B7E46 +_081B7D94: + cmp r2, 0x2 + bne _081B7D9C + movs r0, 0x7 + b _081B7E46 +_081B7D9C: + cmp r2, 0x1 + bne _081B7DA4 + movs r0, 0x8 + b _081B7E46 +_081B7DA4: + lsrs r0, r1, 7 + cmp r0, 0 + beq _081B7DB2 + cmp r2, 0 + bne _081B7DB2 + movs r0, 0x9 + b _081B7E46 +_081B7DB2: + movs r0, 0xB + b _081B7E46 +_081B7DB6: + ldrb r1, [r4, 0x4] + movs r0, 0x44 + ands r0, r1 + adds r2, r1, 0 + cmp r0, 0 + beq _081B7DC6 + movs r0, 0x2 + b _081B7E46 +_081B7DC6: + movs r5, 0x2 + adds r0, r5, 0 + ands r0, r2 + cmp r0, 0 + beq _081B7DD4 + movs r0, 0xC + b _081B7E46 +_081B7DD4: + movs r3, 0x1 + adds r0, r3, 0 + ands r0, r2 + cmp r0, 0 + beq _081B7DE2 + movs r0, 0xD + b _081B7E46 +_081B7DE2: + ldrb r1, [r4, 0x5] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _081B7DF0 + movs r0, 0xE + b _081B7E46 +_081B7DF0: + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _081B7DFC + movs r0, 0xF + b _081B7E46 +_081B7DFC: + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _081B7E08 + movs r0, 0x10 + b _081B7E46 +_081B7E08: + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _081B7E14 + movs r0, 0x11 + b _081B7E46 +_081B7E14: + movs r0, 0x80 + ands r0, r2 + cmp r0, 0 + beq _081B7E20 + movs r0, 0x12 + b _081B7E46 +_081B7E20: + movs r0, 0x20 + ands r0, r2 + cmp r0, 0 + beq _081B7E2C + movs r0, 0x13 + b _081B7E46 +_081B7E2C: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _081B7E38 + movs r0, 0x14 + b _081B7E46 +_081B7E38: + movs r0, 0x18 + ands r0, r2 + cmp r0, 0 + bne _081B7E44 +_081B7E40: + movs r0, 0x16 + b _081B7E46 +_081B7E44: + movs r0, 0x15 +_081B7E46: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end GetItemEffectType + + thumb_func_start sub_81B7E4C +sub_81B7E4C: @ 81B7E4C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B7F1C + ldr r7, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r7, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + movs r0, 0xE + adds r0, r7 + mov r8, r0 + ldr r1, =gStringVar1 + adds r0, r5, 0 + bl GetMonNickname + ldr r4, =gSpecialVar_0x8005 + ldrb r0, [r4] + bl sub_81B2360 + strh r0, [r7, 0xE] + ldr r0, =gStringVar2 + movs r1, 0xE + ldrsh r2, [r7, r1] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl StringCopy + movs r0, 0x2 + mov r1, r8 + strh r0, [r1, 0x2] + ldrb r2, [r4] + adds r0, r5, 0 + movs r1, 0 + bl sub_81B22D8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B7EF0 + cmp r0, 0x2 + beq _081B7EF8 + ldrh r1, [r7, 0xE] + adds r0, r5, 0 + bl GiveMoveToMon + lsls r0, 16 + ldr r1, =0xffff0000 + cmp r0, r1 + beq _081B7F08 + adds r0, r6, 0 + bl sub_81B6EB4 + b _081B7F1C + .pool +_081B7EF0: + ldr r1, =gUnknown_085E9AB4 + b _081B7EFA + .pool +_081B7EF8: + ldr r1, =gUnknown_085E9C00 +_081B7EFA: + adds r0, r6, 0 + bl sub_81B6D98 + b _081B7F1C + .pool +_081B7F08: + ldr r0, =gUnknown_085E9AE9 + bl sub_81B6D74 + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B6FF4 + str r1, [r0] +_081B7F1C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B7E4C + + thumb_func_start CB2_PartyMenuFromStartMenu +CB2_PartyMenuFromStartMenu: @ 81B7F34 + push {lr} + sub sp, 0xC + movs r0, 0 + str r0, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =sub_8086194 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end CB2_PartyMenuFromStartMenu + + thumb_func_start sub_81B7F60 +sub_81B7F60: @ 81B7F60 + push {lr} + sub sp, 0xC + bl InBattlePyramid + lsls r0, 24 + ldr r1, =sub_81C4F84 + cmp r0, 0 + bne _081B7F72 + ldr r1, =c2_815ABFC +_081B7F72: + movs r0, 0x6 + str r0, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + str r1, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0x5 + movs r3, 0 + bl sub_81B0038 + ldr r1, =gUnknown_0203CEC8 + ldr r0, =gScriptItemId + ldrh r0, [r0] + strh r0, [r1, 0xC] + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B7F60 + + thumb_func_start sub_81B7FAC +sub_81B7FAC: @ 81B7FAC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + ldr r5, =gUnknown_0203CEFC + ldr r0, =gUnknown_0203CEC8 + mov r9, r0 + ldrb r0, [r0, 0x9] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x64 + mov r8, r1 + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + ldr r7, =gPlayerParty + adds r0, r7 + movs r1, 0xC + bl GetMonData + strh r0, [r5] + lsls r0, 16 + cmp r0, 0 + bne _081B7FF8 + adds r0, r4, 0 + bl sub_81B8044 + b _081B8030 + .pool +_081B7FF8: + ldrh r0, [r5] + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _081B800C + adds r0, r4, 0 + bl sub_81B83B8 + b _081B8030 +_081B800C: + mov r1, r9 + movs r0, 0x9 + ldrsb r0, [r1, r0] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r7 + ldrh r1, [r5] + movs r2, 0x1 + bl sub_81B1D1C + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B82A0 + str r1, [r0] +_081B8030: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B7FAC + + thumb_func_start sub_81B8044 +sub_81B8044: @ 81B8044 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r5, =gUnknown_0203CEC8 + ldrh r0, [r5, 0xC] + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _081B807C + ldrh r0, [r5, 0xC] + bl sub_81B83F0 + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + ldr r0, =sub_81B814C + str r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_81B12C0 + b _081B8082 + .pool +_081B807C: + adds r0, r4, 0 + bl sub_81B8088 +_081B8082: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81B8044 + + thumb_func_start sub_81B8088 +sub_81B8088: @ 81B8088 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B80E4 + ldr r4, =gUnknown_0203CEC8 + ldrh r5, [r4, 0xC] + movs r0, 0x9 + ldrsb r0, [r4, r0] + movs r1, 0x64 + mov r8, r1 + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + ldr r6, =gPlayerParty + adds r0, r6 + adds r1, r5, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_81B1C84 + movs r0, 0x9 + ldrsb r0, [r4, r0] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r6 + adds r1, r5, 0 + bl sub_81B1DB8 + adds r0, r5, 0 + bl sub_81B83F0 + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B8104 + str r1, [r0] +_081B80E4: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8088 + + thumb_func_start sub_81B8104 +sub_81B8104: @ 81B8104 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gUnknown_0203CEC8 + ldrb r4, [r0, 0x9] + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B8138 + lsls r2, r4, 24 + asrs r2, 24 + movs r0, 0x64 + muls r0, r2 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gUnknown_0203CEDC + lsls r2, 4 + ldr r1, [r1] + adds r1, r2 + bl sub_81B5C94 + adds r0, r5, 0 + bl sub_81B12C0 +_081B8138: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8104 + + thumb_func_start sub_81B814C +sub_81B814C: @ 81B814C + push {r4-r6,lr} + ldr r4, =gUnknown_0203CEC8 + movs r0, 0x9 + ldrsb r0, [r4, r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, =gPlayerParty + adds r0, r5 + ldrh r1, [r4, 0xC] + bl sub_81B1DB8 + movs r0, 0x9 + ldrsb r0, [r4, r0] + muls r0, r6 + adds r0, r5 + movs r1, 0x40 + bl GetMonData + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gSaveBlock1Ptr + lsls r2, r0, 3 + adds r2, r0 + lsls r2, 2 + ldr r0, =0x00002be0 + adds r2, r0 + ldr r1, [r1] + adds r1, r2 + ldr r2, =sub_81B81A8 + movs r0, 0x4 + movs r3, 0x3 + bl sub_811A20C + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B814C + + thumb_func_start sub_81B81A8 +sub_81B81A8: @ 81B81A8 + push {r4-r7,lr} + sub sp, 0xC + ldr r6, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r6, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r7, r0, 16 + ldr r0, =gScriptResult + ldrh r0, [r0] + cmp r0, 0 + bne _081B8208 + adds r0, r5, 0 + bl sub_80D4680 + ldr r4, =gUnknown_0203CEFC + adds r0, r5, 0 + movs r1, 0xC + adds r2, r4, 0 + bl SetMonData + ldrh r0, [r4] + movs r1, 0x1 + bl RemoveBagItem + adds r0, r7, 0 + bl sub_81B841C + ldr r0, [r6] + bl SetMainCallback2 + b _081B8224 + .pool +_081B8208: + ldrb r0, [r6, 0x8] + lsls r0, 28 + lsrs r0, 28 + ldrb r2, [r6, 0xB] + movs r1, 0x7F + str r1, [sp] + ldr r1, =sub_81B8230 + str r1, [sp, 0x4] + ldr r1, [r6] + str r1, [sp, 0x8] + movs r1, 0xFF + movs r3, 0x1 + bl sub_81B0038 +_081B8224: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B81A8 + + thumb_func_start sub_81B8230 +sub_81B8230: @ 81B8230 + 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 _081B828A + ldr r1, =gUnknown_0203CEFC + ldrh r0, [r1] + cmp r0, 0 + beq _081B8264 + ldr r0, =gUnknown_0203CEC8 + ldrh r0, [r0, 0xC] + ldrh r1, [r1] + movs r2, 0 + bl sub_81B1D68 + b _081B827C + .pool +_081B8264: + ldr r2, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r2, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + ldrh r1, [r2, 0xC] + movs r2, 0 + movs r3, 0x1 + bl sub_81B1C84 +_081B827C: + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B8104 + str r0, [r1] +_081B828A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8230 + + thumb_func_start sub_81B82A0 +sub_81B82A0: @ 81B82A0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B82C4 + bl sub_81B334C + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B82D4 + str r0, [r1] +_081B82C4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B82A0 + + thumb_func_start sub_81B82D4 +sub_81B82D4: @ 81B82D4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B82FA + cmp r1, 0 + bgt _081B82F4 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B8394 + b _081B83A8 +_081B82F4: + cmp r1, 0x1 + beq _081B839A + b _081B83A8 +_081B82FA: + ldr r7, =gUnknown_0203CEC8 + ldrh r4, [r7, 0xC] + adds r0, r4, 0 + bl sub_81B83F0 + ldr r6, =gUnknown_0203CEFC + ldrh r0, [r6] + movs r1, 0x1 + bl AddBagItem + lsls r0, 24 + cmp r0, 0 + bne _081B8338 + adds r0, r4, 0 + bl sub_81B841C + ldrh r0, [r6] + bl pokemon_item_not_removed + ldr r0, =gStringVar4 + movs r1, 0 + bl sub_81B1B5C + b _081B8378 + .pool +_081B8338: + adds r0, r4, 0 + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _081B835C + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + ldr r0, =sub_81B814C + str r0, [r1, 0x4] + adds r0, r5, 0 + bl sub_81B12C0 + b _081B83A8 + .pool +_081B835C: + movs r1, 0x9 + ldrsb r1, [r7, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + adds r1, r4, 0 + bl sub_81B1DB8 + ldrh r1, [r6] + adds r0, r4, 0 + movs r2, 0x1 + bl sub_81B1D68 +_081B8378: + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B8104 + str r1, [r0] + b _081B83A8 + .pool +_081B8394: + movs r0, 0x5 + bl PlaySE +_081B839A: + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B8104 + str r0, [r1] +_081B83A8: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B82D4 + + thumb_func_start sub_81B83B8 +sub_81B83B8: @ 81B83B8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_085E98EC + movs r1, 0x1 + 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_81B8104 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B83B8 + + thumb_func_start sub_81B83F0 +sub_81B83F0: @ 81B83F0 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0xB] + cmp r0, 0x6 + bne _081B8410 + lsls r0, r1, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_80D6E48 + b _081B8418 + .pool +_081B8410: + adds r0, r1, 0 + movs r1, 0x1 + bl RemoveBagItem +_081B8418: + pop {r0} + bx r0 + thumb_func_end sub_81B83F0 + + thumb_func_start sub_81B841C +sub_81B841C: @ 81B841C + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0xB] + cmp r0, 0x5 + beq _081B8438 + adds r0, r1, 0 + movs r1, 0x1 + bl sub_80D6D70 + b _081B8440 + .pool +_081B8438: + adds r0, r1, 0 + movs r1, 0x1 + bl AddBagItem +_081B8440: + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_81B841C + + thumb_func_start sub_81B8448 +sub_81B8448: @ 81B8448 + push {lr} + sub sp, 0xC + movs r0, 0x6 + str r0, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =sub_816BB28 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0x7 + movs r3, 0 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8448 + + thumb_func_start sub_81B8474 +sub_81B8474: @ 81B8474 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + ldr r1, =gUnknown_0203CEE8 + movs r0, 0 + strb r0, [r1] + ldr r2, =gSaveBlock1Ptr + ldr r0, =gUnknown_0203BCB8 + ldrh r1, [r0] + adds r1, 0x6 + ldrh r0, [r0, 0x2] + adds r1, r0 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x00002be0 + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + adds r0, r5, 0 + movs r1, 0xC + bl GetMonData + cmp r0, 0 + beq _081B84DC + ldr r0, =gUnknown_085E9A08 + movs r1, 0x1 + bl sub_81B1B5C + b _081B84F2 + .pool +_081B84DC: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80D460C + adds r0, r4, 0 + bl sub_80D439C + ldr r0, =gUnknown_085E9A40 + movs r1, 0x1 + bl sub_81B1B5C +_081B84F2: + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, =gTasks + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B8104 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8474 + + thumb_func_start sub_81B8518 +sub_81B8518: @ 81B8518 + push {lr} + sub sp, 0xC + bl sub_81B8558 + movs r0, 0 + str r0, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =gMain + ldr r0, [r0, 0x8] + str r0, [sp, 0x8] + movs r0, 0x4 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_81B0038 + ldr r1, =gUnknown_0203CEC8 + ldr r0, =sub_81B879C + str r0, [r1, 0x4] + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8518 + + thumb_func_start sub_81B8558 +sub_81B8558: @ 81B8558 + push {lr} + ldr r0, =gUnknown_0203CEF8 + movs r1, 0 + movs r2, 0x4 + bl memset + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8558 + + thumb_func_start sub_81B856C +sub_81B856C: @ 81B856C + push {r4,lr} + lsls r0, 24 + asrs r4, r0, 24 + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + adds r0, r1 + bl sub_81B85AC + lsls r0, 24 + cmp r0, 0 + bne _081B858C + movs r0, 0x2 + b _081B85A4 + .pool +_081B858C: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r0, 24 + bl sub_81B8770 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B85A2 + movs r0, 0 + b _081B85A4 +_081B85A2: + movs r0, 0x1 +_081B85A4: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B856C + + thumb_func_start sub_81B85AC +sub_81B85AC: @ 81B85AC + push {r4-r6,lr} + adds r5, r0, 0 + movs r6, 0 + movs r1, 0x2D + bl GetMonData + cmp r0, 0 + bne _081B8608 + adds r0, r5, 0 + movs r1, 0x38 + bl GetMonData + adds r4, r0, 0 + bl sub_81B8888 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bhi _081B8608 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldrh r1, [r0, 0x4] + ldr r0, =0x0000191a + cmp r1, r0 + bne _081B85EA + adds r0, r5, 0 + movs r1, 0xC + bl GetMonData + cmp r0, 0 + bne _081B8608 +_081B85EA: + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x8 + beq _081B864A + cmp r0, 0x9 + bne _081B8618 + adds r0, r5, 0 + movs r1, 0x39 + bl GetMonData + cmp r0, 0 + bne _081B864A +_081B8608: + movs r0, 0 + b _081B864C + .pool +_081B8618: + adds r0, r5, 0 + movs r1, 0xB + bl GetMonData + lsls r0, 16 + lsrs r4, r0, 16 + ldr r3, =gUnknown_08611C9A + lsls r1, r6, 1 + adds r0, r1, r3 + ldrh r0, [r0] + ldr r2, =0x0000ffff + cmp r0, r2 + beq _081B864A +_081B8632: + adds r0, r1, r3 + ldrh r0, [r0] + cmp r0, r4 + beq _081B8608 + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, r6, 1 + adds r0, r1, r3 + ldrh r0, [r0] + cmp r0, r2 + bne _081B8632 +_081B864A: + movs r0, 0x1 +_081B864C: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B85AC + + thumb_func_start sub_81B865C +sub_81B865C: @ 81B865C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + bl sub_81B885C + lsls r0, 24 + lsrs r2, r0, 24 + adds r1, r2, 0 + ldr r3, =gUnknown_0203CEF8 + adds r0, r2, r3 + subs r0, 0x1 + ldrb r0, [r0] + cmp r0, 0 + bne _081B869C + cmp r2, 0x1 + bne _081B8688 + movs r0, 0xE + b _081B8758 + .pool +_081B8688: + ldr r0, =gStringVar1 + movs r2, 0 + movs r3, 0x1 + bl ConvertIntToDecimalStringN + movs r0, 0x11 + b _081B8758 + .pool +_081B869C: + ldr r0, =0x000040cf + bl VarGet + lsls r0, 24 + movs r1, 0xF8 + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x1 + bhi _081B86C0 + b _081B8756 + .pool +_081B86B8: + movs r0, 0x12 + b _081B8758 +_081B86BC: + movs r0, 0x13 + b _081B8758 +_081B86C0: + bl sub_81B8830 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r5, 0 + b _081B8750 +_081B86CE: + ldr r3, =gUnknown_0203CEF8 + adds r4, r3, r5 + ldrb r0, [r4] + movs r1, 0x64 + muls r0, r1 + subs r0, 0x64 + ldr r3, =gPlayerParty + adds r0, r3, r0 + movs r1, 0xB + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + ldrb r0, [r4] + movs r1, 0x64 + muls r0, r1 + subs r0, 0x64 + ldr r3, =gPlayerParty + adds r0, r3, r0 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r6, r0, 16 + adds r1, r5, 0x1 + lsls r0, r1, 24 + lsrs r4, r0, 24 + mov r9, r1 + cmp r4, r8 + bcs _081B8748 + movs r7, 0x64 +_081B870E: + ldr r0, =gUnknown_0203CEF8 + adds r5, r0, r4 + ldrb r0, [r5] + muls r0, r7 + subs r0, 0x64 + ldr r1, =gPlayerParty + adds r0, r1, r0 + movs r1, 0xB + bl GetMonData + cmp r10, r0 + beq _081B86B8 + cmp r6, 0 + beq _081B873E + ldrb r0, [r5] + muls r0, r7 + subs r0, 0x64 + ldr r3, =gPlayerParty + adds r0, r3, r0 + movs r1, 0xC + bl GetMonData + cmp r6, r0 + beq _081B86BC +_081B873E: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r8 + bcc _081B870E +_081B8748: + mov r1, r9 + lsls r0, r1, 24 + lsrs r5, r0, 24 + mov r0, r8 +_081B8750: + subs r0, 0x1 + cmp r5, r0 + blt _081B86CE +_081B8756: + movs r0, 0xFF +_081B8758: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B865C + + thumb_func_start sub_81B8770 +sub_81B8770: @ 81B8770 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0 + ldr r3, =gUnknown_0203CEF8 +_081B877A: + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _081B878C + movs r0, 0x1 + b _081B8798 + .pool +_081B878C: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x3 + bls _081B877A + movs r0, 0 +_081B8798: + pop {r1} + bx r1 + thumb_func_end sub_81B8770 + + thumb_func_start sub_81B879C +sub_81B879C: @ 81B879C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_81B865C + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xFF + beq _081B87D4 + movs r0, 0x20 + bl PlaySE + adds r0, r4, 0 + bl display_pokemon_menu_message + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B87E8 + str r0, [r1] + b _081B87E0 + .pool +_081B87D4: + movs r0, 0x5 + bl PlaySE + adds r0, r5, 0 + bl sub_81B12C0 +_081B87E0: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81B879C + + thumb_func_start sub_81B87E8 +sub_81B87E8: @ 81B87E8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081B8802 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B881C +_081B8802: + movs r0, 0x5 + bl PlaySE + movs r0, 0 + 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] +_081B881C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B87E8 + + thumb_func_start sub_81B8830 +sub_81B8830: @ 81B8830 + push {lr} + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x8 + beq _081B884C + cmp r0, 0x9 + bne _081B8850 + movs r0, 0x3 + b _081B8854 + .pool +_081B884C: + movs r0, 0x2 + b _081B8854 +_081B8850: + ldr r0, =gSpecialVar_0x8005 + ldrb r0, [r0] +_081B8854: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B8830 + + thumb_func_start sub_81B885C +sub_81B885C: @ 81B885C + push {lr} + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x8 + beq _081B8878 + cmp r0, 0x9 + bne _081B887C + movs r0, 0x1 + b _081B8880 + .pool +_081B8878: + movs r0, 0x2 + b _081B8880 +_081B887C: + ldr r0, =gSpecialVar_0x8005 + ldrb r0, [r0] +_081B8880: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B885C + + thumb_func_start sub_81B8888 +sub_81B8888: @ 81B8888 + push {lr} + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x8 + beq _081B88A4 + cmp r0, 0x9 + bne _081B88A8 +_081B889C: + movs r0, 0x64 + b _081B88B2 + .pool +_081B88A4: + movs r0, 0x1E + b _081B88B2 +_081B88A8: + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + cmp r0, 0 + bne _081B889C + movs r0, 0x32 +_081B88B2: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B8888 + + thumb_func_start sub_81B88BC +sub_81B88BC: @ 81B88BC + push {lr} + ldr r0, =0x000040cf + bl VarGet + lsls r0, 24 + lsrs r1, r0, 24 + movs r2, 0xF8 + lsls r2, 24 + adds r0, r2 + lsrs r0, 24 + cmp r0, 0x1 + bhi _081B88E0 + ldr r0, =gUnknown_085EA126 + b _081B88FA + .pool +_081B88E0: + cmp r1, 0x1 + bne _081B88F8 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x2 + bne _081B88F8 + ldr r0, =gUnknown_085EA139 + b _081B88FA + .pool +_081B88F8: + ldr r0, =gUnknown_085EA155 +_081B88FA: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B88BC + + thumb_func_start sub_81B8904 +sub_81B8904: @ 81B8904 + push {lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + movs r2, 0 + str r2, [sp] + ldr r2, =sub_81B1370 + str r2, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8904 + + thumb_func_start sub_81B892C +sub_81B892C: @ 81B892C + push {lr} + sub sp, 0xC + movs r0, 0x4 + str r0, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0xC + movs r3, 0 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B892C + + thumb_func_start sub_81B8958 +sub_81B8958: @ 81B8958 + push {lr} + sub sp, 0xC + movs r0, 0x1 + str r0, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + str r0, [sp, 0x8] + movs r0, 0xB + movs r1, 0 + movs r2, 0xD + movs r3, 0 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8958 + + thumb_func_start sub_81B8984 +sub_81B8984: @ 81B8984 + push {lr} + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _081B8994 + movs r0, 0 + b _081B89A6 +_081B8994: + bl sub_81B1250 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B89A4 + movs r0, 0x1 + b _081B89A6 +_081B89A4: + movs r0, 0x2 +_081B89A6: + pop {r1} + bx r1 + thumb_func_end sub_81B8984 + + thumb_func_start sub_81B89AC +sub_81B89AC: @ 81B89AC + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_81B8984 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0 + str r0, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =sub_8059D40 + str r0, [sp, 0x8] + movs r0, 0x1 + adds r2, r4, 0 + movs r3, 0 + bl sub_81B0038 + bl nullsub_35 + bl pokemon_change_order + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B89AC + + thumb_func_start sub_81B89F0 +sub_81B89F0: @ 81B89F0 + push {lr} + sub sp, 0xC + bl sub_81B8984 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x5 + str r0, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =c2_815ABFC + str r0, [sp, 0x8] + movs r0, 0x1 + movs r2, 0x3 + movs r3, 0 + bl sub_81B0038 + bl nullsub_35 + bl pokemon_change_order + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B89F0 + + thumb_func_start sub_81B8A2C +sub_81B8A2C: @ 81B8A2C + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gPlayerParty + 0x64 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B8A74 + adds r0, r4, 0 + movs r1, 0x2D + bl GetMonData + cmp r0, 0 + bne _081B8A74 + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0xB] + cmp r0, 0x1 + bne _081B8A5C + movs r0, 0x3 + b _081B8A76 + .pool +_081B8A5C: + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + bne _081B8A74 + movs r0, 0x2 + b _081B8A76 + .pool +_081B8A74: + movs r0, 0x7 +_081B8A76: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B8A2C + + thumb_func_start sub_81B8A7C +sub_81B8A7C: @ 81B8A7C + push {r4-r7,lr} + mov r7, r8 + push {r7} + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_81B1250 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B8AC4 + cmp r5, 0x1 + beq _081B8AA2 + cmp r5, 0x4 + beq _081B8AA2 + cmp r5, 0x5 + bne _081B8AC4 +_081B8AA2: + ldr r4, =gStringVar1 + bl GetTrainerPartnerName + adds r1, r0, 0 + adds r0, r4, 0 + bl StringCopy + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E97B2 + b _081B8C42 + .pool +_081B8AC4: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =gPlayerParty + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x39 + bl GetMonData + cmp r0, 0 + bne _081B8AF8 + ldr r1, =gStringVar1 + adds r0, r4, 0 + bl GetMonNickname + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E978F + b _081B8C42 + .pool +_081B8AF8: + movs r4, 0 + b _081B8B24 +_081B8AFC: + adds r0, r4, 0 + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + bne _081B8B1E + adds r0, r5, 0 + bl sub_81B8F38 + lsls r0, 24 + ldr r2, =gBattlePartyID + lsls r1, r4, 1 + adds r1, r2 + lsrs r0, 24 + ldrh r1, [r1] + cmp r0, r1 + beq _081B8BFC +_081B8B1E: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081B8B24: + ldr r0, =gNoOfAllBanks + ldrb r0, [r0] + cmp r4, r0 + bcc _081B8AFC + movs r7, 0x64 + adds r0, r5, 0 + muls r0, r7 + ldr r1, =gPlayerParty + mov r8, r1 + adds r6, r0, r1 + adds r0, r6, 0 + movs r1, 0x2D + bl GetMonData + cmp r0, 0 + beq _081B8B60 + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E97E5 + b _081B8C42 + .pool +_081B8B60: + adds r0, r5, 0 + bl sub_81B8F38 + ldr r1, =gBattleStruct + ldr r1, [r1] + adds r1, 0x8B + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bne _081B8B94 + ldr r1, =gStringVar1 + adds r0, r6, 0 + bl GetMonNickname + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E976F + b _081B8C42 + .pool +_081B8B94: + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0xB] + cmp r0, 0x4 + bne _081B8BA8 + bl sub_806E994 + b _081B8C46 + .pool +_081B8BA8: + cmp r0, 0x2 + beq _081B8C20 + adds r0, r5, 0 + bl sub_81B8F38 + ldr r1, =gUnknown_0203CEE9 + strb r0, [r1] + ldr r1, =gUnknown_0203CEE8 + movs r0, 0x1 + strb r0, [r1] + ldr r1, =gBattlePartyID + ldr r0, =gBankInMenu + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrb r0, [r0] + bl pokemon_order_func + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_81B8FB0 + adds r0, r4, 0 + muls r0, r7 + add r0, r8 + adds r1, r6, 0 + bl sub_81B1288 + movs r0, 0x1 + b _081B8C48 + .pool +_081B8BFC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gStringVar1 + bl GetMonNickname + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9754 + b _081B8C42 + .pool +_081B8C20: + ldr r0, =gBankInMenu + ldrb r0, [r0] + ldr r1, =gBattlePartyID + lsls r0, 1 + adds r0, r1 + ldrb r0, [r0] + bl pokemon_order_func + lsls r0, 24 + lsrs r0, 24 + muls r0, r7 + add r0, r8 + ldr r1, =gStringVar1 + bl GetMonNickname + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9738 +_081B8C42: + bl StringExpandPlaceholders +_081B8C46: + movs r0, 0 +_081B8C48: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B8A7C + + thumb_func_start sub_81B8C68 +sub_81B8C68: @ 81B8C68 + push {r4,lr} + ldr r4, =gUnknown_0203CF00 + bl sub_806D7EC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_81B8C88 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8C68 + + thumb_func_start sub_81B8C88 +sub_81B8C88: @ 81B8C88 + push {r4-r6,lr} + sub sp, 0x8 + adds r6, r0, 0 + lsls r1, 24 + lsrs r4, r1, 24 + bl sub_81B1250 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B8CBE + cmp r4, 0 + beq _081B8CB0 + movs r0, 0x30 + strb r0, [r6] + movs r0, 0x45 + strb r0, [r6, 0x1] + movs r0, 0x12 + strb r0, [r6, 0x2] + b _081B8D58 +_081B8CB0: + movs r0, 0x3 + strb r0, [r6] + movs r0, 0x12 + strb r0, [r6, 0x1] + movs r0, 0x45 + strb r0, [r6, 0x2] + b _081B8D58 +_081B8CBE: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _081B8CFC + movs r5, 0x1 + movs r0, 0 + bl GetBankByPlayerAI + mov r2, sp + ldr r1, =gBattlePartyID + lsls r0, 24 + lsrs r0, 23 + adds r0, r1 + ldrh r0, [r0] + strb r0, [r2] + movs r4, 0 + mov r1, sp +_081B8CE2: + ldrb r0, [r1] + cmp r4, r0 + beq _081B8CF0 + mov r2, sp + adds r0, r2, r5 + strb r4, [r0] + adds r5, 0x1 +_081B8CF0: + adds r4, 0x1 + cmp r4, 0x5 + ble _081B8CE2 + b _081B8D40 + .pool +_081B8CFC: + movs r5, 0x2 + movs r0, 0 + bl GetBankByPlayerAI + mov r1, sp + ldr r4, =gBattlePartyID + lsls r0, 24 + lsrs r0, 23 + adds r0, r4 + ldrh r0, [r0] + strb r0, [r1] + movs r0, 0x2 + bl GetBankByPlayerAI + mov r1, sp + lsls r0, 24 + lsrs r0, 23 + adds r0, r4 + ldrh r0, [r0] + strb r0, [r1, 0x1] + movs r4, 0 +_081B8D26: + ldrb r0, [r1] + cmp r4, r0 + beq _081B8D3A + ldrb r0, [r1, 0x1] + cmp r4, r0 + beq _081B8D3A + mov r2, sp + adds r0, r2, r5 + strb r4, [r0] + adds r5, 0x1 +_081B8D3A: + adds r4, 0x1 + cmp r4, 0x5 + ble _081B8D26 +_081B8D40: + movs r4, 0 + mov r3, sp +_081B8D44: + adds r0, r6, r4 + ldrb r1, [r3] + lsls r1, 4 + ldrb r2, [r3, 0x1] + orrs r1, r2 + strb r1, [r0] + adds r3, 0x2 + adds r4, 0x1 + cmp r4, 0x2 + ble _081B8D44 +_081B8D58: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8C88 + + thumb_func_start sub_81B8D64 +sub_81B8D64: @ 81B8D64 + push {lr} + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r0, =gBattleStruct + lsls r3, r2, 1 + adds r3, r2 + adds r3, 0x60 + ldr r0, [r0] + adds r0, r3 + bl sub_81B8D88 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8D64 + + thumb_func_start sub_81B8D88 +sub_81B8D88: @ 81B8D88 + push {r4-r7,lr} + sub sp, 0x8 + adds r5, r0, 0 + adds r0, r2, 0 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r0, 24 + lsrs r0, 24 + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + bne _081B8DB0 + movs r0, 0 + bl GetBankByPlayerAI + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x2 + b _081B8DBC +_081B8DB0: + movs r0, 0x1 + bl GetBankByPlayerAI + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x3 +_081B8DBC: + bl GetBankByPlayerAI + lsls r0, 24 + lsrs r6, r0, 24 + bl sub_81B1250 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B8DF0 + cmp r7, 0 + beq _081B8DE2 + movs r0, 0x30 + strb r0, [r5] + movs r0, 0x45 + strb r0, [r5, 0x1] + movs r0, 0x12 + strb r0, [r5, 0x2] + b _081B8E72 +_081B8DE2: + movs r0, 0x3 + strb r0, [r5] + movs r0, 0x12 + strb r0, [r5, 0x1] + movs r0, 0x45 + strb r0, [r5, 0x2] + b _081B8E72 +_081B8DF0: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _081B8E28 + movs r3, 0x1 + mov r2, sp + ldr r1, =gBattlePartyID + lsls r0, r4, 1 + adds r0, r1 + ldrh r0, [r0] + strb r0, [r2] + movs r4, 0 + mov r1, sp +_081B8E0C: + ldrb r0, [r1] + cmp r4, r0 + beq _081B8E1A + mov r2, sp + adds r0, r2, r3 + strb r4, [r0] + adds r3, 0x1 +_081B8E1A: + adds r4, 0x1 + cmp r4, 0x5 + ble _081B8E0C + b _081B8E5A + .pool +_081B8E28: + movs r3, 0x2 + mov r1, sp + ldr r2, =gBattlePartyID + lsls r0, r4, 1 + adds r0, r2 + ldrh r0, [r0] + strb r0, [r1] + lsls r0, r6, 1 + adds r0, r2 + ldrh r0, [r0] + strb r0, [r1, 0x1] + movs r4, 0 +_081B8E40: + ldrb r0, [r1] + cmp r4, r0 + beq _081B8E54 + ldrb r0, [r1, 0x1] + cmp r4, r0 + beq _081B8E54 + mov r2, sp + adds r0, r2, r3 + strb r4, [r0] + adds r3, 0x1 +_081B8E54: + adds r4, 0x1 + cmp r4, 0x5 + ble _081B8E40 +_081B8E5A: + movs r4, 0 + mov r3, sp +_081B8E5E: + adds r0, r5, r4 + ldrb r1, [r3] + lsls r1, 4 + ldrb r2, [r3, 0x1] + orrs r1, r2 + strb r1, [r0] + adds r3, 0x2 + adds r4, 0x1 + cmp r4, 0x2 + ble _081B8E5E +_081B8E72: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8D88 + + thumb_func_start sub_81B8E80 +sub_81B8E80: @ 81B8E80 + push {r4-r7,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r6, r2, 24 + movs r7, 0 + bl sub_81B1250 + lsls r0, 24 + cmp r0, 0 + beq _081B8F2E + ldr r0, =gBattleStruct + lsls r1, r4, 1 + adds r1, r4 + adds r1, 0x60 + ldr r0, [r0] + adds r4, r0, r1 + movs r2, 0 + add r6, sp + mov r12, r6 + movs r6, 0xF + mov r3, sp +_081B8EB2: + adds r1, r4, r2 + ldrb r0, [r1] + lsrs r0, 4 + strb r0, [r3] + adds r3, 0x1 + ldrb r1, [r1] + adds r0, r6, 0 + ands r0, r1 + strb r0, [r3] + adds r3, 0x1 + adds r2, 0x1 + cmp r2, 0x2 + ble _081B8EB2 + mov r0, r12 + ldrb r3, [r0] + movs r2, 0 + mov r0, sp + ldrb r0, [r0] + cmp r0, r5 + bne _081B8EE8 + mov r0, sp + ldrb r7, [r0] + strb r3, [r0] + b _081B8EFC + .pool +_081B8EE8: + adds r2, 0x1 + cmp r2, 0x5 + bgt _081B8EFC + mov r0, sp + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, r5 + bne _081B8EE8 + adds r7, r0, 0 + strb r3, [r1] +_081B8EFC: + cmp r2, 0x6 + beq _081B8F2E + mov r0, r12 + strb r7, [r0] + mov r0, sp + ldrb r0, [r0] + lsls r0, 4 + mov r1, sp + ldrb r1, [r1, 0x1] + orrs r0, r1 + strb r0, [r4] + mov r0, sp + ldrb r0, [r0, 0x2] + lsls r0, 4 + mov r1, sp + ldrb r1, [r1, 0x3] + orrs r0, r1 + strb r0, [r4, 0x1] + mov r0, sp + ldrb r0, [r0, 0x4] + lsls r0, 4 + mov r1, sp + ldrb r1, [r1, 0x5] + orrs r0, r1 + strb r0, [r4, 0x2] +_081B8F2E: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B8E80 + + thumb_func_start sub_81B8F38 +sub_81B8F38: @ 81B8F38 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0x1 + ands r1, r2 + lsrs r2, r0, 25 + cmp r1, 0 + beq _081B8F58 + ldr r0, =gUnknown_0203CF00 + adds r0, r2, r0 + ldrb r0, [r0] + movs r1, 0xF + ands r1, r0 + b _081B8F60 + .pool +_081B8F58: + ldr r0, =gUnknown_0203CF00 + adds r0, r2, r0 + ldrb r0, [r0] + lsrs r1, r0, 4 +_081B8F60: + adds r0, r1, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B8F38 + + thumb_func_start sub_81B8F6C +sub_81B8F6C: @ 81B8F6C + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + movs r1, 0x1 + ands r1, r3 + lsrs r3, r0, 25 + cmp r1, 0 + beq _081B8F94 + ldr r0, =gUnknown_0203CF00 + adds r0, r3, r0 + ldrb r2, [r0] + movs r1, 0xF0 + ands r1, r2 + orrs r1, r4 + strb r1, [r0] + b _081B8FA4 + .pool +_081B8F94: + ldr r2, =gUnknown_0203CF00 + adds r2, r3, r2 + ldrb r1, [r2] + movs r0, 0xF + ands r0, r1 + lsls r1, r4, 4 + orrs r0, r1 + strb r0, [r2] +_081B8FA4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8F6C + + thumb_func_start sub_81B8FB0 +sub_81B8FB0: @ 81B8FB0 + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + adds r0, r5, 0 + bl sub_81B8F38 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + bl sub_81B8F38 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl sub_81B8F6C + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_81B8F6C + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81B8FB0 + + thumb_func_start pokemon_order_func +pokemon_order_func: @ 81B8FEC + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r3, 0 + movs r2, 0 + ldr r5, =gUnknown_0203CF00 +_081B8FF8: + adds r0, r3, r5 + ldrb r1, [r0] + lsrs r0, r1, 4 + cmp r0, r4 + beq _081B9010 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + movs r0, 0xF + ands r0, r1 + cmp r0, r4 + bne _081B9018 +_081B9010: + adds r0, r2, 0 + b _081B902A + .pool +_081B9018: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x2 + bls _081B8FF8 + movs r0, 0 +_081B902A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end pokemon_order_func + + thumb_func_start pokemon_change_order +pokemon_change_order: @ 81B9030 + push {r4-r6,lr} + movs r4, 0x96 + lsls r4, 2 + adds r0, r4, 0 + bl Alloc + adds r5, r0, 0 + ldr r1, =gPlayerParty + adds r2, r4, 0 + bl memcpy + movs r4, 0 + movs r6, 0x64 +_081B904A: + adds r0, r4, 0 + bl pokemon_order_func + lsls r0, 24 + lsrs r0, 24 + muls r0, r6 + ldr r1, =gPlayerParty + adds r0, r1 + adds r1, r4, 0 + muls r1, r6 + adds r1, r5 + movs r2, 0x64 + bl memcpy + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _081B904A + adds r0, r5, 0 + bl Free + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end pokemon_change_order + + thumb_func_start sub_81B9080 +sub_81B9080: @ 81B9080 + push {r4-r6,lr} + movs r4, 0x96 + lsls r4, 2 + adds r0, r4, 0 + bl Alloc + adds r5, r0, 0 + ldr r1, =gPlayerParty + adds r2, r4, 0 + bl memcpy + movs r4, 0 + movs r6, 0x64 +_081B909A: + adds r0, r4, 0 + bl sub_81B8F38 + lsls r0, 24 + lsrs r0, 24 + muls r0, r6 + ldr r1, =gPlayerParty + adds r0, r1 + adds r1, r4, 0 + muls r1, r6 + adds r1, r5 + movs r2, 0x64 + bl memcpy + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _081B909A + adds r0, r5, 0 + bl Free + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9080 + + thumb_func_start sub_81B90D0 +sub_81B90D0: @ 81B90D0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r6, 0x1 + movs r7, 0x64 + ldr r0, =gPlayerParty + mov r8, r0 +_081B90DE: + adds r0, r6, 0 + bl sub_81B8F38 + lsls r0, 24 + lsrs r0, 24 + muls r0, r7 + mov r1, r8 + adds r5, r0, r1 + adds r0, r5, 0 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B912C + adds r0, r5, 0 + movs r1, 0x39 + bl GetMonData + cmp r0, 0 + beq _081B912C + movs r0, 0 + bl sub_81B8F38 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + adds r1, r6, 0 + bl sub_81B8FB0 + adds r0, r4, 0 + muls r0, r7 + add r0, r8 + adds r1, r5, 0 + bl sub_81B1288 + b _081B9136 + .pool +_081B912C: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x5 + bls _081B90DE +_081B9136: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B90D0 + + thumb_func_start sub_81B9140 +sub_81B9140: @ 81B9140 + push {lr} + ldr r0, =sub_8059D40 + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9140 + + thumb_func_start sub_81B9150 +sub_81B9150: @ 81B9150 + push {lr} + sub sp, 0xC + movs r0, 0x7F + str r0, [sp] + ldr r0, =sub_81B917C + str r0, [sp, 0x4] + ldr r0, =gMain + ldr r0, [r0, 0x8] + str r0, [sp, 0x8] + movs r0, 0x5 + movs r1, 0x3 + movs r2, 0 + movs r3, 0 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9150 + + thumb_func_start sub_81B917C +sub_81B917C: @ 81B917C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gTasks + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + movs r1, 0x80 + lsls r1, 1 + strh r1, [r4, 0x8] + bl sub_81B9294 + movs r1, 0x80 + lsls r1, 9 + movs r0, 0x2 + movs r2, 0 + bl ChangeBgX + ldr r0, =sub_81B91B4 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B917C + + thumb_func_start sub_81B91B4 +sub_81B91B4: @ 81B91B4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r6, r5, 2 + adds r0, r6, r5 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B9220 + ldrh r0, [r4] + subs r0, 0x8 + strh r0, [r4] + adds r0, r5, 0 + bl sub_81B9294 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081B9220 + movs r4, 0x3 + ldr r7, =gUnknown_02022FF8 +_081B91E8: + subs r0, r4, 0x3 + lsls r0, 5 + adds r0, r7 + ldrh r0, [r0] + cmp r0, 0 + beq _081B9204 + ldr r0, =gUnknown_0203CEDC + ldr r1, [r0] + lsls r0, r4, 4 + adds r0, r1 + ldrb r0, [r0, 0x9] + movs r1, 0 + bl sub_81B5B6C +_081B9204: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _081B91E8 + movs r0, 0x78 + bl PlaySE + ldr r0, =gTasks + adds r1, r6, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B9240 + str r0, [r1] +_081B9220: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B91B4 + + thumb_func_start sub_81B9240 +sub_81B9240: @ 81B9240 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + strh r1, [r0] + lsls r1, 16 + movs r0, 0x80 + lsls r0, 17 + cmp r1, r0 + bne _081B9266 + adds r0, r2, 0 + bl sub_81B12C0 +_081B9266: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9240 + + thumb_func_start sub_81B9270 +sub_81B9270: @ 81B9270 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 16 + lsrs r3, r1, 16 + cmp r1, 0 + blt _081B928A + ldr r1, =gSprites + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + strh r3, [r0, 0x24] +_081B928A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9270 + + thumb_func_start sub_81B9294 +sub_81B9294: @ 81B9294 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r5, r1, r0 + movs r6, 0x3 + ldr r7, =gUnknown_0203CEDC +_081B92A8: + ldr r0, =gUnknown_02022FF8 + subs r1, r6, 0x3 + lsls r1, 5 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + beq _081B9300 + ldr r0, [r7] + lsls r4, r6, 4 + adds r0, r4, r0 + ldrb r0, [r0, 0x9] + ldrh r1, [r5] + subs r1, 0x8 + lsls r1, 16 + asrs r1, 16 + bl sub_81B9270 + ldr r0, [r7] + adds r0, r4, r0 + ldrb r0, [r0, 0xA] + ldrh r1, [r5] + subs r1, 0x8 + lsls r1, 16 + asrs r1, 16 + bl sub_81B9270 + ldr r0, [r7] + adds r0, r4, r0 + ldrb r0, [r0, 0xB] + ldrh r1, [r5] + subs r1, 0x8 + lsls r1, 16 + asrs r1, 16 + bl sub_81B9270 + ldr r0, [r7] + adds r4, r0 + ldrb r0, [r4, 0xC] + ldrh r1, [r5] + subs r1, 0x8 + lsls r1, 16 + asrs r1, 16 + bl sub_81B9270 +_081B9300: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x5 + bls _081B92A8 + movs r1, 0x80 + lsls r1, 4 + movs r0, 0x2 + movs r2, 0x1 + bl ChangeBgX + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9294 + + thumb_func_start sub_81B9328 +sub_81B9328: @ 81B9328 + push {lr} + sub sp, 0xC + movs r0, 0xF + str r0, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =sub_81B9390 + str r0, [sp, 0x8] + movs r0, 0x6 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9328 + + thumb_func_start sub_81B9354 +sub_81B9354: @ 81B9354 + push {lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gUnknown_03005DB0 + ldr r1, =hm_add_c3_without_phase_2 + str r1, [r2] + movs r1, 0 + str r1, [sp] + ldr r1, =sub_81B1370 + str r1, [sp, 0x4] + ldr r1, =c2_exit_to_overworld_2_switch + str r1, [sp, 0x8] + movs r1, 0 + movs r2, 0xB + movs r3, 0 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9354 + + thumb_func_start sub_81B9390 +sub_81B9390: @ 81B9390 + push {r4,lr} + ldr r4, =gSpecialVar_0x8004 + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + cmp r0, 0x5 + bls _081B93A6 + movs r0, 0xFF + strh r0, [r4] +_081B93A6: + ldr r0, =gUnknown_03005DB0 + ldr r1, =hm_add_c3_without_phase_2 + str r1, [r0] + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9390 + + thumb_func_start hm_add_c3_without_phase_2 +hm_add_c3_without_phase_2: @ 81B93C8 + push {lr} + bl pal_fill_black + ldr r0, =task_hm_without_phase_2 + movs r1, 0xA + bl CreateTask + movs r0, 0x1 + pop {r1} + bx r1 + .pool + thumb_func_end hm_add_c3_without_phase_2 + + thumb_func_start task_hm_without_phase_2 +task_hm_without_phase_2: @ 81B93E0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80ABDFC + lsls r0, 24 + cmp r0, 0 + beq _081B93FE + adds r0, r4, 0 + bl DestroyTask + bl ScriptContext2_Disable + bl EnableBothScriptContexts +_081B93FE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end task_hm_without_phase_2 + + thumb_func_start sub_81B9404 +sub_81B9404: @ 81B9404 + push {lr} + bl ScriptContext2_Enable + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r0, =sub_81B9424 + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9404 + + thumb_func_start sub_81B9424 +sub_81B9424: @ 81B9424 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _081B945C + bl overworld_free_bg_tilemaps + str r4, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =sub_81B9470 + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0 + movs r2, 0xB + movs r3, 0 + bl sub_81B0038 + adds r0, r5, 0 + bl DestroyTask +_081B945C: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9424 + + thumb_func_start sub_81B9470 +sub_81B9470: @ 81B9470 + push {lr} + bl brm_get_pokemon_selection + ldr r2, =gUnknown_02039F24 + strb r0, [r2] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bls _081B9486 + movs r0, 0xFF + strb r0, [r2] +_081B9486: + ldr r1, =gSpecialVar_0x8004 + ldrb r0, [r2] + strh r0, [r1] + ldr r1, =gUnknown_03005DB0 + ldr r0, =hm_add_c3_without_phase_2 + str r0, [r1] + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9470 + + thumb_func_start sub_81B94B0 +sub_81B94B0: @ 81B94B0 + push {lr} + bl ScriptContext2_Enable + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r0, =sub_81B94D0 + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B94B0 + + thumb_func_start sub_81B94D0 +sub_81B94D0: @ 81B94D0 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _081B9508 + bl overworld_free_bg_tilemaps + str r4, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =sub_81B9390 + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0 + movs r2, 0xB + movs r3, 0 + bl sub_81B0038 + adds r0, r5, 0 + bl DestroyTask +_081B9508: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B94D0 + + thumb_func_start sub_81B951C +sub_81B951C: @ 81B951C + push {lr} + bl ScriptContext2_Enable + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r0, =sub_81B953C + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B951C + + thumb_func_start sub_81B953C +sub_81B953C: @ 81B953C + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _081B9574 + bl overworld_free_bg_tilemaps + str r4, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =sub_81B9588 + str r0, [sp, 0x8] + movs r0, 0x7 + movs r1, 0 + movs r2, 0xB + movs r3, 0 + bl sub_81B0038 + adds r0, r5, 0 + bl DestroyTask +_081B9574: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B953C + + thumb_func_start sub_81B9588 +sub_81B9588: @ 81B9588 + push {r4,r5,lr} + ldr r5, =gSpecialVar_0x8004 + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5] + cmp r0, 0x5 + bls _081B95A4 + movs r0, 0xFF + strh r0, [r5] + b _081B95BA + .pool +_081B95A4: + ldr r4, =gSpecialVar_0x8005 + ldrh r1, [r5] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + bl GetNumberOfRelearnableMoves + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] +_081B95BA: + ldr r0, =gUnknown_03005DB0 + ldr r1, =hm_add_c3_without_phase_2 + str r1, [r0] + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9588 + + thumb_func_start sub_81B95E0 +sub_81B95E0: @ 81B95E0 + push {r4,r5,lr} + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] + movs r4, 0 + adds r5, r1, 0 + b _081B95FA + .pool +_081B95F4: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081B95FA: + cmp r4, 0x2 + bhi _081B9614 + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xC + bl GetMonData + cmp r0, 0 + beq _081B95F4 + movs r0, 0x1 + strh r0, [r5] +_081B9614: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B95E0 + + thumb_func_start sub_81B9620 +sub_81B9620: @ 81B9620 + push {lr} + bl ScriptContext2_Enable + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r0, =sub_81B9640 + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9620 + + thumb_func_start sub_81B9640 +sub_81B9640: @ 81B9640 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _081B9678 + bl overworld_free_bg_tilemaps + str r4, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =sub_81B9390 + str r0, [sp, 0x8] + movs r0, 0xC + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_81B0038 + adds r0, r5, 0 + bl DestroyTask +_081B9678: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9640 + + thumb_func_start sub_81B968C +sub_81B968C: @ 81B968C + push {lr} + sub sp, 0x4 + ldr r1, =gPlayerParty + ldr r0, =gSpecialVar_0x8004 + ldrb r2, [r0] + ldr r0, =gPlayerPartyCount + ldrb r3, [r0] + subs r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =c2_exit_to_overworld_2_switch + str r0, [sp] + movs r0, 0x3 + bl sub_81BF8EC + ldr r1, =gUnknown_03005DAC + ldr r0, =sub_80AF168 + str r0, [r1] + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B968C + + thumb_func_start sub_81B96D0 +sub_81B96D0: @ 81B96D0 + push {r4,r5,lr} + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] + movs r4, 0 + adds r5, r1, 0 +_081B96DC: + ldr r0, =gSpecialVar_0x8004 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + adds r1, r4, 0 + adds r1, 0xD + bl GetMonData + cmp r0, 0 + beq _081B96FA + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] +_081B96FA: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _081B96DC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B96D0 + + thumb_func_start sub_81B9718 +sub_81B9718: @ 81B9718 + push {r4,r5,lr} + ldr r0, =gSpecialVar_0x8004 + ldrh r1, [r0] + movs r0, 0x64 + adds r5, r1, 0 + muls r5, r0 + ldr r0, =gPlayerParty + adds r5, r0 + ldr r0, =gSpecialVar_0x8005 + ldrh r1, [r0] + adds r1, 0xD + adds r0, r5, 0 + bl GetMonData + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r1, =gStringVar1 + adds r0, r5, 0 + bl GetMonNickname + ldr r0, =gStringVar2 + movs r1, 0xD + muls r1, r4 + ldr r2, =gMoveNames + adds r1, r2 + bl StringCopy + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9718 + + thumb_func_start sub_81B9770 +sub_81B9770: @ 81B9770 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, =gSpecialVar_0x8004 + mov r8, r0 + ldrh r0, [r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, =gPlayerParty + adds r0, r5 + ldr r4, =gSpecialVar_0x8005 + ldrb r2, [r4] + movs r1, 0 + bl SetMonMoveSlot + mov r1, r8 + ldrh r0, [r1] + muls r0, r6 + adds r0, r5 + ldrb r1, [r4] + bl RemoveMonPPBonus + ldrh r4, [r4] + cmp r4, 0x2 + bhi _081B97C4 +_081B97A2: + ldr r0, =gSpecialVar_0x8004 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + lsls r1, r4, 24 + lsrs r1, 24 + adds r4, 0x1 + lsls r2, r4, 24 + lsrs r2, 24 + bl sub_81B97DC + lsls r4, 16 + lsrs r4, 16 + cmp r4, 0x2 + bls _081B97A2 +_081B97C4: + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9770 + + thumb_func_start sub_81B97DC +sub_81B97DC: @ 81B97DC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + mov r8, r0 + adds r5, r1, 0 + adds r4, r2, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + adds r0, 0xD + str r0, [sp, 0x8] + mov r0, r8 + ldr r1, [sp, 0x8] + bl GetMonData + mov r1, sp + adds r1, 0x2 + str r1, [sp, 0x14] + strh r0, [r1] + adds r3, r4, 0 + adds r3, 0xD + str r3, [sp, 0xC] + mov r0, r8 + adds r1, r3, 0 + bl GetMonData + mov r1, sp + strh r0, [r1] + adds r7, r5, 0 + adds r7, 0x11 + str r7, [sp, 0x10] + mov r0, r8 + adds r1, r7, 0 + bl GetMonData + mov r1, sp + adds r1, 0x5 + str r1, [sp, 0x18] + strb r0, [r1] + adds r3, r4, 0 + adds r3, 0x11 + str r3, [sp, 0x1C] + mov r0, r8 + adds r1, r3, 0 + bl GetMonData + add r7, sp, 0x4 + mov r10, r7 + strb r0, [r7] + mov r0, r8 + movs r1, 0x15 + bl GetMonData + mov r6, sp + adds r6, 0x6 + strb r0, [r6] + ldr r1, =gUnknown_08329D22 + adds r0, r5, r1 + ldrb r0, [r0] + mov r9, r0 + ldrb r0, [r6] + adds r2, r0, 0 + mov r3, r9 + ands r2, r3 + lsls r5, 1 + asrs r2, r5 + lsls r2, 24 + lsrs r2, 24 + adds r1, r4, r1 + ldrb r3, [r1] + adds r1, r0, 0 + ands r1, r3 + lsls r4, 1 + asrs r1, r4 + lsls r1, 24 + lsrs r1, 24 + mov r7, r9 + bics r0, r7 + strb r0, [r6] + ldrb r0, [r6] + bics r0, r3 + strb r0, [r6] + lsls r2, r4 + lsls r1, r5 + adds r2, r1 + ldrb r0, [r6] + orrs r0, r2 + strb r0, [r6] + mov r0, r8 + ldr r1, [sp, 0x8] + mov r2, sp + bl SetMonData + mov r0, r8 + ldr r1, [sp, 0xC] + ldr r2, [sp, 0x14] + bl SetMonData + mov r0, r8 + ldr r1, [sp, 0x10] + mov r2, r10 + bl SetMonData + mov r0, r8 + ldr r1, [sp, 0x1C] + ldr r2, [sp, 0x18] + bl SetMonData + mov r0, r8 + movs r1, 0x15 + adds r2, r6, 0 + bl SetMonData + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B97DC + + thumb_func_start sub_81B98DC +sub_81B98DC: @ 81B98DC + push {lr} + ldr r0, =gSpecialVar_0x8004 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x2D + bl GetMonData + adds r1, r0, 0 + cmp r1, 0 + beq _081B990C + ldr r1, =gScriptResult + movs r0, 0x1 + strh r0, [r1] + b _081B9910 + .pool +_081B990C: + ldr r0, =gScriptResult + strh r1, [r0] +_081B9910: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B98DC + + thumb_func_start sub_81B9918 +sub_81B9918: @ 81B9918 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] + ldr r0, =gSpecialVar_0x8004 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + adds r1, 0xD + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + cmp r0, 0x39 + bne _081B999C + movs r6, 0 + b _081B9980 + .pool +_081B9958: + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + cmp r6, r0 + beq _081B997E + movs r4, 0 + movs r0, 0x64 + adds r5, r6, 0 + muls r5, r0 + ldr r7, =gPlayerParty +_081B996A: + adds r1, r4, 0 + adds r1, 0xD + adds r0, r5, r7 + bl GetMonData + cmp r0, 0x39 + beq _081B999C + adds r4, 0x1 + cmp r4, 0x3 + bls _081B996A +_081B997E: + adds r6, 0x1 +_081B9980: + bl CalculatePlayerPartyCount + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + bcc _081B9958 + mov r0, r8 + bl sub_80D23A8 + cmp r0, 0x1 + beq _081B999C + ldr r1, =gScriptResult + movs r0, 0x1 + strh r0, [r1] +_081B999C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9918 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/pokeball.s b/asm/pokeball.s new file mode 100755 index 000000000..06958d7d2 --- /dev/null +++ b/asm/pokeball.s @@ -0,0 +1,2861 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_80753E8 +sub_80753E8: @ 80753E8 + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + ldr r1, =gDoingBattleAnim + movs r0, 0x1 + strb r0, [r1] + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r6, =gActiveBank + ldrb r1, [r6] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x8 + orrs r1, r2 + strb r1, [r0] + ldr r0, =sub_8075450 + movs r1, 0x5 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0xA] + strh r5, [r1, 0xC] + ldrb r0, [r6] + strh r0, [r1, 0xE] + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80753E8 + + thumb_func_start sub_8075450 +sub_8075450: @ 8075450 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + movs r0, 0 + str r0, [sp] + ldr r1, =gTasks + mov r2, r10 + lsls r0, r2, 2 + add r0, r10 + lsls r0, 3 + adds r1, r0, r1 + ldrh r2, [r1, 0x8] + movs r3, 0x8 + ldrsh r0, [r1, r3] + cmp r0, 0 + bne _08075488 + adds r0, r2, 0x1 + strh r0, [r1, 0x8] + b _08075602 + .pool +_08075488: + ldrh r0, [r1, 0xC] + mov r8, r0 + ldrb r5, [r1, 0xE] + adds r0, r5, 0 + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + beq _080754B4 + ldr r1, =gBattlePartyID + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gEnemyParty + b _080754C2 + .pool +_080754B4: + ldr r1, =gBattlePartyID + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty +_080754C2: + adds r0, r1 + movs r1, 0x26 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + bl ball_number_to_ball_processing_index + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_8076A78 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 3 + ldr r1, =gUnknown_0832C588 + adds r0, r1 + movs r1, 0x20 + movs r2, 0x50 + movs r3, 0x1D + bl CreateSprite + lsls r0, 24 + lsrs r7, r0, 24 + ldr r2, =gSprites + mov r9, r2 + lsls r0, r7, 4 + adds r0, r7 + lsls r6, r0, 2 + adds r4, r6, r2 + movs r0, 0x80 + strh r0, [r4, 0x2E] + movs r3, 0 + strh r3, [r4, 0x30] + mov r0, r8 + strh r0, [r4, 0x3C] + mov r2, r8 + cmp r2, 0xFE + beq _08075548 + cmp r2, 0xFF + bne _08075584 + ldr r0, =gBankTarget + strb r5, [r0] + movs r0, 0x18 + strh r0, [r4, 0x20] + movs r0, 0x44 + strh r0, [r4, 0x22] + mov r0, r9 + adds r0, 0x1C + adds r0, r6, r0 + ldr r1, =sub_80761B4 + str r1, [r0] + b _08075592 + .pool +_08075548: + adds r0, r5, 0 + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x20] + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x18 + strh r0, [r4, 0x22] + ldr r0, =gBankTarget + strb r5, [r0] + movs r3, 0 + strh r3, [r4, 0x2E] + mov r0, r9 + adds r0, 0x1C + adds r0, r6, r0 + ldr r1, =sub_8076398 + str r1, [r0] + b _08075592 + .pool +_08075584: + movs r0, 0x1 + bl GetBankByPlayerAI + ldr r1, =gBankTarget + strb r0, [r1] + movs r0, 0x1 + str r0, [sp] +_08075592: + ldr r0, =gSprites + lsls r1, r7, 4 + adds r1, r7 + lsls r1, 2 + adds r4, r1, r0 + ldr r5, =gBankTarget + ldrb r0, [r5] + strh r0, [r4, 0x3A] + ldr r2, [sp] + cmp r2, 0 + bne _080755B8 + mov r0, r10 + bl DestroyTask + b _08075602 + .pool +_080755B8: + movs r0, 0x22 + strh r0, [r4, 0x2E] + ldrb r0, [r5] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x32] + ldrb r0, [r5] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x10 + strh r0, [r4, 0x36] + ldr r0, =0x0000ffd8 + strh r0, [r4, 0x38] + adds r0, r4, 0 + bl sub_80A68D4 + mov r3, r10 + strh r3, [r4, 0x6] + ldr r1, =gTasks + mov r2, r10 + lsls r0, r2, 2 + add r0, r10 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r5] + strh r1, [r0, 0x10] + ldr r1, =TaskDummy + str r1, [r0] + movs r0, 0x3D + bl PlaySE +_08075602: + 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_8075450 + + thumb_func_start objc_0804ABD4 +objc_0804ABD4: @ 8075620 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r7, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _080756C0 + ldrb r6, [r7, 0x6] + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldrb r5, [r0, 0x10] + ldrb r0, [r0, 0xC] + mov r8, r0 + adds r0, r7, 0 + movs r1, 0x1 + bl StartSpriteAnim + adds r2, r7, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldrh r0, [r7, 0x24] + ldrh r1, [r7, 0x20] + adds r0, r1 + movs r1, 0 + strh r0, [r7, 0x20] + ldrh r0, [r7, 0x26] + ldrh r2, [r7, 0x22] + adds r0, r2 + strh r0, [r7, 0x22] + strh r1, [r7, 0x24] + strh r1, [r7, 0x26] + strh r1, [r7, 0x38] + adds r0, r5, 0 + bl sub_8076B14 + lsls r0, 16 + lsrs r0, 16 + bl ball_number_to_ball_processing_index + adds r4, r0, 0 + ldrh r0, [r7, 0x20] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r7, 0x22] + subs r1, 0x5 + lsls r1, 24 + lsrs r1, 24 + lsls r4, 24 + lsrs r4, 24 + str r4, [sp] + movs r2, 0x1 + movs r3, 0x1C + bl sub_8171D98 + movs r0, 0 + adds r1, r5, 0 + movs r2, 0xE + adds r3, r4, 0 + bl sub_81729E8 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7, 0x2E] + strh r5, [r7, 0x3A] + mov r0, r8 + strh r0, [r7, 0x3C] + adds r0, r6, 0 + bl DestroyTask + ldr r0, =sub_80756D4 + str r0, [r7, 0x1C] +_080756C0: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end objc_0804ABD4 + + thumb_func_start sub_80756D4 +sub_80756D4: @ 80756D4 + ldr r1, =sub_80756E0 + str r1, [r0, 0x1C] + bx lr + .pool + thumb_func_end sub_80756D4 + + thumb_func_start sub_80756E0 +sub_80756E0: @ 80756E0 + push {r4-r7,lr} + adds r6, r0, 0 + ldrh r0, [r6, 0x38] + adds r0, 0x1 + movs r7, 0 + strh r0, [r6, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + bne _0807573A + strh r7, [r6, 0x38] + ldr r0, =sub_807574C + str r0, [r6, 0x1C] + ldr r5, =gBankSpriteIds + movs r1, 0x3A + ldrsh r0, [r6, r1] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =gSprites + adds r0, r4 + movs r1, 0x2 + bl StartSpriteAffineAnim + movs r1, 0x3A + ldrsh r0, [r6, r1] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl AnimateSprite + movs r1, 0x3A + ldrsh r0, [r6, r1] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r7, [r0, 0x30] +_0807573A: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80756E0 + + thumb_func_start sub_807574C +sub_807574C: @ 807574C + push {r4-r6,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xB + bne _08075764 + movs r0, 0x3C + bl PlaySE +_08075764: + ldr r6, =gSprites + ldr r5, =gBankSpriteIds + movs r1, 0x3A + ldrsh r0, [r4, r1] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r6 + adds r0, r1, 0 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 26 + cmp r0, 0 + bge _080757BC + adds r0, r4, 0 + movs r1, 0x2 + bl StartSpriteAnim + movs r2, 0x3A + ldrsh r0, [r4, r2] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + movs r0, 0 + strh r0, [r4, 0x38] + ldr r0, =sub_80757E4 + str r0, [r4, 0x1C] + b _080757DC + .pool +_080757BC: + ldrh r0, [r1, 0x30] + adds r0, 0x60 + strh r0, [r1, 0x30] + movs r1, 0x3A + ldrsh r0, [r4, r1] + adds r0, r5 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + movs r2, 0x30 + ldrsh r0, [r1, r2] + negs r0, r0 + asrs r0, 8 + strh r0, [r1, 0x26] +_080757DC: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_807574C + + thumb_func_start sub_80757E4 +sub_80757E4: @ 80757E4 + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0807582C + ldrh r0, [r4, 0x38] + adds r0, 0x1 + movs r1, 0 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _0807582C + strh r1, [r4, 0x34] + movs r0, 0x20 + strh r0, [r4, 0x36] + strh r1, [r4, 0x38] + movs r0, 0 + movs r1, 0x20 + bl Cos + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + movs r0, 0x36 + ldrsh r1, [r4, r0] + movs r0, 0 + bl Cos + negs r0, r0 + strh r0, [r4, 0x26] + ldr r0, =sub_8075838 + str r0, [r4, 0x1C] +_0807582C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80757E4 + + thumb_func_start sub_8075838 +sub_8075838: @ 8075838 + push {r4,r5,lr} + adds r4, r0, 0 + movs r5, 0 + ldrh r0, [r4, 0x34] + movs r1, 0xFF + ands r1, r0 + cmp r1, 0 + beq _0807584E + cmp r1, 0x1 + beq _080758C2 + b _080758EE +_0807584E: + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r2, 0x36 + ldrsh r1, [r4, r2] + bl Cos + negs r0, r0 + strh r0, [r4, 0x26] + ldrh r1, [r4, 0x38] + adds r1, 0x4 + ldrh r2, [r4, 0x34] + lsls r0, r2, 16 + asrs r0, 24 + adds r1, r0 + strh r1, [r4, 0x38] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x3F + ble _080758EE + ldrh r0, [r4, 0x36] + subs r0, 0xA + strh r0, [r4, 0x36] + ldr r1, =0x00000101 + adds r0, r2, r1 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 24 + cmp r0, 0x4 + bne _0807588A + movs r5, 0x1 +_0807588A: + cmp r0, 0x2 + beq _080758AA + cmp r0, 0x2 + bgt _0807589C + cmp r0, 0x1 + beq _080758A2 + b _080758BA + .pool +_0807589C: + cmp r0, 0x3 + beq _080758B2 + b _080758BA +_080758A2: + movs r0, 0x38 + bl PlaySE + b _080758EE +_080758AA: + movs r0, 0x39 + bl PlaySE + b _080758EE +_080758B2: + movs r0, 0x3A + bl PlaySE + b _080758EE +_080758BA: + movs r0, 0x3B + bl PlaySE + b _080758EE +_080758C2: + movs r2, 0x38 + ldrsh r0, [r4, r2] + movs r2, 0x36 + ldrsh r1, [r4, r2] + bl Cos + negs r0, r0 + strh r0, [r4, 0x26] + ldrh r1, [r4, 0x38] + subs r1, 0x4 + ldrh r2, [r4, 0x34] + lsls r0, r2, 16 + asrs r0, 24 + subs r1, r0 + strh r1, [r4, 0x38] + lsls r1, 16 + cmp r1, 0 + bgt _080758EE + strh r5, [r4, 0x38] + ldr r0, =0xffffff00 + ands r0, r2 + strh r0, [r4, 0x34] +_080758EE: + cmp r5, 0 + beq _08075926 + movs r5, 0 + strh r5, [r4, 0x34] + movs r0, 0x40 + movs r1, 0x20 + bl Cos + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + strh r5, [r4, 0x26] + movs r2, 0x3C + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _0807591C + ldr r0, =sub_8075D14 + str r0, [r4, 0x1C] + b _08075926 + .pool +_0807591C: + ldr r0, =sub_8075930 + str r0, [r4, 0x1C] + movs r0, 0x1 + strh r0, [r4, 0x36] + strh r5, [r4, 0x38] +_08075926: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8075838 + + thumb_func_start sub_8075930 +sub_8075930: @ 8075930 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1F + bne _08075964 + movs r0, 0 + strh r0, [r4, 0x34] + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + adds r0, r4, 0 + movs r1, 0x1 + bl StartSpriteAffineAnim + ldr r0, =sub_8075970 + str r0, [r4, 0x1C] + movs r0, 0x17 + bl PlaySE +_08075964: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8075930 + + thumb_func_start sub_8075970 +sub_8075970: @ 8075970 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x34] + movs r1, 0xFF + ands r1, r0 + cmp r1, 0x4 + bhi _08075A70 + lsls r0, r1, 2 + ldr r1, =_0807598C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0807598C: + .4byte _080759A0 + .4byte _080759D2 + .4byte _080759A0 + .4byte _08075A26 + .4byte _08075A70 +_080759A0: + ldrh r0, [r4, 0x36] + ldrh r2, [r4, 0x24] + adds r1, r0, r2 + strh r1, [r4, 0x24] + ldrh r1, [r4, 0x38] + adds r0, r1 + strh r0, [r4, 0x38] + adds r2, r4, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + ldrh r0, [r4, 0x38] + adds r0, 0x3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x6 + bls _08075AB6 + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + movs r0, 0 + strh r0, [r4, 0x38] + b _08075AB6 +_080759D2: + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _08075A18 + movs r0, 0 + strh r0, [r4, 0x38] + ldrh r0, [r4, 0x36] + negs r0, r0 + strh r0, [r4, 0x36] + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + adds r2, r4, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + movs r2, 0x36 + ldrsh r0, [r4, r2] + cmp r0, 0 + bge _08075A0E + adds r0, r4, 0 + movs r1, 0x2 + bl ChangeSpriteAffineAnim + b _08075AB6 +_08075A0E: + adds r0, r4, 0 + movs r1, 0x1 + bl ChangeSpriteAffineAnim + b _08075AB6 +_08075A18: + adds r0, r4, 0 + adds r0, 0x2C + ldrb r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0] + b _08075AB6 +_08075A26: + movs r1, 0x80 + lsls r1, 1 + adds r0, r1, 0 + ldrh r2, [r4, 0x34] + adds r0, r2 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 24 + movs r2, 0x3C + ldrsh r1, [r4, r2] + cmp r0, r1 + bne _08075A48 + ldr r0, =sub_8075D14 + str r0, [r4, 0x1C] + b _08075AB6 + .pool +_08075A48: + cmp r1, 0x4 + bne _08075A5C + cmp r0, 0x3 + bne _08075A5C + ldr r0, =sub_8075FB4 + str r0, [r4, 0x1C] + b _08075A62 + .pool +_08075A5C: + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] +_08075A62: + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + b _08075AB6 +_08075A70: + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1F + bne _08075AB6 + movs r0, 0 + strh r0, [r4, 0x38] + ldrh r1, [r4, 0x34] + ldr r0, =0xffffff00 + ands r0, r1 + strh r0, [r4, 0x34] + adds r0, r4, 0 + movs r1, 0x3 + bl StartSpriteAffineAnim + movs r1, 0x36 + ldrsh r0, [r4, r1] + cmp r0, 0 + bge _08075AA8 + adds r0, r4, 0 + movs r1, 0x2 + bl StartSpriteAffineAnim + b _08075AB0 + .pool +_08075AA8: + adds r0, r4, 0 + movs r1, 0x1 + bl StartSpriteAffineAnim +_08075AB0: + movs r0, 0x17 + bl PlaySE +_08075AB6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8075970 + + thumb_func_start c3_0804B070 +c3_0804B070: @ 8075ABC + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r2, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r2 + ldrb r1, [r0, 0xC] + mov r12, r1 + ldrb r5, [r0, 0xA] + ldrh r6, [r0, 0x8] + ldrb r3, [r0, 0xE] + mov r8, r3 + ldrb r7, [r0, 0x10] + movs r3, 0x12 + ldrsh r1, [r0, r3] + lsls r3, r1, 16 + ldrh r1, [r0, 0x14] + orrs r3, r1 + movs r1, 0x26 + ldrsh r0, [r0, r1] + cmp r0, 0x20 + bhi _08075B88 + lsls r0, 2 + ldr r1, =_08075B04 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08075B04: + .4byte _08075B88 + .4byte _08075BB4 + .4byte _08075BDA + .4byte _08075C54 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075BF8 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075C66 + .4byte _08075C7E + .4byte _08075CA8 +_08075B88: + ldr r0, =gSprites + lsls r1, r7, 4 + adds r1, r7 + lsls r1, 2 + adds r1, r0 + adds r1, 0x3F + ldrb r0, [r1] + lsls r0, 26 + cmp r0, 0 + blt _08075B9E + b _08075D04 +_08075B9E: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r2 + mov r1, r12 + adds r1, 0x1 + strh r1, [r0, 0x26] + b _08075D04 + .pool +_08075BB4: + adds r0, r3, 0 + bl sub_805F110 + cmp r0, 0x1 + bne _08075BCC + lsls r1, r5, 24 + asrs r1, 24 + adds r0, r6, 0 + movs r2, 0 + bl PlayCry3 + b _08075C2E +_08075BCC: + lsls r1, r5, 24 + asrs r1, 24 + adds r0, r6, 0 + movs r2, 0xB + bl PlayCry3 + b _08075C2E +_08075BDA: + bl StopCryAndClearCrySongs + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0x3 + strh r1, [r0, 0x1C] + movs r1, 0x14 + strh r1, [r0, 0x26] + b _08075D04 + .pool +_08075BF8: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r2 + ldrh r2, [r1, 0x1C] + movs r7, 0x1C + ldrsh r0, [r1, r7] + cmp r0, 0 + bne _08075CBA + adds r0, r3, 0 + bl sub_805F110 + cmp r0, 0x1 + bne _08075C22 + lsls r1, r5, 24 + asrs r1, 24 + adds r0, r6, 0 + movs r2, 0x1 + bl PlayCry4 + b _08075C2E +_08075C22: + lsls r1, r5, 24 + asrs r1, 24 + adds r0, r6, 0 + movs r2, 0xC + bl PlayCry4 +_08075C2E: + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r0, [r0, 0x4] + mov r2, r8 + lsls r1, r2, 1 + add r1, r8 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x1] + movs r0, 0x41 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1] + adds r0, r4, 0 + bl DestroyTask + b _08075D04 + .pool +_08075C54: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r2 + movs r1, 0x6 + strh r1, [r0, 0x1C] + movs r1, 0x1E + strh r1, [r0, 0x26] + b _08075D04 +_08075C66: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r2 + ldrh r2, [r1, 0x1C] + movs r3, 0x1C + ldrsh r0, [r1, r3] + cmp r0, 0 + bne _08075CBA + ldrh r0, [r1, 0x26] + adds r0, 0x1 + strh r0, [r1, 0x26] +_08075C7E: + bl IsCryPlayingOrClearCrySongs + lsls r0, 24 + cmp r0, 0 + bne _08075D04 + bl StopCryAndClearCrySongs + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0x3 + strh r0, [r1, 0x1C] + ldrh r0, [r1, 0x26] + adds r0, 0x1 + strh r0, [r1, 0x26] + b _08075D04 + .pool +_08075CA8: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r2 + ldrh r2, [r1, 0x1C] + movs r7, 0x1C + ldrsh r0, [r1, r7] + cmp r0, 0 + beq _08075CC0 +_08075CBA: + subs r0, r2, 0x1 + strh r0, [r1, 0x1C] + b _08075D04 +_08075CC0: + adds r0, r3, 0 + bl sub_805F110 + cmp r0, 0x1 + bne _08075CD8 + lsls r1, r5, 24 + asrs r1, 24 + adds r0, r6, 0 + movs r2, 0 + bl PlayCry4 + b _08075CE4 +_08075CD8: + lsls r1, r5, 24 + asrs r1, 24 + adds r0, r6, 0 + movs r2, 0xB + bl PlayCry4 +_08075CE4: + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r0, [r0, 0x4] + mov r2, r8 + lsls r1, r2, 1 + add r1, r8 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x1] + movs r0, 0x41 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1] + adds r0, r4, 0 + bl DestroyTask +_08075D04: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end c3_0804B070 + + thumb_func_start sub_8075D14 +sub_8075D14: @ 8075D14 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r6, r0, 0 + ldrh r0, [r6, 0x3A] + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r6, 0 + movs r1, 0x1 + bl StartSpriteAnim + adds r0, r5, 0 + bl sub_8076B14 + lsls r0, 16 + lsrs r0, 16 + bl ball_number_to_ball_processing_index + adds r4, r0, 0 + ldrh r0, [r6, 0x20] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r6, 0x22] + subs r1, 0x5 + lsls r1, 24 + lsrs r1, 24 + lsls r4, 24 + lsrs r4, 24 + str r4, [sp] + movs r2, 0x1 + movs r3, 0x1C + bl sub_8171D98 + ldrh r1, [r6, 0x3A] + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x1 + movs r2, 0xE + adds r3, r4, 0 + bl sub_81729E8 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x2E] + ldr r0, =sub_8075FD4 + str r0, [r6, 0x1C] + ldr r0, =gMain + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08075D88 + b _08075EF4 +_08075D88: + adds r0, r5, 0 + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + beq _08075DC0 + ldr r0, =gBattlePartyID + lsls r2, r5, 1 + adds r0, r2, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gEnemyParty + adds r7, r1, r0 + movs r4, 0x19 + mov r10, r4 + b _08075DD4 + .pool +_08075DC0: + ldr r0, =gBattlePartyID + lsls r2, r5, 1 + adds r0, r2, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r7, r1, r0 + movs r0, 0xE7 + mov r10, r0 +_08075DD4: + mov r8, r2 + adds r0, r7, 0 + movs r1, 0xB + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + movs r0, 0 + bl GetBankByPlayerAI + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + beq _08075E00 + movs r0, 0x1 + bl GetBankByPlayerAI + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + bne _08075E56 +_08075E00: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08075E56 + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r1, [r0, 0x9] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08075E56 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x42 + ands r0, r1 + cmp r0, 0x42 + bne _08075E4C + bl IsBGMPlaying + lsls r0, 24 + cmp r0, 0 + beq _08075E56 + ldr r0, =gMPlay_BGM + bl m4aMPlayStop + b _08075E56 + .pool +_08075E4C: + ldr r0, =gMPlay_BGM + ldr r1, =0x0000ffff + movs r2, 0x80 + bl m4aMPlayVolumeControl +_08075E56: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08075E70 + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r1, [r0, 0x9] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08075E80 +_08075E70: + movs r4, 0 + b _08075EA2 + .pool +_08075E80: + movs r0, 0 + bl GetBankByPlayerAI + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + beq _08075E9C + movs r0, 0x1 + bl GetBankByPlayerAI + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + bne _08075EA0 +_08075E9C: + movs r4, 0x1 + b _08075EA2 +_08075EA0: + movs r4, 0x2 +_08075EA2: + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r0, [r0, 0x4] + mov r2, r8 + adds r1, r2, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + movs r2, 0x40 + orrs r0, r2 + strb r0, [r1, 0x1] + ldr r0, =c3_0804B070 + movs r1, 0x3 + 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 r3, 0 + mov r0, r9 + strh r0, [r1, 0x8] + mov r2, r10 + lsls r0, r2, 24 + asrs r0, 24 + strh r0, [r1, 0xA] + strh r4, [r1, 0xC] + strh r5, [r1, 0xE] + ldr r2, =gBankSpriteIds + movs r4, 0x3A + ldrsh r0, [r6, r4] + adds r0, r2 + ldrb r0, [r0] + strh r0, [r1, 0x10] + lsrs r0, r7, 16 + strh r0, [r1, 0x12] + strh r7, [r1, 0x14] + strh r3, [r1, 0x26] +_08075EF4: + ldr r4, =gBankSpriteIds + movs r1, 0x3A + ldrsh r0, [r6, r1] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, =gSprites + adds r0, r5 + movs r1, 0x1 + bl StartSpriteAffineAnim + ldrh r0, [r6, 0x3A] + lsls r0, 24 + lsrs r0, 24 + bl GetBankSide + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08075F50 + movs r2, 0x3A + ldrsh r0, [r6, r2] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r5, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_8039B58 + b _08075F66 + .pool +_08075F50: + movs r1, 0x3A + ldrsh r0, [r6, r1] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r5, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_8039E44 +_08075F66: + str r1, [r0] + ldr r5, =gBankSpriteIds + movs r2, 0x3A + ldrsh r0, [r6, r2] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =gSprites + adds r0, r4 + bl AnimateSprite + movs r1, 0x3A + ldrsh r0, [r6, r1] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x80 + lsls r1, 5 + strh r1, [r0, 0x30] + 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_8075D14 + + thumb_func_start sub_8075FB4 +sub_8075FB4: @ 8075FB4 + adds r3, r0, 0 + adds r3, 0x2C + ldrb r1, [r3] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r3] + ldr r1, =sub_80760F8 + str r1, [r0, 0x1C] + movs r1, 0 + strh r1, [r0, 0x34] + strh r1, [r0, 0x36] + strh r1, [r0, 0x38] + bx lr + .pool + thumb_func_end sub_8075FB4 + + thumb_func_start sub_8075FD4 +sub_8075FD4: @ 8075FD4 + push {r4-r7,lr} + adds r5, r0, 0 + movs r7, 0 + ldrh r0, [r5, 0x3A] + lsls r0, 24 + lsrs r6, r0, 24 + ldr r4, =gSprites + ldr r0, =gBankSpriteIds + adds r3, r6, r0 + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + adds r0, r5, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08076016 + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_08076016: + ldrb r0, [r3] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + adds r0, r1, 0 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 26 + cmp r0, 0 + bge _08076040 + adds r0, r1, 0 + movs r1, 0 + bl StartSpriteAffineAnim + movs r7, 0x1 + b _0807605C + .pool +_08076040: + ldr r2, =0xfffffee0 + adds r0, r2, 0 + ldrh r2, [r1, 0x30] + adds r0, r2 + strh r0, [r1, 0x30] + ldrb r0, [r3] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrh r0, [r1, 0x30] + lsls r0, 16 + asrs r0, 24 + strh r0, [r1, 0x26] +_0807605C: + adds r0, r5, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080760DE + cmp r7, 0 + beq _080760DE + ldr r2, =gSprites + ldr r0, =gBankSpriteIds + adds r0, r6, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r2, 0 + movs r1, 0 + strh r1, [r0, 0x26] + ldr r0, =gDoingBattleAnim + strb r2, [r0] + ldr r4, =gUnknown_020244D0 + ldr r0, [r4] + ldr r0, [r0, 0x4] + lsls r1, r6, 1 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + adds r0, r5, 0 + bl FreeSpriteOamMatrix + adds r0, r5, 0 + bl DestroySprite + movs r3, 0 + ldr r0, [r4] + ldr r2, [r0, 0x4] + movs r5, 0x8 + movs r4, 0x3 +_080760B6: + ldrb r1, [r2] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _080760C2 + adds r3, 0x1 +_080760C2: + adds r2, 0xC + subs r4, 0x1 + cmp r4, 0 + bge _080760B6 + cmp r3, 0x4 + bne _080760DE + movs r4, 0 +_080760D0: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8076AE8 + adds r4, 0x1 + cmp r4, 0xB + ble _080760D0 +_080760DE: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8075FD4 + + thumb_func_start sub_80760F8 +sub_80760F8: @ 80760F8 + push {r4-r7,lr} + adds r6, r0, 0 + ldrh r0, [r6, 0x3A] + lsls r0, 24 + lsrs r7, r0, 24 + ldrh r0, [r6, 0x36] + adds r0, 0x1 + strh r0, [r6, 0x36] + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0x28 + beq _08076196 + cmp r1, 0x5F + bne _08076130 + ldr r0, =gDoingBattleAnim + movs r1, 0 + strb r1, [r0] + bl m4aMPlayAllStop + ldr r0, =0x00000173 + bl PlaySE + b _08076196 + .pool +_08076130: + ldr r0, =0x0000013b + cmp r1, r0 + bne _08076196 + ldr r5, =gSprites + ldr r4, =gBankSpriteIds + movs r1, 0x3A + ldrsh r0, [r6, r1] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r0, [r0, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl FreeOamMatrix + movs r1, 0x3A + ldrsh r0, [r6, r1] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl DestroySprite + adds r0, r6, 0 + bl DestroySpriteAndFreeResources + ldr r0, =gMain + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08076196 + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r0, [r0, 0x4] + lsls r1, r7, 1 + adds r1, r7 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + strb r0, [r1] +_08076196: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80760F8 + + thumb_func_start sub_80761B4 +sub_80761B4: @ 80761B4 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x19 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x3A] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x3A] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x18 + strh r0, [r4, 0x36] + ldr r0, =0x0000ffe2 + strh r0, [r4, 0x38] + ldrh r0, [r4, 0x3A] + strh r0, [r4, 0x6] + adds r0, r4, 0 + bl sub_80A68D4 + ldr r0, =sub_8076204 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80761B4 + + thumb_func_start sub_8076204 +sub_8076204: @ 8076204 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + ldrh r0, [r5, 0x3C] + movs r1, 0xFF + mov r8, r1 + lsrs r0, 8 + subs r0, 0x23 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2C + bhi _080762F8 + ldrh r1, [r5, 0x6] + movs r0, 0xFF + lsls r0, 8 + ands r0, r1 + cmp r0, 0 + bne _08076266 + ldrh r0, [r5, 0x30] + movs r1, 0x1 + adds r6, r1, 0 + ands r6, r0 + ldrh r0, [r5, 0x32] + adds r7, r1, 0 + ands r7, r0 + movs r2, 0x30 + ldrsh r0, [r5, r2] + movs r1, 0x3 + bl __divsi3 + movs r1, 0x2 + negs r1, r1 + adds r4, r1, 0 + ands r0, r4 + orrs r6, r0 + strh r6, [r5, 0x30] + movs r2, 0x32 + ldrsh r0, [r5, r2] + movs r1, 0x3 + bl __divsi3 + ands r0, r4 + orrs r7, r0 + strh r7, [r5, 0x32] + adds r0, r5, 0 + movs r1, 0x4 + bl StartSpriteAffineAnim +_08076266: + ldrh r4, [r5, 0x2E] + adds r0, r5, 0 + bl sub_80A6F3C + movs r1, 0x3A + ldrsh r0, [r5, r1] + movs r1, 0x3 + bl __divsi3 + adds r1, r0, 0 + ldrh r0, [r5, 0x3C] + adds r0, r1 + strh r0, [r5, 0x3C] + lsls r0, 16 + asrs r0, 24 + mov r2, r8 + ands r0, r2 + movs r2, 0x38 + ldrsh r1, [r5, r2] + bl Sin + ldrh r1, [r5, 0x26] + adds r0, r1 + strh r0, [r5, 0x26] + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + ldrh r1, [r5, 0x6] + adds r0, r1 + strh r0, [r5, 0x6] + lsls r0, 16 + lsrs r0, 24 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + beq _080762B6 + strh r4, [r5, 0x2E] + b _080762BE +_080762B6: + lsls r0, r4, 16 + asrs r0, 16 + subs r0, 0x1 + strh r0, [r5, 0x2E] +_080762BE: + ldrh r0, [r5, 0x3C] + lsrs r0, 8 + cmp r0, 0x4F + ble _08076364 + ldrh r0, [r5, 0x30] + movs r1, 0x1 + adds r6, r1, 0 + ands r6, r0 + ldrh r0, [r5, 0x32] + adds r7, r1, 0 + ands r7, r0 + movs r2, 0x30 + ldrsh r1, [r5, r2] + lsls r0, r1, 1 + adds r0, r1 + movs r1, 0x2 + negs r1, r1 + adds r2, r1, 0 + ands r0, r2 + orrs r0, r6 + strh r0, [r5, 0x30] + movs r0, 0x32 + ldrsh r1, [r5, r0] + lsls r0, r1, 1 + adds r0, r1 + ands r0, r2 + orrs r0, r7 + strh r0, [r5, 0x32] + b _08076364 +_080762F8: + adds r0, r5, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _08076364 + ldrh r0, [r5, 0x24] + ldrh r1, [r5, 0x20] + adds r0, r1 + movs r1, 0 + strh r0, [r5, 0x20] + ldrh r0, [r5, 0x26] + ldrh r2, [r5, 0x22] + adds r0, r2 + strh r0, [r5, 0x22] + strh r1, [r5, 0x26] + strh r1, [r5, 0x24] + ldrb r0, [r5, 0x6] + strh r0, [r5, 0x3A] + strh r1, [r5, 0x2E] + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08076358 + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r1, [r0, 0x9] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08076358 + movs r0, 0x3A + ldrsh r4, [r5, r0] + movs r0, 0x2 + bl GetBankByPlayerAI + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bne _08076358 + ldr r0, =sub_8076374 + b _0807635A + .pool +_08076358: + ldr r0, =sub_8075D14 +_0807635A: + str r0, [r5, 0x1C] + adds r0, r5, 0 + movs r1, 0 + bl StartSpriteAffineAnim +_08076364: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8076204 + + thumb_func_start sub_8076374 +sub_8076374: @ 8076374 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x2E] + adds r1, r0, 0x1 + strh r1, [r2, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x18 + ble _0807638E + movs r0, 0 + strh r0, [r2, 0x2E] + ldr r0, =sub_8075D14 + str r0, [r2, 0x1C] +_0807638E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8076374 + + thumb_func_start sub_8076398 +sub_8076398: @ 8076398 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF + ble _080763EC + movs r0, 0 + strh r0, [r5, 0x2E] + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _080763E8 + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r1, [r0, 0x9] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080763E8 + movs r0, 0x3A + ldrsh r4, [r5, r0] + movs r0, 0x3 + bl GetBankByPlayerAI + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bne _080763E8 + ldr r0, =sub_8076374 + b _080763EA + .pool +_080763E8: + ldr r0, =sub_8075D14 +_080763EA: + str r0, [r5, 0x1C] +_080763EC: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8076398 + + thumb_func_start sub_80763F8 +sub_80763F8: @ 80763F8 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + movs r4, 0 + str r4, [sp] + bl sub_8171D98 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80763F8 + + thumb_func_start sub_8076420 +sub_8076420: @ 8076420 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + movs r3, 0 + bl sub_81729E8 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_8076420 + + thumb_func_start sub_8076438 +sub_8076438: @ 8076438 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r5, r0, 0 + mov r9, r2 + mov r10, r3 + ldr r6, [sp, 0x28] + ldr r4, [sp, 0x2C] + ldr r0, [sp, 0x30] + ldr r2, [sp, 0x38] + lsls r5, 24 + lsrs r5, 24 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + mov r1, r9 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + lsls r3, 24 + lsrs r3, 24 + mov r10, r3 + lsls r6, 24 + lsrs r6, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + lsls r0, r2, 16 + lsrs r7, r0, 16 + ldr r0, =gUnknown_0832C400 + bl LoadCompressedObjectPicUsingHeap + ldr r0, =gUnknown_0832C460 + bl LoadCompressedObjectPaletteUsingHeap + ldr r0, =gUnknown_0832C588 + mov r1, r9 + mov r2, r10 + adds r3, r4, 0 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gSprites + mov r8, r1 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + adds r2, r4, r1 + strh r5, [r2, 0x2E] + lsls r1, r5, 4 + adds r1, r5 + lsls r1, 2 + add r1, r8 + ldrh r0, [r1, 0x20] + strh r0, [r2, 0x38] + ldrh r0, [r1, 0x22] + strh r0, [r2, 0x3A] + mov r3, r9 + strh r3, [r1, 0x20] + mov r0, r10 + strh r0, [r1, 0x22] + strh r7, [r1, 0x3C] + mov r3, sp + ldrh r3, [r3, 0x4] + strh r3, [r2, 0x30] + mov r0, sp + ldrh r0, [r0] + strh r0, [r2, 0x32] + mov r3, sp + ldrh r3, [r3, 0x34] + strh r3, [r2, 0x34] + ldr r3, [sp, 0x34] + lsrs r0, r3, 16 + strh r0, [r2, 0x36] + movs r0, 0x3 + ands r6, r0 + lsls r6, 2 + ldrb r3, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r6 + strb r0, [r2, 0x5] + movs r0, 0x1C + add r8, r0 + add r4, r8 + ldr r0, =sub_8076524 + str r0, [r4] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [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_8076438 + + thumb_func_start sub_8076524 +sub_8076524: @ 8076524 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + ldrh r1, [r6, 0x30] + movs r2, 0x30 + ldrsh r0, [r6, r2] + cmp r0, 0 + bne _080765D0 + ldrh r0, [r6, 0x2E] + lsls r0, 24 + lsrs r7, r0, 24 + ldrh r0, [r6, 0x32] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldrh r4, [r6, 0x34] + ldrh r0, [r6, 0x36] + lsls r0, 16 + orrs r4, r0 + adds r0, r6, 0 + adds r0, 0x43 + ldrb r0, [r0] + cmp r0, 0 + beq _0807655E + subs r0, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + b _08076560 +_0807655E: + movs r5, 0 +_08076560: + adds r0, r6, 0 + movs r1, 0x1 + bl StartSpriteAnim + ldrh r0, [r6, 0x20] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r6, 0x22] + subs r1, 0x5 + lsls r1, 24 + lsrs r1, 24 + ldrb r2, [r6, 0x5] + lsls r2, 28 + lsrs r2, 30 + adds r3, r5, 0 + bl sub_80763F8 + movs r0, 0x1 + mov r1, r8 + adds r2, r4, 0 + bl sub_8076420 + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + strh r0, [r6, 0x30] + ldr r0, =sub_80765E0 + str r0, [r6, 0x1C] + ldr r0, =gSprites + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + adds r4, r0 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r0, r4, 0 + movs r1, 0x1 + bl StartSpriteAffineAnim + adds r0, r4, 0 + bl AnimateSprite + movs r0, 0x80 + lsls r0, 5 + strh r0, [r4, 0x30] + strh r5, [r6, 0x3C] + b _080765D4 + .pool +_080765D0: + subs r0, r1, 0x1 + strh r0, [r6, 0x30] +_080765D4: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8076524 + + thumb_func_start sub_80765E0 +sub_80765E0: @ 80765E0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r4, r0, 0 + movs r0, 0 + mov r12, r0 + movs r7, 0 + ldrh r0, [r4, 0x2E] + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08076610 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_08076610: + ldr r1, =gSprites + lsls r2, r6, 4 + adds r0, r2, r6 + lsls r0, 2 + adds r5, r0, r1 + adds r0, r5, 0 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 26 + mov r8, r2 + cmp r0, 0 + bge _08076634 + adds r0, r5, 0 + movs r1, 0 + bl StartSpriteAffineAnim + movs r1, 0x1 + mov r12, r1 +_08076634: + movs r2, 0x38 + ldrsh r0, [r4, r2] + movs r3, 0x20 + ldrsh r1, [r4, r3] + subs r0, r1 + movs r1, 0x3C + ldrsh r2, [r4, r1] + muls r0, r2 + cmp r0, 0 + bge _0807664A + adds r0, 0x7F +_0807664A: + asrs r0, 7 + ldrh r3, [r4, 0x20] + adds r0, r3 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + movs r1, 0x3A + ldrsh r0, [r4, r1] + movs r3, 0x22 + ldrsh r1, [r4, r3] + subs r0, r1 + muls r0, r2 + cmp r0, 0 + bge _08076668 + adds r0, 0x7F +_08076668: + asrs r0, 7 + ldrh r1, [r4, 0x22] + adds r0, r1 + mov r2, r9 + strh r2, [r5, 0x20] + strh r0, [r5, 0x22] + ldrh r2, [r4, 0x3C] + movs r3, 0x3C + ldrsh r0, [r4, r3] + cmp r0, 0x7F + bgt _080766AC + ldr r1, =gSineTable + lsls r0, r2, 24 + lsrs r0, 23 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bge _08076690 + adds r0, 0x7 +_08076690: + asrs r0, 3 + negs r0, r0 + lsls r0, 16 + lsrs r0, 16 + adds r1, r2, 0x4 + strh r1, [r4, 0x3C] + strh r0, [r5, 0x24] + strh r0, [r5, 0x26] + b _080766BA + .pool +_080766AC: + ldrh r0, [r4, 0x38] + strh r0, [r5, 0x20] + ldrh r0, [r4, 0x3A] + strh r0, [r5, 0x22] + strh r7, [r5, 0x24] + strh r7, [r5, 0x26] + movs r7, 0x1 +_080766BA: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0807670E + mov r2, r12 + cmp r2, 0 + beq _0807670E + cmp r7, 0 + beq _0807670E + ldr r1, =gSprites + mov r3, r8 + adds r0, r3, r6 + lsls r0, 2 + adds r2, r0, r1 + movs r0, 0x3C + ldrsh r1, [r2, r0] + movs r0, 0xCE + lsls r0, 1 + cmp r1, r0 + bne _080766FC + ldrh r1, [r2, 0x3C] + adds r0, r2, 0 + movs r2, 0x1 + movs r3, 0 + bl DoMonFrontSpriteAnimation + b _08076708 + .pool +_080766FC: + ldrh r1, [r2, 0x3C] + adds r0, r2, 0 + movs r2, 0 + movs r3, 0 + bl DoMonFrontSpriteAnimation +_08076708: + adds r0, r4, 0 + bl DestroySpriteAndFreeResources +_0807670E: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80765E0 + + thumb_func_start sub_807671C +sub_807671C: @ 807671C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r10, r0 + adds r6, r2, 0 + mov r8, r3 + ldr r5, [sp, 0x20] + ldr r4, [sp, 0x24] + ldr r0, [sp, 0x28] + mov r9, r0 + mov r0, r10 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r6, 24 + lsrs r6, 24 + mov r1, r8 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r5, 24 + lsrs r5, 24 + lsls r4, 24 + lsrs r4, 24 + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r0, =gUnknown_0832C400 + bl LoadCompressedObjectPicUsingHeap + ldr r0, =gUnknown_0832C460 + bl LoadCompressedObjectPaletteUsingHeap + ldr r0, =gUnknown_0832C588 + adds r1, r6, 0 + mov r2, r8 + adds r3, r4, 0 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + ldr r6, =gSprites + lsls r3, r0, 4 + adds r3, r0 + lsls r3, 2 + adds r2, r3, r6 + mov r1, r10 + strh r1, [r2, 0x2E] + mov r4, r9 + strh r4, [r2, 0x30] + strh r7, [r2, 0x32] + mov r1, sp + ldrh r1, [r1, 0x2C] + strh r1, [r2, 0x34] + ldr r4, [sp, 0x2C] + lsrs r1, r4, 16 + strh r1, [r2, 0x36] + movs r1, 0x3 + ands r5, r1 + lsls r5, 2 + ldrb r4, [r2, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r4 + orrs r1, r5 + strb r1, [r2, 0x5] + adds r6, 0x1C + adds r3, r6 + ldr r1, =sub_80767D4 + str r1, [r3] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_807671C + + thumb_func_start sub_80767D4 +sub_80767D4: @ 80767D4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + ldrh r1, [r4, 0x30] + movs r2, 0x30 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _0807686C + ldrh r0, [r4, 0x2E] + lsls r0, 24 + lsrs r7, r0, 24 + ldrh r0, [r4, 0x32] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldrh r5, [r4, 0x34] + ldrh r0, [r4, 0x36] + lsls r0, 16 + orrs r5, r0 + adds r0, r4, 0 + adds r0, 0x43 + ldrb r0, [r0] + cmp r0, 0 + beq _0807680E + subs r0, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + b _08076810 +_0807680E: + movs r6, 0 +_08076810: + adds r0, r4, 0 + movs r1, 0x1 + bl StartSpriteAnim + ldrh r0, [r4, 0x20] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x22] + subs r1, 0x5 + lsls r1, 24 + lsrs r1, 24 + ldrb r2, [r4, 0x5] + lsls r2, 28 + lsrs r2, 30 + adds r3, r6, 0 + bl sub_80763F8 + movs r0, 0x1 + mov r1, r8 + adds r2, r5, 0 + bl sub_8076420 + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + strh r0, [r4, 0x30] + ldr r0, =sub_807687C + str r0, [r4, 0x1C] + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + ldr r0, =gSprites + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x2 + bl StartSpriteAffineAnim + adds r0, r4, 0 + bl AnimateSprite + strh r5, [r4, 0x30] + b _08076870 + .pool +_0807686C: + subs r0, r1, 0x1 + strh r0, [r4, 0x30] +_08076870: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80767D4 + + thumb_func_start sub_807687C +sub_807687C: @ 807687C + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0x38] + adds r0, 0x1 + strh r0, [r5, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xB + bne _08076894 + movs r0, 0x3C + bl PlaySE +_08076894: + ldrh r1, [r5, 0x2E] + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gSprites + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, r0, r2 + adds r0, r4, 0 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 26 + cmp r0, 0 + bge _080768D8 + adds r0, r5, 0 + movs r1, 0x2 + bl StartSpriteAnim + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + movs r0, 0 + strh r0, [r5, 0x38] + ldr r0, =sub_80768F0 + str r0, [r5, 0x1C] + b _080768E8 + .pool +_080768D8: + ldrh r0, [r4, 0x30] + adds r0, 0x60 + strh r0, [r4, 0x30] + movs r1, 0x30 + ldrsh r0, [r4, r1] + negs r0, r0 + asrs r0, 8 + strh r0, [r4, 0x26] +_080768E8: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_807687C + + thumb_func_start sub_80768F0 +sub_80768F0: @ 80768F0 + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08076904 + ldr r0, =SpriteCallbackDummy + str r0, [r2, 0x1C] +_08076904: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80768F0 + + thumb_func_start obj_delete_and_free_associated_resources_ +obj_delete_and_free_associated_resources_: @ 807690C + push {lr} + bl DestroySpriteAndFreeResources + pop {r0} + bx r0 + thumb_func_end obj_delete_and_free_associated_resources_ + + thumb_func_start sub_8076918 +sub_8076918: @ 8076918 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r0, =gHealthBoxesIds + adds r0, r5, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r6, =gSprites + adds r4, r0, r6 + movs r1, 0 + movs r0, 0x5 + strh r0, [r4, 0x2E] + strh r1, [r4, 0x30] + movs r0, 0x73 + strh r0, [r4, 0x24] + strh r1, [r4, 0x26] + ldr r0, =sub_80769CC + str r0, [r4, 0x1C] + adds r0, r5, 0 + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + beq _08076966 + ldrh r0, [r4, 0x2E] + negs r0, r0 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x30] + negs r0, r0 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x24] + negs r0, r0 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x26] + negs r0, r0 + strh r0, [r4, 0x26] +_08076966: + movs r0, 0x38 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r6, 0 + adds r1, 0x1C + adds r1, r0, r1 + adds r0, r6 + ldr r1, [r1] + bl _call_via_r1 + adds r0, r5, 0 + bl GetBankIdentity + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08076990 + ldr r0, =sub_80769A8 + str r0, [r4, 0x1C] +_08076990: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8076918 + + thumb_func_start sub_80769A8 +sub_80769A8: @ 80769A8 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x30] + adds r0, 0x1 + strh r0, [r1, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + bne _080769C2 + movs r0, 0 + strh r0, [r1, 0x30] + ldr r0, =sub_80769CC + str r0, [r1, 0x1C] +_080769C2: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80769A8 + + thumb_func_start sub_80769CC +sub_80769CC: @ 80769CC + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x24] + ldrh r1, [r2, 0x2E] + subs r0, r1 + strh r0, [r2, 0x24] + ldrh r0, [r2, 0x26] + ldrh r1, [r2, 0x30] + subs r0, r1 + strh r0, [r2, 0x26] + ldr r0, [r2, 0x24] + cmp r0, 0 + bne _080769EA + ldr r0, =SpriteCallbackDummy + str r0, [r2, 0x1C] +_080769EA: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80769CC + + thumb_func_start sub_80769F4 +sub_80769F4: @ 80769F4 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =oamc_804BEB4 + adds r0, r5, 0 + bl CreateInvisibleSpriteWithCallback + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gSprites + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r3, r1, r2 + movs r0, 0x1 + strh r0, [r3, 0x2E] + ldr r0, =gHealthBoxesIds + adds r4, r0 + ldrb r0, [r4] + strh r0, [r3, 0x30] + adds r2, 0x1C + adds r1, r2 + str r5, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80769F4 + + thumb_func_start oamc_804BEB4 +oamc_804BEB4: @ 8076A38 + push {lr} + adds r3, r0, 0 + ldrh r1, [r3, 0x30] + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gSprites + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + ldrh r0, [r3, 0x2E] + movs r2, 0 + strh r0, [r1, 0x26] + ldrh r0, [r3, 0x2E] + negs r0, r0 + strh r0, [r3, 0x2E] + ldrh r0, [r3, 0x32] + adds r0, 0x1 + strh r0, [r3, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x15 + bne _08076A70 + strh r2, [r1, 0x24] + strh r2, [r1, 0x26] + adds r0, r3, 0 + bl DestroySprite +_08076A70: + pop {r0} + bx r0 + .pool + thumb_func_end oamc_804BEB4 + + thumb_func_start sub_8076A78 +sub_8076A78: @ 8076A78 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gUnknown_0832C400 + lsls r6, r4, 3 + adds r5, r6, r0 + ldrh r0, [r5, 0x6] + bl GetSpriteTileStartByTag + lsls r0, 16 + ldr r1, =0xffff0000 + cmp r0, r1 + bne _08076AA0 + adds r0, r5, 0 + bl LoadCompressedObjectPicUsingHeap + ldr r0, =gUnknown_0832C460 + adds r0, r6, r0 + bl LoadCompressedObjectPaletteUsingHeap +_08076AA0: + cmp r4, 0x6 + beq _08076ACC + cmp r4, 0x6 + blt _08076AB0 + cmp r4, 0xB + bgt _08076AB0 + cmp r4, 0xA + bge _08076ACC +_08076AB0: + ldr r1, =gUnknown_0832C400 + lsls r0, r4, 3 + adds r0, r1 + ldrh r0, [r0, 0x6] + bl GetSpriteTileStartByTag + adds r1, r0, 0 + lsls r1, 16 + ldr r0, =gUnknown_08C02300 + lsrs r1, 11 + ldr r2, =0x06010100 + adds r1, r2 + bl LZDecompressVram +_08076ACC: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8076A78 + + thumb_func_start sub_8076AE8 +sub_8076AE8: @ 8076AE8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + ldr r0, =gUnknown_0832C400 + lsrs r4, 21 + adds r0, r4, r0 + ldrh r0, [r0, 0x6] + bl FreeSpriteTilesByTag + ldr r0, =gUnknown_0832C460 + adds r4, r0 + ldrh r0, [r4, 0x4] + bl FreeSpritePaletteByTag + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8076AE8 + + thumb_func_start sub_8076B14 +sub_8076B14: @ 8076B14 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + beq _08076B40 + ldr r1, =gBattlePartyID + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gEnemyParty + b _08076B4E + .pool +_08076B40: + ldr r1, =gBattlePartyID + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty +_08076B4E: + adds r0, r1 + movs r1, 0x26 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8076B14 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/pokemon_icon.s b/asm/pokemon_icon.s new file mode 100755 index 000000000..e90253ab0 --- /dev/null +++ b/asm/pokemon_icon.s @@ -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. diff --git a/asm/rom_80C6FA0.s b/asm/pokemon_storage_system.s old mode 100644 new mode 100755 similarity index 75% rename from asm/rom_80C6FA0.s rename to asm/pokemon_storage_system.s index 7b0fb83b2..df90540e8 --- a/asm/rom_80C6FA0.s +++ b/asm/pokemon_storage_system.s @@ -22681,7075 +22681,4 @@ _080D2CAA: .pool thumb_func_end sub_80D2C1C - 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 - - 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 - - thumb_func_start sub_80D3718 -sub_80D3718: @ 80D3718 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - movs r0, 0x52 - bl npc_before_player_of_type - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080D3754 - ldr r1, =gUnknown_03005DB0 - ldr r0, =hm_add_c3_launch_phase_2 - str r0, [r1] - ldr r1, =gUnknown_0203CEEC - ldr r0, =sub_80D3A9C - str r0, [r1] - movs r0, 0x1 - b _080D3A2C - .pool -_080D3754: - ldr r0, =gUnknown_0203AB40 - adds r1, r0, 0x2 - bl PlayerGetDestCoords - bl brm_get_pokemon_selection - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - bl GetMonAbility - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0xC] - cmp r0, 0x34 - bne _080D3798 - ldr r1, =gUnknown_03001100 - movs r0, 0x5 - strb r0, [r1] - ldr r0, =gUnknown_03001101 - movs r1, 0x2 - b _080D37A2 - .pool -_080D3798: - ldr r1, =gUnknown_03001100 - movs r0, 0x3 - strb r0, [r1] - ldr r0, =gUnknown_03001101 - movs r1, 0x1 -_080D37A2: - strb r1, [r0] - ldr r0, =gUnknown_03001102 - strb r1, [r0] - movs r6, 0 - movs r1, 0 -_080D37AC: - mov r2, sp - adds r0, r2, r6 - strb r1, [r0] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x8 - bls _080D37AC - movs r6, 0 - ldr r2, =gUnknown_03001108 - movs r1, 0 -_080D37C2: - adds r0, r6, r2 - strb r1, [r0] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x18 - bls _080D37C2 - movs r3, 0 - str r3, [sp, 0x10] - movs r6, 0 -_080D37D6: - ldr r4, =0x0000ffff - adds r0, r6, r4 - ldr r1, =gUnknown_0203AB40 - ldrh r1, [r1, 0x2] - adds r0, r1 - movs r5, 0 - adds r2, r6, 0x1 - str r2, [sp, 0x18] - lsls r7, r6, 1 - lsls r0, 16 - str r0, [sp, 0x14] - asrs r0, 16 - mov r10, r0 - lsls r0, r6, 2 - adds r0, r6 - mov r9, r0 -_080D37F6: - ldr r3, =0x0000ffff - adds r0, r5, r3 - ldr r4, =gUnknown_0203AB40 - ldrh r4, [r4] - adds r0, r4 - lsls r0, 16 - lsrs r1, r0, 16 - mov r8, r1 - asrs r4, r0, 16 - adds r0, r4, 0 - mov r1, r10 - bl MapGridGetZCoordAt - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_0203AB40 - movs r1, 0x4 - ldrsb r1, [r2, r1] - cmp r0, r1 - bne _080D38BC - adds r0, r4, 0 - mov r1, r10 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_8088E64 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080D3846 - adds r0, r4, 0 - bl MetatileBehavior_IsAsh - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080D3856 -_080D3846: - adds r0, r5, 0x6 - add r0, r9 - ldr r3, =gUnknown_03001108 - adds r0, r3 - movs r1, 0x1 - strb r1, [r0] - movs r0, 0x1 - str r0, [sp, 0x10] -_080D3856: - mov r1, r8 - lsls r0, r1, 16 - asrs r0, 16 - ldr r2, [sp, 0x14] - asrs r1, r2, 16 - bl MapGridIsImpassableAt - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080D3890 - adds r0, r7, r6 - adds r0, r5 - mov r3, sp - adds r1, r3, r0 - b _080D38C4 - .pool -_080D3890: - adds r0, r7, r6 - adds r0, r5 - mov r2, sp - adds r1, r2, r0 - movs r0, 0x1 - strb r0, [r1] - adds r0, r4, 0 - bl sub_80899F8 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x1 - bne _080D38C8 - adds r0, r5, 0x6 - add r0, r9 - ldr r3, =gUnknown_03001108 - adds r0, r3 - strb r1, [r0] - b _080D38C8 - .pool -_080D38BC: - adds r0, r7, r6 - adds r0, r5 - mov r4, sp - adds r1, r4, r0 -_080D38C4: - movs r0, 0 - strb r0, [r1] -_080D38C8: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _080D37F6 - ldr r1, [sp, 0x18] - lsls r0, r1, 24 - lsrs r6, r0, 24 - cmp r6, 0x2 - bhi _080D38DE - b _080D37D6 -_080D38DE: - ldr r2, [sp, 0xC] - cmp r2, 0x34 - beq _080D38EE - ldr r3, [sp, 0x10] - cmp r3, 0x1 - beq _080D38EC - b _080D3A2A -_080D38EC: - b _080D3A1E -_080D38EE: - movs r6, 0 - ldr r4, =gUnknown_0203AB40 - mov r9, r4 - ldr r0, =gUnknown_0857C608 - mov r10, r0 -_080D38F8: - lsls r2, r6, 2 - mov r3, r10 - adds r1, r2, r3 - movs r0, 0 - ldrsb r0, [r1, r0] - mov r4, r9 - ldrh r4, [r4] - adds r0, r4 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - movs r0, 0x1 - ldrsb r0, [r1, r0] - mov r1, r9 - ldrh r1, [r1, 0x2] - adds r0, r1 - lsls r0, 16 - lsrs r4, r0, 16 - movs r7, 0x1 - movs r5, 0 - ldr r3, =gUnknown_0857C60A - adds r0, r2, r3 - ldrb r0, [r0] - adds r6, 0x1 - str r6, [sp, 0x18] - adds r6, r2, 0 - cmp r0, 0 - beq _080D395A -_080D3930: - adds r1, r2, 0 - adds r0, r5, r2 - adds r0, r3 - ldrb r0, [r0] - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - add r0, sp - ldrb r0, [r0] - cmp r0, 0 - beq _080D39F4 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bhi _080D395A - adds r0, r5, r1 - adds r0, r3 - ldrb r0, [r0] - cmp r0, 0 - bne _080D3930 -_080D395A: - cmp r7, 0x1 - bne _080D3A0C - mov r1, r8 - lsls r0, r1, 16 - asrs r5, r0, 16 - lsls r0, r4, 16 - asrs r4, r0, 16 - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetZCoordAt - lsls r0, 24 - lsrs r0, 24 - mov r2, r9 - movs r1, 0x4 - ldrsb r1, [r2, r1] - cmp r0, r1 - bne _080D3A0C - mov r3, r10 - adds r2, r6, r3 - movs r1, 0x1 - ldrsb r1, [r2, r1] - lsls r0, r1, 2 - adds r0, r1 - adds r0, 0xC - ldrb r2, [r2] - adds r0, r2 - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_8088E64 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080D39BC - adds r0, r4, 0 - bl MetatileBehavior_IsAsh - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080D39F8 -_080D39BC: - ldr r1, =gUnknown_03005DB0 - ldr r0, =hm_add_c3_launch_phase_2 - str r0, [r1] - ldr r1, =gUnknown_0203CEEC - ldr r0, =hm2_ruin_valley - str r0, [r1] - ldr r0, =gUnknown_03001108 - adds r0, r6, r0 - strb r7, [r0] - movs r4, 0x1 - str r4, [sp, 0x10] - b _080D3A0C - .pool -_080D39F4: - movs r7, 0 - b _080D395A -_080D39F8: - adds r0, r4, 0 - bl sub_80899F8 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x1 - bne _080D3A0C - ldr r0, =gUnknown_03001108 - adds r0, r6, r0 - strb r1, [r0] -_080D3A0C: - ldr r1, [sp, 0x18] - lsls r0, r1, 24 - lsrs r6, r0, 24 - cmp r6, 0xF - bhi _080D3A18 - b _080D38F8 -_080D3A18: - ldr r2, [sp, 0x10] - cmp r2, 0x1 - bne _080D3A2A -_080D3A1E: - ldr r1, =gUnknown_03005DB0 - ldr r0, =hm_add_c3_launch_phase_2 - str r0, [r1] - ldr r1, =gUnknown_0203CEEC - ldr r0, =hm2_ruin_valley - str r0, [r1] -_080D3A2A: - ldr r0, [sp, 0x10] -_080D3A2C: - add sp, 0x1C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80D3718 - - thumb_func_start hm2_ruin_valley -hm2_ruin_valley: @ 80D3A50 - push {lr} - movs r0, 0x1 - bl FieldEffectStart - bl brm_get_pokemon_selection - ldr r1, =gUnknown_02038C08 - lsls r0, 24 - lsrs r0, 24 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end hm2_ruin_valley - - thumb_func_start sub_80D3A6C -sub_80D3A6C: @ 80D3A6C - push {lr} - bl oei_task_add - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r2, =sub_80D3AEC - lsrs r0, r2, 16 - strh r0, [r1, 0x18] - strh r2, [r1, 0x1A] - movs r0, 0x12 - bl IncrementGameStat - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80D3A6C - - thumb_func_start sub_80D3A9C -sub_80D3A9C: @ 80D3A9C - push {lr} - bl brm_get_pokemon_selection - ldr r1, =gUnknown_02038C08 - lsls r0, 24 - lsrs r0, 24 - str r0, [r1] - ldr r0, =gUnknown_08290705 - bl ScriptContext1_SetupScript - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D3A9C - - thumb_func_start sub_80D3ABC -sub_80D3ABC: @ 80D3ABC - push {lr} - bl oei_task_add - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r2, =sub_80D4354 - lsrs r0, r2, 16 - strh r0, [r1, 0x18] - strh r2, [r1, 0x1A] - movs r0, 0x12 - bl IncrementGameStat - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80D3ABC - - thumb_func_start sub_80D3AEC -sub_80D3AEC: @ 80D3AEC - push {lr} - movs r0, 0x1 - bl FieldEffectActiveListRemove - movs r0, 0x3A - bl FieldEffectStart - pop {r0} - bx r0 - thumb_func_end sub_80D3AEC - - thumb_func_start sub_80D3B00 -sub_80D3B00: @ 80D3B00 - push {r4-r7,lr} - movs r6, 0 - movs r0, 0x80 - bl PlaySE - ldr r4, =gUnknown_0203AB40 - adds r1, r4, 0x2 - adds r0, r4, 0 - bl PlayerGetDestCoords - adds r7, r4, 0 -_080D3B16: - ldr r0, =gUnknown_03001108 - adds r0, r6, r0 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080D3B64 - adds r0, r6, 0 - movs r1, 0x5 - bl __umodsi3 - adds r4, r0, 0 - subs r4, 0x2 - lsls r4, 24 - lsrs r4, 24 - adds r0, r6, 0 - movs r1, 0x5 - bl __udivsi3 - adds r5, r0, 0 - subs r5, 0x2 - lsls r4, 24 - asrs r4, 24 - ldrh r0, [r7] - adds r4, r0 - lsls r5, 24 - asrs r5, 24 - ldrh r2, [r7, 0x2] - adds r5, r2 - lsls r4, 16 - asrs r4, 16 - lsls r5, 16 - asrs r5, 16 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80D3C10 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_808E75C -_080D3B64: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x18 - bls _080D3B16 - ldr r2, =gUnknown_0203AB40 - ldr r0, =gUnknown_03001101 - ldrb r1, [r0] - ldrh r0, [r2] - subs r0, r1 - lsls r0, 16 - asrs r0, 16 - ldr r1, =gUnknown_03001102 - ldrb r1, [r1] - mvns r1, r1 - ldrh r2, [r2, 0x2] - adds r1, r2 - lsls r1, 16 - asrs r1, 16 - bl sub_80D3D5C - bl DrawWholeMapView - ldr r4, =gUnknown_02039DD0 - movs r0, 0x8 - bl AllocZeroed - str r0, [r4] - movs r6, 0 - ldr r5, =gSprites -_080D3BA0: - ldr r0, =gUnknown_02037590 - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrh r1, [r0, 0x2] - lsls r1, 23 - lsrs r1, 7 - movs r2, 0x80 - lsls r2, 12 - adds r1, r2 - asrs r1, 16 - ldrb r2, [r0] - adds r2, 0x14 - ldr r0, =gUnknown_0857C66C - movs r3, 0 - bl CreateSprite - ldr r1, [r4] - adds r1, r6 - strb r0, [r1] - ldr r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - lsls r1, r6, 5 - strh r1, [r0, 0x32] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x7 - bls _080D3BA0 - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80D3B00 - - thumb_func_start sub_80D3C10 -sub_80D3C10: @ 80D3C10 - push {r4-r7,lr} - lsls r0, 16 - lsls r1, 16 - lsrs r6, r0, 16 - asrs r4, r0, 16 - lsrs r7, r1, 16 - asrs r5, r1, 16 - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridGetMetatileIdAt - adds r1, r0, 0 - ldr r0, =0x00000207 - cmp r1, r0 - bgt _080D3C5C - subs r0, 0x1 - cmp r1, r0 - bge _080D3CD4 - cmp r1, 0x25 - beq _080D3CF6 - cmp r1, 0x25 - bgt _080D3C4C - cmp r1, 0xD - beq _080D3C9C - cmp r1, 0x15 - beq _080D3C9C - b _080D3D00 - .pool -_080D3C4C: - movs r0, 0xE3 - lsls r0, 1 - cmp r1, r0 - beq _080D3CAC - adds r0, 0x1 - cmp r1, r0 - beq _080D3CB2 - b _080D3D00 -_080D3C5C: - ldr r0, =0x00000212 - cmp r1, r0 - beq _080D3CE4 - cmp r1, r0 - bgt _080D3C78 - subs r0, 0xA - cmp r1, r0 - beq _080D3C9C - adds r0, 0x2 - cmp r1, r0 - beq _080D3CE4 - b _080D3D00 - .pool -_080D3C78: - ldr r0, =0x00000282 - cmp r1, r0 - beq _080D3CC4 - cmp r1, r0 - bgt _080D3C90 - subs r0, 0x1 - cmp r1, r0 - beq _080D3CBC - b _080D3D00 - .pool -_080D3C90: - ldr r0, =0x00000283 - cmp r1, r0 - beq _080D3CCC - b _080D3D00 - .pool -_080D3C9C: - lsls r0, r6, 16 - asrs r0, 16 - lsls r1, r7, 16 - asrs r1, 16 - movs r2, 0x1 - bl MapGridSetMetatileIdAt - b _080D3D00 -_080D3CAC: - movs r2, 0xE7 - lsls r2, 1 - b _080D3CD6 -_080D3CB2: - ldr r2, =0x000001cf - b _080D3CD6 - .pool -_080D3CBC: - ldr r2, =0x00000279 - b _080D3CD6 - .pool -_080D3CC4: - ldr r2, =0x0000027a - b _080D3CD6 - .pool -_080D3CCC: - ldr r2, =0x0000027b - b _080D3CD6 - .pool -_080D3CD4: - ldr r2, =0x00000271 -_080D3CD6: - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridSetMetatileIdAt - b _080D3D00 - .pool -_080D3CE4: - lsls r0, r6, 16 - asrs r0, 16 - lsls r1, r7, 16 - asrs r1, 16 - movs r2, 0x86 - lsls r2, 2 - bl MapGridSetMetatileIdAt - b _080D3D00 -_080D3CF6: - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0xE - bl MapGridSetMetatileIdAt -_080D3D00: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80D3C10 - - thumb_func_start sub_80D3D08 -sub_80D3D08: @ 80D3D08 - push {lr} - lsls r0, 16 - asrs r0, 16 - lsls r1, 16 - asrs r1, 16 - bl MapGridGetMetatileIdAt - lsls r0, 16 - lsrs r1, r0, 16 - adds r2, r1, 0 - cmp r1, 0x1 - bne _080D3D24 - movs r0, 0x1 - b _080D3D56 -_080D3D24: - ldr r0, =0x00000279 - cmp r1, r0 - bne _080D3D34 - movs r0, 0x2 - b _080D3D56 - .pool -_080D3D34: - ldr r0, =0x0000027a - cmp r1, r0 - bne _080D3D44 - movs r0, 0x3 - b _080D3D56 - .pool -_080D3D44: - ldr r0, =0x0000027b - cmp r2, r0 - beq _080D3D54 - movs r0, 0 - b _080D3D56 - .pool -_080D3D54: - movs r0, 0x4 -_080D3D56: - pop {r1} - bx r1 - thumb_func_end sub_80D3D08 - - thumb_func_start sub_80D3D5C -sub_80D3D5C: @ 80D3D5C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - lsls r1, 16 - lsrs r1, 16 - mov r10, r1 - ldr r1, =gUnknown_03001100 - ldrb r2, [r1] - mov r3, r10 - adds r0, r2, r3 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp] - movs r4, 0 - cmp r4, r2 - blt _080D3D8A - b _080D3EA0 -_080D3D8A: - lsls r0, r3, 16 - asrs r7, r0, 16 -_080D3D8E: - mov r1, r9 - lsls r0, r1, 16 - asrs r0, 16 - lsls r4, 16 - asrs r1, r4, 16 - adds r0, r1 - lsls r0, 16 - lsrs r6, r0, 16 - asrs r5, r0, 16 - adds r0, r5, 0 - adds r1, r7, 0 - bl MapGridGetMetatileIdAt - mov r8, r4 - cmp r0, 0x15 - bne _080D3E12 - adds r4, r7, 0x1 - lsls r1, r4, 16 - asrs r1, 16 - adds r0, r5, 0 - bl sub_80D3D08 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - beq _080D3DE8 - cmp r0, 0x2 - bgt _080D3DD0 - cmp r0, 0x1 - beq _080D3DDA - b _080D3E12 - .pool -_080D3DD0: - cmp r0, 0x3 - beq _080D3DF8 - cmp r0, 0x4 - beq _080D3E08 - b _080D3E12 -_080D3DDA: - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x82 - lsls r2, 2 - bl MapGridSetMetatileIdAt - b _080D3E12 -_080D3DE8: - adds r0, r5, 0 - adds r1, r4, 0 - ldr r2, =0x00000281 - bl MapGridSetMetatileIdAt - b _080D3E12 - .pool -_080D3DF8: - adds r0, r5, 0 - adds r1, r4, 0 - ldr r2, =0x00000282 - bl MapGridSetMetatileIdAt - b _080D3E12 - .pool -_080D3E08: - adds r0, r5, 0 - adds r1, r4, 0 - ldr r2, =0x00000283 - bl MapGridSetMetatileIdAt -_080D3E12: - lsls r0, r6, 16 - asrs r5, r0, 16 - ldr r3, [sp] - lsls r0, r3, 16 - asrs r4, r0, 16 - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetMetatileIdAt - cmp r0, 0x1 - bne _080D3E8C - adds r4, 0x1 - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetMetatileIdAt - movs r1, 0x82 - lsls r1, 2 - cmp r0, r1 - bne _080D3E44 - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x1 - bl MapGridSetMetatileIdAt -_080D3E44: - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetMetatileIdAt - ldr r1, =0x00000281 - cmp r0, r1 - bne _080D3E5C - adds r0, r5, 0 - adds r1, r4, 0 - ldr r2, =0x00000279 - bl MapGridSetMetatileIdAt -_080D3E5C: - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetMetatileIdAt - ldr r1, =0x00000282 - cmp r0, r1 - bne _080D3E74 - adds r0, r5, 0 - adds r1, r4, 0 - ldr r2, =0x0000027a - bl MapGridSetMetatileIdAt -_080D3E74: - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetMetatileIdAt - ldr r1, =0x00000283 - cmp r0, r1 - bne _080D3E8C - adds r0, r5, 0 - adds r1, r4, 0 - ldr r2, =0x0000027b - bl MapGridSetMetatileIdAt -_080D3E8C: - movs r1, 0x80 - lsls r1, 9 - add r1, r8 - lsrs r4, r1, 16 - asrs r1, 16 - ldr r0, =gUnknown_03001100 - ldrb r0, [r0] - cmp r1, r0 - bge _080D3EA0 - b _080D3D8E -_080D3EA0: - ldr r1, =gUnknown_03001100 - ldrb r0, [r1] - cmp r0, 0x5 - bne _080D3EC8 - mov r3, r9 - lsls r5, r3, 16 - asrs r5, 16 - mov r0, r10 - lsls r4, r0, 16 - asrs r4, 16 - movs r0, 0 - adds r1, r5, 0 - adds r2, r4, 0 - bl sub_80D3EF4 - movs r0, 0x1 - adds r1, r5, 0 - adds r2, r4, 0 - bl sub_80D3EF4 -_080D3EC8: - 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_80D3D5C - - thumb_func_start sub_80D3EF4 -sub_80D3EF4: @ 80D3EF4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r5, r1, 16 - adds r3, r5, 0 - lsls r2, 16 - lsrs r2, 16 - mov r10, r2 - cmp r0, 0 - bne _080D3F2C - mov r2, sp - ldr r1, =gUnknown_03001108 - ldrb r0, [r1, 0x5] - strb r0, [r2] - ldrb r0, [r1, 0xA] - strb r0, [r2, 0x1] - ldrb r0, [r1, 0xF] - strb r0, [r2, 0x2] - mov r8, r5 - b _080D3F4E - .pool -_080D3F2C: - cmp r0, 0x1 - beq _080D3F32 - b _080D414A -_080D3F32: - mov r2, sp - ldr r1, =gUnknown_03001108 - ldrb r0, [r1, 0x9] - strb r0, [r2] - ldrb r0, [r1, 0xE] - strb r0, [r2, 0x1] - ldrb r0, [r1, 0x13] - strb r0, [r2, 0x2] - lsls r0, r3, 16 - movs r1, 0x80 - lsls r1, 11 - adds r0, r1 - lsrs r0, 16 - mov r8, r0 -_080D3F4E: - mov r0, sp - ldrb r0, [r0] - cmp r0, 0x1 - bne _080D3FC6 - mov r1, r8 - lsls r0, r1, 16 - asrs r5, r0, 16 - mov r1, r10 - lsls r0, r1, 16 - asrs r0, 16 - adds r4, r0, 0x3 - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetMetatileIdAt - movs r1, 0x82 - lsls r1, 2 - cmp r0, r1 - bne _080D3F7E - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x1 - bl MapGridSetMetatileIdAt -_080D3F7E: - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetMetatileIdAt - ldr r1, =0x00000281 - cmp r0, r1 - bne _080D3F96 - ldr r2, =0x00000279 - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridSetMetatileIdAt -_080D3F96: - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetMetatileIdAt - ldr r1, =0x00000282 - cmp r0, r1 - bne _080D3FAE - ldr r2, =0x0000027a - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridSetMetatileIdAt -_080D3FAE: - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetMetatileIdAt - ldr r1, =0x00000283 - cmp r0, r1 - bne _080D3FC6 - ldr r2, =0x0000027b - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridSetMetatileIdAt -_080D3FC6: - mov r0, sp - ldrb r0, [r0, 0x1] - cmp r0, 0x1 - bne _080D40C0 - mov r0, r8 - lsls r5, r0, 16 - asrs r6, r5, 16 - mov r1, r10 - lsls r4, r1, 16 - asrs r7, r4, 16 - adds r1, r7, 0x2 - adds r0, r6, 0 - bl MapGridGetMetatileIdAt - mov r9, r4 - cmp r0, 0x15 - bne _080D4056 - adds r4, r7, 0x3 - lsls r1, r4, 16 - asrs r1, 16 - adds r0, r6, 0 - bl sub_80D3D08 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - beq _080D4034 - cmp r0, 0x2 - bgt _080D4024 - cmp r0, 0x1 - beq _080D402E - b _080D4056 - .pool -_080D4024: - cmp r0, 0x3 - beq _080D403C - cmp r0, 0x4 - beq _080D404C - b _080D4056 -_080D402E: - movs r2, 0x82 - lsls r2, 2 - b _080D403E -_080D4034: - ldr r2, =0x00000281 - b _080D403E - .pool -_080D403C: - ldr r2, =0x00000282 -_080D403E: - adds r0, r6, 0 - adds r1, r4, 0 - bl MapGridSetMetatileIdAt - b _080D4056 - .pool -_080D404C: - ldr r2, =0x00000283 - adds r0, r6, 0 - adds r1, r4, 0 - bl MapGridSetMetatileIdAt -_080D4056: - asrs r5, 16 - mov r1, r9 - asrs r0, r1, 16 - adds r4, r0, 0x4 - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetMetatileIdAt - movs r1, 0x82 - lsls r1, 2 - cmp r0, r1 - bne _080D4078 - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x1 - bl MapGridSetMetatileIdAt -_080D4078: - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetMetatileIdAt - ldr r1, =0x00000281 - cmp r0, r1 - bne _080D4090 - ldr r2, =0x00000279 - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridSetMetatileIdAt -_080D4090: - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetMetatileIdAt - ldr r1, =0x00000282 - cmp r0, r1 - bne _080D40A8 - ldr r2, =0x0000027a - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridSetMetatileIdAt -_080D40A8: - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetMetatileIdAt - ldr r1, =0x00000283 - cmp r0, r1 - bne _080D40C0 - ldr r2, =0x0000027b - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridSetMetatileIdAt -_080D40C0: - mov r0, sp - ldrb r0, [r0, 0x2] - cmp r0, 0x1 - bne _080D414A - mov r1, r8 - lsls r0, r1, 16 - asrs r5, r0, 16 - mov r1, r10 - lsls r0, r1, 16 - asrs r4, r0, 16 - adds r1, r4, 0x3 - adds r0, r5, 0 - bl MapGridGetMetatileIdAt - cmp r0, 0x15 - bne _080D414A - adds r4, 0x4 - lsls r1, r4, 16 - asrs r1, 16 - adds r0, r5, 0 - bl sub_80D3D08 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - beq _080D4128 - cmp r0, 0x2 - bgt _080D4118 - cmp r0, 0x1 - beq _080D4122 - b _080D414A - .pool -_080D4118: - cmp r0, 0x3 - beq _080D4130 - cmp r0, 0x4 - beq _080D4140 - b _080D414A -_080D4122: - movs r2, 0x82 - lsls r2, 2 - b _080D4132 -_080D4128: - ldr r2, =0x00000281 - b _080D4132 - .pool -_080D4130: - ldr r2, =0x00000282 -_080D4132: - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridSetMetatileIdAt - b _080D414A - .pool -_080D4140: - ldr r2, =0x00000283 - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridSetMetatileIdAt -_080D414A: - 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_80D3EF4 - - thumb_func_start objc_8097BA8 -objc_8097BA8: @ 80D4160 - movs r2, 0 - movs r1, 0x8 - strh r1, [r0, 0x2E] - strh r2, [r0, 0x30] - strh r2, [r0, 0x34] - ldr r1, =objc_8097BBC - str r1, [r0, 0x1C] - bx lr - .pool - thumb_func_end objc_8097BA8 - - thumb_func_start objc_8097BBC -objc_8097BBC: @ 80D4174 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - movs r2, 0x2E - ldrsh r1, [r4, r2] - bl Sin - strh r0, [r4, 0x24] - movs r1, 0x32 - ldrsh r0, [r4, r1] - movs r2, 0x2E - ldrsh r1, [r4, r2] - bl Cos - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x32] - adds r0, 0x8 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x32] - ldrh r1, [r4, 0x2E] - adds r1, 0x1 - ldrh r2, [r4, 0x34] - lsls r0, r2, 16 - asrs r0, 18 - adds r1, r0 - strh r1, [r4, 0x2E] - adds r2, 0x1 - strh r2, [r4, 0x34] - ldrh r1, [r4, 0x30] - movs r2, 0x30 - ldrsh r0, [r4, r2] - cmp r0, 0x1C - beq _080D41C0 - adds r0, r1, 0x1 - strh r0, [r4, 0x30] - b _080D41C4 -_080D41C0: - ldr r0, =sub_80D41D0 - str r0, [r4, 0x1C] -_080D41C4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end objc_8097BBC - - thumb_func_start sub_80D41D0 -sub_80D41D0: @ 80D41D0 - push {r4-r6,lr} - movs r4, 0x1 -_080D41D4: - ldr r6, =gUnknown_02039DD0 - ldr r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r5, =gSprites - adds r0, r5 - bl DestroySprite - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _080D41D4 - ldr r0, [r6] - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x3A - bl FieldEffectStop - ldr r0, [r6] - bl Free - movs r0, 0 - str r0, [r6] - bl sub_80984F4 - bl ScriptContext2_Disable - bl unown_chamber_related - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080D422A - ldr r0, =gUnknown_08267EDB - bl ScriptContext1_SetupScript -_080D422A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D41D0 - - thumb_func_start sub_80D423C -sub_80D423C: @ 80D423C - push {r4,r5,lr} - lsls r0, 16 - asrs r5, r0, 16 - lsls r1, 16 - asrs r4, r1, 16 - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl MetatileBehavior_IsLongGrass2 - lsls r0, 24 - cmp r0, 0 - beq _080D42AE - adds r4, 0x1 - lsls r1, r4, 16 - asrs r1, 16 - adds r0, r5, 0 - bl sub_80D3D08 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - beq _080D428A - cmp r0, 0x2 - bgt _080D427A - cmp r0, 0x1 - beq _080D4284 - b _080D42AE -_080D427A: - cmp r0, 0x3 - beq _080D4294 - cmp r0, 0x4 - beq _080D42A4 - b _080D42AE -_080D4284: - movs r2, 0x82 - lsls r2, 2 - b _080D4296 -_080D428A: - ldr r2, =0x00000281 - b _080D4296 - .pool -_080D4294: - ldr r2, =0x00000282 -_080D4296: - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridSetMetatileIdAt - b _080D42AE - .pool -_080D42A4: - ldr r2, =0x00000283 - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridSetMetatileIdAt -_080D42AE: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D423C - - thumb_func_start sub_80D42B8 -sub_80D42B8: @ 80D42B8 - push {r4,r5,lr} - lsls r0, 16 - asrs r4, r0, 16 - lsls r1, 16 - asrs r5, r1, 16 - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridGetMetatileIdAt - cmp r0, 0x1 - bne _080D434A - adds r5, 0x1 - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl MetatileBehavior_IsLongGrassSouthEdge - lsls r0, 24 - cmp r0, 0 - beq _080D434A - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridGetMetatileIdAt - adds r1, r0, 0 - ldr r0, =0x00000281 - cmp r1, r0 - beq _080D4328 - cmp r1, r0 - bgt _080D4308 - subs r0, 0x79 - cmp r1, r0 - beq _080D431C - b _080D434A - .pool -_080D4308: - ldr r0, =0x00000282 - cmp r1, r0 - beq _080D4330 - adds r0, 0x1 - cmp r1, r0 - beq _080D4340 - b _080D434A - .pool -_080D431C: - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x1 - bl MapGridSetMetatileIdAt - b _080D434A -_080D4328: - ldr r2, =0x00000279 - b _080D4332 - .pool -_080D4330: - ldr r2, =0x0000027a -_080D4332: - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridSetMetatileIdAt - b _080D434A - .pool -_080D4340: - ldr r2, =0x0000027b - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridSetMetatileIdAt -_080D434A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D42B8 - - thumb_func_start sub_80D4354 -sub_80D4354: @ 80D4354 - push {lr} - movs r0, 0x80 - bl PlaySE - movs r0, 0x2 - bl FieldEffectActiveListRemove - bl EnableBothScriptContexts - pop {r0} - bx r0 - thumb_func_end sub_80D4354 - - 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 - - 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 - - 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 - - thumb_func_start sub_80D51AC -sub_80D51AC: @ 80D51AC - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =gBattleAnimArgs - ldrb r0, [r4] - bl GetAnimBankSpriteId - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - bne _080D51D0 - adds r0, r5, 0 - bl move_anim_task_del - b _080D520C - .pool -_080D51D0: - ldr r1, =gSprites - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrh r1, [r4, 0x2] - strh r1, [r0, 0x24] - ldrh r1, [r4, 0x4] - strh r1, [r0, 0x26] - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - strh r2, [r0, 0x8] - ldrh r1, [r4, 0x6] - strh r1, [r0, 0xA] - ldrh r1, [r4, 0x8] - strh r1, [r0, 0xC] - ldrh r1, [r4, 0x8] - strh r1, [r0, 0xE] - ldrh r1, [r4, 0x2] - strh r1, [r0, 0x10] - ldrh r1, [r4, 0x4] - strh r1, [r0, 0x12] - ldr r1, =sub_80D5220 - str r1, [r0] - adds r0, r5, 0 - bl _call_via_r1 -_080D520C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D51AC - - thumb_func_start sub_80D5220 -sub_80D5220: @ 80D5220 - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r3, r0, r1 - ldrh r0, [r3, 0xE] - movs r2, 0xE - ldrsh r5, [r3, r2] - adds r7, r1, 0 - cmp r5, 0 - bne _080D52C6 - ldr r2, =gSprites - movs r6, 0x8 - ldrsh r1, [r3, r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r2 - movs r6, 0x24 - ldrsh r0, [r1, r6] - adds r6, r2, 0 - cmp r0, 0 - bne _080D5264 - ldrh r0, [r3, 0x10] - strh r0, [r1, 0x24] - b _080D5266 - .pool -_080D5264: - strh r5, [r1, 0x24] -_080D5266: - lsls r2, r4, 2 - adds r0, r2, r4 - lsls r0, 3 - adds r3, r0, r7 - movs r0, 0x8 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r6 - movs r5, 0x26 - ldrsh r0, [r1, r5] - cmp r0, 0 - bne _080D5286 - ldrh r0, [r3, 0x12] - b _080D5288 -_080D5286: - movs r0, 0 -_080D5288: - strh r0, [r1, 0x26] - adds r0, r2, r4 - lsls r0, 3 - adds r2, r0, r7 - ldrh r0, [r2, 0xC] - strh r0, [r2, 0xE] - ldrh r0, [r2, 0xA] - subs r0, 0x1 - strh r0, [r2, 0xA] - lsls r0, 16 - asrs r3, r0, 16 - cmp r3, 0 - bne _080D52CA - movs r0, 0x8 - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r3, [r0, 0x24] - movs r5, 0x8 - ldrsh r1, [r2, r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r3, [r0, 0x26] - adds r0, r4, 0 - bl move_anim_task_del - b _080D52CA -_080D52C6: - subs r0, 0x1 - strh r0, [r3, 0xE] -_080D52CA: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80D5220 - - thumb_func_start sub_80D52D0 -sub_80D52D0: @ 80D52D0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r6, 0 - ldr r2, =gBattleAnimArgs - ldrh r0, [r2] - movs r3, 0 - ldrsh r1, [r2, r3] - cmp r1, 0x3 - bgt _080D52FC - lsls r0, 24 - lsrs r0, 24 - bl GetAnimBankSpriteId - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0xFF - bne _080D5352 - b _080D5356 - .pool -_080D52FC: - cmp r1, 0x8 - beq _080D5348 - movs r1, 0 - ldrsh r0, [r2, r1] - cmp r0, 0x5 - beq _080D531C - cmp r0, 0x5 - bgt _080D5312 - cmp r0, 0x4 - beq _080D5318 - b _080D5324 -_080D5312: - cmp r0, 0x6 - beq _080D5320 - b _080D5324 -_080D5318: - movs r0, 0 - b _080D5326 -_080D531C: - movs r0, 0x2 - b _080D5326 -_080D5320: - movs r0, 0x1 - b _080D5326 -_080D5324: - movs r0, 0x3 -_080D5326: - bl GetBankByPlayerAI - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - bne _080D533C - movs r6, 0x1 -_080D533C: - ldr r0, =gBankSpriteIds - adds r0, r4, r0 - b _080D5350 - .pool -_080D5348: - ldr r1, =gBankSpriteIds - ldr r0, =gAnimationBankAttacker - ldrb r0, [r0] - adds r0, r1 -_080D5350: - ldrb r3, [r0] -_080D5352: - cmp r6, 0 - beq _080D5368 -_080D5356: - adds r0, r5, 0 - bl move_anim_task_del - b _080D53A6 - .pool -_080D5368: - ldr r1, =gSprites - lsls r0, r3, 4 - adds r0, r3 - lsls r0, 2 - adds r0, r1 - ldr r2, =gBattleAnimArgs - ldrh r1, [r2, 0x2] - strh r1, [r0, 0x24] - ldrh r1, [r2, 0x4] - strh r1, [r0, 0x26] - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - strh r3, [r0, 0x8] - ldrh r1, [r2, 0x6] - strh r1, [r0, 0xA] - ldrh r1, [r2, 0x8] - strh r1, [r0, 0xC] - ldrh r1, [r2, 0x8] - strh r1, [r0, 0xE] - ldrh r1, [r2, 0x2] - strh r1, [r0, 0x10] - ldrh r1, [r2, 0x4] - strh r1, [r0, 0x12] - ldr r1, =sub_80D53BC - str r1, [r0] - adds r0, r5, 0 - bl _call_via_r1 -_080D53A6: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D52D0 - - thumb_func_start sub_80D53BC -sub_80D53BC: @ 80D53BC - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r3, r0, r1 - ldrh r2, [r3, 0xE] - movs r4, 0xE - ldrsh r0, [r3, r4] - mov r12, r1 - cmp r0, 0 - bne _080D5474 - ldr r2, =gSprites - movs r7, 0x8 - ldrsh r1, [r3, r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, r0, r2 - movs r0, 0x24 - ldrsh r1, [r4, r0] - ldrh r5, [r3, 0x10] - movs r7, 0x10 - ldrsh r0, [r3, r7] - adds r7, r2, 0 - cmp r1, r0 - bne _080D5408 - negs r0, r5 - strh r0, [r4, 0x24] - b _080D540A - .pool -_080D5408: - strh r5, [r4, 0x24] -_080D540A: - lsls r3, r6, 2 - adds r1, r3, r6 - lsls r1, 3 - add r1, r12 - movs r0, 0x8 - ldrsh r2, [r1, r0] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r4, r0, r7 - movs r0, 0x26 - ldrsh r2, [r4, r0] - mov r8, r2 - ldrh r5, [r1, 0x12] - movs r2, 0x12 - ldrsh r0, [r1, r2] - cmp r8, r0 - bne _080D5434 - negs r0, r5 - strh r0, [r4, 0x26] - b _080D5436 -_080D5434: - strh r5, [r4, 0x26] -_080D5436: - adds r0, r3, r6 - lsls r0, 3 - mov r4, r12 - adds r3, r0, r4 - ldrh r0, [r3, 0xC] - strh r0, [r3, 0xE] - ldrh r0, [r3, 0xA] - subs r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r2, r0, 16 - cmp r2, 0 - bne _080D5478 - movs r0, 0x8 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x24] - movs r4, 0x8 - ldrsh r1, [r3, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - adds r0, r6, 0 - bl move_anim_task_del - b _080D5478 -_080D5474: - subs r0, r2, 0x1 - strh r0, [r3, 0xE] -_080D5478: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80D53BC - - thumb_func_start sub_80D5484 -sub_80D5484: @ 80D5484 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =gBattleAnimArgs - ldrb r0, [r4] - bl GetAnimBankSpriteId - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0xFF - bne _080D54A8 - adds r0, r5, 0 - bl move_anim_task_del - b _080D54F6 - .pool -_080D54A8: - ldr r0, =gSprites - lsls r1, r3, 4 - adds r1, r3 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r4, 0x2] - ldrh r2, [r1, 0x24] - adds r0, r2 - movs r2, 0 - strh r0, [r1, 0x24] - ldrh r0, [r4, 0x4] - ldrh r6, [r1, 0x26] - adds r0, r6 - strh r0, [r1, 0x26] - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - strh r3, [r1, 0x8] - strh r2, [r1, 0xA] - ldrh r0, [r4, 0x6] - strh r0, [r1, 0xC] - strh r2, [r1, 0xE] - ldrh r0, [r4, 0x8] - strh r0, [r1, 0x10] - movs r2, 0x2 - ldrsh r0, [r4, r2] - lsls r0, 1 - strh r0, [r1, 0x12] - movs r6, 0x4 - ldrsh r0, [r4, r6] - lsls r0, 1 - strh r0, [r1, 0x14] - ldr r2, =sub_80D5508 - str r2, [r1] - adds r0, r5, 0 - bl _call_via_r2 -_080D54F6: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D5484 - - thumb_func_start sub_80D5508 -sub_80D5508: @ 80D5508 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - ldrh r2, [r4, 0xE] - movs r3, 0xE - ldrsh r0, [r4, r3] - adds r6, r1, 0 - cmp r0, 0 - beq _080D5526 - b _080D5638 -_080D5526: - ldrh r1, [r4, 0xA] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080D5568 - ldr r2, =gSprites - movs r0, 0x8 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r4, 0x12] - ldrh r3, [r0, 0x24] - adds r1, r3 - strh r1, [r0, 0x24] - movs r0, 0x8 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r4, 0x14] - ldrh r3, [r0, 0x26] - adds r1, r3 - strh r1, [r0, 0x26] - adds r3, r2, 0 - b _080D5592 - .pool -_080D5568: - ldr r3, =gSprites - movs r0, 0x8 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x24] - ldrh r2, [r4, 0x12] - subs r1, r2 - strh r1, [r0, 0x24] - movs r2, 0x8 - ldrsh r1, [r4, r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x26] - ldrh r2, [r4, 0x14] - subs r1, r2 - strh r1, [r0, 0x26] -_080D5592: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r6 - ldrh r0, [r4, 0x10] - strh r0, [r4, 0xE] - ldrh r0, [r4, 0xA] - adds r2, r0, 0x1 - strh r2, [r4, 0xA] - lsls r0, r2, 16 - asrs r0, 16 - movs r6, 0xC - ldrsh r1, [r4, r6] - cmp r0, r1 - blt _080D563C - movs r0, 0x1 - ands r2, r0 - cmp r2, 0 - beq _080D55F8 - movs r1, 0x8 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - movs r2, 0x12 - ldrsh r0, [r4, r2] - lsrs r2, r0, 31 - adds r0, r2 - asrs r0, 1 - ldrh r6, [r1, 0x24] - adds r0, r6 - strh r0, [r1, 0x24] - movs r1, 0x8 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - movs r2, 0x14 - ldrsh r0, [r4, r2] - lsrs r2, r0, 31 - adds r0, r2 - asrs r0, 1 - ldrh r3, [r1, 0x26] - adds r0, r3 - strh r0, [r1, 0x26] - b _080D5630 - .pool -_080D55F8: - movs r6, 0x8 - ldrsh r0, [r4, r6] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r3 - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsrs r0, r1, 31 - adds r1, r0 - asrs r1, 1 - ldrh r0, [r2, 0x24] - subs r0, r1 - strh r0, [r2, 0x24] - movs r1, 0x8 - ldrsh r0, [r4, r1] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r3 - movs r3, 0x14 - ldrsh r1, [r4, r3] - lsrs r0, r1, 31 - adds r1, r0 - asrs r1, 1 - ldrh r0, [r2, 0x26] - subs r0, r1 - strh r0, [r2, 0x26] -_080D5630: - adds r0, r5, 0 - bl move_anim_task_del - b _080D563C -_080D5638: - subs r0, r2, 0x1 - strh r0, [r4, 0xE] -_080D563C: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80D5508 - - thumb_func_start sub_80D5644 -sub_80D5644: @ 80D5644 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =gBattleAnimArgs - ldrb r0, [r5] - bl GetAnimBankSpriteId - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gSprites - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrh r2, [r5, 0x2] - strh r2, [r1, 0x24] - ldr r2, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r2 - strh r0, [r1, 0x8] - ldrh r0, [r5, 0x2] - strh r0, [r1, 0xA] - ldrh r0, [r5, 0x4] - strh r0, [r1, 0xC] - ldrh r0, [r5, 0x6] - strh r0, [r1, 0xE] - ldrh r0, [r5, 0x8] - strh r0, [r1, 0x10] - ldr r2, =sub_80D56A4 - str r2, [r1] - adds r0, r4, 0 - bl _call_via_r2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D5644 - - thumb_func_start sub_80D56A4 -sub_80D56A4: @ 80D56A4 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r2, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r3, r0, r2 - ldrb r5, [r3, 0x8] - ldrh r4, [r3, 0xA] - ldrh r1, [r3, 0x18] - adds r0, r1, 0x1 - strh r0, [r3, 0x18] - movs r7, 0xC - ldrsh r0, [r3, r7] - lsls r1, 16 - asrs r1, 16 - mov r12, r2 - ldr r7, =gSprites - cmp r0, r1 - bne _080D56F6 - movs r0, 0 - strh r0, [r3, 0x18] - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - adds r1, r0, r7 - ldrh r3, [r1, 0x24] - movs r0, 0x24 - ldrsh r2, [r1, r0] - lsls r0, r4, 16 - asrs r0, 16 - cmp r2, r0 - bne _080D56EE - negs r0, r2 - lsls r0, 16 - lsrs r4, r0, 16 -_080D56EE: - lsls r0, r4, 16 - asrs r0, 16 - adds r0, r3 - strh r0, [r1, 0x24] -_080D56F6: - lsls r2, r6, 2 - adds r2, r6 - lsls r2, 3 - add r2, r12 - strh r4, [r2, 0xA] - ldrh r1, [r2, 0xE] - ldrh r0, [r2, 0x1A] - adds r1, r0 - strh r1, [r2, 0x1A] - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - adds r0, r7 - lsls r1, 16 - asrs r1, 24 - strh r1, [r0, 0x26] - ldrh r0, [r2, 0x10] - subs r0, 0x1 - strh r0, [r2, 0x10] - lsls r0, 16 - cmp r0, 0 - bne _080D5728 - adds r0, r6, 0 - bl move_anim_task_del -_080D5728: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D56A4 - - thumb_func_start sub_80D5738 -sub_80D5738: @ 80D5738 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r5, r0, 24 - movs r6, 0x1 - ldr r4, =gBattleAnimArgs - ldrb r0, [r4] - bl GetAnimBankSpriteId - lsls r0, 24 - lsrs r7, r0, 24 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x5 - ble _080D575C - movs r0, 0x5 - strh r0, [r4, 0x8] -_080D575C: - movs r1, 0 - movs r2, 0x8 - ldrsh r0, [r4, r2] - adds r3, r4, 0 - ldr r2, =gTasks - mov r12, r2 - lsls r4, r5, 2 - ldr r2, =sub_80D57B8 - mov r8, r2 - cmp r1, r0 - bge _080D5782 - adds r2, r0, 0 -_080D5774: - lsls r0, r6, 25 - lsrs r6, r0, 24 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, r2 - blt _080D5774 -_080D5782: - adds r0, r4, r5 - lsls r0, 3 - add r0, r12 - strh r7, [r0, 0x8] - ldrh r1, [r3, 0x2] - strh r1, [r0, 0xA] - ldrh r1, [r3, 0x4] - strh r1, [r0, 0xC] - ldrh r1, [r3, 0x6] - strh r1, [r0, 0xE] - strh r6, [r0, 0x10] - mov r1, r8 - str r1, [r0] - adds r0, r5, 0 - bl _call_via_r8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D5738 - - thumb_func_start sub_80D57B8 -sub_80D57B8: @ 80D57B8 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r5, r0, r1 - ldrb r4, [r5, 0x8] - movs r1, 0x12 - ldrsh r0, [r5, r1] - movs r2, 0xA - ldrsh r1, [r5, r2] - bl Sin - ldr r2, =gSprites - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - adds r4, r1, r2 - strh r0, [r4, 0x24] - movs r1, 0x12 - ldrsh r0, [r5, r1] - movs r2, 0xC - ldrsh r1, [r5, r2] - bl Cos - negs r0, r0 - strh r0, [r4, 0x26] - ldrh r1, [r5, 0xC] - adds r0, r1 - strh r0, [r4, 0x26] - ldrh r0, [r5, 0x10] - ldrh r1, [r5, 0x12] - adds r0, r1 - movs r1, 0xFF - ands r0, r1 - strh r0, [r5, 0x12] - cmp r0, 0 - bne _080D5810 - ldrh r0, [r5, 0xE] - subs r0, 0x1 - strh r0, [r5, 0xE] -_080D5810: - movs r2, 0xE - ldrsh r0, [r5, r2] - cmp r0, 0 - bne _080D5822 - strh r0, [r4, 0x24] - strh r0, [r4, 0x26] - adds r0, r6, 0 - bl move_anim_task_del -_080D5822: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D57B8 - - thumb_func_start sub_80D5830 -sub_80D5830: @ 80D5830 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gAnimationBankAttacker - ldrb r0, [r0] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - beq _080D584C - ldr r1, =gBattleAnimArgs - ldrh r0, [r1, 0x2] - negs r0, r0 - strh r0, [r1, 0x2] -_080D584C: - adds r0, r4, 0 - bl sub_80D5738 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D5830 - - thumb_func_start sub_80D5860 -sub_80D5860: @ 80D5860 - push {r4,lr} - adds r4, r0, 0 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =gAnimationBankAttacker - ldrb r0, [r0] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - beq _080D5890 - ldr r1, =gBattleAnimArgs - ldrh r0, [r1, 0x2] - negs r0, r0 - b _080D5894 - .pool -_080D5890: - ldr r1, =gBattleAnimArgs - ldrh r0, [r1, 0x2] -_080D5894: - strh r0, [r4, 0x30] - ldrh r2, [r1] - movs r0, 0 - strh r2, [r4, 0x2E] - strh r0, [r4, 0x32] - ldr r1, =gBankSpriteIds - ldr r0, =gAnimationBankAttacker - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - strh r0, [r4, 0x34] - strh r2, [r4, 0x36] - ldr r1, =sub_80D58D4 - adds r0, r4, 0 - bl StoreSpriteCallbackInData6 - ldr r0, =sub_80A6630 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D5860 - - thumb_func_start sub_80D58D4 -sub_80D58D4: @ 80D58D4 - push {lr} - ldrh r1, [r0, 0x36] - strh r1, [r0, 0x2E] - ldrh r1, [r0, 0x30] - negs r1, r1 - strh r1, [r0, 0x30] - ldr r1, =sub_80A6630 - str r1, [r0, 0x1C] - ldr r1, =move_anim_8072740 - bl StoreSpriteCallbackInData6 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D58D4 - - thumb_func_start sub_80D58F8 -sub_80D58F8: @ 80D58F8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r5, =gBattleAnimArgs - ldrb r0, [r5, 0x4] - bl GetAnimBankSpriteId - lsls r0, 24 - lsrs r0, 24 - ldrh r2, [r5] - movs r1, 0 - strh r2, [r4, 0x2E] - strh r1, [r4, 0x30] - ldrh r1, [r5, 0x2] - strh r1, [r4, 0x32] - strh r0, [r4, 0x34] - strh r2, [r4, 0x36] - ldr r1, =sub_80D5944 - adds r0, r4, 0 - bl StoreSpriteCallbackInData6 - ldr r0, =sub_80A6630 - str r0, [r4, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D58F8 - - thumb_func_start sub_80D5944 -sub_80D5944: @ 80D5944 - push {lr} - ldrh r1, [r0, 0x36] - strh r1, [r0, 0x2E] - ldrh r1, [r0, 0x32] - negs r1, r1 - strh r1, [r0, 0x32] - ldr r1, =sub_80A6630 - str r1, [r0, 0x1C] - ldr r1, =move_anim_8072740 - bl StoreSpriteCallbackInData6 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D5944 - - thumb_func_start sub_80D5968 -sub_80D5968: @ 80D5968 - push {r4-r7,lr} - sub sp, 0x4 - adds r6, r0, 0 - ldr r0, =gBattleAnimArgs - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _080D598C - ldr r1, =gBankSpriteIds - ldr r0, =gAnimationBankAttacker - b _080D5990 - .pool -_080D598C: - ldr r1, =gBankSpriteIds - ldr r0, =gAnimationBankTarget -_080D5990: - ldrb r0, [r0] - adds r0, r1 - ldrb r7, [r0] - ldr r5, =gBattleAnimArgs - ldrh r0, [r5, 0x4] - movs r3, 0 - strh r0, [r6, 0x2E] - ldr r0, =gSprites - lsls r4, r7, 4 - adds r4, r7 - lsls r4, 2 - adds r4, r0 - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r6, 0x30] - ldrh r0, [r4, 0x20] - strh r0, [r6, 0x32] - ldrh r0, [r4, 0x26] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r6, 0x34] - ldrh r0, [r4, 0x22] - strh r0, [r6, 0x36] - adds r0, r6, 0 - str r3, [sp] - bl sub_80A6E14 - ldr r3, [sp] - strh r3, [r6, 0x34] - strh r3, [r6, 0x36] - ldrh r0, [r4, 0x24] - strh r0, [r6, 0x38] - ldrh r0, [r4, 0x26] - strh r0, [r6, 0x3A] - adds r2, r6, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - movs r1, 0x2 - ldrsh r0, [r5, r1] - cmp r0, 0x1 - bne _080D5A00 - strh r3, [r6, 0x32] - b _080D5A06 - .pool -_080D5A00: - cmp r0, 0x2 - bne _080D5A06 - strh r3, [r6, 0x30] -_080D5A06: - ldr r0, =gBattleAnimArgs - ldrh r1, [r0, 0x2] - lsls r0, r7, 8 - orrs r0, r1 - strh r0, [r6, 0x3C] - ldr r0, =sub_80D5A24 - str r0, [r6, 0x1C] - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D5968 - - thumb_func_start sub_80D5A24 -sub_80D5A24: @ 80D5A24 - push {r4-r6,lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x3C] - lsls r1, r0, 24 - lsrs r4, r1, 24 - adds r5, r4, 0 - lsls r0, 16 - asrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =gSprites - adds r3, r1, r0 - ldrh r0, [r2, 0x2E] - movs r6, 0x2E - ldrsh r1, [r2, r6] - cmp r1, 0 - bne _080D5A64 - cmp r4, 0x1 - bhi _080D5A4E - strh r1, [r3, 0x24] -_080D5A4E: - cmp r5, 0x2 - beq _080D5A56 - cmp r5, 0 - bne _080D5A58 -_080D5A56: - strh r1, [r3, 0x26] -_080D5A58: - adds r0, r2, 0 - bl move_anim_8072740 - b _080D5A8E - .pool -_080D5A64: - subs r0, 0x1 - strh r0, [r2, 0x2E] - ldrh r1, [r2, 0x30] - ldrh r0, [r2, 0x34] - adds r1, r0 - strh r1, [r2, 0x34] - ldrh r0, [r2, 0x32] - ldrh r4, [r2, 0x36] - adds r0, r4 - strh r0, [r2, 0x36] - lsls r1, 16 - asrs r1, 24 - ldrh r6, [r2, 0x38] - adds r1, r6 - strh r1, [r3, 0x24] - ldrh r0, [r2, 0x36] - lsls r0, 16 - asrs r0, 24 - ldrh r2, [r2, 0x3A] - adds r0, r2 - strh r0, [r3, 0x26] -_080D5A8E: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80D5A24 - - thumb_func_start sub_80D5A94 -sub_80D5A94: @ 80D5A94 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r0, =gBattleAnimArgs - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _080D5AB0 - ldr r0, =gAnimationBankAttacker - b _080D5AB2 - .pool -_080D5AB0: - ldr r0, =gAnimationBankTarget -_080D5AB2: - ldrb r2, [r0] - ldr r0, =gBankSpriteIds - adds r0, r2, r0 - ldrb r6, [r0] - adds r0, r2, 0 - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - beq _080D5ADC - ldr r1, =gBattleAnimArgs - ldrh r0, [r1, 0x2] - negs r0, r0 - strh r0, [r1, 0x2] - movs r2, 0x6 - ldrsh r0, [r1, r2] - cmp r0, 0x1 - bne _080D5ADC - ldrh r0, [r1, 0x4] - negs r0, r0 - strh r0, [r1, 0x4] -_080D5ADC: - ldr r2, =gBattleAnimArgs - ldrh r0, [r2, 0x8] - movs r4, 0 - strh r0, [r5, 0x2E] - ldr r0, =gSprites - lsls r1, r6, 4 - adds r1, r6 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r1, 0x20] - strh r0, [r5, 0x30] - ldrh r0, [r2, 0x2] - ldrh r3, [r1, 0x20] - adds r0, r3 - strh r0, [r5, 0x32] - ldrh r0, [r1, 0x22] - strh r0, [r5, 0x34] - ldrh r0, [r2, 0x4] - ldrh r1, [r1, 0x22] - adds r0, r1 - strh r0, [r5, 0x36] - adds r0, r5, 0 - bl sub_80A6E14 - strh r4, [r5, 0x34] - strh r4, [r5, 0x36] - strh r6, [r5, 0x38] - adds r2, r5, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r1, =move_anim_8072740 - adds r0, r5, 0 - bl StoreSpriteCallbackInData6 - ldr r0, =sub_80A6680 - str r0, [r5, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D5A94 - - thumb_func_start sub_80D5B48 -sub_80D5B48: @ 80D5B48 - push {r4-r7,lr} - adds r6, r0, 0 - adds r2, r6, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =gBattleAnimArgs - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _080D5B70 - ldr r0, =gAnimationBankAttacker - b _080D5B72 - .pool -_080D5B70: - ldr r0, =gAnimationBankTarget -_080D5B72: - ldrb r1, [r0] - ldr r0, =gBankSpriteIds - adds r0, r1, r0 - ldrb r7, [r0] - adds r0, r1, 0 - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - beq _080D5B9C - ldr r1, =gBattleAnimArgs - ldrh r0, [r1, 0x2] - negs r0, r0 - strh r0, [r1, 0x2] - movs r2, 0x6 - ldrsh r0, [r1, r2] - cmp r0, 0x1 - bne _080D5B9C - ldrh r0, [r1, 0x4] - negs r0, r0 - strh r0, [r1, 0x4] -_080D5B9C: - ldr r5, =gBattleAnimArgs - ldrh r0, [r5, 0x8] - strh r0, [r6, 0x2E] - ldr r0, =gSprites - lsls r4, r7, 4 - adds r4, r7 - lsls r4, 2 - adds r4, r0 - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r6, 0x30] - ldrh r1, [r5, 0x2] - adds r0, r1 - strh r0, [r6, 0x32] - ldrh r0, [r4, 0x26] - ldrh r2, [r4, 0x22] - adds r0, r2 - strh r0, [r6, 0x34] - ldrh r1, [r5, 0x4] - adds r0, r1 - strh r0, [r6, 0x36] - adds r0, r6, 0 - bl sub_80A6E14 - ldrh r0, [r4, 0x24] - lsls r0, 8 - strh r0, [r6, 0x34] - ldrh r0, [r4, 0x26] - lsls r0, 8 - strh r0, [r6, 0x36] - strh r7, [r6, 0x38] - ldrh r0, [r5, 0xA] - strh r0, [r6, 0x3A] - lsls r0, 16 - cmp r0, 0 - bne _080D5C04 - ldr r1, =move_anim_8072740 - adds r0, r6, 0 - bl StoreSpriteCallbackInData6 - b _080D5C0C - .pool -_080D5C04: - ldr r1, =sub_80D5C20 - adds r0, r6, 0 - bl StoreSpriteCallbackInData6 -_080D5C0C: - ldr r0, =sub_80A6680 - str r0, [r6, 0x1C] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D5B48 - - thumb_func_start sub_80D5C20 -sub_80D5C20: @ 80D5C20 - push {r4,lr} - ldr r4, =gSprites - movs r1, 0x38 - ldrsh r2, [r0, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - movs r3, 0 - strh r3, [r1, 0x24] - movs r1, 0x38 - ldrsh r2, [r0, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - strh r3, [r1, 0x26] - bl move_anim_8072740 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D5C20 - - thumb_func_start sub_80D5C50 -sub_80D5C50: @ 80D5C50 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r5, =gBattleAnimArgs - movs r0, 0x6 - ldrsh r1, [r5, r0] - movs r0, 0x80 - lsls r0, 8 - bl __divsi3 - lsls r0, 16 - lsrs r7, r0, 16 - ldr r0, =gAnimationBankAttacker - ldrb r0, [r0] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - beq _080D5C82 - ldrh r0, [r5, 0x2] - negs r0, r0 - strh r0, [r5, 0x2] - ldrh r0, [r5, 0xA] - negs r0, r0 - strh r0, [r5, 0xA] -_080D5C82: - ldrb r0, [r5] - bl GetAnimBankSpriteId - ldr r1, =gTasks - lsls r4, r6, 2 - adds r4, r6 - lsls r4, 3 - adds r4, r1 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x8] - movs r1, 0x2 - ldrsh r0, [r5, r1] - lsls r0, 8 - movs r2, 0x6 - ldrsh r1, [r5, r2] - bl __divsi3 - strh r0, [r4, 0xA] - ldrh r0, [r5, 0x4] - strh r0, [r4, 0xC] - ldrh r0, [r5, 0x6] - strh r0, [r4, 0xE] - ldrh r0, [r5, 0x8] - strh r0, [r4, 0x10] - movs r1, 0xA - ldrsh r0, [r5, r1] - lsls r0, 8 - movs r2, 0xC - ldrsh r1, [r5, r2] - bl __divsi3 - strh r0, [r4, 0x12] - ldrh r0, [r5, 0xC] - strh r0, [r4, 0x14] - strh r7, [r4, 0x16] - ldr r0, =sub_80D5CE4 - str r0, [r4] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D5C50 - - thumb_func_start sub_80D5CE4 -sub_80D5CE4: @ 80D5CE4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r5, r1, r2 - ldrb r1, [r5, 0x8] - ldrh r0, [r5, 0xA] - ldrh r2, [r5, 0x1E] - adds r0, r2 - strh r0, [r5, 0x1E] - ldr r2, =gSprites - lsls r4, r1, 4 - adds r4, r1 - lsls r4, 2 - adds r4, r2 - lsls r0, 16 - asrs r0, 24 - strh r0, [r4, 0x24] - ldrh r0, [r5, 0x1C] - lsrs r0, 8 - movs r2, 0xC - ldrsh r1, [r5, r2] - bl Sin - strh r0, [r4, 0x26] - ldrh r0, [r5, 0x16] - ldrh r1, [r5, 0x1C] - adds r0, r1 - strh r0, [r5, 0x1C] - ldrh r0, [r5, 0xE] - subs r0, 0x1 - strh r0, [r5, 0xE] - lsls r0, 16 - cmp r0, 0 - bne _080D5D34 - ldr r0, =sub_80D5D48 - str r0, [r5] -_080D5D34: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D5CE4 - - thumb_func_start sub_80D5D48 -sub_80D5D48: @ 80D5D48 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - ldrh r1, [r4, 0x10] - movs r2, 0x10 - ldrsh r0, [r4, r2] - cmp r0, 0 - ble _080D5D70 - subs r0, r1, 0x1 - strh r0, [r4, 0x10] - b _080D5DA4 - .pool -_080D5D70: - ldrb r0, [r4, 0x8] - ldrh r2, [r4, 0x12] - ldrh r1, [r4, 0x20] - adds r2, r1 - strh r2, [r4, 0x20] - ldr r3, =gSprites - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - lsls r2, 16 - asrs r2, 24 - ldrh r0, [r4, 0x1E] - lsls r0, 16 - asrs r0, 24 - adds r2, r0 - strh r2, [r1, 0x24] - ldrh r0, [r4, 0x14] - subs r0, 0x1 - strh r0, [r4, 0x14] - lsls r0, 16 - cmp r0, 0 - bne _080D5DA4 - adds r0, r5, 0 - bl move_anim_task_del -_080D5DA4: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D5D48 - - thumb_func_start sub_80D5DB0 -sub_80D5DB0: @ 80D5DB0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =gBattleAnimArgs - movs r2, 0 - ldrsh r0, [r1, r2] - cmp r0, 0x2 - beq _080D5DDE - cmp r0, 0x2 - bgt _080D5DD8 - cmp r0, 0 - blt _080D5E10 - ldrb r0, [r1] - bl GetAnimBankSpriteId - lsls r0, 24 - lsrs r2, r0, 24 - b _080D5E18 - .pool -_080D5DD8: - cmp r0, 0x3 - beq _080D5DE8 - b _080D5E10 -_080D5DDE: - ldr r5, =gAnimationBankAttacker - b _080D5DEA - .pool -_080D5DE8: - ldr r5, =gAnimationBankTarget -_080D5DEA: - ldrb r0, [r5] - movs r4, 0x2 - eors r0, r4 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080D5E10 - ldr r1, =gBankSpriteIds - ldrb r0, [r5] - eors r0, r4 - adds r0, r1 - ldrb r2, [r0] - b _080D5E18 - .pool -_080D5E10: - adds r0, r6, 0 - bl move_anim_task_del - b _080D5E58 -_080D5E18: - ldr r1, =gTasks - lsls r4, r6, 2 - adds r0, r4, r6 - lsls r0, 3 - adds r5, r0, r1 - strh r2, [r5, 0x8] - ldr r0, =gAnimationBankTarget - ldrb r0, [r0] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - beq _080D5E44 - ldr r0, =gBattleAnimArgs - ldrh r0, [r0, 0x2] - b _080D5E4A - .pool -_080D5E44: - ldr r0, =gBattleAnimArgs - ldrh r0, [r0, 0x2] - negs r0, r0 -_080D5E4A: - strh r0, [r5, 0xA] - ldr r0, =gTasks - adds r1, r4, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80D5E6C - str r0, [r1] -_080D5E58: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D5DB0 - - thumb_func_start sub_80D5E6C -sub_80D5E6C: @ 80D5E6C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldrb r2, [r1, 0x8] - ldr r3, =gSprites - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r1, 0xA] - ldrh r2, [r0, 0x24] - adds r1, r2 - strh r1, [r0, 0x24] - movs r2, 0x24 - ldrsh r1, [r0, r2] - movs r2, 0x20 - ldrsh r0, [r0, r2] - adds r1, r0 - adds r1, 0x20 - movs r0, 0x98 - lsls r0, 1 - cmp r1, r0 - bls _080D5EAA - adds r0, r4, 0 - bl move_anim_task_del -_080D5EAA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D5E6C - - thumb_func_start sub_80D5EB8 -sub_80D5EB8: @ 80D5EB8 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r6, =gAnimationBankAttacker - ldrb r0, [r6] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - beq _080D5ED4 - ldr r1, =gBattleAnimArgs - ldrh r0, [r1, 0x2] - negs r0, r0 - strh r0, [r1, 0x2] -_080D5ED4: - ldr r4, =gBattleAnimArgs - ldrb r0, [r4, 0x8] - bl GetAnimBankSpriteId - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r3, r5, 2 - adds r1, r3, r5 - lsls r1, 3 - adds r2, r1, r2 - ldrh r1, [r4] - strh r1, [r2, 0x8] - ldrh r1, [r4, 0x2] - strh r1, [r2, 0xA] - ldrh r1, [r4, 0x4] - strh r1, [r2, 0xC] - ldrh r1, [r4, 0x6] - strh r1, [r2, 0xE] - strh r0, [r2, 0x10] - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080D5F14 - ldrb r0, [r6] - b _080D5F18 - .pool -_080D5F14: - ldr r0, =gAnimationBankTarget - ldrb r0, [r0] -_080D5F18: - strh r0, [r2, 0x12] - ldr r1, =gTasks - adds r0, r3, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0x1 - strh r1, [r0, 0x20] - ldr r1, =sub_80D5F3C - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D5EB8 - - thumb_func_start sub_80D5F3C -sub_80D5F3C: @ 80D5F3C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r4, r0, r1 - ldrb r7, [r4, 0x10] - ldrh r0, [r4, 0xC] - ldrh r1, [r4, 0x1C] - adds r0, r1 - lsls r1, r0, 16 - strh r0, [r4, 0x1C] - lsrs r1, 24 - mov r8, r1 - mov r0, r8 - movs r2, 0xA - ldrsh r1, [r4, r2] - bl Sin - lsls r0, 16 - lsrs r5, r0, 16 - mov r9, r5 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080D5F94 - ldr r0, =gSprites - lsls r2, r7, 4 - adds r1, r2, r7 - lsls r1, 2 - adds r1, r0 - strh r5, [r1, 0x24] - mov r9, r0 - adds r4, r2, 0 - b _080D5FDA - .pool -_080D5F94: - ldrb r0, [r4, 0x12] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _080D5FBC - ldr r1, =gSprites - lsls r2, r7, 4 - adds r0, r2, r7 - lsls r0, 2 - adds r3, r0, r1 - lsls r0, r5, 16 - asrs r0, 16 - mov r9, r1 - adds r4, r2, 0 - cmp r0, 0 - bge _080D5FD8 - b _080D5FD6 - .pool -_080D5FBC: - ldr r1, =gSprites - lsls r2, r7, 4 - adds r0, r2, r7 - lsls r0, 2 - adds r3, r0, r1 - mov r4, r9 - lsls r0, r4, 16 - asrs r0, 16 - mov r9, r1 - adds r4, r2, 0 - cmp r0, 0 - bge _080D5FD6 - negs r0, r0 -_080D5FD6: - negs r0, r0 -_080D5FD8: - strh r0, [r3, 0x26] -_080D5FDA: - mov r5, r8 - cmp r5, 0x7F - bls _080D5FFC - ldr r1, =gTasks - lsls r2, r6, 2 - adds r0, r2, r6 - lsls r0, 3 - adds r3, r0, r1 - movs r5, 0x1E - ldrsh r0, [r3, r5] - adds r5, r1, 0 - cmp r0, 0 - bne _080D5FFC - movs r1, 0x20 - ldrsh r0, [r3, r1] - cmp r0, 0x1 - beq _080D601E -_080D5FFC: - mov r2, r8 - cmp r2, 0x7E - bhi _080D6050 - ldr r1, =gTasks - lsls r2, r6, 2 - adds r0, r2, r6 - lsls r0, 3 - adds r3, r0, r1 - movs r5, 0x1E - ldrsh r0, [r3, r5] - adds r5, r1, 0 - cmp r0, 0x1 - bne _080D6050 - movs r1, 0x20 - ldrsh r0, [r3, r1] - cmp r0, 0 - bne _080D6050 -_080D601E: - adds r1, r2, r6 - lsls r1, 3 - adds r1, r5 - ldrh r0, [r1, 0x1E] - movs r2, 0x1 - eors r0, r2 - strh r0, [r1, 0x1E] - ldrh r0, [r1, 0x20] - eors r0, r2 - strh r0, [r1, 0x20] - ldrh r0, [r1, 0xE] - subs r0, 0x1 - strh r0, [r1, 0xE] - lsls r0, 16 - asrs r3, r0, 16 - cmp r3, 0 - bne _080D6050 - adds r0, r4, r7 - lsls r0, 2 - add r0, r9 - strh r3, [r0, 0x24] - strh r3, [r0, 0x26] - adds r0, r6, 0 - bl move_anim_task_del -_080D6050: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D5F3C - - thumb_func_start sub_80D6064 -sub_80D6064: @ 80D6064 - push {r4-r6,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r6, =gBattleAnimArgs - ldrb r0, [r6, 0x6] - bl GetAnimBankSpriteId - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldrb r1, [r6, 0x8] - adds r0, r5, 0 - bl sub_80A7270 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r6] - strh r1, [r0, 0x8] - ldrh r1, [r6, 0x2] - strh r1, [r0, 0xA] - ldrh r1, [r6, 0x4] - strh r1, [r0, 0xC] - ldrh r1, [r6, 0x4] - strh r1, [r0, 0xE] - strh r5, [r0, 0x10] - movs r1, 0x80 - lsls r1, 1 - strh r1, [r0, 0x1C] - strh r1, [r0, 0x1E] - ldr r1, =sub_80D60BC - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D6064 - - thumb_func_start sub_80D60BC -sub_80D60BC: @ 80D60BC - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - ldrh r0, [r4, 0x8] - ldrh r1, [r4, 0x1C] - adds r0, r1 - strh r0, [r4, 0x1C] - ldrh r0, [r4, 0xA] - ldrh r3, [r4, 0x1E] - adds r0, r3 - strh r0, [r4, 0x1E] - ldrb r0, [r4, 0x10] - adds r6, r0, 0 - movs r0, 0x1C - ldrsh r1, [r4, r0] - movs r3, 0x1E - ldrsh r2, [r4, r3] - adds r0, r6, 0 - movs r3, 0 - bl obj_id_set_rotscale - ldrh r0, [r4, 0xC] - subs r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r1, r0, 16 - cmp r1, 0 - bne _080D612C - ldrh r2, [r4, 0xE] - movs r3, 0xE - ldrsh r0, [r4, r3] - cmp r0, 0 - ble _080D6120 - ldrh r0, [r4, 0x8] - negs r0, r0 - strh r0, [r4, 0x8] - ldrh r0, [r4, 0xA] - negs r0, r0 - strh r0, [r4, 0xA] - strh r2, [r4, 0xC] - strh r1, [r4, 0xE] - b _080D612C - .pool -_080D6120: - adds r0, r6, 0 - bl sub_80A7344 - adds r0, r5, 0 - bl move_anim_task_del -_080D612C: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80D60BC - - thumb_func_start sub_80D6134 -sub_80D6134: @ 80D6134 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r4, =gBattleAnimArgs - ldrb r0, [r4, 0x4] - bl GetAnimBankSpriteId - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r1, 0 - bl sub_80A7270 - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r2, r0, r1 - movs r1, 0 - strh r1, [r2, 0xA] - ldrh r0, [r4] - strh r0, [r2, 0xC] - movs r3, 0x6 - ldrsh r0, [r4, r3] - cmp r0, 0x1 - beq _080D6178 - strh r1, [r2, 0xE] - b _080D6184 - .pool -_080D6178: - ldrh r0, [r4] - ldrh r1, [r4, 0x2] - adds r3, r0, 0 - muls r3, r1 - adds r0, r3, 0 - strh r0, [r2, 0xE] -_080D6184: - ldr r1, =gTasks - lsls r4, r7, 2 - adds r0, r4, r7 - lsls r0, 3 - adds r5, r0, r1 - ldr r6, =gBattleAnimArgs - ldrh r0, [r6, 0x2] - strh r0, [r5, 0x10] - mov r0, r8 - strh r0, [r5, 0x12] - ldrh r0, [r6, 0x6] - strh r0, [r5, 0x14] - bl IsContest - lsls r0, 24 - mov r8, r4 - cmp r0, 0 - beq _080D61B8 - movs r0, 0x1 - strh r0, [r5, 0x16] - b _080D61DC - .pool -_080D61B8: - movs r1, 0x4 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _080D61C8 - ldr r0, =gAnimationBankAttacker - b _080D61CA - .pool -_080D61C8: - ldr r0, =gAnimationBankTarget -_080D61CA: - ldrb r0, [r0] - bl GetBankSide - movs r1, 0 - lsls r0, 24 - cmp r0, 0 - bne _080D61DA - movs r1, 0x1 -_080D61DA: - strh r1, [r5, 0x16] -_080D61DC: - ldr r0, =gTasks - mov r2, r8 - adds r1, r2, r7 - lsls r1, 3 - adds r4, r1, r0 - movs r3, 0x16 - ldrsh r0, [r4, r3] - cmp r0, 0 - beq _080D6208 - bl IsContest - lsls r0, 24 - cmp r0, 0 - bne _080D6208 - movs r1, 0xE - ldrsh r0, [r4, r1] - negs r0, r0 - strh r0, [r4, 0xE] - movs r2, 0x10 - ldrsh r0, [r4, r2] - negs r0, r0 - strh r0, [r4, 0x10] -_080D6208: - ldr r0, =gTasks - mov r3, r8 - adds r1, r3, r7 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80D6308 - str r0, [r1] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D6134 - - thumb_func_start sub_80D622C -sub_80D622C: @ 80D622C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =gBattleAnimArgs - ldrb r0, [r4, 0x4] - bl GetAnimBankSpriteId - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r1, 0 - bl sub_80A7270 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0xA] - ldrh r1, [r4] - strh r1, [r0, 0xC] - movs r1, 0x4 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080D6274 - ldr r0, =gAnimationBankAttacker - b _080D6276 - .pool -_080D6274: - ldr r0, =gAnimationBankTarget -_080D6276: - ldrb r0, [r0] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - beq _080D6288 - ldrh r0, [r4, 0x2] - negs r0, r0 - strh r0, [r4, 0x2] -_080D6288: - ldr r0, =gBattleAnimArgs - movs r2, 0x6 - ldrsh r1, [r0, r2] - adds r6, r0, 0 - cmp r1, 0x1 - beq _080D62B0 - ldr r2, =gTasks - lsls r3, r5, 2 - adds r0, r3, r5 - lsls r0, 3 - adds r0, r2 - movs r1, 0 - strh r1, [r0, 0xE] - b _080D62CA - .pool -_080D62B0: - ldr r3, =gTasks - lsls r4, r5, 2 - adds r0, r4, r5 - lsls r0, 3 - adds r0, r3 - ldrh r2, [r6] - ldrh r1, [r6, 0x2] - adds r7, r2, 0 - muls r7, r1 - adds r1, r7, 0 - strh r1, [r0, 0xE] - adds r2, r3, 0 - adds r3, r4, 0 -_080D62CA: - adds r1, r3, r5 - lsls r1, 3 - adds r1, r2 - ldrh r0, [r6, 0x2] - strh r0, [r1, 0x10] - mov r0, r8 - strh r0, [r1, 0x12] - ldrh r0, [r6, 0x6] - strh r0, [r1, 0x14] - movs r0, 0x1 - strh r0, [r1, 0x16] - movs r2, 0xE - ldrsh r0, [r1, r2] - negs r0, r0 - strh r0, [r1, 0xE] - movs r7, 0x10 - ldrsh r0, [r1, r7] - negs r0, r0 - strh r0, [r1, 0x10] - ldr r0, =sub_80D6308 - str r0, [r1] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D622C - - thumb_func_start sub_80D6308 -sub_80D6308: @ 80D6308 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - ldrh r0, [r4, 0x10] - ldrh r1, [r4, 0xE] - adds r0, r1 - strh r0, [r4, 0xE] - ldrb r0, [r4, 0x12] - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r4, 0xE] - adds r1, r2, 0 - bl obj_id_set_rotscale - movs r2, 0x16 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _080D633C - ldrb r0, [r4, 0x12] - bl sub_80A73A0 -_080D633C: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - movs r2, 0xC - ldrsh r1, [r4, r2] - cmp r0, r1 - blt _080D6382 - movs r1, 0x14 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080D6364 - cmp r0, 0x1 - ble _080D636A - cmp r0, 0x2 - beq _080D6372 - b _080D636A - .pool -_080D6364: - ldrb r0, [r4, 0x12] - bl sub_80A7344 -_080D636A: - adds r0, r5, 0 - bl move_anim_task_del - b _080D6382 -_080D6372: - movs r0, 0 - strh r0, [r4, 0xA] - movs r2, 0x10 - ldrsh r0, [r4, r2] - negs r0, r0 - strh r0, [r4, 0x10] - movs r0, 0x1 - strh r0, [r4, 0x14] -_080D6382: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80D6308 - - thumb_func_start sub_80D6388 -sub_80D6388: @ 80D6388 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =gBattleAnimArgs - movs r2, 0 - ldrsh r1, [r0, r2] - mov r8, r0 - cmp r1, 0 - bne _080D63C0 - ldr r4, =gTasks - lsls r5, r7, 2 - adds r0, r5, r7 - lsls r0, 3 - adds r6, r0, r4 - ldr r0, =gMovePowerMoveAnim - ldrh r0, [r0] - movs r1, 0xC - bl __udivsi3 - b _080D63D4 - .pool -_080D63C0: - ldr r4, =gTasks - lsls r5, r7, 2 - adds r0, r5, r7 - lsls r0, 3 - adds r6, r0, r4 - ldr r0, =gMoveDmgMoveAnim - ldr r0, [r0] - movs r1, 0xC - bl __divsi3 -_080D63D4: - strh r0, [r6, 0x26] - lsls r0, 16 - adds r1, r4, 0 - cmp r0, 0 - bgt _080D63E2 - movs r0, 0x1 - strh r0, [r6, 0x26] -_080D63E2: - movs r2, 0x26 - ldrsh r0, [r6, r2] - cmp r0, 0x10 - ble _080D63EE - movs r0, 0x10 - strh r0, [r6, 0x26] -_080D63EE: - adds r4, r5, r7 - lsls r4, 3 - adds r4, r1 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsrs r0, r1, 31 - adds r1, r0 - asrs r1, 1 - movs r5, 0 - strh r1, [r4, 0x24] - ldrh r2, [r4, 0x26] - movs r0, 0x1 - ands r0, r2 - adds r1, r0 - strh r1, [r4, 0x22] - strh r5, [r4, 0x20] - mov r1, r8 - ldrh r0, [r1, 0x6] - strh r0, [r4, 0x1C] - ldrh r0, [r1, 0x8] - strh r0, [r4, 0x1E] - movs r0, 0x1 - bl GetAnimBankSpriteId - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x16] - ldr r2, =gSprites - movs r0, 0x16 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x24] - strh r0, [r4, 0x18] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x26] - strh r0, [r4, 0x1A] - strh r5, [r4, 0x8] - mov r1, r8 - ldrh r0, [r1, 0x2] - strh r0, [r4, 0xA] - ldrh r0, [r1, 0x4] - strh r0, [r4, 0xC] - ldr r0, =sub_80D646C - str r0, [r4] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D6388 - - thumb_func_start sub_80D646C -sub_80D646C: @ 80D646C - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks - adds r3, r0, r1 - ldrh r0, [r3, 0x8] - adds r0, 0x1 - strh r0, [r3, 0x8] - lsls r0, 16 - asrs r0, 16 - movs r2, 0xA - ldrsh r1, [r3, r2] - cmp r0, r1 - ble _080D654A - movs r0, 0 - strh r0, [r3, 0x8] - ldrh r0, [r3, 0x20] - adds r1, r0, 0x1 - movs r0, 0x1 - ands r1, r0 - strh r1, [r3, 0x20] - movs r2, 0x1C - ldrsh r0, [r3, r2] - cmp r0, 0 - beq _080D64DE - cmp r1, 0 - beq _080D64C8 - ldr r2, =gSprites - movs r0, 0x16 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r3, 0x22] - ldrh r2, [r3, 0x18] - adds r1, r2 - b _080D64DC - .pool -_080D64C8: - ldr r2, =gSprites - movs r0, 0x16 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r3, 0x18] - ldrh r2, [r3, 0x24] - subs r1, r2 -_080D64DC: - strh r1, [r0, 0x24] -_080D64DE: - movs r1, 0x1E - ldrsh r0, [r3, r1] - cmp r0, 0 - beq _080D6518 - movs r2, 0x20 - ldrsh r4, [r3, r2] - cmp r4, 0 - beq _080D6508 - ldr r2, =gSprites - movs r0, 0x16 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r3, 0x26] - strh r1, [r0, 0x26] - b _080D6518 - .pool -_080D6508: - ldr r2, =gSprites - movs r0, 0x16 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r4, [r0, 0x26] -_080D6518: - ldrh r0, [r3, 0xC] - subs r0, 0x1 - strh r0, [r3, 0xC] - lsls r0, 16 - asrs r4, r0, 16 - cmp r4, 0 - bne _080D654A - ldr r2, =gSprites - movs r0, 0x16 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r4, [r0, 0x24] - movs r0, 0x16 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r4, [r0, 0x26] - adds r0, r5, 0 - bl move_anim_task_del -_080D654A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D646C - .align 2, 0 @ Don't pad with nop. diff --git a/asm/pokemon_summary_screen.s b/asm/pokemon_summary_screen.s new file mode 100755 index 000000000..3fb412477 --- /dev/null +++ b/asm/pokemon_summary_screen.s @@ -0,0 +1,13904 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_81BF8EC +sub_81BF8EC: @ 81BF8EC + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r1 + adds r5, r2, 0 + adds r6, r3, 0 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + ldr r4, =gUnknown_0203CF1C + ldr r0, =0x000040f8 + bl AllocZeroed + str r0, [r4] + ldr r1, =0x000040bc + adds r0, r1 + strb r7, [r0] + ldr r0, [r4] + mov r2, r8 + str r2, [r0] + adds r1, 0x2 + adds r0, r1 + strb r5, [r0] + ldr r0, [r4] + ldr r2, =0x000040bf + adds r0, r2 + strb r6, [r0] + ldr r1, [r4] + ldr r0, [sp, 0x18] + str r0, [r1, 0x4] + cmp r7, 0x2 + bne _081BF94C + subs r2, 0x2 + adds r1, r2 + movs r0, 0x1 + b _081BF952 + .pool +_081BF94C: + ldr r0, =0x000040bd + adds r1, r0 + movs r0, 0 +_081BF952: + strb r0, [r1] + cmp r7, 0x1 + beq _081BF9A0 + cmp r7, 0x1 + bgt _081BF96C + cmp r7, 0 + beq _081BF97C + ldr r2, =gUnknown_0203CF1C + b _081BF9EE + .pool +_081BF96C: + cmp r7, 0x2 + beq _081BF97C + cmp r7, 0x3 + beq _081BF9D0 + ldr r2, =gUnknown_0203CF1C + b _081BF9EE + .pool +_081BF97C: + ldr r2, =gUnknown_0203CF1C + ldr r0, [r2] + ldr r1, =0x000040c1 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + ldr r1, =0x000040c2 + adds r0, r1 + movs r1, 0x3 + b _081BF9EC + .pool +_081BF9A0: + ldr r2, =gUnknown_0203CF1C + ldr r0, [r2] + ldr r1, =0x000040c1 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + ldr r1, =0x000040c2 + adds r0, r1 + movs r1, 0x3 + strb r1, [r0] + ldr r0, [r2] + ldr r1, =0x000040c8 + adds r0, r1 + strb r7, [r0] + b _081BF9EE + .pool +_081BF9D0: + ldr r2, =gUnknown_0203CF1C + ldr r0, [r2] + ldr r1, =0x000040c1 + adds r0, r1 + movs r1, 0x2 + strb r1, [r0] + ldr r0, [r2] + ldr r1, =0x000040c2 + adds r0, r1 + strb r7, [r0] + ldr r0, [r2] + adds r1, 0x1 + adds r0, r1 + movs r1, 0x1 +_081BF9EC: + strb r1, [r0] +_081BF9EE: + ldr r0, [r2] + ldr r2, =0x000040c1 + adds r1, r0, r2 + ldrb r1, [r1] + subs r2, 0x1 + adds r0, r2 + strb r1, [r0] + movs r0, 0xFF + bl sub_81C488C + ldr r0, =gBattleSpritesGfx + ldr r0, [r0] + cmp r0, 0 + bne _081BFA12 + movs r0, 0 + movs r1, 0 + bl sub_806F2AC +_081BFA12: + ldr r0, =sub_81BFAE4 + bl SetMainCallback2 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BF8EC + + thumb_func_start sub_81BFA38 +sub_81BFA38: @ 81BFA38 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x4 + mov r8, r0 + adds r4, r1, 0 + adds r5, r2, 0 + ldr r6, [sp, 0x18] + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 16 + lsrs r6, 16 + str r3, [sp] + movs r0, 0x3 + mov r1, r8 + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_81BF8EC + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =0x000040c4 + adds r0, r1 + strh r6, [r0] + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BFA38 + + thumb_func_start sub_81BFA80 +sub_81BFA80: @ 81BFA80 + push {r4,lr} + sub sp, 0x4 + ldr r4, [sp, 0xC] + lsls r0, 24 + lsrs r0, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + str r4, [sp] + bl sub_81BF8EC + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =0x000040ef + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BFA80 + + thumb_func_start sub_81BFAB4 +sub_81BFAB4: @ 81BFAB4 + push {lr} + bl RunTasks + bl AnimateSprites + bl BuildOamBuffer + bl do_scheduled_bg_tilemap_copies_to_vram + bl UpdatePaletteFade + pop {r0} + bx r0 + thumb_func_end sub_81BFAB4 + + thumb_func_start sub_81BFAD0 +sub_81BFAD0: @ 81BFAD0 + push {lr} + bl LoadOam + bl ProcessSpriteCopyRequests + bl TransferPlttBuffer + pop {r0} + bx r0 + thumb_func_end sub_81BFAD0 + + thumb_func_start sub_81BFAE4 +sub_81BFAE4: @ 81BFAE4 + push {lr} +_081BFAE6: + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081BFB0A + bl sub_81BFB10 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081BFB0A + bl sub_81221AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081BFAE6 +_081BFB0A: + pop {r0} + bx r0 + thumb_func_end sub_81BFAE4 + + thumb_func_start sub_81BFB10 +sub_81BFB10: @ 81BFB10 + push {r4,lr} + sub sp, 0x4 + ldr r0, =gMain + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x18 + bls _081BFB24 + b _081BFE00 +_081BFB24: + lsls r0, 2 + ldr r1, =_081BFB38 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081BFB38: + .4byte _081BFB9C + .4byte _081BFBAA + .4byte _081BFBBC + .4byte _081BFBD0 + .4byte _081BFBE4 + .4byte _081BFBEA + .4byte _081BFC04 + .4byte _081BFC20 + .4byte _081BFC26 + .4byte _081BFC38 + .4byte _081BFC58 + .4byte _081BFC7C + .4byte _081BFC82 + .4byte _081BFC94 + .4byte _081BFCAC + .4byte _081BFCC0 + .4byte _081BFCD8 + .4byte _081BFCF8 + .4byte _081BFD34 + .4byte _081BFD50 + .4byte _081BFD60 + .4byte _081BFD74 + .4byte _081BFD7A + .4byte _081BFDB0 + .4byte _081BFDCC +_081BFB9C: + bl SetVBlankHBlankCallbacksToNull + bl sub_8121DA0 + bl clear_scheduled_bg_copies_to_vram + b _081BFDE6 +_081BFBAA: + bl remove_some_task + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081BFDEE + .pool +_081BFBBC: + bl ResetPaletteFade + ldr r2, =gPaletteFade + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + b _081BFDE4 + .pool +_081BFBD0: + bl ResetSpriteData + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081BFDEE + .pool +_081BFBE4: + bl FreeAllSpritePalettes + b _081BFDE6 +_081BFBEA: + bl sub_81BFE24 + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =0x000040f0 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + b _081BFDE6 + .pool +_081BFC04: + bl sub_81BFEB0 + lsls r0, 24 + cmp r0, 0 + bne _081BFC10 + b _081BFE18 +_081BFC10: + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081BFDEE + .pool +_081BFC20: + bl sub_81C2554 + b _081BFDE6 +_081BFC26: + bl sub_81C1BA0 + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081BFDEE + .pool +_081BFC38: + ldr r4, =gUnknown_0203CF1C + ldr r0, [r4] + adds r0, 0xC + bl sub_81C0098 + ldr r0, [r4] + ldr r1, =0x000040f0 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + b _081BFDE6 + .pool +_081BFC58: + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + adds r0, 0xC + bl sub_81C00F0 + lsls r0, 24 + cmp r0, 0 + bne _081BFC6A + b _081BFE18 +_081BFC6A: + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081BFDEE + .pool +_081BFC7C: + bl sub_81C25E8 + b _081BFDE6 +_081BFC82: + bl sub_81C286C + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081BFDEE + .pool +_081BFC94: + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =0x000040c0 + adds r0, r1 + ldrb r0, [r0] + bl sub_81C2D9C + b _081BFDE6 + .pool +_081BFCAC: + bl sub_81C0348 + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081BFDEE + .pool +_081BFCC0: + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =0x000040c0 + adds r0, r1 + ldrb r0, [r0] + bl sub_81C2AFC + b _081BFDE6 + .pool +_081BFCD8: + bl sub_81C4190 + bl sub_81C42C8 + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =0x000040f0 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + b _081BFDE6 + .pool +_081BFCF8: + ldr r4, =gUnknown_0203CF1C + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0xC + ldr r2, =0x000040f0 + adds r1, r2 + bl sub_81C45F4 + ldr r1, [r4] + ldr r2, =0x000040d3 + adds r1, r2 + strb r0, [r1] + ldr r1, [r4] + adds r2, r1, r2 + ldrb r0, [r2] + cmp r0, 0xFF + bne _081BFD1C + b _081BFE18 +_081BFD1C: + ldr r0, =0x000040f0 + adds r1, r0 + movs r0, 0 + strh r0, [r1] + b _081BFDE6 + .pool +_081BFD34: + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + adds r0, 0xC + bl sub_81C4984 + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081BFDEE + .pool +_081BFD50: + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + adds r0, 0xC + bl sub_81C4A08 + b _081BFDE6 + .pool +_081BFD60: + bl sub_81C4A88 + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081BFDEE + .pool +_081BFD74: + bl sub_81C4280 + b _081BFDE6 +_081BFD7A: + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =0x000040bc + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3 + beq _081BFDA0 + ldr r0, =sub_81C0510 + movs r1, 0 + bl CreateTask + b _081BFDE6 + .pool +_081BFDA0: + ldr r0, =sub_81C171C + movs r1, 0 + bl CreateTask + b _081BFDE6 + .pool +_081BFDB0: + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl BlendPalettes + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081BFDEE + .pool +_081BFDCC: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade + ldr r2, =gPaletteFade + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 +_081BFDE4: + strb r0, [r2, 0x8] +_081BFDE6: + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 +_081BFDEE: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _081BFE18 + .pool +_081BFE00: + ldr r0, =sub_81BFAD0 + bl SetVBlankCallback + ldr r0, =sub_81BFAB4 + bl SetMainCallback2 + movs r0, 0x1 + b _081BFE1A + .pool +_081BFE18: + movs r0, 0 +_081BFE1A: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81BFB10 + + thumb_func_start sub_81BFE24 +sub_81BFE24: @ 81BFE24 + push {r4,lr} + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_0861CBB4 + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + ldr r4, =gUnknown_0203CF1C + ldr r1, [r4] + ldr r0, =0x000020bc + adds r1, r0 + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x000010bc + adds r1, r0 + movs r0, 0x2 + bl SetBgTilemapBuffer + ldr r1, [r4] + adds r1, 0xBC + movs r0, 0x3 + bl SetBgTilemapBuffer + bl sub_8121E10 + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x3 + bl schedule_bg_copy_tilemap_to_vram + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BFE24 + + thumb_func_start sub_81BFEB0 +sub_81BFEB0: @ 81BFEB0 + push {r4,lr} + sub sp, 0x4 + ldr r1, =gUnknown_0203CF1C + ldr r0, [r1] + ldr r2, =0x000040f0 + adds r0, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + adds r4, r1, 0 + cmp r0, 0xC + bls _081BFEC8 + b _081C008C +_081BFEC8: + lsls r0, 2 + ldr r1, =_081BFEE0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081BFEE0: + .4byte _081BFF14 + .4byte _081BFF30 + .4byte _081BFF60 + .4byte _081BFF78 + .4byte _081BFF90 + .4byte _081BFFA8 + .4byte _081BFFC0 + .4byte _081BFFF0 + .4byte _081BFFFC + .4byte _081C0018 + .4byte _081C0024 + .4byte _081C0040 + .4byte _081C0064 +_081BFF14: + bl reset_temp_tile_data_buffers + ldr r1, =gUnknown_08D97D0C + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + b _081C0046 + .pool +_081BFF30: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081BFF3E + b _081C008C +_081BFF3E: + ldr r0, =gUnknown_08D9862C + ldr r4, =gUnknown_0203CF1C + ldr r1, [r4] + adds r1, 0xBC + bl LZDecompressWram + ldr r1, [r4] + ldr r2, =0x000040f0 + adds r1, r2 + b _081C004E + .pool +_081BFF60: + ldr r0, =gUnknown_08D98CC8 + ldr r1, [r4] + ldr r2, =0x000008bc + adds r1, r2 + bl LZDecompressWram + ldr r1, [r4] + b _081C004A + .pool +_081BFF78: + ldr r0, =gUnknown_08D987FC + ldr r1, [r4] + ldr r2, =0x000018bc + adds r1, r2 + bl LZDecompressWram + ldr r1, [r4] + b _081C004A + .pool +_081BFF90: + ldr r0, =gUnknown_08D9898C + ldr r1, [r4] + ldr r2, =0x000028bc + adds r1, r2 + bl LZDecompressWram + ldr r1, [r4] + b _081C004A + .pool +_081BFFA8: + ldr r0, =gUnknown_08D98B28 + ldr r1, [r4] + ldr r2, =0x000038bc + adds r1, r2 + bl LZDecompressWram + ldr r1, [r4] + b _081C004A + .pool +_081BFFC0: + ldr r0, =gUnknown_08D9853C + movs r2, 0x80 + lsls r2, 1 + movs r1, 0 + bl LoadCompressedPalette + ldr r0, =gUnknown_08D85620 + movs r1, 0x81 + movs r2, 0x1E + bl LoadPalette + ldr r0, =gUnknown_0203CF1C + ldr r1, [r0] + ldr r2, =0x000040f0 + adds r1, r2 + b _081C004E + .pool +_081BFFF0: + ldr r0, =gUnknown_0861CFBC + bl LoadCompressedObjectPic + b _081C0046 + .pool +_081BFFFC: + ldr r0, =gUnknown_0861D074 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0203CF1C + ldr r1, [r0] + ldr r2, =0x000040f0 + adds r1, r2 + b _081C004E + .pool +_081C0018: + ldr r0, =gUnknown_0861D0F8 + bl LoadCompressedObjectPic + b _081C0046 + .pool +_081C0024: + ldr r0, =gUnknown_0861D100 + bl LoadCompressedObjectPalette + ldr r0, =gUnknown_0203CF1C + ldr r1, [r0] + ldr r2, =0x000040f0 + adds r1, r2 + b _081C004E + .pool +_081C0040: + ldr r0, =gUnknown_0861D07C + bl LoadCompressedObjectPalette +_081C0046: + ldr r0, =gUnknown_0203CF1C + ldr r1, [r0] +_081C004A: + ldr r0, =0x000040f0 + adds r1, r0 +_081C004E: + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _081C008C + .pool +_081C0064: + ldr r0, =gUnknown_08D97B84 + movs r1, 0xE8 + lsls r1, 1 + movs r2, 0x60 + bl LoadCompressedPalette + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =0x000040f0 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + movs r0, 0x1 + b _081C008E + .pool +_081C008C: + movs r0, 0 +_081C008E: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81BFEB0 + + thumb_func_start sub_81C0098 +sub_81C0098: @ 81C0098 + push {r4,lr} + adds r3, r0, 0 + ldr r0, =gUnknown_0203CF1C + ldr r1, [r0] + ldr r2, =0x000040bd + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _081C00D0 + ldr r2, [r1] + ldr r4, =0x000040be + adds r0, r1, r4 + ldrb r1, [r0] + movs r0, 0x64 + muls r1, r0 + adds r1, r2 + adds r0, r3, 0 + movs r2, 0x64 + bl memcpy + b _081C00E6 + .pool +_081C00D0: + ldr r0, [r1] + ldr r2, =0x000040be + adds r1, r2 + ldrb r2, [r1] + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 4 + adds r0, r1 + adds r1, r3, 0 + bl sub_8069004 +_081C00E6: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C0098 + + thumb_func_start sub_81C00F0 +sub_81C00F0: @ 81C00F0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r5, r0, 0 + ldr r0, =gUnknown_0203CF1C + ldr r7, [r0] + adds r6, r7, 0 + adds r6, 0x70 + ldr r1, =0x000040f0 + adds r0, r7, r1 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0x1 + beq _081C0198 + cmp r0, 0x1 + bgt _081C0120 + cmp r0, 0 + beq _081C012C + b _081C0314 + .pool +_081C0120: + cmp r0, 0x2 + beq _081C01DC + cmp r0, 0x3 + bne _081C012A + b _081C02A8 +_081C012A: + b _081C0314 +_081C012C: + adds r0, r5, 0 + movs r1, 0xB + bl GetMonData + strh r0, [r6] + adds r0, r5, 0 + movs r1, 0x41 + bl GetMonData + strh r0, [r6, 0x2] + adds r0, r5, 0 + movs r1, 0x19 + bl GetMonData + str r0, [r6, 0x10] + adds r0, r5, 0 + movs r1, 0x38 + bl GetMonData + strb r0, [r6, 0x5] + adds r0, r5, 0 + movs r1, 0x2E + bl GetMonData + strb r0, [r6, 0x8] + adds r0, r5, 0 + movs r1, 0xC + bl GetMonData + strh r0, [r6, 0x2E] + adds r0, r5, 0 + movs r1, 0 + bl GetMonData + str r0, [r6, 0xC] + adds r0, r5, 0 + movs r1, 0x4 + bl GetMonData + adds r1, r7, 0 + adds r1, 0xA5 + strb r0, [r1] + lsls r0, 24 + cmp r0, 0 + beq _081C018C + movs r0, 0x1 + strb r0, [r6, 0x4] + b _081C0322 +_081C018C: + adds r0, r5, 0 + movs r1, 0x2D + bl GetMonData + strb r0, [r6, 0x4] + b _081C0322 +_081C0198: + movs r4, 0 + movs r0, 0x8C + adds r0, r7 + mov r8, r0 + movs r1, 0xA4 + adds r1, r7 + mov r9, r1 + adds r6, r7, 0 + adds r6, 0x84 +_081C01AA: + adds r1, r4, 0 + adds r1, 0xD + adds r0, r5, 0 + bl GetMonData + strh r0, [r6] + adds r1, r4, 0 + adds r1, 0x11 + adds r0, r5, 0 + bl GetMonData + mov r2, r8 + adds r1, r2, r4 + strb r0, [r1] + adds r6, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + bls _081C01AA + adds r0, r5, 0 + movs r1, 0x15 + bl GetMonData + mov r1, r9 + strb r0, [r1] + b _081C0322 +_081C01DC: + ldr r1, [r7] + ldr r0, =gPlayerParty + cmp r1, r0 + beq _081C01F8 + ldr r2, =0x000040bc + adds r0, r7, r2 + ldrb r0, [r0] + cmp r0, 0x2 + beq _081C01F8 + ldr r1, =0x000040ef + adds r0, r7, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081C0254 +_081C01F8: + adds r0, r5, 0 + bl GetNature + adds r1, r6, 0 + adds r1, 0x33 + strb r0, [r1] + adds r0, r5, 0 + movs r1, 0x39 + bl GetMonData + strh r0, [r6, 0x20] + adds r0, r5, 0 + movs r1, 0x3A + bl GetMonData + strh r0, [r6, 0x22] + adds r0, r5, 0 + movs r1, 0x3B + bl GetMonData + strh r0, [r6, 0x24] + adds r0, r5, 0 + movs r1, 0x3C + bl GetMonData + strh r0, [r6, 0x26] + adds r0, r5, 0 + movs r1, 0x3E + bl GetMonData + strh r0, [r6, 0x28] + adds r0, r5, 0 + movs r1, 0x3F + bl GetMonData + strh r0, [r6, 0x2A] + adds r0, r5, 0 + movs r1, 0x3D + b _081C02A0 + .pool +_081C0254: + adds r0, r5, 0 + bl GetNature + adds r1, r7, 0 + adds r1, 0xA3 + strb r0, [r1] + adds r0, r5, 0 + movs r1, 0x39 + bl GetMonData + strh r0, [r6, 0x20] + adds r0, r5, 0 + movs r1, 0x3A + bl GetMonData + strh r0, [r6, 0x22] + adds r0, r5, 0 + movs r1, 0x54 + bl GetMonData + strh r0, [r6, 0x24] + adds r0, r5, 0 + movs r1, 0x55 + bl GetMonData + strh r0, [r6, 0x26] + adds r0, r5, 0 + movs r1, 0x57 + bl GetMonData + strh r0, [r6, 0x28] + adds r0, r5, 0 + movs r1, 0x58 + bl GetMonData + strh r0, [r6, 0x2A] + adds r0, r5, 0 + movs r1, 0x56 +_081C02A0: + bl GetMonData + strh r0, [r6, 0x2C] + b _081C0322 +_081C02A8: + adds r4, r7, 0 + adds r4, 0xA6 + adds r0, r5, 0 + movs r1, 0x7 + adds r2, r4, 0 + bl GetMonData + adds r0, r5, 0 + movs r1, 0x3 + bl GetMonData + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl ConvertInternationalString + adds r0, r5, 0 + bl sub_81B205C + strb r0, [r6, 0x7] + adds r0, r5, 0 + movs r1, 0x31 + bl GetMonData + adds r1, r7, 0 + adds r1, 0xA2 + strb r0, [r1] + adds r0, r5, 0 + movs r1, 0x1 + bl GetMonData + str r0, [r6, 0x48] + adds r0, r5, 0 + movs r1, 0x23 + bl GetMonData + strb r0, [r6, 0x9] + adds r0, r5, 0 + movs r1, 0x24 + bl GetMonData + strb r0, [r6, 0xA] + adds r0, r5, 0 + movs r1, 0x25 + bl GetMonData + strb r0, [r6, 0xB] + adds r0, r5, 0 + movs r1, 0x20 + bl GetMonData + strh r0, [r6, 0x30] + b _081C0322 +_081C0314: + adds r0, r5, 0 + movs r1, 0x52 + bl GetMonData + strb r0, [r6, 0x6] + movs r0, 0x1 + b _081C0332 +_081C0322: + ldr r0, =gUnknown_0203CF1C + ldr r1, [r0] + ldr r2, =0x000040f0 + adds r1, r2 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + movs r0, 0 +_081C0332: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81C00F0 + + thumb_func_start sub_81C0348 +sub_81C0348: @ 81C0348 + push {r4-r6,lr} + ldr r6, =gUnknown_0203CF1C + ldr r2, [r6] + ldr r1, =0x000040c0 + adds r0, r2, r1 + ldrb r0, [r0] + subs r0, 0x2 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _081C037C + movs r0, 0 + movs r1, 0xFF + bl sub_81C1DA4 + movs r0, 0 + movs r1, 0xFF + movs r2, 0 + bl sub_81C1EFC + b _081C03D8 + .pool +_081C037C: + ldr r1, =0x000040c6 + adds r0, r2, r1 + ldrb r1, [r0] + lsls r1, 1 + adds r0, r2, 0 + adds r0, 0x84 + adds r0, r1 + ldrh r0, [r0] + bl sub_81C240C + ldr r0, [r6] + ldr r5, =0x000020bc + adds r0, r5 + movs r1, 0x3 + movs r2, 0 + bl sub_81C2194 + ldr r0, [r6] + ldr r4, =0x000030bc + adds r0, r4 + movs r1, 0x1 + movs r2, 0 + bl sub_81C2194 + ldr r1, [r6] + adds r1, r4 + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, [r6] + adds r1, r5 + movs r0, 0x2 + bl SetBgTilemapBuffer + movs r1, 0x80 + lsls r1, 9 + movs r0, 0x2 + movs r2, 0x1 + bl ChangeBgX + movs r0, 0x13 + bl ClearWindowTilemap + movs r0, 0xD + bl ClearWindowTilemap +_081C03D8: + ldr r0, =gUnknown_0203CF1C + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x77 + ldrb r0, [r0] + cmp r0, 0 + bne _081C0400 + movs r0, 0 + movs r1, 0xFF + bl sub_81C2074 + b _081C0416 + .pool +_081C0400: + ldr r2, =0x000040c0 + adds r0, r1, r2 + ldrb r0, [r0] + subs r0, 0x2 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _081C0416 + movs r0, 0xD + bl PutWindowTilemap +_081C0416: + bl sub_81C2524 + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + adds r0, 0xC + bl sub_81C2228 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C0348 + + thumb_func_start sub_81C0434 +sub_81C0434: @ 81C0434 + push {lr} + bl FreeAllWindowBuffers + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + bl Free + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C0434 + + thumb_func_start sub_81C044C +sub_81C044C: @ 81C044C + 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_81C0484 + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C044C + + thumb_func_start sub_81C0484 +sub_81C0484: @ 81C0484 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C04EC + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081C04EC + ldr r4, =gUnknown_0203CF1C + ldr r0, [r4] + ldr r0, [r0, 0x4] + bl SetMainCallback2 + ldr r1, =gUnknown_0203CF20 + ldr r0, [r4] + ldr r2, =0x000040be + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + bl sub_81C4898 + bl ResetSpriteData + bl FreeAllSpritePalettes + bl StopCryAndClearCrySongs + ldr r0, =gMPlay_BGM + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl m4aMPlayVolumeControl + ldr r0, =gBattleSpritesGfx + ldr r0, [r0] + cmp r0, 0 + bne _081C04E2 + movs r0, 0 + bl sub_806F47C +_081C04E2: + bl sub_81C0434 + adds r0, r5, 0 + bl DestroyTask +_081C04EC: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C0484 + + thumb_func_start sub_81C0510 +sub_81C0510: @ 81C0510 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C05FE + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r2, 0x80 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _081C05FE + ldr r5, =gMain + ldrh r1, [r5, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081C0550 + movs r1, 0x1 + negs r1, r1 + adds r0, r4, 0 + bl sub_81C0604 + b _081C05FE + .pool +_081C0550: + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _081C0562 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81C0604 + b _081C05FE +_081C0562: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _081C0576 + bl GetLRKeysState + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C0582 +_081C0576: + movs r1, 0x1 + negs r1, r1 + adds r0, r4, 0 + bl sub_81C0A8C + b _081C05FE +_081C0582: + ldrh r1, [r5, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _081C0598 + bl GetLRKeysState + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _081C05A2 +_081C0598: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81C0A8C + b _081C05FE +_081C05A2: + ldrh r1, [r5, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081C05E6 + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =0x000040c0 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _081C05FE + cmp r0, 0 + bne _081C05D8 + bl sub_81C48F0 + movs r0, 0x5 + bl PlaySE + adds r0, r4, 0 + bl sub_81C044C + b _081C05FE + .pool +_081C05D8: + movs r0, 0x5 + bl PlaySE + adds r0, r4, 0 + bl sub_81C0E48 + b _081C05FE +_081C05E6: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081C05FE + bl sub_81C48F0 + movs r0, 0x5 + bl PlaySE + adds r0, r4, 0 + bl sub_81C044C +_081C05FE: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81C0510 + + thumb_func_start sub_81C0604 +sub_81C0604: @ 81C0604 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + adds r4, r5, 0 + ldr r1, =gUnknown_0203CF1C + ldr r3, [r1] + ldr r2, =0x000040c3 + adds r0, r3, r2 + ldrb r0, [r0] + adds r6, r1, 0 + cmp r0, 0 + bne _081C06EE + ldr r1, =0x000040bd + adds r0, r3, r1 + ldrb r2, [r0] + cmp r2, 0x1 + bne _081C0678 + adds r1, 0x3 + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _081C0654 + lsls r1, r5, 24 + asrs r1, 24 + movs r4, 0x2 + eors r1, r2 + negs r0, r1 + orrs r0, r1 + asrs r0, 31 + ands r4, r0 + b _081C065C + .pool +_081C0654: + movs r4, 0x3 + cmp r5, 0x1 + bne _081C065C + movs r4, 0x1 +_081C065C: + ldr r2, [r6] + ldr r0, [r2] + ldr r3, =0x000040be + adds r1, r2, r3 + ldrb r1, [r1] + adds r3, 0x1 + adds r2, r3 + ldrb r2, [r2] + adds r3, r4, 0 + bl sub_80D214C + b _081C0696 + .pool +_081C0678: + bl sub_81B1250 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C068E + lsls r0, r5, 24 + asrs r0, 24 + bl sub_81C09B4 + b _081C0696 +_081C068E: + lsls r0, r4, 24 + asrs r0, 24 + bl sub_81C08F8 +_081C0696: + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _081C06EE + movs r0, 0x5 + bl PlaySE + ldr r5, =gUnknown_0203CF1C + ldr r0, [r5] + adds r0, 0x77 + ldrb r0, [r0] + cmp r0, 0 + beq _081C06D4 + movs r0, 0x2 + movs r1, 0x1 + bl sub_81C4204 + movs r0, 0xD + bl ClearWindowTilemap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0 + movs r1, 0x2 + bl sub_81C2074 +_081C06D4: + ldr r0, [r5] + ldr r1, =0x000040be + adds r0, r1 + movs r2, 0 + strb r4, [r0] + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + strh r2, [r0, 0x8] + ldr r1, =sub_81C0704 + str r1, [r0] +_081C06EE: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C0604 + + thumb_func_start sub_81C0704 +sub_81C0704: @ 81C0704 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r4, r1, 3 + ldr r6, =gTasks + 0x8 + adds r5, r4, r6 + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0xC + bls _081C071E + b _081C08BC +_081C071E: + lsls r0, 2 + ldr r1, =_081C0730 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081C0730: + .4byte _081C0764 + .4byte _081C076A + .4byte _081C0780 + .4byte _081C07A8 + .4byte _081C07C8 + .4byte _081C07E0 + .4byte _081C07F0 + .4byte _081C0800 + .4byte _081C0828 + .4byte _081C086C + .4byte _081C0872 + .4byte _081C0878 + .4byte _081C0894 +_081C0764: + bl StopCryAndClearCrySongs + b _081C08EC +_081C076A: + bl sub_81C4898 + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =0x000040d3 + b _081C0786 + .pool +_081C0780: + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =0x000040d4 +_081C0786: + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + bl DestroySpriteAndFreeResources + b _081C08EC + .pool +_081C07A8: + ldr r4, =gUnknown_0203CF1C + ldr r0, [r4] + adds r0, 0xC + bl sub_81C0098 + ldr r0, [r4] + ldr r1, =0x000040f0 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + b _081C08EC + .pool +_081C07C8: + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + adds r0, 0xC + bl sub_81C00F0 + lsls r0, 24 + cmp r0, 0 + bne _081C07DA + b _081C08F2 +_081C07DA: + b _081C08EC + .pool +_081C07E0: + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + adds r0, 0xC + bl sub_81C49E0 + b _081C08EC + .pool +_081C07F0: + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + adds r0, 0xC + bl sub_81C4A08 + b _081C08EC + .pool +_081C0800: + ldr r4, =gUnknown_0203CF1C + ldr r0, [r4] + adds r0, 0x77 + ldrb r0, [r0] + cmp r0, 0 + beq _081C0816 + movs r1, 0x2 + negs r1, r1 + movs r0, 0xA + bl sub_81C2074 +_081C0816: + ldr r0, [r4] + adds r0, 0xC + bl sub_81C2228 + movs r0, 0 + strh r0, [r5, 0x2] + b _081C08EC + .pool +_081C0828: + ldr r4, =gUnknown_0203CF1C + ldr r0, [r4] + adds r0, 0xC + adds r1, r5, 0x2 + bl sub_81C45F4 + ldr r1, [r4] + ldr r2, =0x000040d3 + adds r1, r2 + strb r0, [r1] + ldr r0, [r4] + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xFF + beq _081C08F2 + ldr r2, =gSprites + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x1 + strh r1, [r0, 0x32] + bl sub_81C0E24 + movs r0, 0 + strh r0, [r5, 0x2] + b _081C08EC + .pool +_081C086C: + bl sub_81C4280 + b _081C08EC +_081C0872: + bl sub_81C25E8 + b _081C08EC +_081C0878: + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =0x000040c0 + adds r0, r1 + ldrb r0, [r0] + bl sub_81C2D9C + bl sub_81C2524 + b _081C08EC + .pool +_081C0894: + ldr r2, =gSprites + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =0x000040d3 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strh r1, [r0, 0x32] + b _081C08EC + .pool +_081C08BC: + bl sub_81221EC + lsls r0, 24 + cmp r0, 0 + bne _081C08F2 + ldr r0, =sub_81C20F0 + bl FuncIsActiveTask + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _081C08F2 + strh r0, [r5] + adds r0, r6, 0 + subs r0, 0x8 + adds r0, r4, r0 + ldr r1, =sub_81C0510 + str r1, [r0] + b _081C08F2 + .pool +_081C08EC: + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] +_081C08F2: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81C0704 + + thumb_func_start sub_81C08F8 +sub_81C08F8: @ 81C08F8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0203CF1C + ldr r2, [r1] + ldr r7, [r2] + ldr r3, =0x000040c0 + adds r0, r2, r3 + ldrb r0, [r0] + adds r5, r1, 0 + cmp r0, 0 + bne _081C0960 + lsls r0, r4, 24 + asrs r3, r0, 24 + movs r1, 0x1 + negs r1, r1 + adds r6, r0, 0 + cmp r3, r1 + bne _081C0928 + ldr r1, =0x000040be + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _081C0988 +_081C0928: + asrs r0, r6, 24 + cmp r0, 0x1 + bne _081C0940 + ldr r0, [r5] + ldr r2, =0x000040be + adds r1, r0, r2 + ldr r3, =0x000040bf + adds r0, r3 + ldrb r1, [r1] + ldrb r0, [r0] + cmp r1, r0 + bcs _081C0988 +_081C0940: + ldr r0, [r5] + ldr r1, =0x000040be + adds r0, r1 + ldrb r0, [r0] + adds r0, r4 + lsls r0, 24 + asrs r0, 24 + b _081C09AE + .pool +_081C0960: + ldr r3, =0x000040be + adds r0, r2, r3 + ldrb r5, [r0] + lsls r6, r4, 24 +_081C0968: + lsls r0, r5, 24 + asrs r0, 24 + asrs r1, r6, 24 + adds r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + asrs r4, r0, 24 + cmp r4, 0 + blt _081C0988 + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =0x000040bf + adds r0, r1 + ldrb r0, [r0] + cmp r4, r0 + ble _081C099C +_081C0988: + movs r0, 0x1 + negs r0, r0 + b _081C09AE + .pool +_081C099C: + movs r0, 0x64 + muls r0, r4 + adds r0, r7, r0 + movs r1, 0x2D + bl GetMonData + cmp r0, 0 + bne _081C0968 + adds r0, r4, 0 +_081C09AE: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81C08F8 + + thumb_func_start sub_81C09B4 +sub_81C09B4: @ 81C09B4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r12, r0 + ldr r6, =gUnknown_0203CF1C + ldr r0, [r6] + ldr r1, [r0] + mov r8, r1 + movs r5, 0 + movs r2, 0 + ldr r3, =gUnknown_0861CC1C + movs r1, 0 + ldrsb r1, [r3, r1] + ldr r4, =0x000040be + adds r0, r4 + ldrb r0, [r0] + cmp r1, r0 + beq _081C09FC + adds r7, r3, 0 + adds r3, r4, 0 +_081C09E0: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bhi _081C09FC + adds r0, r2, r7 + movs r1, 0 + ldrsb r1, [r0, r1] + ldr r0, [r6] + adds r0, r3 + ldrb r0, [r0] + cmp r1, r0 + bne _081C09E0 + adds r5, r2, 0 +_081C09FC: + mov r0, r12 + lsls r6, r0, 24 + ldr r7, =gUnknown_0861CC1C +_081C0A02: + lsls r0, r5, 24 + asrs r0, 24 + asrs r1, r6, 24 + adds r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, r5, 24 + lsrs r0, r1, 24 + cmp r0, 0x5 + bhi _081C0A40 + asrs r0, r1, 24 + adds r0, r7 + movs r4, 0 + ldrsb r4, [r0, r4] + movs r0, 0x64 + muls r0, r4 + add r0, r8 + bl sub_81C0A50 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C0A02 + adds r0, r4, 0 + b _081C0A44 + .pool +_081C0A40: + movs r0, 0x1 + negs r0, r0 +_081C0A44: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81C09B4 + + thumb_func_start sub_81C0A50 +sub_81C0A50: @ 81C0A50 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081C0A84 + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =0x000040be + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _081C0A78 + adds r0, r4, 0 + movs r1, 0x2D + bl GetMonData + cmp r0, 0 + bne _081C0A84 +_081C0A78: + movs r0, 0x1 + b _081C0A86 + .pool +_081C0A84: + movs r0, 0 +_081C0A86: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81C0A50 + + thumb_func_start sub_81C0A8C +sub_81C0A8C: @ 81C0A8C + 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 + str r6, [sp] + lsls r1, 24 + lsrs r3, r1, 24 + str r3, [sp, 0x4] + ldr r0, =gUnknown_0203CF1C + mov r8, r0 + ldr r2, [r0] + adds r1, r2, 0 + adds r1, 0x70 + lsls r0, r6, 2 + adds r0, r6 + lsls r7, r0, 3 + ldr r0, =gTasks + 0x8 + mov r9, r0 + adds r0, r7, r0 + str r0, [sp, 0x8] + ldrb r1, [r1, 0x4] + mov r10, r1 + cmp r1, 0 + bne _081C0B6E + lsls r0, r3, 24 + asrs r5, r0, 24 + movs r0, 0x1 + negs r0, r0 + cmp r5, r0 + bne _081C0AE0 + ldr r1, =0x000040c0 + adds r0, r2, r1 + ldr r3, =0x000040c1 + adds r1, r2, r3 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + beq _081C0B6E +_081C0AE0: + cmp r5, 0x1 + bne _081C0AF4 + ldr r1, =0x000040c0 + adds r0, r2, r1 + ldr r3, =0x000040c2 + adds r1, r2, r3 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + beq _081C0B6E +_081C0AF4: + movs r0, 0x5 + bl PlaySE + mov r1, r8 + ldr r0, [r1] + ldr r4, =0x000040c0 + adds r0, r4 + ldrb r0, [r0] + bl sub_81C2C38 + mov r2, r8 + ldr r1, [r2] + adds r1, r4 + ldrb r0, [r1] + ldr r3, [sp, 0x4] + adds r0, r3 + strb r0, [r1] + mov r1, r10 + ldr r0, [sp, 0x8] + strh r1, [r0] + cmp r5, 0x1 + bne _081C0B4C + ldr r1, =sub_81C0B8C + mov r0, r9 + subs r0, 0x8 + adds r0, r7, r0 + ldr r2, [r0] + adds r0, r6, 0 + bl SetTaskFuncWithFollowupFunc + b _081C0B5C + .pool +_081C0B4C: + ldr r1, =sub_81C0CC4 + mov r0, r9 + subs r0, 0x8 + adds r0, r7, r0 + ldr r2, [r0] + ldr r0, [sp] + bl SetTaskFuncWithFollowupFunc +_081C0B5C: + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r2, =0x000040c0 + adds r0, r2 + ldrb r0, [r0] + bl sub_81C2DE4 + bl sub_81C424C +_081C0B6E: + 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_81C0A8C + + thumb_func_start sub_81C0B8C +sub_81C0B8C: @ 81C0B8C + 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 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081C0C2A + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r3, =0x000040c9 + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _081C0BE0 + movs r0, 0x1 + strh r0, [r4, 0x2] + movs r0, 0x1 + movs r1, 0x7 + movs r2, 0x1 + bl SetBgAttribute + movs r0, 0x2 + movs r1, 0x7 + movs r2, 0x2 + bl SetBgAttribute + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + b _081C0BFE + .pool +_081C0BE0: + movs r0, 0x2 + strh r0, [r4, 0x2] + movs r0, 0x2 + movs r1, 0x7 + movs r2, 0x1 + bl SetBgAttribute + movs r0, 0x1 + movs r1, 0x7 + movs r2, 0x2 + bl SetBgAttribute + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram +_081C0BFE: + ldrb r0, [r4, 0x2] + movs r1, 0 + movs r2, 0 + bl ChangeBgX + ldrb r0, [r4, 0x2] + ldr r1, =gUnknown_0203CF1C + ldr r1, [r1] + ldr r3, =0x000040c0 + adds r2, r1, r3 + ldrb r2, [r2] + lsls r2, 12 + adds r2, 0xBC + adds r1, r2 + bl SetBgTilemapBuffer + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg +_081C0C2A: + ldrb r0, [r4, 0x2] + movs r1, 0x80 + lsls r1, 6 + movs r2, 0x1 + bl ChangeBgX + ldrh r0, [r4] + adds r0, 0x20 + strh r0, [r4] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _081C0C52 + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81C0C68 + str r0, [r1] +_081C0C52: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C0B8C + + thumb_func_start sub_81C0C68 +sub_81C0C68: @ 81C0C68 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r2, r4, 2 + adds r2, r4 + lsls r2, 3 + ldr r0, =gTasks + 0x8 + adds r2, r0 + ldr r5, =gUnknown_0203CF1C + ldr r3, [r5] + ldr r0, =0x000040c9 + adds r3, r0 + ldrb r0, [r3] + movs r1, 0x1 + eors r0, r1 + movs r1, 0 + strb r0, [r3] + strh r1, [r2, 0x2] + strh r1, [r2] + bl sub_81C1BA0 + ldr r0, [r5] + ldr r1, =0x000040c0 + adds r0, r1 + ldrb r0, [r0] + bl sub_81C2AFC + bl sub_81C4280 + bl sub_81C0E24 + adds r0, r4, 0 + bl SwitchTaskToFollowupFunc + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C0C68 + + thumb_func_start sub_81C0CC4 +sub_81C0CC4: @ 81C0CC4 + 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 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081C0D0C + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =0x000040c9 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _081C0CFC + movs r0, 0x2 + b _081C0CFE + .pool +_081C0CFC: + movs r0, 0x1 +_081C0CFE: + strh r0, [r4, 0x2] + ldrb r0, [r4, 0x2] + movs r1, 0x80 + lsls r1, 9 + movs r2, 0 + bl ChangeBgX +_081C0D0C: + ldrb r0, [r4, 0x2] + movs r1, 0x80 + lsls r1, 6 + movs r2, 0x2 + bl ChangeBgX + ldrh r0, [r4] + adds r0, 0x20 + strh r0, [r4] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _081C0D34 + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81C0D44 + str r0, [r1] +_081C0D34: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C0CC4 + + thumb_func_start sub_81C0D44 +sub_81C0D44: @ 81C0D44 + push {r4-r7,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 + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =0x000040c9 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _081C0D8C + movs r0, 0x1 + movs r1, 0x7 + movs r2, 0x1 + bl SetBgAttribute + movs r0, 0x2 + movs r1, 0x7 + movs r2, 0x2 + bl SetBgAttribute + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + b _081C0DA6 + .pool +_081C0D8C: + movs r0, 0x2 + movs r1, 0x7 + movs r2, 0x1 + bl SetBgAttribute + movs r0, 0x1 + movs r1, 0x7 + movs r2, 0x2 + bl SetBgAttribute + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram +_081C0DA6: + ldr r6, =gUnknown_0203CF1C + ldr r2, [r6] + ldr r7, =0x000040c0 + adds r1, r2, r7 + ldrb r0, [r1] + cmp r0, 0x1 + bls _081C0DD0 + ldrb r0, [r4, 0x2] + ldrb r1, [r1] + lsls r1, 12 + ldr r3, =0xfffff0bc + adds r1, r3 + adds r1, r2, r1 + bl SetBgTilemapBuffer + ldrb r0, [r4, 0x2] + movs r1, 0x80 + lsls r1, 9 + movs r2, 0 + bl ChangeBgX +_081C0DD0: + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + ldr r2, [r6] + ldr r0, =0x000040c9 + adds r2, r0 + ldrb r0, [r2] + movs r1, 0x1 + eors r0, r1 + movs r1, 0 + strb r0, [r2] + strh r1, [r4, 0x2] + strh r1, [r4] + bl sub_81C1BA0 + ldr r0, [r6] + adds r0, r7 + ldrb r0, [r0] + bl sub_81C2AFC + bl sub_81C4280 + bl sub_81C0E24 + adds r0, r5, 0 + bl SwitchTaskToFollowupFunc + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C0D44 + + thumb_func_start sub_81C0E24 +sub_81C0E24: @ 81C0E24 + push {lr} + ldr r0, =gUnknown_0203CF1C + ldr r1, [r0] + ldr r2, =0x000040c0 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081C0E3C + adds r0, r1, 0 + adds r0, 0xC + bl sub_81C22CC +_081C0E3C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C0E24 + + thumb_func_start sub_81C0E48 +sub_81C0E48: @ 81C0E48 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r5, =gUnknown_0203CF1C + ldr r0, [r5] + ldr r2, =0x000040c6 + adds r0, r2 + movs r1, 0 + strb r1, [r0] + ldr r1, [r5] + adds r2, r1, r2 + ldrb r0, [r2] + lsls r0, 1 + adds r1, 0x84 + adds r1, r0 + ldrh r6, [r1] + mov r8, r6 + movs r0, 0x13 + bl ClearWindowTilemap + ldr r2, =gSprites + ldr r0, [r5] + ldr r1, =0x000040d5 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _081C0E96 + movs r0, 0xD + bl ClearWindowTilemap +_081C0E96: + movs r4, 0x3 + negs r4, r4 + movs r0, 0x9 + adds r1, r4, 0 + bl sub_81C1DA4 + movs r0, 0x9 + adds r1, r4, 0 + adds r2, r6, 0 + bl sub_81C1EFC + ldr r0, [r5] + ldr r1, =0x000040c8 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _081C0EC4 + movs r0, 0x5 + bl ClearWindowTilemap + movs r0, 0x6 + bl PutWindowTilemap +_081C0EC4: + ldr r0, [r5] + ldr r1, =0x000020bc + adds r0, r1 + movs r1, 0x3 + movs r2, 0 + bl sub_81C2194 + ldr r0, [r5] + ldr r1, =0x000030bc + adds r0, r1 + movs r1, 0x1 + movs r2, 0 + bl sub_81C2194 + mov r0, r8 + bl sub_81C3E9C + bl sub_81C3F44 + bl sub_81C44F0 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x8 + bl sub_81C4AF8 + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81C0F44 + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C0E48 + + thumb_func_start sub_81C0F44 +sub_81C0F44: @ 81C0F44 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C103A + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081C0F98 + movs r0, 0x4 + strh r0, [r4] + movs r1, 0x1 + negs r1, r1 + ldr r0, =gUnknown_0203CF1C + ldr r2, [r0] + ldr r0, =0x000040c6 + adds r2, r0 + adds r0, r4, 0 + bl sub_81C1070 + b _081C103A + .pool +_081C0F98: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081C0FC0 + movs r0, 0x4 + strh r0, [r4] + ldr r0, =gUnknown_0203CF1C + ldr r2, [r0] + ldr r0, =0x000040c6 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81C1070 + b _081C103A + .pool +_081C0FC0: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081C1026 + ldr r0, =gUnknown_0203CF1C + ldr r1, [r0] + ldr r2, =0x000040c8 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x1 + beq _081C0FE8 + subs r2, 0x4 + adds r0, r1, r2 + ldr r0, [r0] + ldr r1, =0x00ffffff + ands r0, r1 + movs r1, 0x80 + lsls r1, 11 + cmp r0, r1 + bne _081C1004 +_081C0FE8: + movs r0, 0x5 + bl PlaySE + adds r0, r5, 0 + bl sub_81C11F4 + b _081C103A + .pool +_081C1004: + bl sub_81C1040 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C101E + movs r0, 0x5 + bl PlaySE + adds r0, r5, 0 + bl sub_81C129C + b _081C103A +_081C101E: + movs r0, 0x20 + bl PlaySE + b _081C103A +_081C1026: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081C103A + movs r0, 0x5 + bl PlaySE + adds r0, r6, 0 + bl sub_81C11F4 +_081C103A: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81C0F44 + + thumb_func_start sub_81C1040 +sub_81C1040: @ 81C1040 + push {lr} + movs r1, 0x1 + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + adds r2, r0, 0 + adds r2, 0x84 +_081C104C: + lsls r0, r1, 1 + adds r0, r2, r0 + ldrh r0, [r0] + cmp r0, 0 + beq _081C1060 + movs r0, 0x1 + b _081C106C + .pool +_081C1060: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x3 + bls _081C104C + movs r0, 0 +_081C106C: + pop {r1} + bx r1 + thumb_func_end sub_81C1040 + + thumb_func_start sub_81C1070 +sub_81C1070: @ 81C1070 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r7, r0, 0 + adds r4, r1, 0 + mov r8, r2 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl PlaySE + mov r0, r8 + ldrb r6, [r0] + movs r2, 0 + lsls r4, 24 + asrs r4, 24 + mov r12, r4 + movs r1, 0 + ldrsh r4, [r7, r1] + ldrb r0, [r7] + lsls r3, r0, 24 +_081C109C: + lsls r0, r6, 24 + asrs r0, 24 + add r0, r12 + lsls r0, 24 + lsrs r6, r0, 24 + asrs r0, 24 + cmp r0, r4 + ble _081C10B0 + movs r6, 0 + b _081C10B6 +_081C10B0: + cmp r0, 0 + bge _081C10B6 + lsrs r6, r3, 24 +_081C10B6: + lsls r0, r6, 24 + asrs r1, r0, 24 + mov r9, r0 + cmp r1, 0x4 + bne _081C10C2 + b _081C11CC +_081C10C2: + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + lsls r1, 1 + adds r0, 0x84 + adds r0, r1 + ldrh r5, [r0] + cmp r5, 0 + bne _081C10E2 + lsls r0, r2, 24 + movs r1, 0x80 + lsls r1, 17 + adds r0, r1 + lsrs r2, r0, 24 + asrs r0, 24 + cmp r0, 0x3 + ble _081C109C +_081C10E2: + adds r0, r5, 0 + bl sub_81C240C + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + adds r0, r5, 0 + bl sub_81C3E9C + mov r1, r8 + ldrb r0, [r1] + cmp r0, 0x4 + bne _081C1110 + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =0x000040c4 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _081C1118 +_081C1110: + movs r1, 0x2 + ldrsh r0, [r7, r1] + cmp r0, 0x1 + bne _081C115E +_081C1118: + movs r0, 0x13 + bl ClearWindowTilemap + ldr r2, =gSprites + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =0x000040d5 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _081C1142 + movs r0, 0xD + bl ClearWindowTilemap +_081C1142: + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r4, 0x3 + negs r4, r4 + movs r0, 0x9 + adds r1, r4, 0 + bl sub_81C1DA4 + movs r0, 0x9 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_81C1EFC +_081C115E: + mov r1, r8 + ldrb r0, [r1] + cmp r0, 0x4 + beq _081C11A0 + mov r1, r9 + asrs r0, r1, 24 + cmp r0, 0x4 + bne _081C11A0 + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =0x000040c4 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + bne _081C11A0 + movs r0, 0xE + bl ClearWindowTilemap + movs r0, 0xF + bl ClearWindowTilemap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0 + movs r1, 0x3 + bl sub_81C1DA4 + movs r0, 0 + movs r1, 0x3 + movs r2, 0 + bl sub_81C1EFC +_081C11A0: + mov r0, r8 + strb r6, [r0] + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =0x000040c6 + adds r0, r1 + cmp r8, r0 + bne _081C11E0 + movs r0, 0x8 + bl sub_81C4D18 + b _081C11E6 + .pool +_081C11CC: + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =0x000040c4 + adds r0, r1 + ldrh r5, [r0] + b _081C10E2 + .pool +_081C11E0: + movs r0, 0x12 + bl sub_81C4D18 +_081C11E6: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81C1070 + + thumb_func_start sub_81C11F4 +sub_81C11F4: @ 81C11F4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x8 + bl sub_81C4C60 + movs r0, 0x6 + bl ClearWindowTilemap + movs r0, 0x5 + bl PutWindowTilemap + movs r0, 0 + bl sub_81C3E9C + ldr r4, =gUnknown_0203CF1C + ldr r0, [r4] + ldr r1, =0x000020bc + adds r0, r1 + movs r1, 0x3 + movs r2, 0x1 + bl sub_81C2194 + ldr r0, [r4] + ldr r1, =0x000030bc + adds r0, r1 + movs r1, 0x1 + movs r2, 0x1 + bl sub_81C2194 + bl sub_81C4064 + ldr r0, [r4] + ldr r1, =0x000040c6 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x4 + beq _081C125E + movs r0, 0xE + bl ClearWindowTilemap + movs r0, 0xF + bl ClearWindowTilemap + movs r0, 0 + movs r1, 0x3 + bl sub_81C1DA4 + movs r0, 0 + movs r1, 0x3 + movs r2, 0 + bl sub_81C1EFC +_081C125E: + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81C0510 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C11F4 + + thumb_func_start sub_81C129C +sub_81C129C: @ 81C129C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r2, =0x000040c6 + adds r1, r0, r2 + ldrb r1, [r1] + adds r2, 0x1 + adds r0, r2 + strb r1, [r0] + movs r0, 0x1 + bl sub_81C4C84 + movs r0, 0x12 + bl sub_81C4AF8 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81C12E4 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C129C + + thumb_func_start sub_81C12E4 +sub_81C12E4: @ 81C12E4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C13AA + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081C1338 + movs r0, 0x3 + strh r0, [r4] + movs r1, 0x1 + negs r1, r1 + ldr r0, =gUnknown_0203CF1C + ldr r2, [r0] + ldr r0, =0x000040c7 + adds r2, r0 + adds r0, r4, 0 + bl sub_81C1070 + b _081C13AA + .pool +_081C1338: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081C1360 + movs r0, 0x3 + strh r0, [r4] + ldr r0, =gUnknown_0203CF1C + ldr r2, [r0] + ldr r0, =0x000040c7 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81C1070 + b _081C13AA + .pool +_081C1360: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081C139A + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r2, =0x000040c6 + adds r1, r0, r2 + adds r2, 0x1 + adds r0, r2 + ldrb r1, [r1] + ldrb r0, [r0] + cmp r1, r0 + bne _081C1390 + adds r0, r5, 0 + movs r1, 0 + bl sub_81C13B0 + b _081C13AA + .pool +_081C1390: + adds r0, r5, 0 + movs r1, 0x1 + bl sub_81C13B0 + b _081C13AA +_081C139A: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081C13AA + adds r0, r6, 0 + movs r1, 0 + bl sub_81C13B0 +_081C13AA: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81C12E4 + + thumb_func_start sub_81C13B0 +sub_81C13B0: @ 81C13B0 + push {r4-r7,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl PlaySE + movs r0, 0 + bl sub_81C4C84 + movs r0, 0x12 + bl sub_81C4C60 + cmp r4, 0x1 + bne _081C1464 + ldr r0, =gUnknown_0203CF1C + ldr r3, [r0] + ldr r1, =0x000040bd + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _081C1410 + ldr r0, [r3] + ldr r2, =0x000040be + adds r1, r3, r2 + ldrb r2, [r1] + movs r1, 0x64 + muls r1, r2 + adds r0, r1 + ldr r4, =0x000040c6 + adds r1, r3, r4 + ldrb r1, [r1] + adds r4, 0x1 + adds r2, r3, r4 + ldrb r2, [r2] + bl sub_81C14BC + b _081C1430 + .pool +_081C1410: + ldr r0, [r3] + ldr r2, =0x000040be + adds r1, r3, r2 + ldrb r2, [r1] + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 4 + adds r0, r1 + ldr r4, =0x000040c6 + adds r1, r3, r4 + ldrb r1, [r1] + adds r4, 0x1 + adds r2, r3, r4 + ldrb r2, [r2] + bl sub_81C15EC +_081C1430: + ldr r5, =gUnknown_0203CF1C + ldr r0, [r5] + adds r0, 0xC + bl sub_81C0098 + ldr r1, [r5] + ldr r6, =0x000040c6 + adds r0, r1, r6 + ldrb r0, [r0] + ldr r4, =0x000040c7 + adds r1, r4 + ldrb r1, [r1] + bl sub_81C40A0 + ldr r1, [r5] + adds r0, r1, r6 + ldrb r0, [r0] + adds r1, r4 + ldrb r1, [r1] + bl sub_81C4568 + ldr r0, [r5] + adds r4, r0, r4 + ldrb r1, [r4] + adds r0, r6 + strb r1, [r0] +_081C1464: + ldr r0, =gUnknown_0203CF1C + ldr r1, [r0] + ldr r2, =0x000040c6 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 1 + adds r1, 0x84 + adds r1, r0 + ldrh r4, [r1] + adds r0, r4, 0 + bl sub_81C3E9C + adds r0, r4, 0 + bl sub_81C240C + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81C0F44 + str r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C13B0 + + thumb_func_start sub_81C14BC +sub_81C14BC: @ 81C14BC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + adds r7, r0, 0 + adds r4, r1, 0 + adds r6, r2, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r6, 24 + lsrs r6, 24 + ldr r0, =gUnknown_0203CF1C + ldr r2, [r0] + lsls r0, r4, 1 + mov r10, r0 + adds r1, r2, 0 + adds r1, 0x84 + adds r0, r1, r0 + str r0, [sp, 0x8] + ldrh r0, [r0] + mov r3, sp + adds r3, 0x2 + str r3, [sp, 0x1C] + strh r0, [r3] + lsls r0, r6, 1 + mov r9, r0 + add r1, r9 + str r1, [sp, 0xC] + ldrh r1, [r1] + mov r0, sp + strh r1, [r0] + adds r1, r2, 0 + adds r1, 0x8C + adds r3, r1, r4 + str r3, [sp, 0x10] + ldrb r0, [r3] + mov r3, sp + adds r3, 0x5 + str r3, [sp, 0x24] + strb r0, [r3] + adds r1, r6 + str r1, [sp, 0x14] + ldrb r0, [r1] + mov r1, sp + adds r1, 0x4 + str r1, [sp, 0x20] + strb r0, [r1] + adds r2, 0xA4 + str r2, [sp, 0x18] + ldrb r0, [r2] + mov r5, sp + adds r5, 0x6 + strb r0, [r5] + ldr r1, =gUnknown_08329D22 + adds r0, r4, r1 + ldrb r0, [r0] + mov r8, r0 + ldrb r0, [r5] + adds r2, r0, 0 + mov r3, r8 + ands r2, r3 + mov r3, r10 + asrs r2, r3 + lsls r2, 24 + lsrs r2, 24 + adds r1, r6, r1 + ldrb r1, [r1] + mov r12, r1 + adds r1, r0, 0 + mov r3, r12 + ands r1, r3 + mov r3, r9 + asrs r1, r3 + lsls r1, 24 + lsrs r1, 24 + mov r3, r8 + bics r0, r3 + strb r0, [r5] + ldrb r0, [r5] + mov r3, r12 + bics r0, r3 + strb r0, [r5] + mov r0, r9 + lsls r2, r0 + mov r3, r10 + lsls r1, r3 + adds r2, r1 + ldrb r0, [r5] + orrs r0, r2 + strb r0, [r5] + adds r1, r4, 0 + adds r1, 0xD + adds r0, r7, 0 + mov r2, sp + bl SetMonData + adds r1, r6, 0 + adds r1, 0xD + adds r0, r7, 0 + ldr r2, [sp, 0x1C] + bl SetMonData + adds r4, 0x11 + adds r0, r7, 0 + adds r1, r4, 0 + ldr r2, [sp, 0x20] + bl SetMonData + adds r6, 0x11 + adds r0, r7, 0 + adds r1, r6, 0 + ldr r2, [sp, 0x24] + bl SetMonData + adds r0, r7, 0 + movs r1, 0x15 + adds r2, r5, 0 + bl SetMonData + mov r0, sp + ldrh r0, [r0] + ldr r1, [sp, 0x8] + strh r0, [r1] + ldr r3, [sp, 0x1C] + ldrh r0, [r3] + ldr r1, [sp, 0xC] + strh r0, [r1] + ldr r3, [sp, 0x20] + ldrb r0, [r3] + ldr r1, [sp, 0x10] + strb r0, [r1] + ldr r3, [sp, 0x24] + ldrb r0, [r3] + ldr r1, [sp, 0x14] + strb r0, [r1] + ldrb r0, [r5] + ldr r3, [sp, 0x18] + strb r0, [r3] + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C14BC + + thumb_func_start sub_81C15EC +sub_81C15EC: @ 81C15EC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + adds r7, r0, 0 + adds r4, r1, 0 + adds r6, r2, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r6, 24 + lsrs r6, 24 + ldr r0, =gUnknown_0203CF1C + ldr r2, [r0] + lsls r0, r4, 1 + mov r10, r0 + adds r1, r2, 0 + adds r1, 0x84 + adds r0, r1, r0 + str r0, [sp, 0x8] + ldrh r0, [r0] + mov r3, sp + adds r3, 0x2 + str r3, [sp, 0x1C] + strh r0, [r3] + lsls r0, r6, 1 + mov r9, r0 + add r1, r9 + str r1, [sp, 0xC] + ldrh r1, [r1] + mov r0, sp + strh r1, [r0] + adds r1, r2, 0 + adds r1, 0x8C + adds r3, r1, r4 + str r3, [sp, 0x10] + ldrb r0, [r3] + mov r3, sp + adds r3, 0x5 + str r3, [sp, 0x24] + strb r0, [r3] + adds r1, r6 + str r1, [sp, 0x14] + ldrb r0, [r1] + mov r1, sp + adds r1, 0x4 + str r1, [sp, 0x20] + strb r0, [r1] + adds r2, 0xA4 + str r2, [sp, 0x18] + ldrb r0, [r2] + mov r5, sp + adds r5, 0x6 + strb r0, [r5] + ldr r1, =gUnknown_08329D22 + adds r0, r4, r1 + ldrb r0, [r0] + mov r8, r0 + ldrb r0, [r5] + adds r2, r0, 0 + mov r3, r8 + ands r2, r3 + mov r3, r10 + asrs r2, r3 + lsls r2, 24 + lsrs r2, 24 + adds r1, r6, r1 + ldrb r1, [r1] + mov r12, r1 + adds r1, r0, 0 + mov r3, r12 + ands r1, r3 + mov r3, r9 + asrs r1, r3 + lsls r1, 24 + lsrs r1, 24 + mov r3, r8 + bics r0, r3 + strb r0, [r5] + ldrb r0, [r5] + mov r3, r12 + bics r0, r3 + strb r0, [r5] + mov r0, r9 + lsls r2, r0 + mov r3, r10 + lsls r1, r3 + adds r2, r1 + ldrb r0, [r5] + orrs r0, r2 + strb r0, [r5] + adds r1, r4, 0 + adds r1, 0xD + adds r0, r7, 0 + mov r2, sp + bl SetBoxMonData + adds r1, r6, 0 + adds r1, 0xD + adds r0, r7, 0 + ldr r2, [sp, 0x1C] + bl SetBoxMonData + adds r4, 0x11 + adds r0, r7, 0 + adds r1, r4, 0 + ldr r2, [sp, 0x20] + bl SetBoxMonData + adds r6, 0x11 + adds r0, r7, 0 + adds r1, r6, 0 + ldr r2, [sp, 0x24] + bl SetBoxMonData + adds r0, r7, 0 + movs r1, 0x15 + adds r2, r5, 0 + bl SetBoxMonData + mov r0, sp + ldrh r0, [r0] + ldr r1, [sp, 0x8] + strh r0, [r1] + ldr r3, [sp, 0x1C] + ldrh r0, [r3] + ldr r1, [sp, 0xC] + strh r0, [r1] + ldr r3, [sp, 0x20] + ldrb r0, [r3] + ldr r1, [sp, 0x10] + strb r0, [r1] + ldr r3, [sp, 0x24] + ldrb r0, [r3] + ldr r1, [sp, 0x14] + strb r0, [r1] + ldrb r0, [r5] + ldr r3, [sp, 0x18] + strb r0, [r3] + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C15EC + + thumb_func_start sub_81C171C +sub_81C171C: @ 81C171C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_81C44F0 + movs r0, 0x8 + bl sub_81C4AF8 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81C174C + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C171C + + thumb_func_start sub_81C174C +sub_81C174C: @ 81C174C + push {r4-r6,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 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C176A + b _081C189A +_081C176A: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r2, 0x80 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _081C177A + b _081C189A +_081C177A: + ldr r6, =gMain + ldrh r1, [r6, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081C17B4 + movs r0, 0x4 + strh r0, [r4] + movs r1, 0x1 + negs r1, r1 + ldr r0, =gUnknown_0203CF1C + ldr r2, [r0] + ldr r0, =0x000040c6 + adds r2, r0 + adds r0, r4, 0 + bl sub_81C1070 + b _081C189A + .pool +_081C17B4: + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _081C17DC + movs r0, 0x4 + strh r0, [r4] + ldr r0, =gUnknown_0203CF1C + ldr r2, [r0] + ldr r1, =0x000040c6 + adds r2, r1 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81C1070 + b _081C189A + .pool +_081C17DC: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _081C17F0 + bl GetLRKeysState + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C17FC +_081C17F0: + movs r1, 0x1 + negs r1, r1 + adds r0, r5, 0 + bl sub_81C0A8C + b _081C189A +_081C17FC: + ldrh r1, [r6, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _081C1812 + bl GetLRKeysState + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _081C181C +_081C1812: + adds r0, r5, 0 + movs r1, 0x1 + bl sub_81C0A8C + b _081C189A +_081C181C: + ldrh r1, [r6, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081C1876 + bl sub_81C18A8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C1868 + bl sub_81C48F0 + movs r0, 0x5 + bl PlaySE + ldr r2, =gUnknown_0203CF21 + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =0x000040c6 + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + ldr r1, =gSpecialVar_0x8005 + ldrb r0, [r2] + strh r0, [r1] + adds r0, r5, 0 + bl sub_81C044C + b _081C189A + .pool +_081C1868: + movs r0, 0x20 + bl PlaySE + adds r0, r5, 0 + bl sub_81C18F4 + b _081C189A +_081C1876: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081C189A + bl sub_81C48F0 + movs r0, 0x5 + bl PlaySE + ldr r1, =gUnknown_0203CF21 + movs r0, 0x4 + strb r0, [r1] + ldr r1, =gSpecialVar_0x8005 + movs r0, 0x4 + strh r0, [r1] + adds r0, r5, 0 + bl sub_81C044C +_081C189A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C174C + + thumb_func_start sub_81C18A8 +sub_81C18A8: @ 81C18A8 + push {lr} + ldr r0, =gUnknown_0203CF1C + ldr r2, [r0] + ldr r0, =0x000040c6 + adds r1, r2, r0 + ldrb r0, [r1] + cmp r0, 0x4 + beq _081C18DA + ldr r3, =0x000040c4 + adds r0, r2, r3 + ldrh r0, [r0] + cmp r0, 0 + beq _081C18DA + ldrb r1, [r1] + lsls r1, 1 + adds r0, r2, 0 + adds r0, 0x84 + adds r0, r1 + ldrh r0, [r0] + bl sub_81B6D14 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C18EC +_081C18DA: + movs r0, 0x1 + b _081C18EE + .pool +_081C18EC: + movs r0, 0 +_081C18EE: + pop {r1} + bx r1 + thumb_func_end sub_81C18A8 + + thumb_func_start sub_81C18F4 +sub_81C18F4: @ 81C18F4 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0xE + bl ClearWindowTilemap + movs r0, 0xF + bl ClearWindowTilemap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0 + movs r1, 0x3 + bl sub_81C1DA4 + movs r0, 0 + movs r1, 0x3 + movs r2, 0 + bl sub_81C1EFC + bl sub_81C4154 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81C1940 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C18F4 + + thumb_func_start sub_81C1940 +sub_81C1940: @ 81C1940 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + mov r8, r0 + ldr r0, =gTasks + 0x8 + mov r9, r0 + mov r4, r8 + add r4, r9 + ldr r0, =sub_81C1E20 + bl FuncIsActiveTask + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C196C + b _081C1B74 +_081C196C: + ldr r6, =gMain + ldrh r1, [r6, 0x2E] + movs r0, 0x40 + ands r0, r1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + beq _081C19B0 + movs r0, 0x1 + strh r0, [r4, 0x2] + movs r0, 0x4 + strh r0, [r4] + movs r1, 0x1 + negs r1, r1 + ldr r0, =gUnknown_0203CF1C + ldr r2, [r0] + ldr r0, =0x000040c6 + adds r2, r0 + adds r0, r4, 0 + bl sub_81C1070 + movs r0, 0 + strh r0, [r4, 0x2] + b _081C1B6A + .pool +_081C19B0: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081C19DC + movs r0, 0x1 + strh r0, [r4, 0x2] + movs r0, 0x4 + strh r0, [r4] + ldr r0, =gUnknown_0203CF1C + ldr r2, [r0] + ldr r1, =0x000040c6 + adds r2, r1 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81C1070 + strh r5, [r4, 0x2] + b _081C1B6A + .pool +_081C19DC: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _081C19F0 + bl GetLRKeysState + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C1A64 +_081C19F0: + ldr r4, =gUnknown_0203CF1C + ldr r0, [r4] + ldr r2, =0x000040c0 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0x2 + bne _081C1A00 + b _081C1B74 +_081C1A00: + movs r0, 0x13 + bl ClearWindowTilemap + ldr r2, =gSprites + ldr r0, [r4] + ldr r1, =0x000040d5 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _081C1A28 + movs r0, 0xD + bl ClearWindowTilemap +_081C1A28: + ldr r1, [r4] + ldr r2, =0x000040c6 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 1 + adds r1, 0x84 + adds r1, r0 + ldrh r5, [r1] + mov r0, r9 + subs r0, 0x8 + add r0, r8 + ldr r1, =sub_81C174C + str r1, [r0] + movs r1, 0x1 + negs r1, r1 + adds r0, r7, 0 + b _081C1ACE + .pool +_081C1A64: + ldrh r1, [r6, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _081C1A7A + bl GetLRKeysState + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _081C1B04 +_081C1A7A: + ldr r4, =gUnknown_0203CF1C + ldr r0, [r4] + ldr r1, =0x000040c0 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3 + beq _081C1B74 + movs r0, 0x13 + bl ClearWindowTilemap + ldr r2, =gSprites + ldr r0, [r4] + ldr r1, =0x000040d5 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _081C1AB0 + movs r0, 0xD + bl ClearWindowTilemap +_081C1AB0: + ldr r1, [r4] + ldr r2, =0x000040c6 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 1 + adds r1, 0x84 + adds r1, r0 + ldrh r5, [r1] + mov r0, r9 + subs r0, 0x8 + add r0, r8 + ldr r1, =sub_81C174C + str r1, [r0] + adds r0, r7, 0 + movs r1, 0x1 +_081C1ACE: + bl sub_81C0A8C + movs r4, 0x2 + negs r4, r4 + movs r0, 0x9 + adds r1, r4, 0 + bl sub_81C1DA4 + movs r0, 0x9 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_81C1EFC + b _081C1B74 + .pool +_081C1B04: + ldrh r1, [r6, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081C1B74 + movs r0, 0x13 + bl ClearWindowTilemap + ldr r2, =gSprites + ldr r4, =gUnknown_0203CF1C + ldr r0, [r4] + ldr r1, =0x000040d5 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _081C1B38 + movs r0, 0xD + bl ClearWindowTilemap +_081C1B38: + ldr r1, [r4] + ldr r2, =0x000040c6 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 1 + adds r1, 0x84 + adds r1, r0 + ldrh r5, [r1] + adds r0, r5, 0 + bl sub_81C3E9C + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r4, 0x3 + negs r4, r4 + movs r0, 0x9 + adds r1, r4, 0 + bl sub_81C1DA4 + movs r0, 0x9 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_81C1EFC +_081C1B6A: + mov r0, r9 + subs r0, 0x8 + add r0, r8 + ldr r1, =sub_81C174C + str r1, [r0] +_081C1B74: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C1940 + + thumb_func_start sub_81C1B94 +sub_81C1B94: @ 81C1B94 + ldr r0, =gUnknown_0203CF21 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_81C1B94 + + thumb_func_start sub_81C1BA0 +sub_81C1BA0: @ 81C1BA0 + push {r4-r7,lr} + sub sp, 0xC + movs r0, 0x20 + bl Alloc + adds r4, r0, 0 + movs r5, 0 +_081C1BAE: + lsls r0, r5, 25 + lsrs r1, r0, 24 + adds r6, r1, 0 + ldr r0, =gUnknown_0203CF1C + ldr r3, [r0] + ldr r2, =0x000040c1 + adds r0, r3, r2 + ldrb r0, [r0] + cmp r5, r0 + bcs _081C1BD8 + lsls r0, r1, 1 + adds r0, r4 + movs r1, 0x40 + strh r1, [r0] + strh r1, [r0, 0x2] + movs r1, 0x50 + b _081C1BEE + .pool +_081C1BD8: + ldr r7, =0x000040c2 + adds r0, r3, r7 + ldrb r2, [r0] + cmp r5, r2 + bls _081C1BF8 + lsls r0, r1, 1 + adds r0, r4 + movs r1, 0x4A + strh r1, [r0] + strh r1, [r0, 0x2] + movs r1, 0x5A +_081C1BEE: + strh r1, [r0, 0x10] + strh r1, [r0, 0x12] + b _081C1C78 + .pool +_081C1BF8: + ldr r7, =0x000040c0 + adds r0, r3, r7 + ldrb r0, [r0] + cmp r5, r0 + bcs _081C1C1C + lsls r1, 1 + adds r1, r4 + movs r0, 0x46 + strh r0, [r1] + movs r0, 0x47 + strh r0, [r1, 0x2] + movs r0, 0x56 + strh r0, [r1, 0x10] + movs r0, 0x57 + b _081C1C76 + .pool +_081C1C1C: + cmp r5, r0 + bne _081C1C4C + cmp r5, r2 + beq _081C1C38 + lsls r1, 1 + adds r1, r4 + movs r0, 0x41 + strh r0, [r1] + movs r0, 0x42 + strh r0, [r1, 0x2] + movs r0, 0x51 + strh r0, [r1, 0x10] + movs r0, 0x52 + b _081C1C76 +_081C1C38: + lsls r1, 1 + adds r1, r4 + movs r0, 0x4B + strh r0, [r1] + movs r0, 0x4C + strh r0, [r1, 0x2] + movs r0, 0x5B + strh r0, [r1, 0x10] + movs r0, 0x5C + b _081C1C76 +_081C1C4C: + cmp r5, r2 + beq _081C1C64 + lsls r1, 1 + adds r1, r4 + movs r0, 0x43 + strh r0, [r1] + movs r0, 0x44 + strh r0, [r1, 0x2] + movs r0, 0x53 + strh r0, [r1, 0x10] + movs r0, 0x54 + b _081C1C76 +_081C1C64: + lsls r1, r6, 1 + adds r1, r4 + movs r0, 0x48 + strh r0, [r1] + movs r0, 0x49 + strh r0, [r1, 0x2] + movs r0, 0x58 + strh r0, [r1, 0x10] + movs r0, 0x59 +_081C1C76: + strh r0, [r1, 0x12] +_081C1C78: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _081C1BAE + movs r0, 0x8 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x10 + str r0, [sp, 0x8] + movs r0, 0x3 + adds r1, r4, 0 + movs r2, 0xB + movs r3, 0 + bl CopyToBgTilemapBufferRect_ChangePalette + movs r0, 0x3 + bl schedule_bg_copy_tilemap_to_vram + adds r0, r4, 0 + bl Free + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81C1BA0 + + thumb_func_start sub_81C1CB0 +sub_81C1CB0: @ 81C1CB0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r4, r0, 0 + mov r8, r1 + lsls r2, 24 + lsrs r6, r2, 24 + lsls r3, 24 + lsrs r5, r3, 24 + ldrb r1, [r4, 0x6] + ldrb r0, [r4, 0x7] + lsls r0, 1 + muls r0, r1 + bl Alloc + adds r7, r0, 0 + mov r1, sp + ldrh r0, [r4, 0x4] + strh r0, [r1] + ldrb r1, [r4, 0x7] + ldrb r0, [r4, 0x6] + adds r2, r1, 0 + muls r2, r0 + movs r0, 0x80 + lsls r0, 17 + orrs r2, r0 + mov r0, sp + adds r1, r7, 0 + bl CpuSet + ldrb r0, [r4, 0x6] + cmp r0, r6 + beq _081C1D60 + cmp r5, 0 + bne _081C1D30 + movs r5, 0 + ldrb r0, [r4, 0x7] + cmp r5, r0 + bcs _081C1D60 +_081C1D00: + ldrb r2, [r4, 0x6] + adds r1, r2, 0 + muls r1, r5 + adds r3, r6, r1 + lsls r3, 1 + ldr r0, [r4] + adds r0, r3 + lsls r1, 1 + adds r1, r7, r1 + subs r2, r6 + ldr r3, =0x001fffff + ands r2, r3 + bl CpuSet + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + ldrb r3, [r4, 0x7] + cmp r5, r3 + bcc _081C1D00 + b _081C1D60 + .pool +_081C1D30: + movs r5, 0 + ldrb r0, [r4, 0x7] + cmp r5, r0 + bcs _081C1D60 +_081C1D38: + ldrb r2, [r4, 0x6] + adds r1, r2, 0 + muls r1, r5 + lsls r3, r1, 1 + ldr r0, [r4] + adds r0, r3 + adds r1, r6, r1 + lsls r1, 1 + adds r1, r7, r1 + subs r2, r6 + ldr r3, =0x001fffff + ands r2, r3 + bl CpuSet + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + ldrb r3, [r4, 0x7] + cmp r5, r3 + bcc _081C1D38 +_081C1D60: + movs r5, 0 + b _081C1D8A + .pool +_081C1D68: + ldrb r2, [r4, 0x6] + adds r0, r2, 0 + muls r0, r5 + lsls r0, 1 + adds r0, r7, r0 + ldrb r1, [r4, 0x9] + adds r1, r5 + lsls r1, 5 + ldrb r3, [r4, 0x8] + adds r1, r3 + lsls r1, 1 + add r1, r8 + bl CpuSet + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_081C1D8A: + ldrb r0, [r4, 0x7] + cmp r5, r0 + bcc _081C1D68 + adds r0, r7, 0 + bl Free + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81C1CB0 + + thumb_func_start sub_81C1DA4 +sub_81C1DA4: @ 81C1DA4 + push {r4-r6,lr} + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 16 + lsrs r4, r1, 16 + asrs r1, 16 + ldr r3, =gUnknown_0861CC04 + ldrb r2, [r3, 0x6] + cmp r1, r2 + ble _081C1DBA + adds r4, r2, 0 +_081C1DBA: + lsls r0, r4, 16 + asrs r0, 16 + cmp r0, 0 + beq _081C1DC6 + cmp r0, r2 + bne _081C1DE8 +_081C1DC6: + ldr r0, =gUnknown_0203CF1C + ldr r1, [r0] + ldr r0, =0x000020bc + adds r1, r0 + lsls r2, r4, 24 + lsrs r2, 24 + adds r0, r3, 0 + movs r3, 0x1 + bl sub_81C1CB0 + b _081C1E12 + .pool +_081C1DE8: + ldr r5, =sub_81C1E20 + adds r0, r5, 0 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + bne _081C1E04 + adds r0, r5, 0 + movs r1, 0x8 + bl CreateTask + lsls r0, 24 + lsrs r2, r0, 24 +_081C1E04: + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + strh r4, [r0, 0x8] + strh r6, [r0, 0xA] +_081C1E12: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C1DA4 + + thumb_func_start sub_81C1E20 +sub_81C1E20: @ 81C1E20 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + ldrh r0, [r4] + ldrh r1, [r4, 0x2] + adds r0, r1 + strh r0, [r4, 0x2] + lsls r0, 16 + cmp r0, 0 + bge _081C1E50 + movs r0, 0 + strh r0, [r4, 0x2] + ldr r7, =gUnknown_0861CC04 + b _081C1E60 + .pool +_081C1E50: + movs r0, 0x2 + ldrsh r1, [r4, r0] + ldr r0, =gUnknown_0861CC04 + ldrb r2, [r0, 0x6] + adds r7, r0, 0 + cmp r1, r2 + ble _081C1E60 + strh r2, [r4, 0x2] +_081C1E60: + ldr r5, =gUnknown_0203CF1C + ldr r1, [r5] + ldr r0, =0x000020bc + adds r1, r0 + ldrb r2, [r4, 0x2] + adds r0, r7, 0 + movs r3, 0x1 + bl sub_81C1CB0 + movs r1, 0x2 + ldrsh r0, [r4, r1] + cmp r0, 0 + ble _081C1E80 + ldrb r7, [r7, 0x6] + cmp r0, r7 + blt _081C1EE0 +_081C1E80: + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + bge _081C1EAC + ldr r0, [r5] + ldr r1, =0x000040c0 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x2 + bne _081C1ED4 + movs r0, 0xE + bl PutWindowTilemap + b _081C1ED4 + .pool +_081C1EAC: + ldr r2, =gSprites + ldr r0, [r5] + ldr r1, =0x000040d5 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _081C1ECE + movs r0, 0xD + bl PutWindowTilemap +_081C1ECE: + movs r0, 0x13 + bl PutWindowTilemap +_081C1ED4: + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + adds r0, r6, 0 + bl DestroyTask +_081C1EE0: + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C1E20 + + thumb_func_start sub_81C1EFC +sub_81C1EFC: @ 81C1EFC + push {r4-r7,lr} + lsls r0, 16 + lsrs r7, r0, 16 + lsls r1, 16 + lsls r2, 16 + lsrs r6, r2, 16 + lsrs r4, r1, 16 + asrs r1, 16 + ldr r3, =gUnknown_0861CC10 + ldrb r2, [r3, 0x6] + cmp r1, r2 + ble _081C1F16 + adds r4, r2, 0 +_081C1F16: + lsls r0, r4, 16 + asrs r0, 16 + cmp r0, 0 + beq _081C1F22 + cmp r0, r2 + bne _081C1F44 +_081C1F22: + ldr r0, =gUnknown_0203CF1C + ldr r1, [r0] + ldr r0, =0x000030bc + adds r1, r0 + lsls r2, r4, 24 + lsrs r2, 24 + adds r0, r3, 0 + movs r3, 0x1 + bl sub_81C1CB0 + b _081C1F70 + .pool +_081C1F44: + ldr r5, =sub_81C1F80 + adds r0, r5, 0 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + bne _081C1F60 + adds r0, r5, 0 + movs r1, 0x8 + bl CreateTask + lsls r0, 24 + lsrs r2, r0, 24 +_081C1F60: + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + strh r4, [r0, 0x8] + strh r7, [r0, 0xA] + strh r6, [r0, 0xC] +_081C1F70: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C1EFC + + thumb_func_start sub_81C1F80 +sub_81C1F80: @ 81C1F80 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + ldrh r0, [r4] + ldrh r1, [r4, 0x2] + adds r0, r1 + strh r0, [r4, 0x2] + lsls r0, 16 + cmp r0, 0 + bge _081C1FB0 + movs r0, 0 + strh r0, [r4, 0x2] + ldr r7, =gUnknown_0861CC10 + b _081C1FC0 + .pool +_081C1FB0: + movs r0, 0x2 + ldrsh r1, [r4, r0] + ldr r0, =gUnknown_0861CC10 + ldrb r2, [r0, 0x6] + adds r7, r0, 0 + cmp r1, r2 + ble _081C1FC0 + strh r2, [r4, 0x2] +_081C1FC0: + ldr r5, =gUnknown_0203CF1C + ldr r1, [r5] + ldr r0, =0x000030bc + adds r1, r0 + ldrb r2, [r4, 0x2] + adds r0, r7, 0 + movs r3, 0x1 + bl sub_81C1CB0 + movs r1, 0x2 + ldrsh r0, [r4, r1] + cmp r0, 0 + ble _081C1FE0 + ldrb r7, [r7, 0x6] + cmp r0, r7 + blt _081C2058 +_081C1FE0: + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + bge _081C2024 + ldr r0, [r5] + ldr r1, =0x000040c0 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3 + bne _081C2006 + ldr r0, =sub_81C0B8C + bl FuncIsActiveTask + lsls r0, 24 + cmp r0, 0 + bne _081C2006 + movs r0, 0xF + bl PutWindowTilemap +_081C2006: + ldrh r0, [r4, 0x4] + bl sub_81C240C + b _081C204C + .pool +_081C2024: + ldr r2, =gSprites + ldr r0, [r5] + ldr r1, =0x000040d5 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _081C2046 + movs r0, 0xD + bl PutWindowTilemap +_081C2046: + movs r0, 0x13 + bl PutWindowTilemap +_081C204C: + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + adds r0, r6, 0 + bl DestroyTask +_081C2058: + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C1F80 + + thumb_func_start sub_81C2074 +sub_81C2074: @ 81C2074 + push {r4,r5,lr} + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 16 + lsrs r4, r1, 16 + asrs r1, 16 + ldr r3, =gUnknown_0861CBEC + ldrb r2, [r3, 0x6] + cmp r1, r2 + ble _081C208A + adds r4, r2, 0 +_081C208A: + lsls r0, r4, 16 + asrs r0, 16 + cmp r0, 0 + beq _081C2096 + cmp r0, r2 + bne _081C20C8 +_081C2096: + ldr r5, =gUnknown_0203CF1C + ldr r1, [r5] + adds r1, 0xBC + lsls r4, 24 + lsrs r4, 24 + adds r0, r3, 0 + adds r2, r4, 0 + movs r3, 0 + bl sub_81C1CB0 + ldr r0, =gUnknown_0861CBF8 + ldr r1, [r5] + adds r1, 0xBC + adds r2, r4, 0 + movs r3, 0 + bl sub_81C1CB0 + b _081C20E2 + .pool +_081C20C8: + ldr r0, =sub_81C20F0 + movs r1, 0x8 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + strh r5, [r1, 0xA] +_081C20E2: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C2074 + + thumb_func_start sub_81C20F0 +sub_81C20F0: @ 81C20F0 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r5, r0, r1 + ldrh r0, [r5] + ldrh r1, [r5, 0x2] + adds r0, r1 + strh r0, [r5, 0x2] + lsls r0, 16 + cmp r0, 0 + bge _081C2120 + movs r0, 0 + strh r0, [r5, 0x2] + ldr r7, =gUnknown_0861CBEC + b _081C2130 + .pool +_081C2120: + movs r0, 0x2 + ldrsh r1, [r5, r0] + ldr r0, =gUnknown_0861CBEC + ldrb r2, [r0, 0x6] + adds r7, r0, 0 + cmp r1, r2 + ble _081C2130 + strh r2, [r5, 0x2] +_081C2130: + ldr r4, =gUnknown_0203CF1C + ldr r1, [r4] + adds r1, 0xBC + ldrb r2, [r5, 0x2] + adds r0, r7, 0 + movs r3, 0 + bl sub_81C1CB0 + ldr r0, =gUnknown_0861CBF8 + ldr r1, [r4] + adds r1, 0xBC + ldrb r2, [r5, 0x2] + movs r3, 0 + bl sub_81C1CB0 + movs r0, 0x3 + bl schedule_bg_copy_tilemap_to_vram + movs r1, 0x2 + ldrsh r0, [r5, r1] + cmp r0, 0 + ble _081C2162 + ldrb r7, [r7, 0x6] + cmp r0, r7 + blt _081C2180 +_081C2162: + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0 + bge _081C217A + bl sub_81C4A88 + movs r0, 0xD + bl PutWindowTilemap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram +_081C217A: + adds r0, r6, 0 + bl DestroyTask +_081C2180: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C20F0 + + thumb_func_start sub_81C2194 +sub_81C2194: @ 81C2194 + push {r4-r7,lr} + adds r6, r0, 0 + lsls r2, 24 + lsls r1, 28 + lsrs r4, r1, 16 + ldr r7, =0x0000056a + cmp r2, 0 + bne _081C21E4 + movs r3, 0 + ldr r5, =gUnknown_08DC3CD4 +_081C21A8: + adds r2, r7, r3 + lsls r2, 1 + adds r2, r6 + lsls r0, r3, 1 + adds r0, r5 + ldrh r1, [r0] + adds r1, r4, r1 + strh r1, [r2] + adds r0, r2, 0 + adds r0, 0x40 + strh r1, [r0] + adds r2, 0x80 + adds r0, r3, 0 + adds r0, 0x14 + lsls r0, 1 + adds r0, r5 + ldrh r0, [r0] + adds r0, r4, r0 + strh r0, [r2] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x13 + bls _081C21A8 + b _081C221C + .pool +_081C21E4: + movs r3, 0 + ldr r5, =gUnknown_08DC3CD4 +_081C21E8: + adds r1, r7, r3 + lsls r1, 1 + adds r1, r6 + adds r0, r3, 0 + adds r0, 0x14 + lsls r0, 1 + adds r0, r5 + ldrh r0, [r0] + adds r0, r4, r0 + strh r0, [r1] + adds r2, r1, 0 + adds r2, 0x40 + adds r0, r3, 0 + adds r0, 0x28 + lsls r0, 1 + adds r0, r5 + ldrh r0, [r0] + adds r0, r4, r0 + strh r0, [r2] + adds r1, 0x80 + strh r0, [r1] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x13 + bls _081C21E8 +_081C221C: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C2194 + + thumb_func_start sub_81C2228 +sub_81C2228: @ 81C2228 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0 + bl CheckPartyPokerus + lsls r0, 24 + cmp r0, 0 + bne _081C225C + adds r0, r4, 0 + movs r1, 0 + bl CheckPartyHasHadPokerus + lsls r0, 24 + cmp r0, 0 + beq _081C225C + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r2, =0x00000502 + adds r1, r0, r2 + movs r2, 0x2C + b _081C2266 + .pool +_081C225C: + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r2, =0x00000502 + adds r1, r0, r2 + ldr r2, =0x0000081a +_081C2266: + strh r2, [r1] + ldr r1, =0x00000d02 + adds r0, r1 + strh r2, [r0] + movs r0, 0x3 + bl schedule_bg_copy_tilemap_to_vram + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C2228 + + thumb_func_start sub_81C228C +sub_81C228C: @ 81C228C + push {lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _081C22AC + movs r0, 0x8 + str r0, [sp] + str r1, [sp, 0x4] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0x4 + movs r3, 0x8 + bl sub_8199C30 + b _081C22C0 +_081C22AC: + movs r0, 0x8 + str r0, [sp] + movs r0, 0x5 + str r0, [sp, 0x4] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0x4 + movs r3, 0x8 + bl sub_8199C30 +_081C22C0: + movs r0, 0x3 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x8 + pop {r0} + bx r0 + thumb_func_end sub_81C228C + + thumb_func_start sub_81C22CC +sub_81C22CC: @ 81C22CC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =gUnknown_0203CF1C + ldr r1, [r0] + adds r6, r1, 0 + adds r6, 0x70 + ldrb r1, [r6, 0x5] + mov r8, r0 + cmp r1, 0x63 + bhi _081C2340 + ldr r5, =gExperienceTables + adds r2, r1, 0 + adds r1, r2, 0x1 + lsls r1, 2 + ldr r4, =gBaseStats + ldrh r3, [r6] + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r4 + ldrb r3, [r0, 0x13] + movs r0, 0xCA + lsls r0, 1 + muls r0, r3 + adds r1, r0 + adds r1, r5 + lsls r2, 2 + adds r2, r0 + adds r2, r5 + ldr r1, [r1] + ldr r2, [r2] + subs r1, r2 + ldr r0, [r6, 0x10] + subs r4, r0, r2 + lsls r0, r4, 6 + bl __udivsi3 + adds r6, r0, 0 + movs r7, 0 + adds r0, r7, 0 + orrs r0, r6 + cmp r0, 0 + bne _081C2344 + cmp r4, 0 + beq _081C2344 + movs r6, 0x1 + movs r7, 0 + b _081C2344 + .pool +_081C2340: + movs r6, 0 + movs r7, 0 +_081C2344: + mov r1, r8 + ldr r0, [r1] + ldr r2, =0x00001d66 + adds r2, r0 + mov r9, r2 + movs r0, 0 + mov r12, r0 + ldr r1, =0x00002062 + mov r10, r1 +_081C2356: + cmp r7, 0 + bgt _081C2362 + cmp r7, 0 + bne _081C237C + cmp r6, 0x7 + bls _081C237C +_081C2362: + mov r2, r12 + lsls r0, r2, 1 + add r0, r9 + ldr r2, =0x0000206a + adds r1, r2, 0 + strh r1, [r0] + b _081C23B6 + .pool +_081C237C: + mov r1, r12 + lsls r0, r1, 1 + add r0, r9 + mov r8, r0 + adds r5, r7, 0 + adds r4, r6, 0 + cmp r7, 0 + bge _081C2394 + movs r4, 0x7 + movs r5, 0 + adds r4, r6 + adcs r5, r7 +_081C2394: + lsls r3, r5, 29 + lsrs r2, r4, 3 + adds r0, r3, 0 + orrs r0, r2 + asrs r1, r5, 3 + lsrs r5, r0, 29 + lsls r4, r1, 3 + adds r3, r5, 0 + orrs r3, r4 + lsls r2, r0, 3 + adds r1, r7, 0 + adds r0, r6, 0 + subs r0, r2 + sbcs r1, r3 + add r0, r10 + mov r2, r8 + strh r0, [r2] +_081C23B6: + movs r0, 0x8 + negs r0, r0 + asrs r1, r0, 31 + adds r6, r0 + adcs r7, r1 + cmp r7, 0 + bge _081C23C8 + movs r6, 0 + movs r7, 0 +_081C23C8: + mov r0, r12 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r12, r0 + cmp r0, 0x7 + bls _081C2356 + movs r0, 0x1 + bl GetBgTilemapBuffer + ldr r1, =gUnknown_0203CF1C + ldr r1, [r1] + ldr r2, =0x000010bc + adds r1, r2 + cmp r0, r1 + bne _081C23F8 + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + b _081C23FE + .pool +_081C23F8: + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram +_081C23FE: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81C22CC + + thumb_func_start sub_81C240C +sub_81C240C: @ 81C240C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 16 + lsrs r3, r0, 16 + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =0x000038bc + adds r5, r0, r1 + cmp r3, 0 + beq _081C2510 + ldr r1, =gContestEffects + ldr r2, =gContestMoves + lsls r3, 3 + adds r0, r3, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldrb r4, [r0, 0x1] + mov r9, r1 + mov r8, r2 + mov r10, r3 + cmp r4, 0xFF + beq _081C244C + adds r0, r4, 0 + movs r1, 0xA + bl __udivsi3 + lsls r0, 24 + lsrs r4, r0, 24 +_081C244C: + movs r2, 0 + movs r6, 0x3 + movs r3, 0xF3 + lsls r3, 2 +_081C2454: + cmp r4, 0xFF + beq _081C2484 + cmp r2, r4 + bcs _081C2484 + lsrs r0, r2, 2 + adds r1, r2, 0 + ands r1, r6 + lsls r0, 5 + adds r0, r1 + lsls r0, 1 + adds r0, r5 + adds r0, r3 + ldr r7, =0x0000103a + b _081C2496 + .pool +_081C2484: + lsrs r0, r2, 2 + adds r1, r2, 0 + ands r1, r6 + lsls r0, 5 + adds r0, r1 + lsls r0, 1 + adds r0, r5 + adds r0, r3 + ldr r7, =0x00001039 +_081C2496: + adds r1, r7, 0 + strh r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x7 + bls _081C2454 + mov r0, r10 + add r0, r8 + ldrb r0, [r0] + lsls r0, 2 + add r0, r9 + ldrb r4, [r0, 0x2] + cmp r4, 0xFF + beq _081C24C0 + adds r0, r4, 0 + movs r1, 0xA + bl __udivsi3 + lsls r0, 24 + lsrs r4, r0, 24 +_081C24C0: + movs r2, 0 + movs r6, 0x3 + ldr r3, =0x0000044c +_081C24C6: + cmp r4, 0xFF + beq _081C24F0 + cmp r2, r4 + bcs _081C24F0 + lsrs r0, r2, 2 + adds r1, r2, 0 + ands r1, r6 + lsls r0, 5 + adds r0, r1 + lsls r0, 1 + adds r0, r5 + adds r0, r3 + ldr r7, =0x0000103c + b _081C2502 + .pool +_081C24F0: + lsrs r0, r2, 2 + adds r1, r2, 0 + ands r1, r6 + lsls r0, 5 + adds r0, r1 + lsls r0, 1 + adds r0, r5 + adds r0, r3 + ldr r7, =0x0000103d +_081C2502: + adds r1, r7, 0 + strh r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x7 + bls _081C24C6 +_081C2510: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C240C + + thumb_func_start sub_81C2524 +sub_81C2524: @ 81C2524 + push {lr} + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + adds r0, 0x74 + ldrb r0, [r0] + cmp r0, 0 + beq _081C2544 + movs r1, 0x80 + lsls r1, 9 + movs r0, 0x3 + movs r2, 0 + bl ChangeBgX + b _081C254E + .pool +_081C2544: + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgX +_081C254E: + pop {r0} + bx r0 + thumb_func_end sub_81C2524 + + thumb_func_start sub_81C2554 +sub_81C2554: @ 81C2554 + push {r4,r5,lr} + ldr r0, =gUnknown_0861CC24 + bl InitWindows + bl DeactivateAllTextPrinters + movs r4, 0 +_081C2562: + adds r0, r4, 0 + movs r1, 0 + bl FillWindowPixelBuffer + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x13 + bls _081C2562 + movs r4, 0 + ldr r5, =gUnknown_0203CF1C + ldr r3, =0x000040cb + movs r2, 0xFF +_081C257C: + ldr r0, [r5] + adds r0, r3 + adds r0, r4 + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _081C257C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C2554 + + thumb_func_start sub_81C25A4 +sub_81C25A4: @ 81C25A4 + push {r4-r6,lr} + sub sp, 0x14 + ldr r4, [sp, 0x24] + ldr r5, [sp, 0x28] + lsls r0, 24 + lsrs r0, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + movs r6, 0 + str r6, [sp] + str r4, [sp, 0x4] + lsls r4, r5, 1 + adds r4, r5 + ldr r5, =gUnknown_0861CD2C + adds r4, r5 + str r4, [sp, 0x8] + str r6, [sp, 0xC] + str r1, [sp, 0x10] + movs r1, 0x1 + bl AddTextPrinterParametrized2 + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C25A4 + + thumb_func_start sub_81C25E8 +sub_81C25E8: @ 81C25E8 + push {lr} + movs r0, 0x11 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x12 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x13 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + adds r0, 0x74 + ldrb r0, [r0] + cmp r0, 0 + bne _081C2618 + bl sub_81C2628 + b _081C261C + .pool +_081C2618: + bl sub_81C2794 +_081C261C: + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + pop {r0} + bx r0 + thumb_func_end sub_81C25E8 + + thumb_func_start sub_81C2628 +sub_81C2628: @ 81C2628 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x18 + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + movs r1, 0xC + adds r1, r0 + mov r8, r1 + adds r7, r0, 0 + adds r7, 0x70 + ldrh r0, [r7] + bl SpeciesToPokedexNum + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, =0x0000ffff + cmp r5, r0 + beq _081C26CE + ldr r6, =gStringVar1 + ldr r1, =gText_UnkCtrlF908Clear01 + adds r0, r6, 0 + bl StringCopy + ldr r4, =gStringVar2 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x2 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + adds r0, r6, 0 + adds r1, r4, 0 + bl StringAppend + mov r0, r8 + bl IsMonShiny + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _081C26AC + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r0, 0x11 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_81C25A4 + movs r0, 0 + bl sub_81C228C + b _081C26C6 + .pool +_081C26AC: + movs r0, 0 + str r0, [sp] + movs r0, 0x7 + str r0, [sp, 0x4] + movs r0, 0x11 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_81C25A4 + movs r0, 0x1 + bl sub_81C228C +_081C26C6: + movs r0, 0x11 + bl PutWindowTilemap + b _081C26EE +_081C26CE: + movs r0, 0x11 + bl ClearWindowTilemap + mov r0, r8 + bl IsMonShiny + lsls r0, 24 + cmp r0, 0 + bne _081C26E8 + movs r0, 0 + bl sub_81C228C + b _081C26EE +_081C26E8: + movs r0, 0x1 + bl sub_81C228C +_081C26EE: + ldr r4, =gStringVar1 + ldr r1, =gText_LevelSymbol + adds r0, r4, 0 + bl StringCopy + ldr r5, =gStringVar2 + ldrb r1, [r7, 0x5] + adds r0, r5, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + adds r0, r4, 0 + adds r1, r5, 0 + bl StringAppend + movs r6, 0 + str r6, [sp] + movs r5, 0x1 + str r5, [sp, 0x4] + movs r0, 0x13 + adds r1, r4, 0 + movs r2, 0x18 + movs r3, 0x11 + bl sub_81C25A4 + mov r0, r8 + adds r1, r4, 0 + bl GetMonNickname + str r6, [sp] + str r5, [sp, 0x4] + movs r0, 0x12 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_81C25A4 + add r1, sp, 0x8 + movs r0, 0xBA + strb r0, [r1] + mov r0, sp + adds r0, 0x9 + ldrh r2, [r7, 0x2] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl StringCopy + str r6, [sp] + str r5, [sp, 0x4] + movs r0, 0x13 + add r1, sp, 0x8 + movs r2, 0 + movs r3, 0x1 + bl sub_81C25A4 + ldrh r1, [r7, 0x2] + mov r0, r8 + bl sub_81C27DC + movs r0, 0x12 + bl PutWindowTilemap + movs r0, 0x13 + bl PutWindowTilemap + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C2628 + + thumb_func_start sub_81C2794 +sub_81C2794: @ 81C2794 + push {r4,lr} + sub sp, 0x8 + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + adds r0, 0xC + ldr r4, =gStringVar1 + adds r1, r4, 0 + bl GetMonNickname + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r0, 0x12 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_81C25A4 + movs r0, 0x12 + bl PutWindowTilemap + movs r0, 0x11 + bl ClearWindowTilemap + movs r0, 0x13 + bl ClearWindowTilemap + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C2794 + + thumb_func_start sub_81C27DC +sub_81C27DC: @ 81C27DC + push {lr} + sub sp, 0x8 + lsls r1, 16 + lsrs r1, 16 + cmp r1, 0x20 + beq _081C282C + cmp r1, 0x1D + beq _081C282C + bl GetMonGender + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _081C27FE + cmp r0, 0xFE + beq _081C2818 + b _081C282C +_081C27FE: + ldr r1, =gText_MaleSymbol + str r0, [sp] + movs r0, 0x3 + str r0, [sp, 0x4] + movs r0, 0x13 + movs r2, 0x39 + movs r3, 0x11 + bl sub_81C25A4 + b _081C282C + .pool +_081C2818: + ldr r1, =gText_FemaleSymbol + movs r0, 0 + str r0, [sp] + movs r0, 0x4 + str r0, [sp, 0x4] + movs r0, 0x13 + movs r2, 0x39 + movs r3, 0x11 + bl sub_81C25A4 +_081C282C: + add sp, 0x8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C27DC + + thumb_func_start sub_81C2838 +sub_81C2838: @ 81C2838 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + ldr r3, =gUnknown_0861CDD3 + cmp r1, 0 + bne _081C284A + subs r3, 0x80 +_081C284A: + lsls r2, 16 + lsrs r2, 16 + movs r0, 0x10 + str r0, [sp] + str r0, [sp, 0x4] + adds r0, r4, 0 + adds r1, r3, 0 + movs r3, 0 + bl BlitBitmapToWindow + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C2838 + + thumb_func_start sub_81C286C +sub_81C286C: @ 81C286C + push {r4-r7,lr} + sub sp, 0x8 + ldr r1, =gUnknown_085EA3CF + movs r5, 0 + str r5, [sp] + movs r6, 0x1 + str r6, [sp, 0x4] + movs r0, 0 + movs r2, 0x2 + movs r3, 0x1 + bl sub_81C25A4 + ldr r1, =gUnknown_085EA3DC + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0x1 + movs r2, 0x2 + movs r3, 0x1 + bl sub_81C25A4 + ldr r1, =gUnknown_085EA3EB + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0x2 + movs r2, 0x2 + movs r3, 0x1 + bl sub_81C25A4 + ldr r1, =gUnknown_085EA3F8 + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0x3 + movs r2, 0x2 + movs r3, 0x1 + bl sub_81C25A4 + ldr r7, =gText_Cancel2 + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0x3E + bl GetStringRightAlignXOffset + adds r4, r0, 0 + adds r2, r4, 0 + subs r2, 0x10 + cmp r2, 0 + bge _081C28CC + movs r2, 0 +_081C28CC: + movs r0, 0x4 + movs r1, 0 + bl sub_81C2838 + lsls r2, r4, 24 + lsrs r2, 24 + str r5, [sp] + str r5, [sp, 0x4] + movs r0, 0x4 + adds r1, r7, 0 + movs r3, 0x1 + bl sub_81C25A4 + ldr r7, =gUnknown_085EA406 + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0x3E + bl GetStringRightAlignXOffset + adds r4, r0, 0 + adds r2, r4, 0 + subs r2, 0x10 + cmp r2, 0 + bge _081C28FE + movs r2, 0 +_081C28FE: + movs r0, 0x5 + movs r1, 0 + bl sub_81C2838 + lsls r2, r4, 24 + lsrs r2, 24 + str r5, [sp] + str r5, [sp, 0x4] + movs r0, 0x5 + adds r1, r7, 0 + movs r3, 0x1 + bl sub_81C25A4 + ldr r7, =gUnknown_085EA3C8 + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0x3E + bl GetStringRightAlignXOffset + adds r4, r0, 0 + adds r2, r4, 0 + subs r2, 0x10 + cmp r2, 0 + bge _081C2930 + movs r2, 0 +_081C2930: + movs r0, 0x6 + movs r1, 0 + bl sub_81C2838 + lsls r2, r4, 24 + lsrs r2, 24 + str r5, [sp] + str r5, [sp, 0x4] + movs r0, 0x6 + adds r1, r7, 0 + movs r3, 0x1 + bl sub_81C25A4 + ldr r1, =gUnknown_085EA369 + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0x8 + movs r2, 0 + movs r3, 0x1 + bl sub_81C25A4 + ldr r1, =gUnknown_085EA378 + str r5, [sp] + str r5, [sp, 0x4] + movs r0, 0x9 + movs r2, 0 + movs r3, 0x1 + bl sub_81C25A4 + ldr r4, =gUnknown_085EA361 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x2A + bl GetStringCenterAlignXOffset + adds r0, 0x6 + lsls r2, r0, 24 + lsrs r2, 24 + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0xA + adds r1, r4, 0 + movs r3, 0x1 + bl sub_81C25A4 + ldr r4, =gUnknown_085EA33C + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x2A + bl GetStringCenterAlignXOffset + adds r0, 0x6 + lsls r2, r0, 24 + lsrs r2, 24 + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0xA + adds r1, r4, 0 + movs r3, 0x11 + bl sub_81C25A4 + ldr r4, =gUnknown_085EA343 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x2A + bl GetStringCenterAlignXOffset + adds r0, 0x6 + lsls r2, r0, 24 + lsrs r2, 24 + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0xA + adds r1, r4, 0 + movs r3, 0x21 + bl sub_81C25A4 + ldr r4, =gUnknown_085EA34B + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x24 + bl GetStringCenterAlignXOffset + adds r0, 0x2 + lsls r2, r0, 24 + lsrs r2, 24 + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0xB + adds r1, r4, 0 + movs r3, 0x1 + bl sub_81C25A4 + ldr r4, =gUnknown_085EA353 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x24 + bl GetStringCenterAlignXOffset + adds r0, 0x2 + lsls r2, r0, 24 + lsrs r2, 24 + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0xB + adds r1, r4, 0 + movs r3, 0x11 + bl sub_81C25A4 + ldr r4, =gUnknown_085EA35B + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x24 + bl GetStringCenterAlignXOffset + adds r0, 0x2 + lsls r2, r0, 24 + lsrs r2, 24 + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0xB + adds r1, r4, 0 + movs r3, 0x21 + bl sub_81C25A4 + ldr r1, =gUnknown_085EA39F + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0xC + movs r2, 0x6 + movs r3, 0x1 + bl sub_81C25A4 + ldr r1, =gUnknown_085EA3AB + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0xC + movs r2, 0x6 + movs r3, 0x11 + bl sub_81C25A4 + ldr r1, =gUnknown_085EA398 + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0xD + movs r2, 0x2 + movs r3, 0x1 + bl sub_81C25A4 + ldr r1, =gUnknown_085EA37E + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0xE + movs r2, 0 + movs r3, 0x1 + bl sub_81C25A4 + ldr r1, =gUnknown_085EA384 + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0xE + movs r2, 0 + movs r3, 0x11 + bl sub_81C25A4 + ldr r1, =gUnknown_085EA38D + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0xF + movs r2, 0 + movs r3, 0x1 + bl sub_81C25A4 + ldr r1, =gUnknown_085EA394 + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0xF + movs r2, 0 + movs r3, 0x11 + bl sub_81C25A4 + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C286C + + thumb_func_start sub_81C2AFC +sub_81C2AFC: @ 81C2AFC + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + movs r0, 0 + bl ClearWindowTilemap + movs r0, 0x1 + bl ClearWindowTilemap + movs r0, 0x2 + bl ClearWindowTilemap + movs r0, 0x3 + bl ClearWindowTilemap + cmp r4, 0x1 + beq _081C2B66 + cmp r4, 0x1 + bgt _081C2B2A + cmp r4, 0 + beq _081C2B34 + b _081C2C06 +_081C2B2A: + cmp r5, 0x2 + beq _081C2B80 + cmp r5, 0x3 + beq _081C2BC4 + b _081C2C06 +_081C2B34: + movs r0, 0 + bl PutWindowTilemap + movs r0, 0x4 + bl PutWindowTilemap + bl sub_81A6BF4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C2B58 + bl sub_81B9E94 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C2B5E +_081C2B58: + movs r0, 0x8 + bl PutWindowTilemap +_081C2B5E: + movs r0, 0x9 + bl PutWindowTilemap + b _081C2C06 +_081C2B66: + movs r0, 0x1 + bl PutWindowTilemap + movs r0, 0xA + bl PutWindowTilemap + movs r0, 0xB + bl PutWindowTilemap + movs r0, 0xC + bl PutWindowTilemap + b _081C2C06 +_081C2B80: + movs r0, 0x2 + bl PutWindowTilemap + ldr r0, =gUnknown_0203CF1C + ldr r1, [r0] + ldr r2, =0x000040bc + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x3 + bne _081C2BBC + adds r2, 0x8 + adds r0, r1, r2 + ldr r0, [r0] + ldr r1, =0x00ffffff + ands r0, r1 + movs r1, 0x80 + lsls r1, 11 + cmp r0, r1 + beq _081C2C06 + movs r0, 0xE + bl PutWindowTilemap + b _081C2C06 + .pool +_081C2BBC: + movs r0, 0x5 + bl PutWindowTilemap + b _081C2C06 +_081C2BC4: + movs r0, 0x3 + bl PutWindowTilemap + ldr r0, =gUnknown_0203CF1C + ldr r1, [r0] + ldr r2, =0x000040bc + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x3 + bne _081C2C00 + adds r2, 0x8 + adds r0, r1, r2 + ldr r0, [r0] + ldr r1, =0x00ffffff + ands r0, r1 + movs r1, 0x80 + lsls r1, 11 + cmp r0, r1 + beq _081C2C06 + movs r0, 0xF + bl PutWindowTilemap + b _081C2C06 + .pool +_081C2C00: + movs r0, 0x5 + bl PutWindowTilemap +_081C2C06: + movs r4, 0 + ldr r5, =gUnknown_0203CF1C +_081C2C0A: + ldr r0, [r5] + ldr r1, =0x000040cb + adds r0, r1 + adds r0, r4 + ldrb r0, [r0] + bl PutWindowTilemap + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _081C2C0A + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C2AFC + + thumb_func_start sub_81C2C38 +sub_81C2C38: @ 81C2C38 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x1 + beq _081C2C84 + cmp r0, 0x1 + bgt _081C2C4E + cmp r0, 0 + beq _081C2C58 + b _081C2D0E +_081C2C4E: + cmp r1, 0x2 + beq _081C2C98 + cmp r1, 0x3 + beq _081C2CD4 + b _081C2D0E +_081C2C58: + movs r0, 0x4 + bl ClearWindowTilemap + bl sub_81A6BF4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C2C76 + bl sub_81B9E94 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C2C7C +_081C2C76: + movs r0, 0x8 + bl ClearWindowTilemap +_081C2C7C: + movs r0, 0x9 + bl ClearWindowTilemap + b _081C2D0E +_081C2C84: + movs r0, 0xA + bl ClearWindowTilemap + movs r0, 0xB + bl ClearWindowTilemap + movs r0, 0xC + bl ClearWindowTilemap + b _081C2D0E +_081C2C98: + ldr r0, =gUnknown_0203CF1C + ldr r1, [r0] + ldr r2, =0x000040bc + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x3 + bne _081C2CCC + adds r2, 0x8 + adds r0, r1, r2 + ldr r0, [r0] + ldr r1, =0x00ffffff + ands r0, r1 + movs r1, 0x80 + lsls r1, 11 + cmp r0, r1 + beq _081C2D0E + movs r0, 0xE + bl ClearWindowTilemap + b _081C2D0E + .pool +_081C2CCC: + movs r0, 0x5 + bl ClearWindowTilemap + b _081C2D0E +_081C2CD4: + ldr r0, =gUnknown_0203CF1C + ldr r1, [r0] + ldr r2, =0x000040bc + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x3 + bne _081C2D08 + adds r2, 0x8 + adds r0, r1, r2 + ldr r0, [r0] + ldr r1, =0x00ffffff + ands r0, r1 + movs r1, 0x80 + lsls r1, 11 + cmp r0, r1 + beq _081C2D0E + movs r0, 0xF + bl ClearWindowTilemap + b _081C2D0E + .pool +_081C2D08: + movs r0, 0x5 + bl ClearWindowTilemap +_081C2D0E: + movs r4, 0 +_081C2D10: + adds r0, r4, 0 + bl sub_81C2D68 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _081C2D10 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81C2C38 + + thumb_func_start sub_81C2D2C +sub_81C2D2C: @ 81C2D2C + push {r4,lr} + adds r3, r0, 0 + lsls r1, 24 + lsrs r2, r1, 24 + ldr r0, =gUnknown_0203CF1C + ldr r4, =0x000040cb + adds r1, r2, r4 + ldr r0, [r0] + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0xFF + bne _081C2D56 + lsls r0, r2, 3 + adds r0, r3, r0 + bl AddWindow + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl FillWindowPixelBuffer +_081C2D56: + ldrb r0, [r4] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81C2D2C + + thumb_func_start sub_81C2D68 +sub_81C2D68: @ 81C2D68 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0203CF1C + ldr r2, =0x000040cb + adds r0, r2 + ldr r1, [r1] + adds r4, r1, r0 + ldrb r0, [r4] + cmp r0, 0xFF + beq _081C2D8C + bl ClearWindowTilemap + ldrb r0, [r4] + bl RemoveWindow + movs r0, 0xFF + strb r0, [r4] +_081C2D8C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C2D68 + + thumb_func_start sub_81C2D9C +sub_81C2D9C: @ 81C2D9C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 +_081C2DA4: + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =0x000040cb + adds r0, r1 + adds r1, r0, r4 + ldrb r0, [r1] + cmp r0, 0xFF + beq _081C2DBA + movs r1, 0 + bl FillWindowPixelBuffer +_081C2DBA: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x7 + bls _081C2DA4 + ldr r0, =gUnknown_0861CE54 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + bl _call_via_r0 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C2D9C + + thumb_func_start sub_81C2DE4 +sub_81C2DE4: @ 81C2DE4 + push {lr} + lsls r0, 24 + ldr r1, =gUnknown_0861CE64 + lsrs r0, 22 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x10 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C2DE4 + + thumb_func_start sub_81C2E00 +sub_81C2E00: @ 81C2E00 + push {lr} + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + adds r0, 0x74 + ldrb r0, [r0] + cmp r0, 0 + beq _081C2E24 + bl sub_81C335C + bl sub_81C33CC + bl sub_81C3428 + bl sub_81C349C + b _081C2E3C + .pool +_081C2E24: + bl sub_81C2EC4 + bl sub_81C2F5C + bl sub_81C2FD8 + bl sub_81C302C + bl sub_81C307C + bl sub_81C3194 +_081C2E3C: + pop {r0} + bx r0 + thumb_func_end sub_81C2E00 + + thumb_func_start sub_81C2E40 +sub_81C2E40: @ 81C2E40 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + ldrh r0, [r4] + subs r0, 0x1 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + bhi _081C2EB8 + lsls r0, 2 + ldr r1, =_081C2E70 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081C2E70: + .4byte _081C2E8C + .4byte _081C2E92 + .4byte _081C2E98 + .4byte _081C2E9E + .4byte _081C2EA4 + .4byte _081C2EAA + .4byte _081C2EB0 +_081C2E8C: + bl sub_81C2EC4 + b _081C2EB8 +_081C2E92: + bl sub_81C2F5C + b _081C2EB8 +_081C2E98: + bl sub_81C2FD8 + b _081C2EB8 +_081C2E9E: + bl sub_81C302C + b _081C2EB8 +_081C2EA4: + bl sub_81C307C + b _081C2EB8 +_081C2EAA: + bl sub_81C3194 + b _081C2EB8 +_081C2EB0: + adds r0, r2, 0 + bl DestroyTask + b _081C2EBE +_081C2EB8: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_081C2EBE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81C2E40 + + thumb_func_start sub_81C2EC4 +sub_81C2EC4: @ 81C2EC4 + push {r4-r6,lr} + sub sp, 0x8 + bl sub_81A6BF4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C2F54 + bl sub_81B9E94 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C2F54 + ldr r0, =gUnknown_0861CCCC + movs r1, 0 + bl sub_81C2D2C + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =gUnknown_085EA365 + movs r6, 0 + str r6, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_81C25A4 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0 + bl GetStringWidth + adds r2, r0, 0 + ldr r0, =gUnknown_0203CF1C + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xA2 + ldrb r0, [r0] + cmp r0, 0 + bne _081C2F40 + adds r1, 0xA6 + lsls r2, 24 + lsrs r2, 24 + str r6, [sp] + movs r0, 0x5 + str r0, [sp, 0x4] + adds r0, r5, 0 + movs r3, 0x1 + bl sub_81C25A4 + b _081C2F54 + .pool +_081C2F40: + adds r1, 0xA6 + lsls r2, 24 + lsrs r2, 24 + str r6, [sp] + movs r0, 0x6 + str r0, [sp, 0x4] + adds r0, r5, 0 + movs r3, 0x1 + bl sub_81C25A4 +_081C2F54: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81C2EC4 + + thumb_func_start sub_81C2F5C +sub_81C2F5C: @ 81C2F5C + push {r4,r5,lr} + sub sp, 0x8 + bl sub_81A6BF4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C2FC0 + bl sub_81B9E94 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C2FC0 + ldr r5, =gStringVar1 + ldr r1, =gText_UnkCtrlF907F908 + adds r0, r5, 0 + bl StringCopy + ldr r1, =gUnknown_0203CF1C + ldr r1, [r1] + adds r1, 0xB8 + ldrh r1, [r1] + movs r2, 0x2 + movs r3, 0x5 + bl ConvertIntToDecimalStringN + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x38 + bl GetStringRightAlignXOffset + adds r4, r0, 0 + ldr r0, =gUnknown_0861CCCC + movs r1, 0x1 + bl sub_81C2D2C + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsrs r4, 24 + movs r1, 0 + str r1, [sp] + movs r1, 0x1 + str r1, [sp, 0x4] + adds r1, r5, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_81C25A4 +_081C2FC0: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C2F5C + + thumb_func_start sub_81C2FD8 +sub_81C2FD8: @ 81C2FD8 + push {r4,lr} + sub sp, 0x8 + ldr r0, =gUnknown_0203CF1C + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x70 + ldrh r0, [r0] + adds r1, 0x78 + ldrb r1, [r1] + bl GetAbilityBySpecies + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_0861CCCC + movs r1, 0x2 + bl sub_81C2D2C + lsls r0, 24 + lsrs r0, 24 + movs r1, 0xD + muls r1, r4 + ldr r2, =gAbilityNames + adds r1, r2 + movs r2, 0 + str r2, [sp] + movs r2, 0x1 + str r2, [sp, 0x4] + movs r2, 0 + movs r3, 0x1 + bl sub_81C25A4 + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C2FD8 + + thumb_func_start sub_81C302C +sub_81C302C: @ 81C302C + push {r4,lr} + sub sp, 0x8 + ldr r0, =gUnknown_0203CF1C + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x70 + ldrh r0, [r0] + adds r1, 0x78 + ldrb r1, [r1] + bl GetAbilityBySpecies + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_0861CCCC + movs r1, 0x2 + bl sub_81C2D2C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gAbilityDescriptionPointers + lsls r4, 2 + adds r4, r1 + ldr r1, [r4] + movs r2, 0 + str r2, [sp] + str r2, [sp, 0x4] + movs r3, 0x11 + bl sub_81C25A4 + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C302C + + thumb_func_start sub_81C307C +sub_81C307C: @ 81C307C + push {r4-r6,lr} + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + adds r4, r0, 0 + adds r4, 0x70 + bl sub_81AFBF0 + ldr r1, =gUnknown_0861CE74 + movs r0, 0 + bl sub_81AFC0C + ldr r1, =gUnknown_0861CE7B + movs r0, 0x1 + bl sub_81AFC0C + bl sub_81C31C0 + bl sub_81A6BF4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C30C2 + bl sub_81B9E94 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C30C2 + bl sub_81C3304 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C30E0 +_081C30C2: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EA5DB + bl sub_81AFC28 + b _081C3182 + .pool +_081C30E0: + movs r0, 0x20 + bl Alloc + adds r6, r0, 0 + movs r0, 0x20 + bl Alloc + adds r5, r0, 0 + adds r0, r6, 0 + bl sub_81C31F0 + ldrb r0, [r4, 0x9] + cmp r0, 0xD4 + bhi _081C310C + adds r1, r0, 0 + adds r0, r5, 0 + bl sub_8124610 + movs r0, 0x4 + adds r1, r5, 0 + bl sub_81AFC0C +_081C310C: + bl sub_81C3220 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C3148 + ldrb r0, [r4, 0xA] + cmp r0, 0 + bne _081C3134 + ldrb r0, [r4, 0x9] + ldr r1, =gUnknown_085EA516 + cmp r0, 0xD4 + bls _081C3170 + ldr r1, =gUnknown_085EA617 + b _081C3170 + .pool +_081C3134: + ldrb r0, [r4, 0x9] + ldr r1, =gUnknown_085EA4EC + cmp r0, 0xD4 + bls _081C3170 + ldr r1, =gUnknown_085EA5EB + b _081C3170 + .pool +_081C3148: + ldrb r0, [r4, 0x9] + cmp r0, 0xFF + bne _081C3158 + ldr r1, =gUnknown_085EA56A + b _081C3170 + .pool +_081C3158: + cmp r0, 0xFE + beq _081C316E + bl sub_81C32BC + lsls r0, 24 + cmp r0, 0 + beq _081C316E + ldrb r0, [r4, 0x9] + ldr r1, =gUnknown_085EA5A8 + cmp r0, 0xD4 + bls _081C3170 +_081C316E: + ldr r1, =gUnknown_085EA544 +_081C3170: + ldr r0, =gStringVar4 + bl sub_81AFC28 + adds r0, r6, 0 + bl Free + adds r0, r5, 0 + bl Free +_081C3182: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C307C + + thumb_func_start sub_81C3194 +sub_81C3194: @ 81C3194 + push {lr} + sub sp, 0x8 + ldr r0, =gUnknown_0861CCCC + movs r1, 0x3 + bl sub_81C2D2C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gStringVar4 + movs r2, 0 + str r2, [sp] + str r2, [sp, 0x4] + movs r3, 0x1 + bl sub_81C25A4 + add sp, 0x8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C3194 + + thumb_func_start sub_81C31C0 +sub_81C31C0: @ 81C31C0 + push {lr} + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =gNatureNamePointers + adds r0, 0xA3 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + movs r0, 0x2 + bl sub_81AFC0C + ldr r1, =gUnknown_085EA3C0 + movs r0, 0x5 + bl sub_81AFC0C + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C31C0 + + thumb_func_start sub_81C31F0 +sub_81C31F0: @ 81C31F0 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + adds r0, 0x7A + ldrb r1, [r0] + cmp r1, 0 + bne _081C3202 + movs r1, 0x5 +_081C3202: + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + movs r0, 0x3 + adds r1, r4, 0 + bl sub_81AFC0C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C31F0 + + thumb_func_start sub_81C3220 +sub_81C3220: @ 81C3220 + push {r4-r6,lr} + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + adds r6, r0, 0 + adds r6, 0x70 + ldr r1, [r0] + ldr r0, =gEnemyParty + cmp r1, r0 + bne _081C326C + bl GetMultiplayerId + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gLinkPlayers + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r0, r2, 0x4 + adds r0, r1, r0 + ldrh r4, [r0] + adds r0, r1, r2 + ldrb r5, [r0, 0x13] + ldr r0, =gStringVar1 + adds r2, 0x8 + adds r1, r2 + bl StringCopy + b _081C3282 + .pool +_081C326C: + bl sub_80F0020 + adds r4, r0, 0 + ldr r0, =0x0000ffff + ands r4, r0 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldrb r5, [r1, 0x8] + ldr r0, =gStringVar1 + bl StringCopy +_081C3282: + adds r0, r6, 0 + adds r0, 0x32 + ldrb r0, [r0] + cmp r5, r0 + bne _081C32A4 + ldr r0, [r6, 0x48] + ldr r1, =0x0000ffff + ands r0, r1 + cmp r4, r0 + bne _081C32A4 + ldr r0, =gStringVar1 + adds r1, r6, 0 + adds r1, 0x36 + bl StringCompareWithoutExtCtrlCodes + cmp r0, 0 + beq _081C32B4 +_081C32A4: + movs r0, 0 + b _081C32B6 + .pool +_081C32B4: + movs r0, 0x1 +_081C32B6: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81C3220 + + thumb_func_start sub_81C32BC +sub_81C32BC: @ 81C32BC + push {lr} + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + adds r0, 0x70 + ldrb r0, [r0, 0xB] + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bls _081C32D8 + movs r0, 0 + b _081C32DA + .pool +_081C32D8: + movs r0, 0x1 +_081C32DA: + pop {r1} + bx r1 + thumb_func_end sub_81C32BC + + thumb_func_start sub_81C32E0 +sub_81C32E0: @ 81C32E0 + push {lr} + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + adds r0, 0x70 + ldrb r0, [r0, 0xB] + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bls _081C32FC + movs r0, 0 + b _081C32FE + .pool +_081C32FC: + movs r0, 0x1 +_081C32FE: + pop {r1} + bx r1 + thumb_func_end sub_81C32E0 + + thumb_func_start sub_81C3304 +sub_81C3304: @ 81C3304 + push {lr} + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + beq _081C3354 + ldr r0, =gMain + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081C3354 + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =0x000040be + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _081C333A + cmp r0, 0x4 + beq _081C333A + cmp r0, 0x5 + bne _081C3354 +_081C333A: + movs r0, 0x1 + b _081C3356 + .pool +_081C3354: + movs r0, 0 +_081C3356: + pop {r1} + bx r1 + thumb_func_end sub_81C3304 + + thumb_func_start sub_81C335C +sub_81C335C: @ 81C335C + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x8 + ldr r0, =gUnknown_0861CCCC + movs r1, 0 + bl sub_81C2D2C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_085EA365 + mov r8, r0 + movs r0, 0x1 + mov r1, r8 + movs r2, 0 + bl GetStringWidth + adds r5, r0, 0 + movs r0, 0 + mov r9, r0 + str r0, [sp] + movs r6, 0x1 + str r6, [sp, 0x4] + adds r0, r4, 0 + mov r1, r8 + movs r2, 0 + movs r3, 0x1 + bl sub_81C25A4 + ldr r1, =gText_FiveMarks + lsls r5, 24 + lsrs r5, 24 + mov r0, r9 + str r0, [sp] + str r6, [sp, 0x4] + adds r0, r4, 0 + adds r2, r5, 0 + movs r3, 0x1 + bl sub_81C25A4 + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C335C + + thumb_func_start sub_81C33CC +sub_81C33CC: @ 81C33CC + push {r4,r5,lr} + sub sp, 0x8 + ldr r5, =gStringVar1 + ldr r1, =gText_UnkCtrlF907F908 + adds r0, r5, 0 + bl StringCopy + ldr r1, =gText_FiveMarks + adds r0, r5, 0 + bl StringAppend + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x38 + bl GetStringRightAlignXOffset + adds r4, r0, 0 + ldr r0, =gUnknown_0861CCCC + movs r1, 0x1 + bl sub_81C2D2C + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsrs r4, 24 + movs r1, 0 + str r1, [sp] + movs r1, 0x1 + str r1, [sp, 0x4] + adds r1, r5, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_81C25A4 + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C33CC + + thumb_func_start sub_81C3428 +sub_81C3428: @ 81C3428 + push {r4,lr} + sub sp, 0x8 + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0x70 + adds r0, 0xA5 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081C3448 + ldr r4, =gUnknown_085EA40B + b _081C346C + .pool +_081C3448: + ldrh r0, [r1, 0x30] + cmp r0, 0x5 + bhi _081C3458 + ldr r4, =gUnknown_085EA4A2 + b _081C346C + .pool +_081C3458: + cmp r0, 0xA + bhi _081C3464 + ldr r4, =gUnknown_085EA475 + b _081C346C + .pool +_081C3464: + ldr r4, =gUnknown_085EA40B + cmp r0, 0x28 + bhi _081C346C + ldr r4, =gUnknown_085EA442 +_081C346C: + ldr r0, =gUnknown_0861CCCC + movs r1, 0x2 + bl sub_81C2D2C + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + str r1, [sp] + str r1, [sp, 0x4] + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_81C25A4 + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C3428 + + thumb_func_start sub_81C349C +sub_81C349C: @ 81C349C + push {r4,lr} + sub sp, 0x8 + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + adds r4, r0, 0 + adds r4, 0x70 + adds r0, 0xA5 + ldrb r0, [r0] + cmp r0, 0x1 + beq _081C3500 + ldrb r0, [r4, 0x9] + cmp r0, 0xFF + bne _081C34C4 + ldr r4, =gUnknown_085EA678 + b _081C3502 + .pool +_081C34C4: + bl sub_81C32BC + lsls r0, 24 + cmp r0, 0 + beq _081C34D8 + bl sub_81C3220 + lsls r0, 24 + cmp r0, 0 + bne _081C34E0 +_081C34D8: + ldr r4, =gUnknown_085EA6AB + b _081C3502 + .pool +_081C34E0: + ldrb r0, [r4, 0x9] + cmp r0, 0xFD + bne _081C3500 + bl sub_81C32E0 + lsls r0, 24 + lsrs r0, 24 + ldr r4, =gUnknown_085EA702 + cmp r0, 0x1 + bne _081C3502 + ldr r4, =gUnknown_085EA6D7 + b _081C3502 + .pool +_081C3500: + ldr r4, =gUnknown_085EA647 +_081C3502: + ldr r0, =gUnknown_0861CCCC + movs r1, 0x3 + bl sub_81C2D2C + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + str r1, [sp] + str r1, [sp, 0x4] + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_81C25A4 + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C349C + + thumb_func_start sub_81C3530 +sub_81C3530: @ 81C3530 + push {lr} + bl sub_81C35E4 + bl sub_81C3690 + bl sub_81C3710 + bl sub_81C37D8 + bl sub_81C3808 + bl sub_81C3890 + bl sub_81C38C0 + pop {r0} + bx r0 + thumb_func_end sub_81C3530 + + thumb_func_start sub_81C3554 +sub_81C3554: @ 81C3554 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + ldrh r0, [r4] + subs r0, 0x1 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + bhi _081C35D6 + lsls r0, 2 + ldr r1, =_081C3584 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081C3584: + .4byte _081C35A4 + .4byte _081C35AA + .4byte _081C35B0 + .4byte _081C35B6 + .4byte _081C35BC + .4byte _081C35C2 + .4byte _081C35C8 + .4byte _081C35CE +_081C35A4: + bl sub_81C35E4 + b _081C35D6 +_081C35AA: + bl sub_81C3690 + b _081C35D6 +_081C35B0: + bl sub_81C3710 + b _081C35D6 +_081C35B6: + bl sub_81C37D8 + b _081C35D6 +_081C35BC: + bl sub_81C3808 + b _081C35D6 +_081C35C2: + bl sub_81C3890 + b _081C35D6 +_081C35C8: + bl sub_81C38C0 + b _081C35D6 +_081C35CE: + adds r0, r2, 0 + bl DestroyTask + b _081C35DC +_081C35D6: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_081C35DC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81C3554 + + thumb_func_start sub_81C35E4 +sub_81C35E4: @ 81C35E4 + push {r4,r5,lr} + sub sp, 0x8 + ldr r4, =gUnknown_0203CF1C + ldr r0, [r4] + adds r0, 0x9E + ldrh r0, [r0] + cmp r0, 0xAF + bne _081C3628 + bl sub_81B1250 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C3628 + ldr r0, [r4] + ldr r1, =0x000040be + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _081C3614 + cmp r0, 0x4 + beq _081C3614 + cmp r0, 0x5 + bne _081C3628 +_081C3614: + movs r0, 0xAF + bl ItemId_GetItem + adds r5, r0, 0 + b _081C3650 + .pool +_081C3628: + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0x9E + ldrh r0, [r1] + cmp r0, 0 + bne _081C3644 + ldr r5, =gText_None + b _081C3650 + .pool +_081C3644: + ldrh r0, [r1] + ldr r4, =gStringVar1 + adds r1, r4, 0 + bl CopyItemName + adds r5, r4, 0 +_081C3650: + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x48 + bl GetStringCenterAlignXOffset + adds r4, r0, 0 + adds r4, 0x6 + ldr r0, =gUnknown_0861CCEC + movs r1, 0 + bl sub_81C2D2C + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsrs r4, 24 + movs r1, 0 + str r1, [sp] + str r1, [sp, 0x4] + adds r1, r5, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_81C25A4 + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C35E4 + + thumb_func_start sub_81C3690 +sub_81C3690: @ 81C3690 + push {r4,r5,lr} + sub sp, 0x8 + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0x76 + ldrb r0, [r1] + cmp r0, 0 + bne _081C36B0 + ldr r5, =gText_None + b _081C36C8 + .pool +_081C36B0: + ldr r0, =gStringVar1 + ldrb r1, [r1] + movs r2, 0x1 + movs r3, 0x2 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EA3B4 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r5, r4, 0 +_081C36C8: + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x46 + bl GetStringCenterAlignXOffset + adds r4, r0, 0 + adds r4, 0x6 + ldr r0, =gUnknown_0861CCEC + movs r1, 0x1 + bl sub_81C2D2C + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsrs r4, 24 + movs r1, 0 + str r1, [sp] + str r1, [sp, 0x4] + adds r1, r5, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_81C25A4 + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C3690 + + thumb_func_start sub_81C3710 +sub_81C3710: @ 81C3710 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + movs r0, 0x8 + bl Alloc + mov r9, r0 + movs r0, 0x8 + bl Alloc + mov r8, r0 + movs r0, 0x8 + bl Alloc + adds r6, r0, 0 + movs r0, 0x8 + bl Alloc + adds r5, r0, 0 + ldr r4, =gUnknown_0203CF1C + ldr r0, [r4] + adds r0, 0x90 + ldrh r1, [r0] + mov r0, r9 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + ldr r0, [r4] + adds r0, 0x92 + ldrh r1, [r0] + mov r0, r8 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + ldr r0, [r4] + adds r0, 0x94 + ldrh r1, [r0] + adds r0, r6, 0 + movs r2, 0x1 + movs r3, 0x7 + bl ConvertIntToDecimalStringN + ldr r0, [r4] + adds r0, 0x96 + ldrh r1, [r0] + adds r0, r5, 0 + movs r2, 0x1 + movs r3, 0x7 + bl ConvertIntToDecimalStringN + bl sub_81AFBF0 + movs r0, 0 + mov r1, r9 + bl sub_81AFC0C + movs r0, 0x1 + mov r1, r8 + bl sub_81AFC0C + movs r0, 0x2 + adds r1, r6, 0 + bl sub_81AFC0C + movs r0, 0x3 + adds r1, r5, 0 + bl sub_81AFC0C + ldr r0, =gStringVar4 + ldr r1, =gUnknown_0861CE82 + bl sub_81AFC28 + mov r0, r9 + bl Free + mov r0, r8 + bl Free + adds r0, r6, 0 + bl Free + adds r0, r5, 0 + bl Free + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C3710 + + thumb_func_start sub_81C37D8 +sub_81C37D8: @ 81C37D8 + push {lr} + sub sp, 0x8 + ldr r0, =gUnknown_0861CCEC + movs r1, 0x2 + bl sub_81C2D2C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gStringVar4 + movs r2, 0 + str r2, [sp] + str r2, [sp, 0x4] + movs r2, 0x4 + movs r3, 0x1 + bl sub_81C25A4 + add sp, 0x8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C37D8 + + thumb_func_start sub_81C3808 +sub_81C3808: @ 81C3808 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, =gStringVar1 + mov r8, r0 + ldr r4, =gUnknown_0203CF1C + ldr r0, [r4] + adds r0, 0x98 + ldrh r1, [r0] + mov r0, r8 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + ldr r6, =gStringVar2 + ldr r0, [r4] + adds r0, 0x9A + ldrh r1, [r0] + adds r0, r6, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + ldr r5, =gStringVar3 + ldr r0, [r4] + adds r0, 0x9C + ldrh r1, [r0] + adds r0, r5, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + bl sub_81AFBF0 + movs r0, 0 + mov r1, r8 + bl sub_81AFC0C + movs r0, 0x1 + adds r1, r6, 0 + bl sub_81AFC0C + movs r0, 0x2 + adds r1, r5, 0 + bl sub_81AFC0C + ldr r0, =gStringVar4 + ldr r1, =gUnknown_0861CE8E + bl sub_81AFC28 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C3808 + + thumb_func_start sub_81C3890 +sub_81C3890: @ 81C3890 + push {lr} + sub sp, 0x8 + ldr r0, =gUnknown_0861CCEC + movs r1, 0x3 + bl sub_81C2D2C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gStringVar4 + movs r2, 0 + str r2, [sp] + str r2, [sp, 0x4] + movs r2, 0x2 + movs r3, 0x1 + bl sub_81C25A4 + add sp, 0x8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C3890 + + thumb_func_start sub_81C38C0 +sub_81C38C0: @ 81C38C0 + push {r4-r6,lr} + sub sp, 0x8 + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + adds r5, r0, 0 + adds r5, 0x70 + ldr r0, =gUnknown_0861CCEC + movs r1, 0x4 + bl sub_81C2D2C + lsls r0, 24 + lsrs r6, r0, 24 + ldr r4, =gStringVar1 + ldr r1, [r5, 0x10] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x7 + bl ConvertIntToDecimalStringN + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x2A + bl GetStringRightAlignXOffset + adds r0, 0x2 + lsls r2, r0, 24 + lsrs r2, 24 + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + adds r0, r6, 0 + adds r1, r4, 0 + movs r3, 0x1 + bl sub_81C25A4 + ldrb r0, [r5, 0x5] + cmp r0, 0x63 + bhi _081C3948 + ldr r4, =gExperienceTables + adds r1, r0, 0 + adds r1, 0x1 + lsls r1, 2 + ldr r3, =gBaseStats + ldrh r2, [r5] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r3 + ldrb r2, [r0, 0x13] + movs r0, 0xCA + lsls r0, 1 + muls r0, r2 + adds r1, r0 + adds r1, r4 + ldr r1, [r1] + ldr r0, [r5, 0x10] + subs r1, r0 + b _081C394A + .pool +_081C3948: + movs r1, 0 +_081C394A: + ldr r4, =gStringVar1 + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x6 + bl ConvertIntToDecimalStringN + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x2A + bl GetStringRightAlignXOffset + adds r0, 0x2 + lsls r2, r0, 24 + lsrs r2, 24 + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + adds r0, r6, 0 + adds r1, r4, 0 + movs r3, 0x11 + bl sub_81C25A4 + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C38C0 + + thumb_func_start sub_81C3984 +sub_81C3984: @ 81C3984 + push {r4,lr} + movs r0, 0 + bl sub_81C3B08 + movs r0, 0x1 + bl sub_81C3B08 + movs r0, 0x2 + bl sub_81C3B08 + movs r0, 0x3 + bl sub_81C3B08 + ldr r4, =gUnknown_0203CF1C + ldr r0, [r4] + ldr r1, =0x000040bc + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3 + bne _081C39EA + bl sub_81C3F44 + ldr r1, [r4] + ldr r0, =0x000040c6 + adds r2, r1, r0 + ldrb r0, [r2] + cmp r0, 0x4 + bne _081C39DC + ldr r0, =0x000040c4 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + beq _081C39EA + bl sub_81C3E9C + b _081C39EA + .pool +_081C39DC: + ldrb r0, [r2] + lsls r0, 1 + adds r1, 0x84 + adds r1, r0 + ldrh r0, [r1] + bl sub_81C3E9C +_081C39EA: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81C3984 + + thumb_func_start sub_81C39F0 +sub_81C39F0: @ 81C39F0 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + ldrh r0, [r4] + subs r0, 0x1 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + bhi _081C3AFC + lsls r0, 2 + ldr r1, =_081C3A20 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081C3A20: + .4byte _081C3A40 + .4byte _081C3A48 + .4byte _081C3A50 + .4byte _081C3A58 + .4byte _081C3A60 + .4byte _081C3A7C + .4byte _081C3ABE + .4byte _081C3AF4 +_081C3A40: + movs r0, 0 + bl sub_81C3B08 + b _081C3AFC +_081C3A48: + movs r0, 0x1 + bl sub_81C3B08 + b _081C3AFC +_081C3A50: + movs r0, 0x2 + bl sub_81C3B08 + b _081C3AFC +_081C3A58: + movs r0, 0x3 + bl sub_81C3B08 + b _081C3AFC +_081C3A60: + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =0x000040bc + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3 + bne _081C3AFC + bl sub_81C3F44 + b _081C3AFC + .pool +_081C3A7C: + ldr r0, =gUnknown_0203CF1C + ldr r1, [r0] + ldr r2, =0x000040bc + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x3 + bne _081C3AFC + ldr r0, =0x000040c6 + adds r2, r1, r0 + ldrb r0, [r2] + cmp r0, 0x4 + bne _081C3AB0 + ldr r2, =0x000040c4 + adds r0, r1, r2 + ldrh r0, [r0] + strh r0, [r4, 0x2] + b _081C3AFC + .pool +_081C3AB0: + ldrb r0, [r2] + lsls r0, 1 + adds r1, 0x84 + adds r1, r0 + ldrh r0, [r1] + strh r0, [r4, 0x2] + b _081C3AFC +_081C3ABE: + ldr r0, =gUnknown_0203CF1C + ldr r1, [r0] + ldr r2, =0x000040bc + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x3 + bne _081C3AFC + adds r2, 0x8 + adds r0, r1, r2 + ldr r0, [r0] + ldr r1, =0x00ffffff + ands r0, r1 + movs r1, 0x80 + lsls r1, 11 + cmp r0, r1 + beq _081C3AFC + ldrh r0, [r4, 0x2] + bl sub_81C3E9C + b _081C3AFC + .pool +_081C3AF4: + adds r0, r2, 0 + bl DestroyTask + b _081C3B02 +_081C3AFC: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_081C3B02: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81C39F0 + + thumb_func_start sub_81C3B08 +sub_81C3B08: @ 81C3B08 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + mov r10, r0 + ldr r4, =gUnknown_0861CD14 + adds r0, r4, 0 + movs r1, 0 + bl sub_81C2D2C + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81C2D2C + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x8] + lsls r1, r7, 1 + mov r0, r10 + adds r0, 0x84 + adds r0, r1 + ldrh r5, [r0] + cmp r5, 0 + beq _081C3C00 + mov r0, r10 + adds r0, 0xA4 + ldrb r1, [r0] + adds r0, r5, 0 + adds r2, r7, 0 + bl CalculatePPWithBonus + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + movs r0, 0xD + adds r1, r5, 0 + muls r1, r0 + ldr r0, =gMoveNames + adds r1, r0 + lsls r0, r7, 4 + mov r9, r0 + mov r3, r9 + adds r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + mov r0, r8 + movs r2, 0 + bl sub_81C25A4 + ldr r0, =gStringVar1 + mov r8, r0 + mov r5, r10 + adds r5, 0x8C + adds r5, r7 + ldrb r1, [r5] + movs r2, 0x1 + movs r3, 0x2 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar2 + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0x2 + bl ConvertIntToDecimalStringN + bl sub_81AFBF0 + movs r0, 0 + mov r1, r8 + bl sub_81AFC0C + movs r0, 0x1 + adds r1, r4, 0 + bl sub_81AFC0C + ldr r4, =gStringVar4 + ldr r1, =gUnknown_0861CE97 + adds r0, r4, 0 + bl sub_81AFC28 + adds r7, r4, 0 + ldrb r0, [r5] + adds r1, r6, 0 + bl sub_814FC20 + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + adds r5, 0x9 + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0x2C + bl GetStringRightAlignXOffset + mov r4, r9 + b _081C3C26 + .pool +_081C3C00: + ldr r1, =gText_OneDash + lsls r4, r7, 4 + adds r3, r4, 0x1 + lsls r3, 24 + lsrs r3, 24 + str r5, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + mov r0, r8 + movs r2, 0 + bl sub_81C25A4 + ldr r7, =gText_TwoDashes + movs r5, 0xC + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0x2C + bl GetStringCenterAlignXOffset +_081C3C26: + lsls r2, r0, 24 + lsrs r2, 24 + adds r3, r4, 0x1 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0 + str r0, [sp] + lsls r0, r5, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + ldr r0, [sp, 0x8] + adds r1, r7, 0 + bl sub_81C25A4 + 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_81C3B08 + + thumb_func_start sub_81C3C5C +sub_81C3C5C: @ 81C3C5C + push {r4-r6,lr} + sub sp, 0x8 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + beq _081C3CFC + movs r0, 0x13 + str r0, [sp] + movs r0, 0x20 + str r0, [sp, 0x4] + movs r0, 0xE + movs r1, 0 + movs r2, 0x35 + movs r3, 0 + bl FillWindowPixelRect + ldr r2, =gBattleMoves + lsls r1, r5, 1 + adds r0, r1, r5 + lsls r0, 2 + adds r2, r0, r2 + ldrb r0, [r2, 0x1] + adds r6, r1, 0 + cmp r0, 0x1 + bhi _081C3C9C + ldr r1, =gText_ThreeDashes + b _081C3CAC + .pool +_081C3C9C: + ldr r4, =gStringVar1 + ldrb r1, [r2, 0x1] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + adds r1, r4, 0 +_081C3CAC: + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0xE + movs r2, 0x35 + movs r3, 0x1 + bl sub_81C25A4 + ldr r1, =gBattleMoves + adds r0, r6, r5 + lsls r0, 2 + adds r1, r0, r1 + ldrb r0, [r1, 0x3] + cmp r0, 0 + bne _081C3CDC + ldr r1, =gText_ThreeDashes + b _081C3CEC + .pool +_081C3CDC: + ldr r4, =gStringVar1 + ldrb r1, [r1, 0x3] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + adds r1, r4, 0 +_081C3CEC: + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0xE + movs r2, 0x35 + movs r3, 0x11 + bl sub_81C25A4 +_081C3CFC: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C3C5C + + thumb_func_start sub_81C3D08 +sub_81C3D08: @ 81C3D08 + push {r4,lr} + movs r0, 0 + bl sub_81C3B08 + movs r0, 0x1 + bl sub_81C3B08 + movs r0, 0x2 + bl sub_81C3B08 + movs r0, 0x3 + bl sub_81C3B08 + ldr r4, =gUnknown_0203CF1C + ldr r0, [r4] + ldr r1, =0x000040bc + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3 + bne _081C3D40 + bl sub_81C3F44 + ldr r0, [r4] + ldr r1, =0x000040c6 + adds r0, r1 + ldrb r0, [r0] + bl sub_81C3E2C +_081C3D40: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C3D08 + + thumb_func_start sub_81C3D54 +sub_81C3D54: @ 81C3D54 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + ldrh r0, [r4] + subs r0, 0x1 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + bhi _081C3E20 + lsls r0, 2 + ldr r1, =_081C3D84 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081C3D84: + .4byte _081C3DA0 + .4byte _081C3DA8 + .4byte _081C3DB0 + .4byte _081C3DB8 + .4byte _081C3DC0 + .4byte _081C3DDC + .4byte _081C3E18 +_081C3DA0: + movs r0, 0 + bl sub_81C3B08 + b _081C3E20 +_081C3DA8: + movs r0, 0x1 + bl sub_81C3B08 + b _081C3E20 +_081C3DB0: + movs r0, 0x2 + bl sub_81C3B08 + b _081C3E20 +_081C3DB8: + movs r0, 0x3 + bl sub_81C3B08 + b _081C3E20 +_081C3DC0: + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =0x000040bc + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3 + bne _081C3E20 + bl sub_81C3F44 + b _081C3E20 + .pool +_081C3DDC: + ldr r0, =gUnknown_0203CF1C + ldr r2, [r0] + ldr r1, =0x000040bc + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x3 + bne _081C3E20 + adds r1, 0x8 + adds r0, r2, r1 + ldr r0, [r0] + ldr r1, =0x00ffffff + ands r0, r1 + movs r1, 0x80 + lsls r1, 11 + cmp r0, r1 + beq _081C3E20 + ldr r1, =0x000040c6 + adds r0, r2, r1 + ldrb r0, [r0] + bl sub_81C3E2C + b _081C3E20 + .pool +_081C3E18: + adds r0, r2, 0 + bl DestroyTask + b _081C3E26 +_081C3E20: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_081C3E26: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81C3D54 + + thumb_func_start sub_81C3E2C +sub_81C3E2C: @ 81C3E2C + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x4 + bne _081C3E48 + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =0x000040c4 + b _081C3E50 + .pool +_081C3E48: + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + lsls r1, 1 + adds r0, 0x84 +_081C3E50: + adds r0, r1 + ldrh r4, [r0] + cmp r4, 0 + beq _081C3E82 + ldr r0, =gUnknown_0861CD14 + movs r1, 0x2 + bl sub_81C2D2C + lsls r0, 24 + lsrs r0, 24 + ldr r3, =gContestEffectDescriptionPointers + ldr r2, =gContestMoves + lsls r1, r4, 3 + adds r1, r2 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + movs r2, 0 + str r2, [sp] + str r2, [sp, 0x4] + movs r2, 0x6 + movs r3, 0x1 + bl sub_81C25A4 +_081C3E82: + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C3E2C + + thumb_func_start sub_81C3E9C +sub_81C3E9C: @ 81C3E9C + push {r4-r6,lr} + sub sp, 0x8 + lsls r0, 16 + lsrs r4, r0, 16 + adds r6, r4, 0 + ldr r0, =gUnknown_0861CD14 + movs r1, 0x2 + bl sub_81C2D2C + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + movs r1, 0 + bl FillWindowPixelBuffer + cmp r4, 0 + beq _081C3F30 + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =0x000040c0 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x2 + bne _081C3F00 + adds r0, r4, 0 + bl sub_81C3C5C + ldr r1, =gMoveDescriptionPointers + subs r0, r4, 0x1 + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + adds r0, r5, 0 + movs r2, 0x6 + movs r3, 0x1 + bl sub_81C25A4 + b _081C3F20 + .pool +_081C3F00: + ldr r2, =gContestEffectDescriptionPointers + ldr r1, =gContestMoves + lsls r0, r6, 3 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r2 + ldr r1, [r0] + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + adds r0, r5, 0 + movs r2, 0x6 + movs r3, 0x1 + bl sub_81C25A4 +_081C3F20: + adds r0, r5, 0 + bl PutWindowTilemap + b _081C3F36 + .pool +_081C3F30: + adds r0, r5, 0 + bl ClearWindowTilemap +_081C3F36: + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81C3E9C + + thumb_func_start sub_81C3F44 +sub_81C3F44: @ 81C3F44 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + ldr r4, =gUnknown_0861CD14 + adds r0, r4, 0 + movs r1, 0 + bl sub_81C2D2C + lsls r0, 24 + lsrs r6, r0, 24 + adds r7, r6, 0 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81C2D2C + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, =gUnknown_0203CF1C + ldr r1, [r0] + ldr r2, =0x000040c4 + adds r0, r1, r2 + ldrh r2, [r0] + cmp r2, 0 + bne _081C3F9C + ldr r1, =gText_Cancel + str r2, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + adds r0, r6, 0 + movs r2, 0 + movs r3, 0x41 + bl sub_81C25A4 + b _081C4044 + .pool +_081C3F9C: + ldrh r5, [r0] + ldr r2, =0x000040c0 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x2 + bne _081C3FD0 + movs r0, 0xD + adds r1, r5, 0 + muls r1, r0 + ldr r0, =gMoveNames + adds r1, r0 + movs r0, 0 + str r0, [sp] + movs r0, 0x6 + str r0, [sp, 0x4] + adds r0, r6, 0 + movs r2, 0 + movs r3, 0x41 + bl sub_81C25A4 + b _081C3FEC + .pool +_081C3FD0: + movs r0, 0xD + adds r1, r5, 0 + muls r1, r0 + ldr r0, =gMoveNames + adds r1, r0 + movs r0, 0 + str r0, [sp] + movs r0, 0x5 + str r0, [sp, 0x4] + adds r0, r7, 0 + movs r2, 0 + movs r3, 0x41 + bl sub_81C25A4 +_081C3FEC: + ldr r4, =gStringVar1 + ldr r1, =gBattleMoves + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x4] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x2 + bl ConvertIntToDecimalStringN + bl sub_81AFBF0 + movs r0, 0 + adds r1, r4, 0 + bl sub_81AFC0C + movs r0, 0x1 + adds r1, r4, 0 + bl sub_81AFC0C + ldr r4, =gStringVar4 + ldr r1, =gUnknown_0861CE97 + adds r0, r4, 0 + bl sub_81AFC28 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x2C + bl GetStringRightAlignXOffset + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0 + str r0, [sp] + movs r0, 0xC + str r0, [sp, 0x4] + mov r0, r8 + adds r1, r4, 0 + movs r3, 0x41 + bl sub_81C25A4 +_081C4044: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C3F44 + + thumb_func_start sub_81C4064 +sub_81C4064: @ 81C4064 + push {r4,lr} + sub sp, 0x8 + ldr r0, =gUnknown_0861CD14 + movs r1, 0 + bl sub_81C2D2C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x48 + str r0, [sp] + movs r0, 0x10 + str r0, [sp, 0x4] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x42 + bl FillWindowPixelRect + adds r0, r4, 0 + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4064 + + thumb_func_start sub_81C40A0 +sub_81C40A0: @ 81C40A0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + mov r9, r0 + mov r10, r1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + mov r0, r10 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r5, =gUnknown_0861CD14 + adds r0, r5, 0 + movs r1, 0 + bl sub_81C2D2C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_81C2D2C + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + mov r0, r9 + lsls r6, r0, 4 + movs r0, 0x48 + mov r8, r0 + str r0, [sp] + movs r0, 0x10 + str r0, [sp, 0x4] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + adds r3, r6, 0 + bl FillWindowPixelRect + mov r0, r10 + lsls r7, r0, 4 + mov r0, r8 + str r0, [sp] + movs r0, 0x10 + str r0, [sp, 0x4] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + adds r3, r7, 0 + bl FillWindowPixelRect + movs r4, 0x30 + str r4, [sp] + movs r0, 0x10 + str r0, [sp, 0x4] + adds r0, r5, 0 + movs r1, 0 + movs r2, 0 + adds r3, r6, 0 + bl FillWindowPixelRect + str r4, [sp] + movs r0, 0x10 + str r0, [sp, 0x4] + adds r0, r5, 0 + movs r1, 0 + movs r2, 0 + adds r3, r7, 0 + bl FillWindowPixelRect + mov r0, r9 + bl sub_81C3B08 + mov r0, r10 + bl sub_81C3B08 + 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_81C40A0 + + thumb_func_start sub_81C4154 +sub_81C4154: @ 81C4154 + push {r4,lr} + sub sp, 0x8 + ldr r0, =gUnknown_0861CD14 + movs r1, 0x2 + bl sub_81C2D2C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r1, =gUnknown_085EA4CB + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + adds r0, r4, 0 + movs r2, 0x6 + movs r3, 0x1 + bl sub_81C25A4 + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4154 + + thumb_func_start sub_81C4190 +sub_81C4190: @ 81C4190 + push {r4,r5,lr} + movs r2, 0 + ldr r5, =gUnknown_0203CF1C + ldr r4, =0x000040d3 + movs r3, 0xFF +_081C419A: + ldr r0, [r5] + adds r0, r4 + adds r0, r2 + ldrb r1, [r0] + orrs r1, r3 + strb r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x1B + bls _081C419A + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4190 + + thumb_func_start sub_81C41C0 +sub_81C41C0: @ 81C41C0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r5, =gUnknown_0203CF1C + ldr r0, [r5] + ldr r1, =0x000040d3 + adds r0, r1 + adds r1, r0, r4 + ldrb r0, [r1] + cmp r0, 0xFF + beq _081C41F2 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + bl DestroySprite + ldr r0, [r5] + ldr r1, =0x000040d3 + adds r0, r1 + adds r0, r4 + movs r1, 0xFF + strb r1, [r0] +_081C41F2: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C41C0 + + thumb_func_start sub_81C4204 +sub_81C4204: @ 81C4204 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r3, =gSprites + ldr r2, =gUnknown_0203CF1C + ldr r2, [r2] + ldr r4, =0x000040d3 + adds r2, r4 + adds r2, r0 + ldrb r0, [r2] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r3 + adds r2, 0x3E + movs r0, 0x1 + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4204 + + thumb_func_start sub_81C424C +sub_81C424C: @ 81C424C + push {r4,lr} + movs r4, 0x3 +_081C4250: + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =0x000040d3 + adds r0, r1 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0xFF + beq _081C4268 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81C4204 +_081C4268: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1B + bls _081C4250 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C424C + + thumb_func_start sub_81C4280 +sub_81C4280: @ 81C4280 + push {lr} + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =0x000040c0 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x2 + beq _081C42B0 + cmp r0, 0x2 + bgt _081C42A4 + cmp r0, 0 + beq _081C42AA + b _081C42C2 + .pool +_081C42A4: + cmp r0, 0x3 + beq _081C42BA + b _081C42C2 +_081C42AA: + bl sub_81C43A0 + b _081C42C2 +_081C42B0: + bl sub_81C4420 + bl sub_81C44F0 + b _081C42C2 +_081C42BA: + bl sub_81C4484 + bl sub_81C44F0 +_081C42C2: + pop {r0} + bx r0 + thumb_func_end sub_81C4280 + + thumb_func_start sub_81C42C8 +sub_81C42C8: @ 81C42C8 + push {r4,r5,lr} + movs r4, 0x3 + ldr r5, =gUnknown_0203CF1C +_081C42CE: + ldr r0, [r5] + ldr r1, =0x000040d3 + adds r0, r1 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0xFF + bne _081C42F2 + ldr r0, =gUnknown_0861CFC4 + movs r1, 0 + movs r2, 0 + movs r3, 0x2 + bl CreateSprite + ldr r1, [r5] + ldr r2, =0x000040d3 + adds r1, r2 + adds r1, r4 + strb r0, [r1] +_081C42F2: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81C4204 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _081C42CE + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C42C8 + + thumb_func_start sub_81C4318 +sub_81C4318: @ 81C4318 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + mov r8, r2 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =0x000040d3 + adds r0, r1 + adds r0, r3 + ldrb r0, [r0] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =gSprites + adds r4, r0 + adds r0, r4, 0 + adds r1, r5, 0 + str r3, [sp] + bl StartSpriteAnim + ldr r0, =gUnknown_0861CFDC + adds r5, r0 + ldrb r1, [r5] + lsls r1, 4 + ldrb r2, [r4, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x5] + adds r6, 0x10 + strh r6, [r4, 0x20] + movs r0, 0x8 + add r8, r0 + mov r1, r8 + strh r1, [r4, 0x22] + ldr r3, [sp] + adds r0, r3, 0 + movs r1, 0 + bl sub_81C4204 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4318 + + thumb_func_start sub_81C43A0 +sub_81C43A0: @ 81C43A0 + push {r4,r5,lr} + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + adds r5, r0, 0 + adds r5, 0x70 + ldrb r0, [r5, 0x4] + cmp r0, 0 + beq _081C43CC + movs r0, 0x9 + movs r1, 0x78 + movs r2, 0x30 + movs r3, 0x3 + bl sub_81C4318 + movs r0, 0x4 + movs r1, 0x1 + bl sub_81C4204 + b _081C4418 + .pool +_081C43CC: + ldr r4, =gBaseStats + ldrh r1, [r5] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x6] + movs r1, 0x78 + movs r2, 0x30 + movs r3, 0x3 + bl sub_81C4318 + ldrh r1, [r5] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r1, r0, r4 + ldrb r0, [r1, 0x6] + ldrb r2, [r1, 0x7] + cmp r0, r2 + beq _081C4410 + ldrb r0, [r1, 0x7] + movs r1, 0xA0 + movs r2, 0x30 + movs r3, 0x4 + bl sub_81C4318 + movs r0, 0x4 + movs r1, 0 + bl sub_81C4204 + b _081C4418 + .pool +_081C4410: + movs r0, 0x4 + movs r1, 0x1 + bl sub_81C4204 +_081C4418: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81C43A0 + + thumb_func_start sub_81C4420 +sub_81C4420: @ 81C4420 + push {r4-r6,lr} + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + adds r5, r0, 0 + adds r5, 0x70 + movs r4, 0 + ldr r6, =gBattleMoves +_081C442E: + lsls r0, r4, 1 + adds r1, r5, 0 + adds r1, 0x14 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + beq _081C4468 + adds r1, r0, 0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x2] + lsls r2, r4, 28 + movs r1, 0x80 + lsls r1, 22 + adds r2, r1 + lsrs r2, 24 + adds r3, r4, 0x3 + lsls r3, 24 + lsrs r3, 24 + movs r1, 0x55 + bl sub_81C4318 + b _081C4474 + .pool +_081C4468: + adds r0, r4, 0x3 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_81C4204 +_081C4474: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _081C442E + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81C4420 + + thumb_func_start sub_81C4484 +sub_81C4484: @ 81C4484 + push {r4,r5,lr} + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + adds r5, r0, 0 + adds r5, 0x70 + movs r4, 0 +_081C4490: + lsls r0, r4, 1 + adds r1, r5, 0 + adds r1, 0x14 + adds r2, r1, r0 + ldrh r0, [r2] + cmp r0, 0 + beq _081C44D4 + ldr r1, =gContestMoves + lsls r0, 3 + adds r0, r1 + ldrb r0, [r0, 0x1] + lsls r0, 29 + lsrs r0, 5 + movs r1, 0x90 + lsls r1, 21 + adds r0, r1 + lsrs r0, 24 + lsls r2, r4, 28 + movs r1, 0x80 + lsls r1, 22 + adds r2, r1 + lsrs r2, 24 + adds r3, r4, 0x3 + lsls r3, 24 + lsrs r3, 24 + movs r1, 0x55 + bl sub_81C4318 + b _081C44E0 + .pool +_081C44D4: + adds r0, r4, 0x3 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_81C4204 +_081C44E0: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _081C4490 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81C4484 + + thumb_func_start sub_81C44F0 +sub_81C44F0: @ 81C44F0 + push {lr} + ldr r0, =gUnknown_0203CF1C + ldr r1, [r0] + ldr r0, =0x000040c4 + adds r3, r1, r0 + ldrh r0, [r3] + cmp r0, 0 + bne _081C4514 + movs r0, 0x7 + movs r1, 0x1 + bl sub_81C4204 + b _081C4560 + .pool +_081C4514: + ldr r2, =0x000040c0 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x2 + bne _081C4540 + ldr r2, =gBattleMoves + ldrh r1, [r3] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x2] + movs r1, 0x55 + movs r2, 0x60 + movs r3, 0x7 + bl sub_81C4318 + b _081C4560 + .pool +_081C4540: + ldr r1, =gContestMoves + ldrh r0, [r3] + lsls r0, 3 + adds r0, r1 + ldrb r0, [r0, 0x1] + lsls r0, 29 + lsrs r0, 5 + movs r1, 0x90 + lsls r1, 21 + adds r0, r1 + lsrs r0, 24 + movs r1, 0x55 + movs r2, 0x60 + movs r3, 0x7 + bl sub_81C4318 +_081C4560: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C44F0 + + thumb_func_start sub_81C4568 +sub_81C4568: @ 81C4568 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gUnknown_0203CF1C + ldr r2, [r2] + adds r0, 0x3 + ldr r3, =0x000040d3 + adds r2, r3 + adds r0, r2, r0 + ldrb r0, [r0] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r5, =gSprites + adds r4, r5 + adds r1, 0x3 + adds r2, r1 + ldrb r0, [r2] + lsls r3, r0, 4 + adds r3, r0 + lsls r3, 2 + adds r3, r5 + adds r5, r4, 0 + adds r5, 0x2A + ldrb r1, [r5] + adds r2, r3, 0 + adds r2, 0x2A + ldrb r0, [r2] + strb r0, [r5] + strb r1, [r2] + ldrb r6, [r4, 0x5] + lsrs r5, r6, 4 + ldrb r2, [r3, 0x5] + lsrs r2, 4 + lsls r2, 4 + movs r1, 0xF + adds r0, r1, 0 + ands r0, r6 + orrs r0, r2 + strb r0, [r4, 0x5] + lsls r5, 4 + ldrb r0, [r3, 0x5] + ands r1, r0 + orrs r1, r5 + strb r1, [r3, 0x5] + adds r4, 0x3F + ldrb r0, [r4] + movs r2, 0x4 + orrs r0, r2 + movs r1, 0x11 + negs r1, r1 + ands r0, r1 + strb r0, [r4] + adds r3, 0x3F + ldrb r0, [r3] + orrs r0, r2 + ands r0, r1 + strb r0, [r3] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4568 + + thumb_func_start sub_81C45F4 +sub_81C45F4: @ 81C45F4 + push {r4-r6,lr} + adds r3, r0, 0 + adds r6, r1, 0 + ldr r0, =gUnknown_0203CF1C + ldr r2, [r0] + adds r5, r2, 0 + adds r5, 0x70 + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0 + beq _081C4620 + cmp r0, 0x1 + bne _081C4610 + b _081C4750 +_081C4610: + adds r0, r3, 0 + bl sub_81C47B4 + lsls r0, 24 + lsrs r0, 24 + b _081C4770 + .pool +_081C4620: + ldr r0, =gMain + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081C4680 + ldr r1, =0x000040be + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0x3 + bl sub_80688F8 + lsls r0, 24 + cmp r0, 0 + beq _081C4668 + ldrh r2, [r5, 0x2] + lsls r0, r2, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + ldr r1, =gBattleSpritesGfx + ldr r1, [r1] + ldr r1, [r1, 0x8] + b _081C46D6 + .pool +_081C4668: + ldrh r2, [r5, 0x2] + lsls r0, r2, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + ldr r1, =gBattleSpritesGfx + ldr r1, [r1] + b _081C46B0 + .pool +_081C4680: + ldr r0, =gBattleSpritesGfx + ldr r3, [r0] + adds r4, r0, 0 + cmp r3, 0 + beq _081C46E4 + ldr r1, [r2] + ldr r0, =gPlayerParty + cmp r1, r0 + beq _081C46A6 + ldr r1, =0x000040bc + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x2 + beq _081C46A6 + adds r1, 0x33 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081C46CC +_081C46A6: + ldrh r2, [r5, 0x2] + lsls r0, r2, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + ldr r1, [r4] +_081C46B0: + ldr r1, [r1, 0x8] + ldr r3, [r5, 0xC] + bl HandleLoadSpecialPokePic_2 + b _081C4768 + .pool +_081C46CC: + ldrh r2, [r5, 0x2] + lsls r0, r2, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + ldr r1, [r3, 0x8] +_081C46D6: + ldr r3, [r5, 0xC] + bl HandleLoadSpecialPokePic_DontHandleDeoxys + b _081C4768 + .pool +_081C46E4: + ldr r1, [r2] + ldr r0, =gPlayerParty + cmp r1, r0 + beq _081C4700 + ldr r1, =0x000040bc + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x2 + beq _081C4700 + adds r1, 0x33 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081C472C +_081C4700: + ldrh r4, [r5, 0x2] + lsls r4, 3 + ldr r0, =gMonFrontPicTable + adds r4, r0 + movs r0, 0 + movs r1, 0x1 + bl sub_806F4F8 + adds r1, r0, 0 + ldrh r2, [r5, 0x2] + ldr r3, [r5, 0xC] + adds r0, r4, 0 + bl HandleLoadSpecialPokePic_2 + b _081C4768 + .pool +_081C472C: + ldrh r4, [r5, 0x2] + lsls r4, 3 + ldr r0, =gMonFrontPicTable + adds r4, r0 + movs r0, 0 + movs r1, 0x1 + bl sub_806F4F8 + adds r1, r0, 0 + ldrh r2, [r5, 0x2] + ldr r3, [r5, 0xC] + adds r0, r4, 0 + bl HandleLoadSpecialPokePic_DontHandleDeoxys + b _081C4768 + .pool +_081C4750: + ldrh r0, [r5, 0x2] + ldr r1, [r5, 0x48] + ldr r2, [r5, 0xC] + bl sub_806E7CC + adds r4, r0, 0 + bl LoadCompressedObjectPalette + ldrh r0, [r4, 0x4] + movs r1, 0x1 + bl sub_806A068 +_081C4768: + ldrh r0, [r6] + adds r0, 0x1 + strh r0, [r6] + movs r0, 0xFF +_081C4770: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81C45F4 + + thumb_func_start sub_81C4778 +sub_81C4778: @ 81C4778 + push {r4,lr} + ldr r0, =gUnknown_0203CF1C + ldr r1, [r0] + adds r4, r1, 0 + adds r4, 0x70 + ldrb r0, [r4, 0x4] + cmp r0, 0 + bne _081C47AE + adds r0, r1, 0 + adds r0, 0xC + bl sub_805F110 + cmp r0, 0x1 + bne _081C47A4 + ldrh r0, [r4, 0x2] + movs r1, 0 + movs r2, 0 + bl PlayCry3 + b _081C47AE + .pool +_081C47A4: + ldrh r0, [r4, 0x2] + movs r1, 0 + movs r2, 0xB + bl PlayCry3 +_081C47AE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81C4778 + + thumb_func_start sub_81C47B4 +sub_81C47B4: @ 81C47B4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =gUnknown_0203CF1C + ldr r6, [r0] + adds r6, 0x70 + ldr r0, =gUnknown_0202499C + movs r1, 0x28 + movs r2, 0x40 + movs r3, 0x5 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r4, r0, 4 + add r4, r8 + lsls r4, 2 + ldr r5, =gSprites + adds r7, r4, r5 + adds r0, r7, 0 + bl FreeSpriteOamMatrix + ldrh r0, [r6, 0x2] + movs r1, 0 + strh r0, [r7, 0x2E] + strh r1, [r7, 0x32] + adds r5, 0x1C + adds r4, r5 + ldr r0, =sub_81C4844 + str r0, [r4] + ldrb r1, [r7, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + strb r0, [r7, 0x5] + ldrh r0, [r6, 0x2] + bl IsPokeSpriteNotFlipped + lsls r0, 24 + cmp r0, 0 + bne _081C4828 + adds r0, r7, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] + b _081C4836 + .pool +_081C4828: + adds r2, r7, 0 + adds r2, 0x3F + ldrb r1, [r2] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_081C4836: + mov r0, r8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81C47B4 + + thumb_func_start sub_81C4844 +sub_81C4844: @ 81C4844 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + adds r5, r0, 0 + adds r5, 0x70 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081C487E + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _081C487E + ldrh r0, [r4, 0x2E] + bl IsPokeSpriteNotFlipped + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x30] + bl sub_81C4778 + ldrh r1, [r4, 0x2E] + ldrb r2, [r5, 0x4] + adds r0, r4, 0 + bl PokemonSummaryDoMonAnimation +_081C487E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4844 + + thumb_func_start sub_81C488C +sub_81C488C: @ 81C488C + ldr r1, =gUnknown_0203CF24 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_81C488C + + thumb_func_start sub_81C4898 +sub_81C4898: @ 81C4898 + push {r4,lr} + ldr r4, =gUnknown_0203CF24 + ldrb r0, [r4] + cmp r0, 0xFF + beq _081C48AA + bl DestroyTask + movs r0, 0xFF + strb r0, [r4] +_081C48AA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4898 + + thumb_func_start sub_81C48B4 +sub_81C48B4: @ 81C48B4 + push {lr} + ldr r2, =gSprites + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =0x000040d3 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =SpriteCallbackDummy + cmp r1, r0 + beq _081C48E8 + movs r0, 0x1 + b _081C48EA + .pool +_081C48E8: + movs r0, 0 +_081C48EA: + pop {r1} + bx r1 + thumb_func_end sub_81C48B4 + + thumb_func_start sub_81C48F0 +sub_81C48F0: @ 81C48F0 + push {r4-r6,lr} + ldr r6, =gSprites + ldr r5, =gUnknown_0203CF1C + ldr r0, [r5] + ldr r4, =0x000040d3 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x2C + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r6, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =SpriteCallbackDummy + str r1, [r0] + bl sub_806EE98 + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x5] + lsrs r0, 4 + lsls r3, r0, 4 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1, 0 + orrs r3, r0 + movs r2, 0 + ldr r5, =gPlttBufferUnfaded + ldr r4, =gPlttBufferFaded +_081C494C: + adds r0, r2, r3 + lsls r0, 16 + lsrs r0, 15 + adds r1, r0, r5 + adds r0, r4 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0xF + bls _081C494C + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C48F0 + + thumb_func_start sub_81C4984 +sub_81C4984: @ 81C4984 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r1, =0x00007533 + ldr r2, =gUnknown_0861D120 + adds r0, r1, 0 + bl sub_811FF94 + adds r4, r0, 0 + ldr r6, =gUnknown_0203CF1C + ldr r0, [r6] + str r4, [r0, 0x8] + cmp r4, 0 + beq _081C49CE + adds r0, r5, 0 + movs r1, 0x8 + bl GetMonData + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartSpriteAnim + ldr r1, [r6] + ldr r2, [r1, 0x8] + movs r0, 0x3C + strh r0, [r2, 0x20] + ldr r2, [r1, 0x8] + movs r0, 0x1A + strh r0, [r2, 0x22] + ldr r2, [r1, 0x8] + ldrb r1, [r2, 0x5] + subs r0, 0x27 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2, 0x5] +_081C49CE: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4984 + + thumb_func_start sub_81C49E0 +sub_81C49E0: @ 81C49E0 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r0, [r0, 0x8] + bl DestroySprite + ldr r0, =0x00007533 + bl FreeSpriteTilesByTag + adds r0, r4, 0 + bl sub_81C4984 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C49E0 + + thumb_func_start sub_81C4A08 +sub_81C4A08: @ 81C4A08 + push {r4,lr} + movs r1, 0x26 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + bl ball_number_to_ball_processing_index + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_8076A78 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 3 + ldr r1, =gUnknown_0832C588 + adds r0, r1 + movs r1, 0x10 + movs r2, 0x88 + movs r3, 0 + bl CreateSprite + ldr r2, =gUnknown_0203CF1C + ldr r1, [r2] + ldr r3, =0x000040d4 + adds r1, r3 + strb r0, [r1] + ldr r4, =gSprites + ldr r2, [r2] + adds r2, r3 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =SpriteCallbackDummy + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0, 0x5] + movs r2, 0xC + orrs r1, r2 + strb r1, [r0, 0x5] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4A08 + + thumb_func_start sub_81C4A88 +sub_81C4A88: @ 81C4A88 + push {r4,r5,lr} + ldr r5, =gUnknown_0203CF1C + ldr r0, [r5] + ldr r1, =0x000040d5 + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0xFF + bne _081C4AA6 + ldr r0, =gUnknown_0861D108 + movs r1, 0x40 + movs r2, 0x98 + movs r3, 0 + bl CreateSprite + strb r0, [r4] +_081C4AA6: + ldr r0, [r5] + adds r0, 0xC + bl sub_81B205C + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + beq _081C4AE8 + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + subs r1, r2, 0x1 + lsls r1, 24 + lsrs r1, 24 + bl StartSpriteAnim + movs r0, 0x2 + movs r1, 0 + bl sub_81C4204 + b _081C4AF0 + .pool +_081C4AE8: + movs r0, 0x2 + movs r1, 0x1 + bl sub_81C4204 +_081C4AF0: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81C4A88 + + thumb_func_start sub_81C4AF8 +sub_81C4AF8: @ 81C4AF8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, =gUnknown_0203CF1C + ldr r1, =0x000040d3 + add r1, r8 + ldr r0, [r0] + adds r7, r0, r1 + ldr r1, =0x000040c0 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bls _081C4BD2 + movs r0, 0 + mov r9, r0 + mov r1, r8 + cmp r1, 0x8 + bne _081C4B2A + movs r0, 0x1 + mov r9, r0 +_081C4B2A: + movs r5, 0 + ldr r6, =gSprites + mov r10, r5 +_081C4B30: + lsls r1, r5, 20 + movs r0, 0xB2 + lsls r0, 15 + adds r1, r0 + asrs r1, 16 + ldr r0, =gUnknown_0861D084 + movs r2, 0x28 + mov r3, r9 + bl CreateSprite + adds r1, r7, r5 + strb r0, [r1] + adds r4, r1, 0 + cmp r5, 0 + bne _081C4B74 + ldrb r1, [r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x4 + bl StartSpriteAnim + b _081C4B9A + .pool +_081C4B74: + cmp r5, 0x9 + bne _081C4B8A + ldrb r1, [r7, 0x9] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x5 + bl StartSpriteAnim + b _081C4B9A +_081C4B8A: + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x6 + bl StartSpriteAnim +_081C4B9A: + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r6, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_81C4BE4 + str r1, [r0] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + mov r1, r8 + strh r1, [r0, 0x2E] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + mov r1, r10 + strh r1, [r0, 0x30] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x9 + bls _081C4B30 +_081C4BD2: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4AF8 + + thumb_func_start sub_81C4BE4 +sub_81C4BE4: @ 81C4BE4 + push {lr} + adds r3, r0, 0 + adds r0, 0x2A + ldrb r0, [r0] + subs r0, 0x4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bhi _081C4C1C + ldrh r0, [r3, 0x30] + adds r0, 0x1 + movs r1, 0x1F + ands r0, r1 + strh r0, [r3, 0x30] + cmp r0, 0x18 + ble _081C4C10 + adds r2, r3, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + b _081C4C2A +_081C4C10: + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + b _081C4C28 +_081C4C1C: + movs r0, 0 + strh r0, [r3, 0x30] + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + subs r0, 0x5 +_081C4C28: + ands r0, r1 +_081C4C2A: + strb r0, [r2] + movs r1, 0x2E + ldrsh r0, [r3, r1] + cmp r0, 0x8 + bne _081C4C44 + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =0x000040c6 + b _081C4C4A + .pool +_081C4C44: + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =0x000040c7 +_081C4C4A: + adds r0, r1 + ldrb r0, [r0] + lsls r0, 4 + strh r0, [r3, 0x26] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4BE4 + + thumb_func_start sub_81C4C60 +sub_81C4C60: @ 81C4C60 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 +_081C4C68: + adds r0, r5, r4 + lsls r0, 24 + lsrs r0, 24 + bl sub_81C41C0 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x9 + bls _081C4C68 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81C4C60 + + thumb_func_start sub_81C4C84 +sub_81C4C84: @ 81C4C84 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =gUnknown_0203CF1C + ldr r0, [r0] + ldr r1, =0x000040db + adds r5, r0, r1 + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 24 + movs r4, 0 + ldr r7, =gSprites + movs r2, 0x80 + lsls r2, 19 + adds r2, r0 + mov r9, r2 + lsrs r6, r0, 24 + movs r1, 0xA0 + lsls r1, 19 + adds r1, r0 + mov r8, r1 +_081C4CB4: + cmp r4, 0 + bne _081C4CD4 + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + mov r2, r9 + b _081C4CE4 + .pool +_081C4CD4: + cmp r4, 0x9 + bne _081C4CEC + ldrb r1, [r5, 0x9] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + mov r2, r8 +_081C4CE4: + lsrs r1, r2, 24 + bl StartSpriteAnim + b _081C4D02 +_081C4CEC: + adds r0, r5, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + adds r1, r6, 0x6 + lsls r1, 24 + lsrs r1, 24 + bl StartSpriteAnim +_081C4D02: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x9 + bls _081C4CB4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81C4C84 + + thumb_func_start sub_81C4D18 +sub_81C4D18: @ 81C4D18 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0203CF1C + ldr r2, =0x000040d3 + adds r0, r2 + ldr r1, [r1] + adds r5, r1, r0 + movs r3, 0 + ldr r4, =gSprites + movs r7, 0x5 + negs r7, r7 + movs r6, 0 +_081C4D32: + adds r2, r5, r3 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r6, [r0, 0x30] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + adds r1, 0x3E + ldrb r2, [r1] + adds r0, r7, 0 + ands r0, r2 + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x9 + bls _081C4D32 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4D18 + + thumb_func_start sub_81C4D70 +sub_81C4D70: @ 81C4D70 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + ldr r4, =gUnknown_0203CF28 + movs r0, 0x4 + bl Alloc + str r0, [r4] + ldr r1, [r5] + lsls r0, r1, 20 + lsrs r4, r0, 30 + cmp r4, 0 + bne _081C4DDC + lsls r0, r1, 30 + lsrs r0, 30 + movs r1, 0x8 + movs r2, 0 + bl SetBgAttribute + ldr r3, [r5] + lsls r0, r3, 30 + lsrs r0, 30 + ldr r1, =gUnknown_0861D1A0 + lsls r3, 22 + lsrs r3, 24 + str r4, [sp] + movs r2, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r0, [r5] + lsls r0, 30 + lsrs r0, 30 + ldr r1, =gUnknown_0861DEF4 + movs r2, 0x1 + str r2, [sp] + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r1, [r5] + lsls r1, 22 + lsrs r1, 24 + str r4, [sp] + movs r2, 0x20 + movs r3, 0x20 + bl sub_8199D3C + b _081C4E2E + .pool +_081C4DDC: + lsls r0, r1, 30 + lsrs r0, 30 + movs r1, 0x8 + movs r2, 0x2 + bl SetBgAttribute + ldr r0, [r5] + lsls r0, 30 + lsrs r0, 30 + movs r1, 0x9 + movs r2, 0x1 + bl SetBgAttribute + ldr r3, [r5] + lsls r0, r3, 30 + lsrs r0, 30 + ldr r1, =gUnknown_0861E208 + lsls r3, 22 + lsrs r3, 24 + movs r2, 0 + str r2, [sp] + bl decompress_and_copy_tile_data_to_vram + ldr r0, [r5] + lsls r0, 30 + lsrs r0, 30 + ldr r1, =gUnknown_0861EF64 + movs r4, 0x1 + str r4, [sp] + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r1, [r5] + lsls r1, 22 + lsrs r1, 24 + str r4, [sp] + movs r2, 0x40 + movs r3, 0x40 + bl sub_8199D3C +_081C4E2E: + ldr r0, [r5] + lsls r0, 30 + lsrs r0, 30 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + ldr r0, [r5] + lsls r0, 30 + lsrs r0, 30 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + ldr r0, [r5] + lsls r0, 30 + lsrs r0, 30 + movs r1, 0x4 + movs r2, 0x1 + bl SetBgAttribute + ldr r0, =gUnknown_0861D140 + ldr r1, =gPlttBufferUnfaded + 0xE0 + ldr r2, =0x04000018 + bl CpuSet + ldr r0, =gUnknown_0203CF28 + ldr r1, [r0] + ldr r0, [r5] + lsls r0, 30 + lsrs r0, 30 + strb r0, [r1] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4D70 + + thumb_func_start sub_81C4E90 +sub_81C4E90: @ 81C4E90 + push {lr} + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + beq _081C4EA0 + movs r0, 0x1 + b _081C4EAC +_081C4EA0: + ldr r0, =gUnknown_0203CF28 + ldr r0, [r0] + ldrb r0, [r0] + bl ShowBg + movs r0, 0 +_081C4EAC: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81C4E90 + + thumb_func_start sub_81C4EB4 +sub_81C4EB4: @ 81C4EB4 + push {r4,lr} + ldr r4, =gUnknown_0203CF28 + ldr r0, [r4] + cmp r0, 0 + beq _081C4EC6 + bl Free + movs r0, 0 + str r0, [r4] +_081C4EC6: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4EB4 + + thumb_func_start sub_81C4ED0 +sub_81C4ED0: @ 81C4ED0 + push {lr} + adds r1, r0, 0 + ldr r0, =gUnknown_0203CF28 + ldr r0, [r0] + ldrb r0, [r0] + lsls r1, 8 + movs r2, 0 + bl ChangeBgY + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4ED0 + + thumb_func_start sub_81C4EEC +sub_81C4EEC: @ 81C4EEC + ldr r1, =gUnknown_0203CF30 + movs r0, 0 + strh r0, [r1, 0x6] + strh r0, [r1, 0x8] + bx lr + .pool + thumb_func_end sub_81C4EEC + + thumb_func_start sub_81C4EFC +sub_81C4EFC: @ 81C4EFC + push {lr} + ldr r1, =sub_8086194 + movs r0, 0 + bl sub_81C4F98 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4EFC + + thumb_func_start sub_81C4F10 +sub_81C4F10: @ 81C4F10 + push {lr} + ldr r1, =sub_8059D50 + movs r0, 0x1 + bl sub_81C4F98 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4F10 + + thumb_func_start sub_81C4F24 +sub_81C4F24: @ 81C4F24 + push {lr} + bl ScriptContext2_Enable + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r0, =sub_81C4F44 + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4F24 + + thumb_func_start sub_81C4F44 +sub_81C4F44: @ 81C4F44 + 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 _081C4F6E + bl overworld_free_bg_tilemaps + ldr r0, =gUnknown_03005DB0 + ldr r1, =hm_add_c3_without_phase_2 + str r1, [r0] + ldr r1, =c2_exit_to_overworld_2_switch + movs r0, 0x3 + bl sub_81C4F98 + adds r0, r4, 0 + bl DestroyTask +_081C4F6E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4F44 + + thumb_func_start sub_81C4F84 +sub_81C4F84: @ 81C4F84 + push {lr} + ldr r0, =gUnknown_0203CF30 + ldr r1, [r0] + movs r0, 0x4 + bl sub_81C4F98 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4F84 + + thumb_func_start sub_81C4F98 +sub_81C4F98: @ 81C4F98 + push {r4-r6,lr} + adds r5, r1, 0 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r6, =gUnknown_0203CF2C + ldr r0, =0x0000098c + bl AllocZeroed + str r0, [r6] + cmp r4, 0x4 + beq _081C4FB2 + ldr r0, =gUnknown_0203CF30 + strb r4, [r0, 0x4] +_081C4FB2: + cmp r5, 0 + beq _081C4FBA + ldr r0, =gUnknown_0203CF30 + str r5, [r0] +_081C4FBA: + ldr r0, [r6] + movs r1, 0 + str r1, [r0] + ldr r1, =0x00000814 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldr r0, [r6] + ldr r1, =0x00000816 + adds r0, r1 + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + ldr r0, [r6] + ldr r1, =0x00000804 + adds r0, r1 + movs r1, 0xFF + movs r2, 0xB + bl memset + ldr r0, [r6] + ldr r1, =0x0000080f + adds r0, r1 + movs r1, 0xFF + movs r2, 0x5 + bl memset + ldr r0, =sub_81C504C + bl SetMainCallback2 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4F98 + + thumb_func_start sub_81C501C +sub_81C501C: @ 81C501C + push {lr} + bl RunTasks + bl AnimateSprites + bl BuildOamBuffer + bl do_scheduled_bg_tilemap_copies_to_vram + bl UpdatePaletteFade + pop {r0} + bx r0 + thumb_func_end sub_81C501C + + thumb_func_start sub_81C5038 +sub_81C5038: @ 81C5038 + push {lr} + bl LoadOam + bl ProcessSpriteCopyRequests + bl TransferPlttBuffer + pop {r0} + bx r0 + thumb_func_end sub_81C5038 + + thumb_func_start sub_81C504C +sub_81C504C: @ 81C504C + push {lr} +_081C504E: + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C5072 + bl sub_81C5078 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C5072 + bl sub_81221AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C504E +_081C5072: + pop {r0} + bx r0 + thumb_func_end sub_81C504C + + thumb_func_start sub_81C5078 +sub_81C5078: @ 81C5078 + push {lr} + sub sp, 0x4 + ldr r0, =gMain + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x10 + bls _081C508C + b _081C51BC +_081C508C: + lsls r0, 2 + ldr r1, =_081C50A0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081C50A0: + .4byte _081C50E4 + .4byte _081C50EE + .4byte _081C50F4 + .4byte _081C50FA + .4byte _081C510C + .4byte _081C5112 + .4byte _081C5122 + .4byte _081C513C + .4byte _081C5148 + .4byte _081C514E + .4byte _081C515C + .4byte _081C5162 + .4byte _081C5168 + .4byte _081C516E + .4byte _081C5174 + .4byte _081C517A + .4byte _081C5188 +_081C50E4: + bl SetVBlankHBlankCallbacksToNull + bl clear_scheduled_bg_copies_to_vram + b _081C51A2 +_081C50EE: + bl remove_some_task + b _081C51A2 +_081C50F4: + bl FreeAllSpritePalettes + b _081C51A2 +_081C50FA: + bl ResetPaletteFade + ldr r2, =gPaletteFade + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + b _081C51A0 + .pool +_081C510C: + bl ResetSpriteData + b _081C51A2 +_081C5112: + bl sub_81221AC + lsls r0, 24 + cmp r0, 0 + bne _081C51A2 + bl ResetTasks + b _081C51A2 +_081C5122: + bl sub_81C51DC + ldr r0, =gUnknown_0203CF2C + ldr r0, [r0] + ldr r1, =0x00000984 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + b _081C51A2 + .pool +_081C513C: + bl sub_81C5238 + lsls r0, 24 + cmp r0, 0 + beq _081C51D4 + b _081C51A2 +_081C5148: + bl sub_81C6BD8 + b _081C51A2 +_081C514E: + bl sub_81C5924 + bl sub_81C59BC + bl sub_81C5A20 + b _081C51A2 +_081C515C: + bl sub_81C5314 + b _081C51A2 +_081C5162: + bl sub_81C56F8 + b _081C51A2 +_081C5168: + bl sub_81C6EF4 + b _081C51A2 +_081C516E: + bl sub_81C5674 + b _081C51A2 +_081C5174: + bl sub_81C700C + b _081C51A2 +_081C517A: + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl BlendPalettes + b _081C51A2 +_081C5188: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade + ldr r2, =gPaletteFade + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 +_081C51A0: + strb r0, [r2, 0x8] +_081C51A2: + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _081C51D4 + .pool +_081C51BC: + ldr r0, =sub_81C5038 + bl SetVBlankCallback + ldr r0, =sub_81C501C + bl SetMainCallback2 + movs r0, 0x1 + b _081C51D6 + .pool +_081C51D4: + movs r0, 0 +_081C51D6: + add sp, 0x4 + pop {r1} + bx r1 + thumb_func_end sub_81C5078 + + thumb_func_start sub_81C51DC +sub_81C51DC: @ 81C51DC + push {lr} + bl sub_8121DA0 + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_0861F2B4 + movs r0, 0 + movs r2, 0x3 + bl InitBgsFromTemplates + ldr r0, =gUnknown_0203CF2C + ldr r1, [r0] + adds r1, 0x4 + movs r0, 0x2 + bl SetBgTilemapBuffer + bl sub_8121E10 + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C51DC + + thumb_func_start sub_81C5238 +sub_81C5238: @ 81C5238 + push {r4,lr} + sub sp, 0x4 + ldr r4, =gUnknown_0203CF2C + ldr r0, [r4] + ldr r1, =0x00000984 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x4 + bhi _081C52F0 + lsls r0, 2 + ldr r1, =_081C5264 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081C5264: + .4byte _081C5278 + .4byte _081C5294 + .4byte _081C52B8 + .4byte _081C52C8 + .4byte _081C52D4 +_081C5278: + bl reset_temp_tile_data_buffers + ldr r1, =gUnknown_08D9A620 + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + b _081C52D8 + .pool +_081C5294: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C5308 + ldr r0, =gUnknown_08D9AE04 + ldr r4, =gUnknown_0203CF2C + ldr r1, [r4] + adds r1, 0x4 + bl LZDecompressWram + ldr r1, [r4] + b _081C52DC + .pool +_081C52B8: + ldr r0, =gUnknown_08D9AF44 + movs r1, 0 + movs r2, 0x20 + bl LoadCompressedPalette + b _081C52D8 + .pool +_081C52C8: + ldr r0, =gUnknown_0861F3CC + bl LoadCompressedObjectPic + b _081C52D8 + .pool +_081C52D4: + bl sub_81C6E98 +_081C52D8: + ldr r0, =gUnknown_0203CF2C + ldr r1, [r0] +_081C52DC: + ldr r0, =0x00000984 + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _081C5308 + .pool +_081C52F0: + bl sub_8122328 + ldr r0, [r4] + ldr r1, =0x00000984 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + movs r0, 0x1 + b _081C530A + .pool +_081C5308: + movs r0, 0 +_081C530A: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81C5238 + + thumb_func_start sub_81C5314 +sub_81C5314: @ 81C5314 + push {r4-r7,lr} + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r1, =0x00000ca9 + adds r0, r2, r1 + ldrb r1, [r0] + lsls r1, 30 + lsrs r1, 30 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + ldr r3, =0x00000e2c + adds r0, r3 + adds r7, r2, r0 + movs r6, 0 + ldr r1, =gUnknown_0203CF2C + ldr r0, [r1] + ldr r4, =0x00000821 + adds r0, r4 + ldrb r0, [r0] + subs r0, 0x1 + cmp r6, r0 + bge _081C5382 + adds r5, r1, 0 +_081C5344: + lsls r1, r6, 1 + adds r4, r1, r6 + lsls r4, 3 + ldr r0, =0x0000087c + adds r4, r0 + ldr r0, [r5] + adds r0, r4 + adds r1, r7 + ldrh r1, [r1] + bl sub_81C540C + ldr r1, [r5] + lsls r2, r6, 3 + ldr r3, =0x00000824 + adds r0, r1, r3 + adds r0, r2 + adds r4, r1, r4 + str r4, [r0] + ldr r4, =0x00000828 + adds r0, r1, r4 + adds r0, r2 + str r6, [r0] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, =0x00000821 + adds r1, r0 + ldrb r0, [r1] + subs r0, 0x1 + cmp r6, r0 + blt _081C5344 +_081C5382: + ldr r5, =gUnknown_0203CF2C + lsls r4, r6, 1 + adds r4, r6 + lsls r4, 3 + ldr r1, =0x0000087c + adds r4, r1 + ldr r0, [r5] + adds r0, r4 + ldr r1, =gText_CloseBag + bl StringCopy + ldr r1, [r5] + lsls r2, r6, 3 + ldr r3, =0x00000824 + adds r0, r1, r3 + adds r0, r2 + adds r4, r1, r4 + str r4, [r0] + ldr r4, =0x00000828 + adds r1, r4 + adds r1, r2 + movs r0, 0x2 + negs r0, r0 + str r0, [r1] + ldr r2, =gUnknown_03006310 + adds r1, r2, 0 + ldr r0, =gUnknown_0861F2C0 + ldm r0!, {r4,r6,r7} + stm r1!, {r4,r6,r7} + ldm r0!, {r4,r6,r7} + stm r1!, {r4,r6,r7} + ldr r1, [r5] + ldr r6, =0x00000821 + adds r0, r1, r6 + ldrb r0, [r0] + strh r0, [r2, 0xC] + adds r3, r1, r3 + str r3, [r2] + ldr r7, =0x00000822 + adds r1, r7 + ldrb r0, [r1] + strh r0, [r2, 0xE] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C5314 + + thumb_func_start sub_81C540C +sub_81C540C: @ 81C540C + push {r4,r5,lr} + adds r5, r0, 0 + lsls r1, 16 + lsrs r4, r1, 16 + adds r0, r4, 0 + bl ItemId_GetPocket + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bne _081C5450 + ldr r0, =gStringVar1 + adds r1, r4, 0 + subs r1, 0x84 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalStringN + ldr r1, =gStringVar2 + adds r0, r4, 0 + bl CopyItemName + ldr r1, =gUnknown_085E9210 + adds r0, r5, 0 + bl StringExpandPlaceholders + b _081C5458 + .pool +_081C5450: + adds r0, r4, 0 + adds r1, r5, 0 + bl CopyItemName +_081C5458: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81C540C + + thumb_func_start sub_81C5460 +sub_81C5460: @ 81C5460 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x1 + beq _081C5476 + movs r0, 0x5 + bl PlaySE + bl sub_81C6F20 +_081C5476: + ldr r5, =gUnknown_0203CF2C + ldr r1, [r5] + ldr r2, =0x00000814 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0xFF + bne _081C5504 + adds r2, 0x1 + adds r0, r1, r2 + ldrb r1, [r0] + movs r0, 0x1 + eors r0, r1 + bl sub_81C6FF8 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _081C54E0 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + lsls r3, r4, 1 + ldr r1, =0x00000ca9 + adds r0, r2, r1 + ldrb r1, [r0] + lsls r1, 30 + lsrs r1, 30 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r3, r0 + ldr r0, =0x00000e2c + adds r2, r0 + adds r2, r3 + ldrh r0, [r2] + ldr r1, [r5] + ldr r2, =0x00000815 + adds r1, r2 + ldrb r1, [r1] + bl sub_81C6F90 + b _081C54EE + .pool +_081C54E0: + ldr r0, =0x0000ffff + ldr r1, [r5] + ldr r2, =0x00000815 + adds r1, r2 + ldrb r1, [r1] + bl sub_81C6F90 +_081C54EE: + ldr r0, =gUnknown_0203CF2C + ldr r1, [r0] + ldr r0, =0x00000815 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x1 + eors r0, r2 + strb r0, [r1] + adds r0, r4, 0 + bl sub_81C55D8 +_081C5504: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C5460 + + thumb_func_start sub_81C5518 +sub_81C5518: @ 81C5518 + push {r4-r6,lr} + sub sp, 0x10 + adds r4, r1, 0 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r2, 24 + lsrs r5, r2, 24 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _081C55B8 + ldr r0, =gUnknown_0203CF2C + ldr r0, [r0] + ldr r1, =0x00000814 + adds r0, r1 + ldrb r1, [r0] + cmp r1, 0xFF + beq _081C5560 + lsls r0, r4, 24 + lsrs r0, 24 + cmp r1, r0 + bne _081C5558 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_81C5AB8 + b _081C5560 + .pool +_081C5558: + adds r0, r5, 0 + movs r1, 0xFF + bl sub_81C5AB8 +_081C5560: + ldr r0, =gStringVar1 + ldr r1, =gSaveBlock2Ptr + ldr r3, [r1] + ldr r2, =0x00000ca9 + adds r1, r3, r2 + ldrb r2, [r1] + lsls r2, 30 + lsrs r2, 30 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 1 + adds r1, r4, r1 + ldr r2, =0x00000e54 + adds r3, r2 + adds r3, r1 + ldrb r1, [r3] + movs r2, 0x1 + movs r3, 0x2 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gText_xVar1 + adds r0, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x7 + adds r1, r4, 0 + movs r2, 0x77 + bl GetStringRightAlignXOffset + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + movs r1, 0 + str r1, [sp] + str r1, [sp, 0x4] + movs r0, 0xFF + str r0, [sp, 0x8] + str r1, [sp, 0xC] + adds r0, r6, 0 + adds r1, r4, 0 + adds r3, r5, 0 + bl sub_81C6C94 +_081C55B8: + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C5518 + + thumb_func_start sub_81C55D8 +sub_81C55D8: @ 81C55D8 + push {r4,lr} + sub sp, 0x10 + adds r3, r0, 0 + movs r0, 0x2 + negs r0, r0 + cmp r3, r0 + beq _081C561C + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + lsls r3, 1 + ldr r1, =0x00000ca9 + adds r0, r2, r1 + ldrb r1, [r0] + lsls r1, 30 + lsrs r1, 30 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r3, r0 + ldr r0, =0x00000e2c + adds r2, r0 + adds r2, r3 + ldrh r0, [r2] + bl ItemId_GetDescription + adds r4, r0, 0 + b _081C5638 + .pool +_081C561C: + ldr r0, =gStringVar1 + ldr r2, =gUnknown_085E91B0 + ldr r1, =gUnknown_0203CF30 + ldrb r1, [r1, 0x4] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl StringCopy + ldr r4, =gStringVar4 + ldr r1, =gText_ReturnToVar1 + adds r0, r4, 0 + bl StringExpandPlaceholders +_081C5638: + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r1, 0 + str r1, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + str r1, [sp, 0x8] + str r1, [sp, 0xC] + adds r1, r4, 0 + movs r2, 0x3 + movs r3, 0 + bl sub_81C6C3C + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C55D8 + + thumb_func_start sub_81C5674 +sub_81C5674: @ 81C5674 + push {r4,lr} + sub sp, 0x10 + ldr r4, =gUnknown_0203CF2C + ldr r1, [r4] + ldr r2, =0x00000816 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0xFF + bne _081C56B4 + adds r2, 0xB + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + subs r0, r1 + str r0, [sp] + ldr r0, =0x00000b5e + str r0, [sp, 0x4] + str r0, [sp, 0x8] + ldr r0, =gUnknown_0203CF38 + str r0, [sp, 0xC] + movs r0, 0x2 + movs r1, 0xAC + movs r2, 0xC + movs r3, 0x94 + bl AddScrollIndicatorArrowPairParametrized + ldr r1, [r4] + ldr r2, =0x00000816 + adds r1, r2 + strb r0, [r1] +_081C56B4: + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C5674 + + thumb_func_start sub_81C56CC +sub_81C56CC: @ 81C56CC + push {r4,lr} + ldr r4, =gUnknown_0203CF2C + ldr r0, [r4] + ldr r2, =0x00000816 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xFF + beq _081C56EA + bl RemoveScrollIndicatorArrowPair + ldr r0, [r4] + ldr r1, =0x00000816 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] +_081C56EA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C56CC + + thumb_func_start sub_81C56F8 +sub_81C56F8: @ 81C56F8 + push {r4,lr} + ldr r0, =sub_81C5BC8 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + ldr r0, =gUnknown_03006310 + ldr r2, =gUnknown_0203CF30 + ldrh r1, [r2, 0x8] + ldrh r2, [r2, 0x6] + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C56F8 + + thumb_func_start sub_81C5738 +sub_81C5738: @ 81C5738 + push {r4-r6,lr} + mov r6, r8 + push {r6} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gSaveBlock2Ptr + ldr r6, [r2] + ldr r3, =0x00000ca9 + adds r2, r6, r3 + ldrb r3, [r2] + lsls r3, 30 + lsrs r2, r3, 30 + lsls r4, r2, 2 + adds r4, r2 + lsls r4, 2 + ldr r2, =0x00000e2c + adds r4, r2 + adds r4, r6, r4 + lsrs r3, 30 + lsls r2, r3, 2 + adds r2, r3 + lsls r2, 1 + ldr r3, =0x00000e54 + adds r2, r3 + adds r6, r2 + lsls r5, r0, 1 + adds r5, r4 + ldrh r2, [r5] + mov r8, r2 + lsls r2, r1, 1 + adds r2, r4 + ldrh r3, [r2] + strh r3, [r5] + mov r3, r8 + strh r3, [r2] + adds r0, r6, r0 + ldrb r2, [r0] + adds r6, r1 + ldrb r1, [r6] + strb r1, [r0] + strb r2, [r6] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C5738 + + thumb_func_start sub_81C57A8 +sub_81C57A8: @ 81C57A8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r4, r0, 24 + adds r7, r4, 0 + lsls r1, 24 + lsrs r5, r1, 24 + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r1, =0x00000ca9 + adds r0, r3, r1 + ldrb r1, [r0] + lsls r1, 30 + lsrs r2, r1, 30 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x00000e2c + adds r0, r2 + adds r6, r3, r0 + lsrs r1, 30 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 1 + ldr r1, =0x00000e54 + adds r0, r1 + adds r3, r0 + cmp r4, r5 + beq _081C5862 + lsls r0, r4, 1 + adds r0, r6 + ldrh r0, [r0] + mov r12, r0 + adds r0, r3, r4 + ldrb r0, [r0] + mov r8, r0 + cmp r5, r4 + bls _081C5830 + subs r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r2, r4, 16 + cmp r4, r5 + bge _081C5854 +_081C5802: + asrs r2, 16 + lsls r0, r2, 1 + adds r0, r6 + ldrh r1, [r0, 0x2] + strh r1, [r0] + adds r1, r3, r2 + ldrb r0, [r1, 0x1] + strb r0, [r1] + adds r2, 0x1 + lsls r2, 16 + asrs r0, r2, 16 + cmp r0, r5 + blt _081C5802 + b _081C5854 + .pool +_081C5830: + lsls r2, r7, 16 + cmp r7, r5 + ble _081C5854 +_081C5836: + asrs r2, 16 + lsls r1, r2, 1 + adds r1, r6 + subs r0, r1, 0x2 + ldrh r0, [r0] + strh r0, [r1] + adds r1, r3, r2 + subs r0, r1, 0x1 + ldrb r0, [r0] + strb r0, [r1] + subs r2, 0x1 + lsls r2, 16 + asrs r0, r2, 16 + cmp r0, r5 + bgt _081C5836 +_081C5854: + lsls r0, r5, 1 + adds r0, r6 + mov r2, r12 + strh r2, [r0] + adds r0, r3, r5 + mov r1, r8 + strb r1, [r0] +_081C5862: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81C57A8 + + thumb_func_start sub_81C586C +sub_81C586C: @ 81C586C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r1, =0x00000ca9 + adds r0, r3, r1 + ldrb r1, [r0] + lsls r1, 30 + lsrs r2, r1, 30 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x00000e2c + adds r0, r2 + adds r0, r3 + mov r9, r0 + lsrs r1, 30 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 1 + ldr r4, =0x00000e54 + adds r0, r4 + adds r3, r0 + mov r8, r3 + movs r5, 0 + movs r3, 0 +_081C58A4: + lsls r0, r5, 1 + mov r1, r9 + adds r2, r0, r1 + ldrh r0, [r2] + mov r4, r8 + adds r1, r4, r5 + cmp r0, 0 + beq _081C58BA + ldrb r0, [r1] + cmp r0, 0 + bne _081C58BE +_081C58BA: + strh r3, [r2] + strb r3, [r1] +_081C58BE: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x9 + bls _081C58A4 + movs r5, 0 +_081C58CA: + adds r1, r5, 0x1 + lsls r0, r1, 24 + lsrs r4, r0, 24 + adds r7, r1, 0 + cmp r4, 0x9 + bhi _081C58FE + lsls r0, r5, 1 + mov r1, r9 + adds r6, r0, r1 +_081C58DC: + ldrh r0, [r6] + cmp r0, 0 + beq _081C58EC + mov r2, r8 + adds r0, r2, r5 + ldrb r0, [r0] + cmp r0, 0 + bne _081C58F4 +_081C58EC: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81C5738 +_081C58F4: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x9 + bls _081C58DC +_081C58FE: + lsls r0, r7, 24 + lsrs r5, r0, 24 + cmp r5, 0x8 + bls _081C58CA + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C586C + + thumb_func_start sub_81C5924 +sub_81C5924: @ 81C5924 + push {r4-r6,lr} + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r1, =0x00000ca9 + adds r0, r2, r1 + ldrb r1, [r0] + lsls r1, 30 + lsrs r1, 30 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x00000e2c + adds r0, r1 + adds r5, r2, r0 + bl sub_81C586C + ldr r3, =gUnknown_0203CF2C + ldr r0, [r3] + ldr r2, =0x00000821 + adds r0, r2 + movs r1, 0 + strb r1, [r0] + movs r4, 0 + adds r6, r3, 0 +_081C5954: + lsls r0, r4, 1 + adds r0, r5 + ldrh r0, [r0] + ldr r3, =gUnknown_0203CF2C + cmp r0, 0 + beq _081C596A + ldr r1, [r6] + adds r1, r2 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_081C596A: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x9 + bls _081C5954 + ldr r0, [r3] + ldr r2, =0x00000821 + adds r0, r2 + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + ldr r0, [r3] + adds r2, r0, r2 + ldrb r2, [r2] + cmp r2, 0x8 + bls _081C59AC + ldr r2, =0x00000822 + adds r1, r0, r2 + movs r0, 0x8 + strb r0, [r1] + b _081C59B2 + .pool +_081C59AC: + ldr r1, =0x00000822 + adds r0, r1 + strb r2, [r0] +_081C59B2: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C5924 + + thumb_func_start sub_81C59BC +sub_81C59BC: @ 81C59BC + push {r4,r5,lr} + ldr r0, =gUnknown_0203CF30 + ldrh r1, [r0, 0x8] + adds r3, r0, 0 + ldr r4, =gUnknown_0203CF2C + cmp r1, 0 + beq _081C59E4 + ldrh r0, [r3, 0x8] + ldr r1, [r4] + ldr r5, =0x00000822 + adds r2, r1, r5 + ldrb r2, [r2] + adds r0, r2 + subs r5, 0x1 + adds r1, r5 + ldrb r1, [r1] + cmp r0, r1 + ble _081C59E4 + subs r0, r1, r2 + strh r0, [r3, 0x8] +_081C59E4: + adds r2, r3, 0 + ldrh r1, [r2, 0x8] + ldrh r0, [r2, 0x6] + adds r1, r0 + ldr r0, [r4] + ldr r4, =0x00000821 + adds r0, r4 + ldrb r0, [r0] + cmp r1, r0 + blt _081C5A18 + adds r1, r0, 0 + cmp r1, 0 + bne _081C5A14 + strh r1, [r2, 0x6] + b _081C5A18 + .pool +_081C5A14: + subs r0, 0x1 + strh r0, [r3, 0x6] +_081C5A18: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81C59BC + + thumb_func_start sub_81C5A20 +sub_81C5A20: @ 81C5A20 + push {r4-r7,lr} + ldr r0, =gUnknown_0203CF30 + ldrh r1, [r0, 0x6] + adds r5, r0, 0 + cmp r1, 0x4 + bls _081C5A80 + movs r4, 0 + ldrh r0, [r5, 0x6] + subs r0, 0x4 + cmp r4, r0 + bgt _081C5A80 + ldrh r2, [r5, 0x8] + ldr r6, =gUnknown_0203CF2C + ldr r0, [r6] + ldr r3, =0x00000822 + adds r1, r0, r3 + ldrb r1, [r1] + adds r2, r1 + ldr r7, =0x00000821 + adds r0, r7 + ldrb r0, [r0] + cmp r2, r0 + beq _081C5A80 + adds r3, r5, 0 +_081C5A50: + ldrh r0, [r3, 0x6] + subs r0, 0x1 + strh r0, [r3, 0x6] + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + ldrh r0, [r3, 0x6] + subs r0, 0x4 + cmp r4, r0 + bgt _081C5A80 + ldrh r2, [r5, 0x8] + ldr r1, [r6] + ldr r7, =0x00000822 + adds r0, r1, r7 + ldrb r0, [r0] + adds r2, r0 + ldr r0, =0x00000821 + adds r1, r0 + ldrb r1, [r1] + cmp r2, r1 + bne _081C5A50 +_081C5A80: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C5A20 + + thumb_func_start sub_81C5A98 +sub_81C5A98: @ 81C5A98 + push {r4,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsrs r4, 24 + bl ListMenuGetYCoordForPrintingArrowCursor + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + bl sub_81C5AB8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81C5A98 + + thumb_func_start sub_81C5AB8 +sub_81C5AB8: @ 81C5AB8 + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r2, r1, 24 + cmp r2, 0xFF + bne _081C5AF4 + movs r0, 0x1 + movs r1, 0 + bl GetMenuCursorDimensionByFont + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + movs r1, 0x1 + bl GetMenuCursorDimensionByFont + lsls r0, 24 + lsrs r0, 24 + str r4, [sp] + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + adds r3, r5, 0 + bl FillWindowPixelRect + b _081C5B08 +_081C5AF4: + ldr r1, =gText_SelectorArrow2 + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r2, [sp, 0xC] + movs r2, 0 + adds r3, r5, 0 + bl sub_81C6C3C +_081C5B08: + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C5AB8 + + thumb_func_start sub_81C5B14 +sub_81C5B14: @ 81C5B14 + 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_81C5B4C + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C5B14 + + thumb_func_start sub_81C5B4C +sub_81C5B4C: @ 81C5B4C + 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 r2, r0, r1 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081C5BBC + ldrb r0, [r2] + ldr r4, =gUnknown_0203CF38 + subs r2, r4, 0x2 + adds r1, r4, 0 + bl sub_81AE6C8 + ldr r0, =gUnknown_0203CF2C + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0 + beq _081C5B94 + bl SetMainCallback2 + b _081C5B9E + .pool +_081C5B94: + adds r0, r4, 0 + subs r0, 0x8 + ldr r0, [r0] + bl SetMainCallback2 +_081C5B9E: + bl sub_81C56CC + bl ResetSpriteData + bl FreeAllSpritePalettes + bl FreeAllWindowBuffers + ldr r0, =gUnknown_0203CF2C + ldr r0, [r0] + bl Free + adds r0, r5, 0 + bl DestroyTask +_081C5BBC: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C5B4C + + thumb_func_start sub_81C5BC8 +sub_81C5BC8: @ 81C5BC8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r7, r0, r1 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C5BEA + b _081C5D16 +_081C5BEA: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081C5BF8 + b _081C5D16 +_081C5BF8: + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x4 + ands r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _081C5C5C + ldr r4, =gUnknown_0203CF30 + ldrb r0, [r4, 0x4] + cmp r0, 0x2 + bne _081C5C12 + b _081C5D16 +_081C5C12: + ldrb r0, [r7] + adds r1, r4, 0 + adds r1, 0x8 + adds r2, r4, 0x6 + bl get_coro_args_x18_x1A + ldrh r1, [r4, 0x8] + ldrh r0, [r4, 0x6] + adds r1, r0 + ldr r0, =gUnknown_0203CF2C + ldr r0, [r0] + ldr r2, =0x00000821 + adds r0, r2 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + beq _081C5D16 + movs r0, 0x5 + bl PlaySE + adds r0, r5, 0 + bl sub_81C67CC + b _081C5D16 + .pool +_081C5C5C: + ldrb r0, [r7] + bl ListMenuHandleInput + adds r6, r0, 0 + ldrb r0, [r7] + ldr r1, =gUnknown_0203CF38 + mov r8, r1 + mov r2, r8 + subs r2, 0x2 + bl get_coro_args_x18_x1A + movs r0, 0x2 + negs r0, r0 + cmp r6, r0 + beq _081C5C88 + adds r0, 0x1 + cmp r6, r0 + bne _081C5CA0 + b _081C5D16 + .pool +_081C5C88: + movs r0, 0x5 + bl PlaySE + ldr r0, =gScriptItemId + strh r4, [r0] + adds r0, r5, 0 + bl sub_81C5B14 + b _081C5D16 + .pool +_081C5CA0: + movs r0, 0x5 + bl PlaySE + ldr r2, =gScriptItemId + mov r12, r2 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + lsls r3, r6, 1 + ldr r0, =0x00000ca9 + adds r4, r2, r0 + ldrb r1, [r4] + lsls r1, 30 + lsrs r1, 30 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r3, r0 + ldr r1, =0x00000e2c + adds r0, r2, r1 + adds r0, r3 + ldrh r0, [r0] + mov r1, r12 + strh r0, [r1] + strh r6, [r7, 0x2] + ldrb r1, [r4] + lsls r1, 30 + lsrs r1, 30 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 1 + adds r0, r6, r0 + ldr r1, =0x00000e54 + adds r2, r1 + adds r2, r0 + ldrb r0, [r2] + strh r0, [r7, 0x4] + mov r0, r8 + subs r0, 0x8 + ldrb r0, [r0, 0x4] + cmp r0, 0x2 + bne _081C5D10 + adds r0, r5, 0 + bl sub_81C674C + b _081C5D16 + .pool +_081C5D10: + adds r0, r5, 0 + bl sub_81C5D20 +_081C5D16: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81C5BC8 + + thumb_func_start sub_81C5D20 +sub_81C5D20: @ 81C5D20 + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + bl sub_81C56CC + ldrb r0, [r4] + movs r1, 0x1 + bl sub_81C5A98 + ldr r0, =gUnknown_0203CF30 + ldrb r4, [r0, 0x4] + cmp r4, 0x1 + beq _081C5D74 + cmp r4, 0x3 + beq _081C5DC4 + ldr r0, =gUnknown_0203CF2C + ldr r1, [r0] + ldr r0, =0x00000818 + adds r2, r1, r0 + ldr r0, =gUnknown_0861F308 + str r0, [r2] + movs r0, 0x82 + lsls r0, 4 + adds r1, r0 + movs r0, 0x4 + b _081C5DD8 + .pool +_081C5D74: + ldr r0, =gScriptItemId + ldrh r0, [r0] + bl ItemId_GetBattleUsage + lsls r0, 24 + cmp r0, 0 + beq _081C5DA0 + ldr r0, =gUnknown_0203CF2C + ldr r1, [r0] + ldr r0, =0x00000818 + adds r2, r1, r0 + ldr r0, =gUnknown_0861F30E + b _081C5DCE + .pool +_081C5DA0: + ldr r0, =gUnknown_0203CF2C + ldr r0, [r0] + ldr r1, =0x00000818 + adds r2, r0, r1 + ldr r1, =gUnknown_0861F310 + str r1, [r2] + movs r1, 0x82 + lsls r1, 4 + adds r0, r1 + strb r4, [r0] + b _081C5DDA + .pool +_081C5DC4: + ldr r0, =gUnknown_0203CF2C + ldr r1, [r0] + ldr r0, =0x00000818 + adds r2, r1, r0 + ldr r0, =gUnknown_0861F30C +_081C5DCE: + str r0, [r2] + movs r0, 0x82 + lsls r0, 4 + adds r1, r0 + movs r0, 0x2 +_081C5DD8: + strb r0, [r1] +_081C5DDA: + ldr r0, =gScriptItemId + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gText_Var1IsSelected + adds r0, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r1, 0 + str r1, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + str r1, [sp, 0x8] + str r1, [sp, 0xC] + adds r1, r4, 0 + movs r2, 0x3 + movs r3, 0 + bl sub_81C6C3C + ldr r0, =gUnknown_0203CF2C + ldr r0, [r0] + movs r1, 0x82 + lsls r1, 4 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081C5E3C + movs r0, 0 + b _081C5E42 + .pool +_081C5E3C: + cmp r0, 0x2 + bne _081C5E50 + movs r0, 0x1 +_081C5E42: + bl sub_81C6D24 + lsls r0, 24 + lsrs r0, 24 + bl sub_81C5EAC + b _081C5E62 +_081C5E50: + movs r0, 0x2 + bl sub_81C6D24 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + movs r2, 0x2 + bl sub_81C5F08 +_081C5E62: + ldr r0, =gUnknown_0203CF2C + ldr r0, [r0] + movs r1, 0x82 + lsls r1, 4 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x4 + bne _081C5E8C + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81C5FE4 + b _081C5E98 + .pool +_081C5E8C: + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81C5F68 +_081C5E98: + str r0, [r1] + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C5D20 + + thumb_func_start sub_81C5EAC +sub_81C5EAC: @ 81C5EAC + push {r4-r6,lr} + sub sp, 0x14 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + str r0, [sp] + movs r0, 0x10 + str r0, [sp, 0x4] + ldr r6, =gUnknown_0203CF2C + ldr r1, [r6] + movs r5, 0x82 + lsls r5, 4 + adds r0, r1, r5 + ldrb r0, [r0] + str r0, [sp, 0x8] + ldr r0, =gUnknown_0861F2D8 + str r0, [sp, 0xC] + ldr r0, =0x00000818 + adds r1, r0 + ldr r0, [r1] + str r0, [sp, 0x10] + adds r0, r4, 0 + movs r1, 0x7 + movs r2, 0x8 + movs r3, 0x1 + bl AddItemMenuActionTextPrinters + ldr r0, [r6] + adds r0, r5 + ldrb r1, [r0] + adds r0, r4, 0 + movs r2, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C5EAC + + thumb_func_start sub_81C5F08 +sub_81C5F08: @ 81C5F08 + push {r4-r6,lr} + sub sp, 0x14 + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + movs r0, 0x38 + str r0, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + ldr r0, =gUnknown_0861F2D8 + str r0, [sp, 0xC] + ldr r0, =gUnknown_0203CF2C + ldr r0, [r0] + ldr r1, =0x00000818 + adds r0, r1 + ldr r0, [r0] + str r0, [sp, 0x10] + adds r0, r4, 0 + movs r1, 0x7 + movs r2, 0x8 + movs r3, 0x1 + bl sub_8198DBC + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r1, 0x38 + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_8199944 + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C5F08 + + thumb_func_start sub_81C5F68 +sub_81C5F68: @ 81C5F68 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C5FD0 + bl ProcessMenuInputNoWrapAround + lsls r0, 24 + asrs r4, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _081C5FD0 + adds r0, 0x1 + cmp r4, r0 + bne _081C5FA8 + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_0861F2D8 + ldr r1, [r0, 0x1C] + adds r0, r5, 0 + bl _call_via_r1 + b _081C5FD0 + .pool +_081C5FA8: + movs r0, 0x5 + bl PlaySE + ldr r1, =gUnknown_0861F2D8 + ldr r0, =gUnknown_0203CF2C + ldr r0, [r0] + ldr r2, =0x00000818 + adds r0, r2 + ldr r0, [r0] + adds r0, r4 + ldrb r0, [r0] + lsls r0, 3 + adds r1, 0x4 + adds r0, r1 + ldr r1, [r0] + cmp r1, 0 + beq _081C5FD0 + adds r0, r6, 0 + bl _call_via_r1 +_081C5FD0: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C5F68 + + thumb_func_start sub_81C5FE4 +sub_81C5FE4: @ 81C5FE4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C5FF8 + b _081C6160 +_081C5FF8: + bl GetMenuCursorPos + lsls r0, 24 + lsrs r4, r0, 24 + ldr r5, =gMain + ldrh r1, [r5, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081C6040 + lsls r0, r4, 24 + asrs r0, 24 + cmp r0, 0 + bgt _081C6016 + b _081C6160 +_081C6016: + subs r0, 0x2 + lsls r0, 24 + asrs r0, 24 + bl sub_81C616C + lsls r0, 24 + cmp r0, 0 + bne _081C6028 + b _081C6160 +_081C6028: + movs r0, 0x5 + bl PlaySE + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + bl sub_8199134 + b _081C6160 + .pool +_081C6040: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081C6084 + lsls r0, r4, 24 + asrs r1, r0, 24 + ldr r0, =gUnknown_0203CF2C + ldr r0, [r0] + movs r2, 0x82 + lsls r2, 4 + adds r0, r2 + ldrb r0, [r0] + subs r0, 0x2 + cmp r1, r0 + blt _081C6060 + b _081C6160 +_081C6060: + adds r0, r1, 0x2 + lsls r0, 24 + asrs r0, 24 + bl sub_81C616C + lsls r0, 24 + cmp r0, 0 + beq _081C6160 + movs r0, 0x5 + bl PlaySE + movs r0, 0 + movs r1, 0x1 + bl sub_8199134 + b _081C6160 + .pool +_081C6084: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _081C6098 + bl GetLRKeysState + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C60C0 +_081C6098: + lsls r0, r4, 24 + asrs r1, r0, 24 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081C6160 + subs r0, r1, 0x1 + lsls r0, 24 + asrs r0, 24 + bl sub_81C616C + lsls r0, 24 + cmp r0, 0 + beq _081C6160 + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + negs r0, r0 + b _081C60FA +_081C60C0: + ldrh r1, [r5, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _081C60D6 + bl GetLRKeysState + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _081C6102 +_081C60D6: + lsls r0, r4, 24 + asrs r1, r0, 24 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081C6160 + adds r0, r1, 0x1 + lsls r0, 24 + asrs r0, 24 + bl sub_81C616C + lsls r0, 24 + cmp r0, 0 + beq _081C6160 + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 +_081C60FA: + movs r1, 0 + bl sub_8199134 + b _081C6160 +_081C6102: + ldrh r1, [r5, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081C6148 + movs r0, 0x5 + bl PlaySE + ldr r2, =gUnknown_0861F2D8 + ldr r0, =gUnknown_0203CF2C + ldr r0, [r0] + lsls r1, r4, 24 + asrs r1, 24 + ldr r3, =0x00000818 + adds r0, r3 + ldr r0, [r0] + adds r0, r1 + ldrb r0, [r0] + lsls r0, 3 + adds r2, 0x4 + adds r0, r2 + ldr r1, [r0] + cmp r1, 0 + beq _081C6160 + adds r0, r6, 0 + bl _call_via_r1 + b _081C6160 + .pool +_081C6148: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081C6160 + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_0861F2D8 + ldr r1, [r0, 0x1C] + adds r0, r6, 0 + bl _call_via_r1 +_081C6160: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C5FE4 + + thumb_func_start sub_81C616C +sub_81C616C: @ 81C616C + push {lr} + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + blt _081C61A0 + ldr r0, =gUnknown_0203CF2C + ldr r2, [r0] + movs r3, 0x82 + lsls r3, 4 + adds r0, r2, r3 + ldrb r0, [r0] + cmp r1, r0 + bgt _081C61A0 + ldr r3, =0x00000818 + adds r0, r2, r3 + ldr r0, [r0] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x5 + beq _081C61A0 + movs r0, 0x1 + b _081C61A2 + .pool +_081C61A0: + movs r0, 0 +_081C61A2: + pop {r1} + bx r1 + thumb_func_end sub_81C616C + + thumb_func_start sub_81C61A8 +sub_81C61A8: @ 81C61A8 + push {lr} + ldr r0, =gUnknown_0203CF2C + ldr r0, [r0] + movs r1, 0x82 + lsls r1, 4 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081C61C8 + movs r0, 0 + bl sub_81C6D6C + b _081C61DA + .pool +_081C61C8: + cmp r0, 0x2 + bne _081C61D4 + movs r0, 0x1 + bl sub_81C6D6C + b _081C61DA +_081C61D4: + movs r0, 0x2 + bl sub_81C6D6C +_081C61DA: + pop {r0} + bx r0 + thumb_func_end sub_81C61A8 + + thumb_func_start sub_81C61E0 +sub_81C61E0: @ 81C61E0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =gScriptItemId + ldrh r0, [r4] + bl ItemId_GetPocket + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + beq _081C620C + cmp r0, 0x2 + beq _081C620C + cmp r0, 0x3 + beq _081C620C + ldrh r0, [r4] + bl itemid_is_mail + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C6228 +_081C620C: + bl sub_81C61A8 + ldr r1, =gText_DadsAdvice + ldr r2, =sub_81C6714 + adds r0, r5, 0 + bl DisplayItemMessageInBattlePyramid + b _081C6252 + .pool +_081C6228: + ldrh r0, [r4] + bl ItemId_GetFieldFunc + cmp r0, 0 + beq _081C6252 + bl sub_81C61A8 + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldrh r0, [r4] + bl ItemId_GetFieldFunc + adds r1, r0, 0 + adds r0, r5, 0 + bl _call_via_r1 +_081C6252: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81C61E0 + + thumb_func_start sub_81C6258 +sub_81C6258: @ 81C6258 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + bl sub_81C61A8 + movs r1, 0x2 + ldrsh r0, [r4, r1] + bl sub_81C55D8 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + ldrb r0, [r4] + movs r1, 0 + bl sub_81C5A98 + adds r0, r5, 0 + bl sub_81C629C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C6258 + + thumb_func_start sub_81C629C +sub_81C629C: @ 81C629C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_81C5674 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81C5BC8 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C629C + + thumb_func_start sub_81C62C4 +sub_81C62C4: @ 81C62C4 + push {r4-r7,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r6, r0, 3 + ldr r7, =gTasks + 0x8 + adds r4, r6, r7 + bl sub_81C61A8 + movs r0, 0x1 + strh r0, [r4, 0x10] + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _081C62F4 + adds r0, r5, 0 + bl sub_81C6350 + b _081C6334 + .pool +_081C62F4: + ldr r0, =gScriptItemId + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gText_TossHowManyVar1s + adds r0, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r1, 0 + str r1, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + str r1, [sp, 0x8] + str r1, [sp, 0xC] + adds r1, r4, 0 + movs r2, 0x3 + movs r3, 0 + bl sub_81C6C3C + bl sub_81C6404 + adds r0, r7, 0 + subs r0, 0x8 + adds r0, r6, r0 + ldr r1, =sub_81C64B4 + str r1, [r0] +_081C6334: + add sp, 0x10 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C62C4 + + thumb_func_start sub_81C6350 +sub_81C6350: @ 81C6350 + push {r4,r5,lr} + sub sp, 0x10 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + ldr r0, =gScriptItemId + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r0, =gStringVar2 + movs r2, 0x10 + ldrsh r1, [r4, r2] + movs r2, 0 + movs r3, 0x2 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gText_ConfirmTossItems + adds r0, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r1, 0 + str r1, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + str r1, [sp, 0x8] + str r1, [sp, 0xC] + adds r1, r4, 0 + movs r2, 0x3 + movs r3, 0 + bl sub_81C6C3C + ldr r1, =gUnknown_0861F314 + adds r0, r5, 0 + bl sub_81C6DAC + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C6350 + + thumb_func_start sub_81C63D0 +sub_81C63D0: @ 81C63D0 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + movs r1, 0x2 + ldrsh r0, [r4, r1] + bl sub_81C55D8 + ldrb r0, [r4] + movs r1, 0 + bl sub_81C5A98 + adds r0, r5, 0 + bl sub_81C629C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C63D0 + + thumb_func_start sub_81C6404 +sub_81C6404: @ 81C6404 + push {r4,lr} + sub sp, 0xC + ldr r0, =gStringVar1 + movs r1, 0x1 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gText_xVar1 + adds r0, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x3 + bl sub_81C6CEC + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x28 + bl GetStringCenterAlignXOffset + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x2 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + adds r2, r4, 0 + bl PrintTextOnWindow + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C6404 + + thumb_func_start sub_81C645C +sub_81C645C: @ 81C645C + push {r4,lr} + sub sp, 0xC + adds r1, r0, 0 + ldr r0, =gStringVar1 + lsls r1, 16 + asrs r1, 16 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gText_xVar1 + adds r0, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x28 + bl GetStringCenterAlignXOffset + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x2 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + adds r2, r4, 0 + bl PrintTextOnWindow + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C645C + + thumb_func_start sub_81C64B4 +sub_81C64B4: @ 81C64B4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + adds r0, r4, 0 + adds r0, 0x10 + ldrh r1, [r4, 0x4] + bl AdjustQuantityAccordingToDPadInput + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C64E8 + movs r1, 0x10 + ldrsh r0, [r4, r1] + bl sub_81C645C + b _081C6544 + .pool +_081C64E8: + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081C651C + movs r0, 0x5 + bl PlaySE + movs r0, 0x3 + movs r1, 0 + bl sub_8198070 + movs r0, 0x3 + bl ClearWindowTilemap + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + adds r0, r5, 0 + bl sub_81C6350 + b _081C6544 + .pool +_081C651C: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081C6544 + movs r0, 0x5 + bl PlaySE + movs r0, 0x3 + movs r1, 0 + bl sub_8198070 + movs r0, 0x3 + bl ClearWindowTilemap + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + adds r0, r6, 0 + bl sub_81C63D0 +_081C6544: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81C64B4 + + thumb_func_start sub_81C654C +sub_81C654C: @ 81C654C + push {r4-r6,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r5, =gTasks + 0x8 + adds r6, r4, r5 + ldr r0, =gScriptItemId + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r0, =gStringVar2 + movs r2, 0x10 + ldrsh r1, [r6, r2] + movs r2, 0 + movs r3, 0x2 + bl ConvertIntToDecimalStringN + ldr r6, =gStringVar4 + ldr r1, =gText_ThrewAwayVar2Var1s + adds r0, r6, 0 + bl StringExpandPlaceholders + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r1, 0 + str r1, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + str r1, [sp, 0x8] + str r1, [sp, 0xC] + adds r1, r6, 0 + movs r2, 0x3 + movs r3, 0 + bl sub_81C6C3C + subs r5, 0x8 + adds r4, r5 + ldr r0, =sub_81C65CC + str r0, [r4] + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C654C + + thumb_func_start sub_81C65CC +sub_81C65CC: @ 81C65CC + push {r4-r7,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 + ldr r6, =gUnknown_0203CF38 + subs r7, r6, 0x2 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081C662E + movs r0, 0x5 + bl PlaySE + ldr r0, =gScriptItemId + ldrh r0, [r0] + ldrh r1, [r4, 0x10] + bl RemovePyramidBagItem + ldrb r0, [r4] + adds r1, r6, 0 + adds r2, r7, 0 + bl sub_81AE6C8 + bl sub_81C5924 + bl sub_81C59BC + bl sub_81C5314 + ldr r0, =gUnknown_03006310 + ldrh r1, [r6] + ldrh r2, [r7] + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + adds r0, r5, 0 + bl sub_81C629C +_081C662E: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C65CC + + thumb_func_start sub_81C6648 +sub_81C6648: @ 81C6648 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + bl sub_81C61A8 + ldr r5, =gScriptItemId + ldrh r0, [r5] + bl itemid_is_mail + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C667C + ldr r1, =gText_CantWriteMail + ldr r2, =sub_81C66EC + adds r0, r4, 0 + bl DisplayItemMessageInBattlePyramid + b _081C66A6 + .pool +_081C667C: + ldrh r0, [r5] + bl itemid_is_unique + lsls r0, 24 + cmp r0, 0 + bne _081C66A0 + ldr r0, =gUnknown_0203CF2C + ldr r1, [r0] + ldr r0, =sub_81B7F60 + str r0, [r1] + adds r0, r4, 0 + bl sub_81C5B14 + b _081C66A6 + .pool +_081C66A0: + adds r0, r6, 0 + bl sub_81C66AC +_081C66A6: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81C6648 + + thumb_func_start sub_81C66AC +sub_81C66AC: @ 81C66AC + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gScriptItemId + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r5, =gStringVar4 + ldr r1, =gText_Var1CantBeHeld + adds r0, r5, 0 + bl StringExpandPlaceholders + ldr r2, =sub_81C66EC + adds r0, r4, 0 + adds r1, r5, 0 + bl DisplayItemMessageInBattlePyramid + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C66AC + + thumb_func_start sub_81C66EC +sub_81C66EC: @ 81C66EC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081C670A + movs r0, 0x5 + bl PlaySE + adds r0, r4, 0 + bl sub_81C6714 +_081C670A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C66EC + + thumb_func_start sub_81C6714 +sub_81C6714: @ 81C6714 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + bl sub_81C6E1C + movs r1, 0x2 + ldrsh r0, [r4, r1] + bl sub_81C55D8 + ldrb r0, [r4] + movs r1, 0 + bl sub_81C5A98 + adds r0, r5, 0 + bl sub_81C629C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C6714 + + thumb_func_start sub_81C674C +sub_81C674C: @ 81C674C + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + ldr r5, =gScriptItemId + ldrh r0, [r5] + bl itemid_80BF6D8_mail_related + lsls r0, 24 + cmp r0, 0 + bne _081C677C + ldr r1, =gText_CantWriteMail + ldr r2, =sub_81C66EC + adds r0, r4, 0 + bl DisplayItemMessageInBattlePyramid + b _081C6796 + .pool +_081C677C: + ldrh r0, [r5] + bl itemid_is_unique + lsls r0, 24 + cmp r0, 0 + bne _081C6790 + adds r0, r4, 0 + bl sub_81C5B14 + b _081C6796 +_081C6790: + adds r0, r6, 0 + bl sub_81C66AC +_081C6796: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81C674C + + thumb_func_start sub_81C679C +sub_81C679C: @ 81C679C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =gScriptItemId + ldrh r0, [r4] + bl ItemId_GetBattleFunc + cmp r0, 0 + beq _081C67C0 + bl sub_81C61A8 + ldrh r0, [r4] + bl ItemId_GetBattleFunc + adds r1, r0, 0 + adds r0, r5, 0 + bl _call_via_r1 +_081C67C0: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C679C + + thumb_func_start sub_81C67CC +sub_81C67CC: @ 81C67CC + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + mov r9, r0 + adds r5, r4, r0 + ldr r0, =gUnknown_0203CF30 + ldrh r1, [r0, 0x6] + ldrh r0, [r0, 0x8] + adds r1, r0 + strh r1, [r5, 0x2] + ldr r0, =gUnknown_0203CF2C + ldr r0, [r0] + ldr r2, =0x00000814 + adds r0, r2 + movs r2, 0 + mov r8, r2 + strb r1, [r0] + ldrb r0, [r5] + movs r1, 0x10 + movs r2, 0x1 + bl sub_81AF15C + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + movs r0, 0x2 + ldrsh r2, [r5, r0] + lsls r2, 1 + ldr r1, =0x00000ca9 + adds r0, r3, r1 + ldrb r1, [r0] + lsls r1, 30 + lsrs r1, 30 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, r0 + ldr r0, =0x00000e2c + adds r3, r0 + adds r3, r2 + ldrh r0, [r3] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r6, =gStringVar4 + ldr r1, =gText_MoveVar1Where + adds r0, r6, 0 + bl StringExpandPlaceholders + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + mov r1, r8 + str r1, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + str r1, [sp, 0x8] + str r1, [sp, 0xC] + adds r1, r6, 0 + movs r2, 0x3 + movs r3, 0 + bl sub_81C6C3C + ldrb r0, [r5] + movs r1, 0x1 + bl sub_81C5A98 + ldrb r0, [r5, 0x2] + bl sub_81C704C + movs r2, 0x8 + negs r2, r2 + add r9, r2 + add r4, r9 + ldr r0, =sub_81C68B0 + str r0, [r4] + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C67CC + + thumb_func_start sub_81C68B0 +sub_81C68B0: @ 81C68B0 + push {r4-r7,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 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C695C + ldr r7, =gMain + ldrh r1, [r7, 0x2E] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _081C68F8 + movs r0, 0x5 + bl PlaySE + ldrb r0, [r4] + ldr r1, =gUnknown_0203CF38 + subs r2, r1, 0x2 + bl get_coro_args_x18_x1A + b _081C6940 + .pool +_081C68F8: + ldrb r0, [r4] + bl ListMenuHandleInput + adds r6, r0, 0 + ldrb r0, [r4] + ldr r4, =gUnknown_0203CF38 + subs r2, r4, 0x2 + adds r1, r4, 0 + bl get_coro_args_x18_x1A + movs r0, 0 + bl sub_81C7028 + subs r4, 0x8 + ldrb r0, [r4, 0x6] + bl sub_81C704C + movs r0, 0x2 + negs r0, r0 + cmp r6, r0 + beq _081C6930 + adds r0, 0x1 + cmp r6, r0 + bne _081C6950 + b _081C695C + .pool +_081C6930: + movs r0, 0x5 + bl PlaySE + ldrh r1, [r7, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081C6948 +_081C6940: + adds r0, r5, 0 + bl sub_81C6964 + b _081C695C +_081C6948: + adds r0, r5, 0 + bl sub_81C6A14 + b _081C695C +_081C6950: + movs r0, 0x5 + bl PlaySE + adds r0, r5, 0 + bl sub_81C6964 +_081C695C: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81C68B0 + + thumb_func_start sub_81C6964 +sub_81C6964: @ 81C6964 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r5, r0, r1 + ldr r7, =gUnknown_0203CF38 + subs r0, r7, 0x2 + mov r8, r0 + ldrh r0, [r0] + ldrh r1, [r7] + adds r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 + movs r3, 0x2 + ldrsh r1, [r5, r3] + cmp r1, r4 + beq _081C6996 + subs r0, r4, 0x1 + cmp r1, r0 + bne _081C69A8 +_081C6996: + adds r0, r6, 0 + bl sub_81C6A14 + b _081C69FC + .pool +_081C69A8: + ldrb r0, [r5, 0x2] + lsls r1, r4, 24 + lsrs r1, 24 + bl sub_81C57A8 + ldr r0, =gUnknown_0203CF2C + ldr r0, [r0] + ldr r1, =0x00000814 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + movs r0, 0x1 + bl sub_81C7028 + ldrb r0, [r5] + adds r1, r7, 0 + mov r2, r8 + bl sub_81AE6C8 + movs r3, 0x2 + ldrsh r0, [r5, r3] + cmp r0, r4 + bge _081C69E0 + adds r1, r7, 0 + subs r1, 0x8 + ldrh r0, [r1, 0x6] + subs r0, 0x1 + strh r0, [r1, 0x6] +_081C69E0: + bl sub_81C5314 + ldr r0, =gUnknown_03006310 + ldrh r1, [r7] + mov r3, r8 + ldrh r2, [r3] + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5] + adds r0, r6, 0 + bl sub_81C629C +_081C69FC: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C6964 + + thumb_func_start sub_81C6A14 +sub_81C6A14: @ 81C6A14 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + ldr r5, =gUnknown_0203CF38 + subs r7, r5, 0x2 + ldr r0, =gUnknown_0203CF2C + ldr r0, [r0] + ldr r1, =0x00000814 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + movs r0, 0x1 + bl sub_81C7028 + ldrb r0, [r4] + adds r1, r5, 0 + adds r2, r7, 0 + bl sub_81AE6C8 + movs r0, 0x2 + ldrsh r2, [r4, r0] + ldrh r0, [r5] + ldrh r1, [r7] + adds r0, r1 + cmp r2, r0 + bge _081C6A5E + adds r1, r5, 0 + subs r1, 0x8 + ldrh r0, [r1, 0x6] + subs r0, 0x1 + strh r0, [r1, 0x6] +_081C6A5E: + bl sub_81C5314 + ldr r0, =gUnknown_03006310 + ldrh r1, [r5] + ldrh r2, [r7] + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + adds r0, r6, 0 + bl sub_81C629C + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C6A14 + + thumb_func_start sub_81C6A94 +sub_81C6A94: @ 81C6A94 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + ldr r0, =gPlayerParty + mov r9, r0 + movs r0, 0x14 + bl Alloc + adds r7, r0, 0 + movs r0, 0xA + bl Alloc + adds r5, r0, 0 + ldr r1, =gSaveBlock2Ptr + mov r8, r1 + ldr r2, [r1] + ldr r4, =0x00000ca9 + adds r0, r2, r4 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldr r0, =0x00000e2c + adds r1, r0 + adds r0, r7, 0 + movs r2, 0x14 + bl memcpy + mov r1, r8 + ldr r2, [r1] + adds r0, r2, r4 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 1 + adds r1, r2 + ldr r0, =0x00000e54 + adds r1, r0 + adds r0, r5, 0 + movs r2, 0xA + bl memcpy + movs r6, 0 +_081C6AF8: + movs r0, 0x64 + muls r0, r6 + add r0, r9 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + mov r1, sp + strh r0, [r1] + cmp r0, 0 + beq _081C6B88 + movs r1, 0x1 + bl AddBagItem + lsls r0, 24 + cmp r0, 0 + bne _081C6B88 + mov r1, r8 + ldr r2, [r1] + adds r0, r2, r4 + ldrb r1, [r0] + lsls r1, 30 + lsrs r1, 30 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =0x00000e2c + adds r0, r1 + adds r1, r7, 0 + movs r2, 0x14 + bl memcpy + mov r0, r8 + ldr r2, [r0] + adds r0, r2, r4 + ldrb r1, [r0] + lsls r1, 30 + lsrs r1, 30 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 1 + adds r0, r2 + ldr r1, =0x00000e54 + adds r0, r1 + adds r1, r5, 0 + movs r2, 0xA + bl memcpy + adds r0, r7, 0 + bl Free + adds r0, r5, 0 + bl Free + ldr r1, =gScriptResult + movs r0, 0x1 + strh r0, [r1] + b _081C6BC6 + .pool +_081C6B88: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x2 + bls _081C6AF8 + movs r1, 0 + mov r0, sp + strh r1, [r0] + movs r6, 0 + movs r4, 0x64 +_081C6B9C: + adds r0, r6, 0 + muls r0, r4 + add r0, r9 + movs r1, 0xC + mov r2, sp + bl SetMonData + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x2 + bls _081C6B9C + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] + adds r0, r7, 0 + bl Free + adds r0, r5, 0 + bl Free +_081C6BC6: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C6A94 + + thumb_func_start sub_81C6BD8 +sub_81C6BD8: @ 81C6BD8 + push {r4,lr} + ldr r0, =gUnknown_0861F328 + bl InitWindows + bl DeactivateAllTextPrinters + movs r0, 0 + movs r1, 0x1 + movs r2, 0xE0 + bl sub_809882C + movs r0, 0 + movs r1, 0xA + movs r2, 0xD0 + bl copy_textbox_border_tile_patterns_to_vram + ldr r0, =gUnknown_0860F074 + movs r1, 0xF0 + movs r2, 0x20 + bl LoadPalette + movs r4, 0 +_081C6C04: + adds r0, r4, 0 + movs r1, 0 + bl FillWindowPixelBuffer + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x4 + bls _081C6C04 + movs r0, 0 + bl PutWindowTilemap + movs r0, 0x1 + bl PutWindowTilemap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C6BD8 + + thumb_func_start sub_81C6C3C +sub_81C6C3C: @ 81C6C3C + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x14 + ldr r4, [sp, 0x28] + ldr r6, [sp, 0x2C] + ldr r5, [sp, 0x30] + mov r8, r5 + ldr r5, [sp, 0x34] + lsls r0, 24 + lsrs r0, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r5, 24 + lsrs r5, 24 + str r4, [sp] + str r6, [sp, 0x4] + lsls r4, r5, 1 + adds r4, r5 + ldr r5, =gUnknown_0861F31C + adds r4, r5 + str r4, [sp, 0x8] + mov r4, r8 + lsls r4, 24 + asrs r4, 24 + str r4, [sp, 0xC] + str r1, [sp, 0x10] + movs r1, 0x1 + bl AddTextPrinterParametrized2 + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C6C3C + + thumb_func_start sub_81C6C94 +sub_81C6C94: @ 81C6C94 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x14 + ldr r4, [sp, 0x28] + ldr r6, [sp, 0x2C] + ldr r5, [sp, 0x30] + mov r8, r5 + ldr r5, [sp, 0x34] + lsls r0, 24 + lsrs r0, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r5, 24 + lsrs r5, 24 + str r4, [sp] + str r6, [sp, 0x4] + lsls r4, r5, 1 + adds r4, r5 + ldr r5, =gUnknown_0861F31C + adds r4, r5 + str r4, [sp, 0x8] + mov r4, r8 + lsls r4, 24 + asrs r4, 24 + str r4, [sp, 0xC] + str r1, [sp, 0x10] + movs r1, 0x7 + bl AddTextPrinterParametrized2 + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C6C94 + + thumb_func_start sub_81C6CEC +sub_81C6CEC: @ 81C6CEC + push {lr} + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + movs r2, 0x1 + movs r3, 0xE + bl SetWindowBorderStyle + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + pop {r0} + bx r0 + thumb_func_end sub_81C6CEC + + thumb_func_start sub_81C6D08 +sub_81C6D08: @ 81C6D08 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0203CF2C + ldr r1, [r1] + ldr r2, =0x0000080f + adds r1, r2 + adds r1, r0 + ldrb r0, [r1] + bx lr + .pool + thumb_func_end sub_81C6D08 + + thumb_func_start sub_81C6D24 +sub_81C6D24: @ 81C6D24 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =gUnknown_0203CF2C + ldr r3, =0x0000080f + adds r1, r2, r3 + ldr r0, [r0] + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0xFF + bne _081C6D58 + lsls r0, r2, 3 + ldr r1, =gUnknown_0861F350 + adds r0, r1 + bl AddWindow + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + movs r2, 0x1 + movs r3, 0xE + bl SetWindowBorderStyle + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram +_081C6D58: + ldrb r0, [r4] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81C6D24 + + thumb_func_start sub_81C6D6C +sub_81C6D6C: @ 81C6D6C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0203CF2C + ldr r2, =0x0000080f + adds r0, r2 + ldr r1, [r1] + adds r4, r1, r0 + ldrb r0, [r4] + cmp r0, 0xFF + beq _081C6D9E + movs r1, 0 + bl sub_8198070 + ldrb r0, [r4] + bl ClearWindowTilemap + ldrb r0, [r4] + bl RemoveWindow + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0xFF + strb r0, [r4] +_081C6D9E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C6D6C + + thumb_func_start sub_81C6DAC +sub_81C6DAC: @ 81C6DAC + push {lr} + sub sp, 0x10 + adds r3, r1, 0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0861F370 + movs r2, 0x2 + str r2, [sp] + movs r2, 0x1 + str r2, [sp, 0x4] + movs r2, 0xE + str r2, [sp, 0x8] + str r3, [sp, 0xC] + movs r2, 0x1 + movs r3, 0 + bl CreateYesNoMenuWithCallbacks + add sp, 0x10 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C6DAC + + thumb_func_start DisplayItemMessageInBattlePyramid +@ void DisplayItemMessageInBattlePyramid(u8 taskId, u8 *str, void ( *callback)(u8 taskId)) +DisplayItemMessageInBattlePyramid: @ 81C6DD8 + push {r4-r6,lr} + sub sp, 0x10 + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x2 + movs r1, 0x11 + bl FillWindowPixelBuffer + bl sav2_get_text_speed + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + str r1, [sp] + str r0, [sp, 0x4] + str r5, [sp, 0x8] + str r6, [sp, 0xC] + adds r0, r4, 0 + movs r1, 0x2 + movs r2, 0xA + movs r3, 0xD + bl DisplayMessageAndContinueTask + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end DisplayItemMessageInBattlePyramid + + thumb_func_start sub_81C6E1C +sub_81C6E1C: @ 81C6E1C + push {lr} + movs r0, 0x2 + movs r1, 0 + bl sub_8197DF8 + movs r0, 0x2 + bl ClearWindowTilemap + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + pop {r0} + bx r0 + thumb_func_end sub_81C6E1C + + thumb_func_start sub_81C6E38 +sub_81C6E38: @ 81C6E38 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gUnknown_0203CF2C + ldr r2, =0x00000804 + adds r1, r4, r2 + ldr r0, [r0] + adds r5, r0, r1 + ldrb r0, [r5] + cmp r0, 0xFF + beq _081C6E80 + ldr r0, =0x00001024 + adds r4, r0 + 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] +_081C6E80: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C6E38 + + thumb_func_start sub_81C6E98 +sub_81C6E98: @ 81C6E98 + push {r4,lr} + sub sp, 0x8 + movs r0, 0x40 + bl Alloc + adds r4, r0, 0 + ldr r0, =gUnknown_08D9ADD0 + adds r1, r4, 0 + bl LZDecompressWram + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 25 + adds r0, r4, r0 + str r0, [sp] + ldr r1, =0xffff0000 + ldr r0, [sp, 0x4] + ands r0, r1 + ldr r1, =0x00001024 + orrs r0, r1 + str r0, [sp, 0x4] + mov r0, sp + bl LoadSpritePalette + adds r0, r4, 0 + bl Free + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C6E98 + + thumb_func_start sub_81C6EF4 +sub_81C6EF4: @ 81C6EF4 + push {r4,lr} + ldr r0, =gUnknown_0203CF2C + ldr r4, [r0] + ldr r0, =0x00000804 + adds r4, r0 + ldr r0, =gUnknown_0861F3D4 + movs r1, 0x44 + movs r2, 0x38 + movs r3, 0 + bl CreateSprite + strb r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C6EF4 + + thumb_func_start sub_81C6F20 +sub_81C6F20: @ 81C6F20 + push {r4,lr} + ldr r0, =gUnknown_0203CF2C + 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 _081C6F50 + adds r0, r4, 0 + movs r1, 0x1 + bl StartSpriteAffineAnim + ldr r0, =sub_81C6F68 + str r0, [r4, 0x1C] +_081C6F50: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C6F20 + + thumb_func_start sub_81C6F68 +sub_81C6F68: @ 81C6F68 + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _081C6F84 + adds r0, r4, 0 + movs r1, 0 + bl StartSpriteAffineAnim + ldr r0, =SpriteCallbackDummy + str r0, [r4, 0x1C] +_081C6F84: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C6F68 + + thumb_func_start sub_81C6F90 +sub_81C6F90: @ 81C6F90 + push {r4-r6,lr} + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 24 + lsrs r4, r1, 24 + ldr r0, =gUnknown_0203CF2C + ldr r2, =0x00000805 + adds r1, r4, r2 + ldr r0, [r0] + adds r5, r0, r1 + ldrb r0, [r5] + cmp r0, 0xFF + bne _081C6FE0 + ldr r0, =0x00001025 + adds r4, r0 + 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 _081C6FE0 + 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] +_081C6FE0: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C6F90 + + thumb_func_start sub_81C6FF8 +sub_81C6FF8: @ 81C6FF8 + push {lr} + lsls r0, 24 + movs r1, 0x80 + lsls r1, 17 + adds r0, r1 + lsrs r0, 24 + bl sub_81C6E38 + pop {r0} + bx r0 + thumb_func_end sub_81C6FF8 + + thumb_func_start sub_81C700C +sub_81C700C: @ 81C700C + push {lr} + ldr r0, =gUnknown_0203CF2C + ldr r0, [r0] + ldr r1, =0x00000807 + adds r0, r1 + movs r1, 0x8 + bl sub_8122344 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C700C + + thumb_func_start sub_81C7028 +sub_81C7028: @ 81C7028 + push {lr} + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gUnknown_0203CF2C + ldr r0, [r0] + ldr r1, =0x00000807 + adds r0, r1 + movs r1, 0x8 + bl sub_81223FC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C7028 + + thumb_func_start sub_81C704C +sub_81C704C: @ 81C704C + push {lr} + adds r3, r0, 0 + lsls r3, 24 + ldr r0, =gUnknown_0203CF2C + ldr r0, [r0] + ldr r1, =0x00000807 + 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_81C704C + + thumb_func_start sub_81C7078 +sub_81C7078: @ 81C7078 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + bl is_c1_link_related_active + cmp r0, 0 + bne _081C7090 + ldr r0, =sub_81C7170 + b _081C7092 + .pool +_081C7090: + ldr r0, =sub_81C71E4 +_081C7092: + lsls r1, r4, 24 + lsrs r1, 24 + bl CreateTask + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + movs r1, 0x1 + adds r2, r5, 0 + bl SetWordTaskArg + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r2, =gUnknown_0203CF3C + ldrb r1, [r2] + strh r1, [r0, 0xE] + ldrb r0, [r2] + adds r1, r0, 0x1 + strb r1, [r2] + lsls r0, 24 + lsrs r0, 8 + orrs r0, r4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81C7078 + + thumb_func_start sub_81C70D8 +sub_81C70D8: @ 81C70D8 + push {lr} + ldr r1, =0x0000ffff + ands r1, r0 + lsrs r3, r0, 16 + ldr r2, =gTasks + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r1, r0, r2 + ldrb r0, [r1, 0x4] + cmp r0, 0 + beq _081C711C + ldr r2, [r1] + ldr r0, =sub_81C7170 + cmp r2, r0 + beq _081C70FE + ldr r0, =sub_81C71E4 + cmp r2, r0 + bne _081C711C +_081C70FE: + movs r2, 0xE + ldrsh r0, [r1, r2] + cmp r0, r3 + bne _081C711C + movs r0, 0x1 + b _081C711E + .pool +_081C711C: + movs r0, 0 +_081C711E: + pop {r1} + bx r1 + thumb_func_end sub_81C70D8 + + thumb_func_start sub_81C7124 +sub_81C7124: @ 81C7124 + push {r4-r6,lr} + adds r6, r0, 0 + movs r5, 0 + ldr r4, =gTasks +_081C712C: + ldrb r0, [r4, 0x4] + cmp r0, 0 + beq _081C7160 + ldr r1, [r4] + ldr r0, =sub_81C7170 + cmp r1, r0 + beq _081C7140 + ldr r0, =sub_81C71E4 + cmp r1, r0 + bne _081C7160 +_081C7140: + lsls r0, r5, 24 + lsrs r0, 24 + movs r1, 0x1 + bl GetWordTaskArg + cmp r0, r6 + bne _081C7160 + movs r0, 0x1 + b _081C716A + .pool +_081C7160: + adds r4, 0x28 + adds r5, 0x1 + cmp r5, 0xF + ble _081C712C + movs r0, 0 +_081C716A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81C7124 + + thumb_func_start sub_81C7170 +sub_81C7170: @ 81C7170 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + movs r1, 0x1 + bl GetWordTaskArg + adds r6, r0, 0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + movs r7, 0 +_081C718C: + movs r1, 0 + ldrsh r0, [r4, r1] + bl _call_via_r6 + cmp r0, 0x4 + bhi _081C71D6 + lsls r0, 2 + ldr r1, =_081C71AC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081C71AC: + .4byte _081C71C6 + .4byte _081C71C0 + .4byte _081C71DE + .4byte _081C71DA + .4byte _081C71CE +_081C71C0: + ldrh r0, [r4] + adds r0, 0x1 + b _081C71D8 +_081C71C6: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _081C71DE +_081C71CE: + adds r0, r5, 0 + bl DestroyTask + b _081C71DE +_081C71D6: + subs r0, 0x5 +_081C71D8: + strh r0, [r4] +_081C71DA: + cmp r7, 0 + beq _081C718C +_081C71DE: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81C7170 + + thumb_func_start sub_81C71E4 +sub_81C71E4: @ 81C71E4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_8087598 + cmp r0, 0 + bne _081C724A + adds r0, r5, 0 + movs r1, 0x1 + bl GetWordTaskArg + adds r2, r0, 0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + movs r1, 0 + ldrsh r0, [r4, r1] + bl _call_via_r2 + cmp r0, 0x4 + bhi _081C7246 + lsls r0, 2 + ldr r1, =_081C7224 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081C7224: + .4byte _081C7238 + .4byte _081C7238 + .4byte _081C724A + .4byte _081C724A + .4byte _081C723E +_081C7238: + ldrh r0, [r4] + adds r0, 0x1 + b _081C7248 +_081C723E: + adds r0, r5, 0 + bl DestroyTask + b _081C724A +_081C7246: + subs r0, 0x5 +_081C7248: + strh r0, [r4] +_081C724A: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81C71E4 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_81BE66C.s b/asm/pokenav.s old mode 100644 new mode 100755 similarity index 54% rename from asm/rom_81BE66C.s rename to asm/pokenav.s index 7cc5eef13..f6c50a3f7 --- a/asm/rom_81BE66C.s +++ b/asm/pokenav.s @@ -4,16065 +4,6 @@ .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 - - 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 - - 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 - - thumb_func_start sub_81BF8EC -sub_81BF8EC: @ 81BF8EC - push {r4-r7,lr} - mov r7, r8 - push {r7} - mov r8, r1 - adds r5, r2, 0 - adds r6, r3, 0 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - ldr r4, =gUnknown_0203CF1C - ldr r0, =0x000040f8 - bl AllocZeroed - str r0, [r4] - ldr r1, =0x000040bc - adds r0, r1 - strb r7, [r0] - ldr r0, [r4] - mov r2, r8 - str r2, [r0] - adds r1, 0x2 - adds r0, r1 - strb r5, [r0] - ldr r0, [r4] - ldr r2, =0x000040bf - adds r0, r2 - strb r6, [r0] - ldr r1, [r4] - ldr r0, [sp, 0x18] - str r0, [r1, 0x4] - cmp r7, 0x2 - bne _081BF94C - subs r2, 0x2 - adds r1, r2 - movs r0, 0x1 - b _081BF952 - .pool -_081BF94C: - ldr r0, =0x000040bd - adds r1, r0 - movs r0, 0 -_081BF952: - strb r0, [r1] - cmp r7, 0x1 - beq _081BF9A0 - cmp r7, 0x1 - bgt _081BF96C - cmp r7, 0 - beq _081BF97C - ldr r2, =gUnknown_0203CF1C - b _081BF9EE - .pool -_081BF96C: - cmp r7, 0x2 - beq _081BF97C - cmp r7, 0x3 - beq _081BF9D0 - ldr r2, =gUnknown_0203CF1C - b _081BF9EE - .pool -_081BF97C: - ldr r2, =gUnknown_0203CF1C - ldr r0, [r2] - ldr r1, =0x000040c1 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - ldr r1, =0x000040c2 - adds r0, r1 - movs r1, 0x3 - b _081BF9EC - .pool -_081BF9A0: - ldr r2, =gUnknown_0203CF1C - ldr r0, [r2] - ldr r1, =0x000040c1 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - ldr r1, =0x000040c2 - adds r0, r1 - movs r1, 0x3 - strb r1, [r0] - ldr r0, [r2] - ldr r1, =0x000040c8 - adds r0, r1 - strb r7, [r0] - b _081BF9EE - .pool -_081BF9D0: - ldr r2, =gUnknown_0203CF1C - ldr r0, [r2] - ldr r1, =0x000040c1 - adds r0, r1 - movs r1, 0x2 - strb r1, [r0] - ldr r0, [r2] - ldr r1, =0x000040c2 - adds r0, r1 - strb r7, [r0] - ldr r0, [r2] - adds r1, 0x1 - adds r0, r1 - movs r1, 0x1 -_081BF9EC: - strb r1, [r0] -_081BF9EE: - ldr r0, [r2] - ldr r2, =0x000040c1 - adds r1, r0, r2 - ldrb r1, [r1] - subs r2, 0x1 - adds r0, r2 - strb r1, [r0] - movs r0, 0xFF - bl sub_81C488C - ldr r0, =gBattleSpritesGfx - ldr r0, [r0] - cmp r0, 0 - bne _081BFA12 - movs r0, 0 - movs r1, 0 - bl sub_806F2AC -_081BFA12: - ldr r0, =sub_81BFAE4 - bl SetMainCallback2 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BF8EC - - thumb_func_start sub_81BFA38 -sub_81BFA38: @ 81BFA38 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x4 - mov r8, r0 - adds r4, r1, 0 - adds r5, r2, 0 - ldr r6, [sp, 0x18] - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 16 - lsrs r6, 16 - str r3, [sp] - movs r0, 0x3 - mov r1, r8 - adds r2, r4, 0 - adds r3, r5, 0 - bl sub_81BF8EC - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040c4 - adds r0, r1 - strh r6, [r0] - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BFA38 - - thumb_func_start sub_81BFA80 -sub_81BFA80: @ 81BFA80 - push {r4,lr} - sub sp, 0x4 - ldr r4, [sp, 0xC] - lsls r0, 24 - lsrs r0, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - str r4, [sp] - bl sub_81BF8EC - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040ef - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BFA80 - - thumb_func_start sub_81BFAB4 -sub_81BFAB4: @ 81BFAB4 - push {lr} - bl RunTasks - bl AnimateSprites - bl BuildOamBuffer - bl do_scheduled_bg_tilemap_copies_to_vram - bl UpdatePaletteFade - pop {r0} - bx r0 - thumb_func_end sub_81BFAB4 - - thumb_func_start sub_81BFAD0 -sub_81BFAD0: @ 81BFAD0 - push {lr} - bl LoadOam - bl ProcessSpriteCopyRequests - bl TransferPlttBuffer - pop {r0} - bx r0 - thumb_func_end sub_81BFAD0 - - thumb_func_start sub_81BFAE4 -sub_81BFAE4: @ 81BFAE4 - push {lr} -_081BFAE6: - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081BFB0A - bl sub_81BFB10 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081BFB0A - bl sub_81221AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081BFAE6 -_081BFB0A: - pop {r0} - bx r0 - thumb_func_end sub_81BFAE4 - - thumb_func_start sub_81BFB10 -sub_81BFB10: @ 81BFB10 - push {r4,lr} - sub sp, 0x4 - ldr r0, =gMain - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x18 - bls _081BFB24 - b _081BFE00 -_081BFB24: - lsls r0, 2 - ldr r1, =_081BFB38 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081BFB38: - .4byte _081BFB9C - .4byte _081BFBAA - .4byte _081BFBBC - .4byte _081BFBD0 - .4byte _081BFBE4 - .4byte _081BFBEA - .4byte _081BFC04 - .4byte _081BFC20 - .4byte _081BFC26 - .4byte _081BFC38 - .4byte _081BFC58 - .4byte _081BFC7C - .4byte _081BFC82 - .4byte _081BFC94 - .4byte _081BFCAC - .4byte _081BFCC0 - .4byte _081BFCD8 - .4byte _081BFCF8 - .4byte _081BFD34 - .4byte _081BFD50 - .4byte _081BFD60 - .4byte _081BFD74 - .4byte _081BFD7A - .4byte _081BFDB0 - .4byte _081BFDCC -_081BFB9C: - bl SetVBlankHBlankCallbacksToNull - bl sub_8121DA0 - bl clear_scheduled_bg_copies_to_vram - b _081BFDE6 -_081BFBAA: - bl remove_some_task - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081BFDEE - .pool -_081BFBBC: - bl ResetPaletteFade - ldr r2, =gPaletteFade - ldrb r0, [r2, 0x8] - movs r1, 0x80 - orrs r0, r1 - b _081BFDE4 - .pool -_081BFBD0: - bl ResetSpriteData - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081BFDEE - .pool -_081BFBE4: - bl FreeAllSpritePalettes - b _081BFDE6 -_081BFBEA: - bl sub_81BFE24 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040f0 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - b _081BFDE6 - .pool -_081BFC04: - bl sub_81BFEB0 - lsls r0, 24 - cmp r0, 0 - bne _081BFC10 - b _081BFE18 -_081BFC10: - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081BFDEE - .pool -_081BFC20: - bl sub_81C2554 - b _081BFDE6 -_081BFC26: - bl sub_81C1BA0 - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081BFDEE - .pool -_081BFC38: - ldr r4, =gUnknown_0203CF1C - ldr r0, [r4] - adds r0, 0xC - bl sub_81C0098 - ldr r0, [r4] - ldr r1, =0x000040f0 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - b _081BFDE6 - .pool -_081BFC58: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r0, 0xC - bl sub_81C00F0 - lsls r0, 24 - cmp r0, 0 - bne _081BFC6A - b _081BFE18 -_081BFC6A: - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081BFDEE - .pool -_081BFC7C: - bl sub_81C25E8 - b _081BFDE6 -_081BFC82: - bl sub_81C286C - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081BFDEE - .pool -_081BFC94: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040c0 - adds r0, r1 - ldrb r0, [r0] - bl sub_81C2D9C - b _081BFDE6 - .pool -_081BFCAC: - bl sub_81C0348 - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081BFDEE - .pool -_081BFCC0: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040c0 - adds r0, r1 - ldrb r0, [r0] - bl sub_81C2AFC - b _081BFDE6 - .pool -_081BFCD8: - bl sub_81C4190 - bl sub_81C42C8 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040f0 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - b _081BFDE6 - .pool -_081BFCF8: - ldr r4, =gUnknown_0203CF1C - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0xC - ldr r2, =0x000040f0 - adds r1, r2 - bl sub_81C45F4 - ldr r1, [r4] - ldr r2, =0x000040d3 - adds r1, r2 - strb r0, [r1] - ldr r1, [r4] - adds r2, r1, r2 - ldrb r0, [r2] - cmp r0, 0xFF - bne _081BFD1C - b _081BFE18 -_081BFD1C: - ldr r0, =0x000040f0 - adds r1, r0 - movs r0, 0 - strh r0, [r1] - b _081BFDE6 - .pool -_081BFD34: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r0, 0xC - bl sub_81C4984 - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081BFDEE - .pool -_081BFD50: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r0, 0xC - bl sub_81C4A08 - b _081BFDE6 - .pool -_081BFD60: - bl sub_81C4A88 - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081BFDEE - .pool -_081BFD74: - bl sub_81C4280 - b _081BFDE6 -_081BFD7A: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040bc - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x3 - beq _081BFDA0 - ldr r0, =sub_81C0510 - movs r1, 0 - bl CreateTask - b _081BFDE6 - .pool -_081BFDA0: - ldr r0, =sub_81C171C - movs r1, 0 - bl CreateTask - b _081BFDE6 - .pool -_081BFDB0: - movs r0, 0x1 - negs r0, r0 - movs r1, 0x10 - movs r2, 0 - bl BlendPalettes - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081BFDEE - .pool -_081BFDCC: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - ldr r2, =gPaletteFade - ldrb r1, [r2, 0x8] - movs r0, 0x7F - ands r0, r1 -_081BFDE4: - strb r0, [r2, 0x8] -_081BFDE6: - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 -_081BFDEE: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _081BFE18 - .pool -_081BFE00: - ldr r0, =sub_81BFAD0 - bl SetVBlankCallback - ldr r0, =sub_81BFAB4 - bl SetMainCallback2 - movs r0, 0x1 - b _081BFE1A - .pool -_081BFE18: - movs r0, 0 -_081BFE1A: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81BFB10 - - thumb_func_start sub_81BFE24 -sub_81BFE24: @ 81BFE24 - push {r4,lr} - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0861CBB4 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - ldr r4, =gUnknown_0203CF1C - ldr r1, [r4] - ldr r0, =0x000020bc - adds r1, r0 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x000010bc - adds r1, r0 - movs r0, 0x2 - bl SetBgTilemapBuffer - ldr r1, [r4] - adds r1, 0xBC - movs r0, 0x3 - bl SetBgTilemapBuffer - bl sub_8121E10 - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x3 - bl schedule_bg_copy_tilemap_to_vram - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BFE24 - - thumb_func_start sub_81BFEB0 -sub_81BFEB0: @ 81BFEB0 - push {r4,lr} - sub sp, 0x4 - ldr r1, =gUnknown_0203CF1C - ldr r0, [r1] - ldr r2, =0x000040f0 - adds r0, r2 - movs r2, 0 - ldrsh r0, [r0, r2] - adds r4, r1, 0 - cmp r0, 0xC - bls _081BFEC8 - b _081C008C -_081BFEC8: - lsls r0, 2 - ldr r1, =_081BFEE0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081BFEE0: - .4byte _081BFF14 - .4byte _081BFF30 - .4byte _081BFF60 - .4byte _081BFF78 - .4byte _081BFF90 - .4byte _081BFFA8 - .4byte _081BFFC0 - .4byte _081BFFF0 - .4byte _081BFFFC - .4byte _081C0018 - .4byte _081C0024 - .4byte _081C0040 - .4byte _081C0064 -_081BFF14: - bl reset_temp_tile_data_buffers - ldr r1, =gUnknown_08D97D0C - movs r0, 0 - str r0, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - b _081C0046 - .pool -_081BFF30: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081BFF3E - b _081C008C -_081BFF3E: - ldr r0, =gUnknown_08D9862C - ldr r4, =gUnknown_0203CF1C - ldr r1, [r4] - adds r1, 0xBC - bl LZDecompressWram - ldr r1, [r4] - ldr r2, =0x000040f0 - adds r1, r2 - b _081C004E - .pool -_081BFF60: - ldr r0, =gUnknown_08D98CC8 - ldr r1, [r4] - ldr r2, =0x000008bc - adds r1, r2 - bl LZDecompressWram - ldr r1, [r4] - b _081C004A - .pool -_081BFF78: - ldr r0, =gUnknown_08D987FC - ldr r1, [r4] - ldr r2, =0x000018bc - adds r1, r2 - bl LZDecompressWram - ldr r1, [r4] - b _081C004A - .pool -_081BFF90: - ldr r0, =gUnknown_08D9898C - ldr r1, [r4] - ldr r2, =0x000028bc - adds r1, r2 - bl LZDecompressWram - ldr r1, [r4] - b _081C004A - .pool -_081BFFA8: - ldr r0, =gUnknown_08D98B28 - ldr r1, [r4] - ldr r2, =0x000038bc - adds r1, r2 - bl LZDecompressWram - ldr r1, [r4] - b _081C004A - .pool -_081BFFC0: - ldr r0, =gUnknown_08D9853C - movs r2, 0x80 - lsls r2, 1 - movs r1, 0 - bl LoadCompressedPalette - ldr r0, =gUnknown_08D85620 - movs r1, 0x81 - movs r2, 0x1E - bl LoadPalette - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r2, =0x000040f0 - adds r1, r2 - b _081C004E - .pool -_081BFFF0: - ldr r0, =gUnknown_0861CFBC - bl LoadCompressedObjectPic - b _081C0046 - .pool -_081BFFFC: - ldr r0, =gUnknown_0861D074 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r2, =0x000040f0 - adds r1, r2 - b _081C004E - .pool -_081C0018: - ldr r0, =gUnknown_0861D0F8 - bl LoadCompressedObjectPic - b _081C0046 - .pool -_081C0024: - ldr r0, =gUnknown_0861D100 - bl LoadCompressedObjectPalette - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r2, =0x000040f0 - adds r1, r2 - b _081C004E - .pool -_081C0040: - ldr r0, =gUnknown_0861D07C - bl LoadCompressedObjectPalette -_081C0046: - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] -_081C004A: - ldr r0, =0x000040f0 - adds r1, r0 -_081C004E: - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _081C008C - .pool -_081C0064: - ldr r0, =gUnknown_08D97B84 - movs r1, 0xE8 - lsls r1, 1 - movs r2, 0x60 - bl LoadCompressedPalette - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040f0 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - movs r0, 0x1 - b _081C008E - .pool -_081C008C: - movs r0, 0 -_081C008E: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81BFEB0 - - thumb_func_start sub_81C0098 -sub_81C0098: @ 81C0098 - push {r4,lr} - adds r3, r0, 0 - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r2, =0x000040bd - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _081C00D0 - ldr r2, [r1] - ldr r4, =0x000040be - adds r0, r1, r4 - ldrb r1, [r0] - movs r0, 0x64 - muls r1, r0 - adds r1, r2 - adds r0, r3, 0 - movs r2, 0x64 - bl memcpy - b _081C00E6 - .pool -_081C00D0: - ldr r0, [r1] - ldr r2, =0x000040be - adds r1, r2 - ldrb r2, [r1] - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 4 - adds r0, r1 - adds r1, r3, 0 - bl sub_8069004 -_081C00E6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C0098 - - thumb_func_start sub_81C00F0 -sub_81C00F0: @ 81C00F0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r5, r0, 0 - ldr r0, =gUnknown_0203CF1C - ldr r7, [r0] - adds r6, r7, 0 - adds r6, 0x70 - ldr r1, =0x000040f0 - adds r0, r7, r1 - movs r2, 0 - ldrsh r0, [r0, r2] - cmp r0, 0x1 - beq _081C0198 - cmp r0, 0x1 - bgt _081C0120 - cmp r0, 0 - beq _081C012C - b _081C0314 - .pool -_081C0120: - cmp r0, 0x2 - beq _081C01DC - cmp r0, 0x3 - bne _081C012A - b _081C02A8 -_081C012A: - b _081C0314 -_081C012C: - adds r0, r5, 0 - movs r1, 0xB - bl GetMonData - strh r0, [r6] - adds r0, r5, 0 - movs r1, 0x41 - bl GetMonData - strh r0, [r6, 0x2] - adds r0, r5, 0 - movs r1, 0x19 - bl GetMonData - str r0, [r6, 0x10] - adds r0, r5, 0 - movs r1, 0x38 - bl GetMonData - strb r0, [r6, 0x5] - adds r0, r5, 0 - movs r1, 0x2E - bl GetMonData - strb r0, [r6, 0x8] - adds r0, r5, 0 - movs r1, 0xC - bl GetMonData - strh r0, [r6, 0x2E] - adds r0, r5, 0 - movs r1, 0 - bl GetMonData - str r0, [r6, 0xC] - adds r0, r5, 0 - movs r1, 0x4 - bl GetMonData - adds r1, r7, 0 - adds r1, 0xA5 - strb r0, [r1] - lsls r0, 24 - cmp r0, 0 - beq _081C018C - movs r0, 0x1 - strb r0, [r6, 0x4] - b _081C0322 -_081C018C: - adds r0, r5, 0 - movs r1, 0x2D - bl GetMonData - strb r0, [r6, 0x4] - b _081C0322 -_081C0198: - movs r4, 0 - movs r0, 0x8C - adds r0, r7 - mov r8, r0 - movs r1, 0xA4 - adds r1, r7 - mov r9, r1 - adds r6, r7, 0 - adds r6, 0x84 -_081C01AA: - adds r1, r4, 0 - adds r1, 0xD - adds r0, r5, 0 - bl GetMonData - strh r0, [r6] - adds r1, r4, 0 - adds r1, 0x11 - adds r0, r5, 0 - bl GetMonData - mov r2, r8 - adds r1, r2, r4 - strb r0, [r1] - adds r6, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - bls _081C01AA - adds r0, r5, 0 - movs r1, 0x15 - bl GetMonData - mov r1, r9 - strb r0, [r1] - b _081C0322 -_081C01DC: - ldr r1, [r7] - ldr r0, =gPlayerParty - cmp r1, r0 - beq _081C01F8 - ldr r2, =0x000040bc - adds r0, r7, r2 - ldrb r0, [r0] - cmp r0, 0x2 - beq _081C01F8 - ldr r1, =0x000040ef - adds r0, r7, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _081C0254 -_081C01F8: - adds r0, r5, 0 - bl GetNature - adds r1, r6, 0 - adds r1, 0x33 - strb r0, [r1] - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - strh r0, [r6, 0x20] - adds r0, r5, 0 - movs r1, 0x3A - bl GetMonData - strh r0, [r6, 0x22] - adds r0, r5, 0 - movs r1, 0x3B - bl GetMonData - strh r0, [r6, 0x24] - adds r0, r5, 0 - movs r1, 0x3C - bl GetMonData - strh r0, [r6, 0x26] - adds r0, r5, 0 - movs r1, 0x3E - bl GetMonData - strh r0, [r6, 0x28] - adds r0, r5, 0 - movs r1, 0x3F - bl GetMonData - strh r0, [r6, 0x2A] - adds r0, r5, 0 - movs r1, 0x3D - b _081C02A0 - .pool -_081C0254: - adds r0, r5, 0 - bl GetNature - adds r1, r7, 0 - adds r1, 0xA3 - strb r0, [r1] - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - strh r0, [r6, 0x20] - adds r0, r5, 0 - movs r1, 0x3A - bl GetMonData - strh r0, [r6, 0x22] - adds r0, r5, 0 - movs r1, 0x54 - bl GetMonData - strh r0, [r6, 0x24] - adds r0, r5, 0 - movs r1, 0x55 - bl GetMonData - strh r0, [r6, 0x26] - adds r0, r5, 0 - movs r1, 0x57 - bl GetMonData - strh r0, [r6, 0x28] - adds r0, r5, 0 - movs r1, 0x58 - bl GetMonData - strh r0, [r6, 0x2A] - adds r0, r5, 0 - movs r1, 0x56 -_081C02A0: - bl GetMonData - strh r0, [r6, 0x2C] - b _081C0322 -_081C02A8: - adds r4, r7, 0 - adds r4, 0xA6 - adds r0, r5, 0 - movs r1, 0x7 - adds r2, r4, 0 - bl GetMonData - adds r0, r5, 0 - movs r1, 0x3 - bl GetMonData - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl ConvertInternationalString - adds r0, r5, 0 - bl sub_81B205C - strb r0, [r6, 0x7] - adds r0, r5, 0 - movs r1, 0x31 - bl GetMonData - adds r1, r7, 0 - adds r1, 0xA2 - strb r0, [r1] - adds r0, r5, 0 - movs r1, 0x1 - bl GetMonData - str r0, [r6, 0x48] - adds r0, r5, 0 - movs r1, 0x23 - bl GetMonData - strb r0, [r6, 0x9] - adds r0, r5, 0 - movs r1, 0x24 - bl GetMonData - strb r0, [r6, 0xA] - adds r0, r5, 0 - movs r1, 0x25 - bl GetMonData - strb r0, [r6, 0xB] - adds r0, r5, 0 - movs r1, 0x20 - bl GetMonData - strh r0, [r6, 0x30] - b _081C0322 -_081C0314: - adds r0, r5, 0 - movs r1, 0x52 - bl GetMonData - strb r0, [r6, 0x6] - movs r0, 0x1 - b _081C0332 -_081C0322: - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r2, =0x000040f0 - adds r1, r2 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - movs r0, 0 -_081C0332: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81C00F0 - - thumb_func_start sub_81C0348 -sub_81C0348: @ 81C0348 - push {r4-r6,lr} - ldr r6, =gUnknown_0203CF1C - ldr r2, [r6] - ldr r1, =0x000040c0 - adds r0, r2, r1 - ldrb r0, [r0] - subs r0, 0x2 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _081C037C - movs r0, 0 - movs r1, 0xFF - bl sub_81C1DA4 - movs r0, 0 - movs r1, 0xFF - movs r2, 0 - bl sub_81C1EFC - b _081C03D8 - .pool -_081C037C: - ldr r1, =0x000040c6 - adds r0, r2, r1 - ldrb r1, [r0] - lsls r1, 1 - adds r0, r2, 0 - adds r0, 0x84 - adds r0, r1 - ldrh r0, [r0] - bl sub_81C240C - ldr r0, [r6] - ldr r5, =0x000020bc - adds r0, r5 - movs r1, 0x3 - movs r2, 0 - bl sub_81C2194 - ldr r0, [r6] - ldr r4, =0x000030bc - adds r0, r4 - movs r1, 0x1 - movs r2, 0 - bl sub_81C2194 - ldr r1, [r6] - adds r1, r4 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r6] - adds r1, r5 - movs r0, 0x2 - bl SetBgTilemapBuffer - movs r1, 0x80 - lsls r1, 9 - movs r0, 0x2 - movs r2, 0x1 - bl ChangeBgX - movs r0, 0x13 - bl ClearWindowTilemap - movs r0, 0xD - bl ClearWindowTilemap -_081C03D8: - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x77 - ldrb r0, [r0] - cmp r0, 0 - bne _081C0400 - movs r0, 0 - movs r1, 0xFF - bl sub_81C2074 - b _081C0416 - .pool -_081C0400: - ldr r2, =0x000040c0 - adds r0, r1, r2 - ldrb r0, [r0] - subs r0, 0x2 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _081C0416 - movs r0, 0xD - bl PutWindowTilemap -_081C0416: - bl sub_81C2524 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r0, 0xC - bl sub_81C2228 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C0348 - - thumb_func_start sub_81C0434 -sub_81C0434: @ 81C0434 - push {lr} - bl FreeAllWindowBuffers - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - bl Free - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C0434 - - thumb_func_start sub_81C044C -sub_81C044C: @ 81C044C - 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_81C0484 - str r1, [r0] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C044C - - thumb_func_start sub_81C0484 -sub_81C0484: @ 81C0484 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C04EC - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081C04EC - ldr r4, =gUnknown_0203CF1C - ldr r0, [r4] - ldr r0, [r0, 0x4] - bl SetMainCallback2 - ldr r1, =gUnknown_0203CF20 - ldr r0, [r4] - ldr r2, =0x000040be - adds r0, r2 - ldrb r0, [r0] - strb r0, [r1] - bl sub_81C4898 - bl ResetSpriteData - bl FreeAllSpritePalettes - bl StopCryAndClearCrySongs - ldr r0, =gMPlay_BGM - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl m4aMPlayVolumeControl - ldr r0, =gBattleSpritesGfx - ldr r0, [r0] - cmp r0, 0 - bne _081C04E2 - movs r0, 0 - bl sub_806F47C -_081C04E2: - bl sub_81C0434 - adds r0, r5, 0 - bl DestroyTask -_081C04EC: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C0484 - - thumb_func_start sub_81C0510 -sub_81C0510: @ 81C0510 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C05FE - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r2, 0x80 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - bne _081C05FE - ldr r5, =gMain - ldrh r1, [r5, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081C0550 - movs r1, 0x1 - negs r1, r1 - adds r0, r4, 0 - bl sub_81C0604 - b _081C05FE - .pool -_081C0550: - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _081C0562 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81C0604 - b _081C05FE -_081C0562: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _081C0576 - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C0582 -_081C0576: - movs r1, 0x1 - negs r1, r1 - adds r0, r4, 0 - bl sub_81C0A8C - b _081C05FE -_081C0582: - ldrh r1, [r5, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _081C0598 - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _081C05A2 -_081C0598: - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81C0A8C - b _081C05FE -_081C05A2: - ldrh r1, [r5, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081C05E6 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040c0 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _081C05FE - cmp r0, 0 - bne _081C05D8 - bl sub_81C48F0 - movs r0, 0x5 - bl PlaySE - adds r0, r4, 0 - bl sub_81C044C - b _081C05FE - .pool -_081C05D8: - movs r0, 0x5 - bl PlaySE - adds r0, r4, 0 - bl sub_81C0E48 - b _081C05FE -_081C05E6: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081C05FE - bl sub_81C48F0 - movs r0, 0x5 - bl PlaySE - adds r0, r4, 0 - bl sub_81C044C -_081C05FE: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81C0510 - - thumb_func_start sub_81C0604 -sub_81C0604: @ 81C0604 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - adds r4, r5, 0 - ldr r1, =gUnknown_0203CF1C - ldr r3, [r1] - ldr r2, =0x000040c3 - adds r0, r3, r2 - ldrb r0, [r0] - adds r6, r1, 0 - cmp r0, 0 - bne _081C06EE - ldr r1, =0x000040bd - adds r0, r3, r1 - ldrb r2, [r0] - cmp r2, 0x1 - bne _081C0678 - adds r1, 0x3 - adds r0, r3, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _081C0654 - lsls r1, r5, 24 - asrs r1, 24 - movs r4, 0x2 - eors r1, r2 - negs r0, r1 - orrs r0, r1 - asrs r0, 31 - ands r4, r0 - b _081C065C - .pool -_081C0654: - movs r4, 0x3 - cmp r5, 0x1 - bne _081C065C - movs r4, 0x1 -_081C065C: - ldr r2, [r6] - ldr r0, [r2] - ldr r3, =0x000040be - adds r1, r2, r3 - ldrb r1, [r1] - adds r3, 0x1 - adds r2, r3 - ldrb r2, [r2] - adds r3, r4, 0 - bl sub_80D214C - b _081C0696 - .pool -_081C0678: - bl sub_81B1250 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C068E - lsls r0, r5, 24 - asrs r0, 24 - bl sub_81C09B4 - b _081C0696 -_081C068E: - lsls r0, r4, 24 - asrs r0, 24 - bl sub_81C08F8 -_081C0696: - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _081C06EE - movs r0, 0x5 - bl PlaySE - ldr r5, =gUnknown_0203CF1C - ldr r0, [r5] - adds r0, 0x77 - ldrb r0, [r0] - cmp r0, 0 - beq _081C06D4 - movs r0, 0x2 - movs r1, 0x1 - bl sub_81C4204 - movs r0, 0xD - bl ClearWindowTilemap - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0 - movs r1, 0x2 - bl sub_81C2074 -_081C06D4: - ldr r0, [r5] - ldr r1, =0x000040be - adds r0, r1 - movs r2, 0 - strb r4, [r0] - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - strh r2, [r0, 0x8] - ldr r1, =sub_81C0704 - str r1, [r0] -_081C06EE: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C0604 - - thumb_func_start sub_81C0704 -sub_81C0704: @ 81C0704 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r4, r1, 3 - ldr r6, =gTasks + 0x8 - adds r5, r4, r6 - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0xC - bls _081C071E - b _081C08BC -_081C071E: - lsls r0, 2 - ldr r1, =_081C0730 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081C0730: - .4byte _081C0764 - .4byte _081C076A - .4byte _081C0780 - .4byte _081C07A8 - .4byte _081C07C8 - .4byte _081C07E0 - .4byte _081C07F0 - .4byte _081C0800 - .4byte _081C0828 - .4byte _081C086C - .4byte _081C0872 - .4byte _081C0878 - .4byte _081C0894 -_081C0764: - bl StopCryAndClearCrySongs - b _081C08EC -_081C076A: - bl sub_81C4898 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040d3 - b _081C0786 - .pool -_081C0780: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040d4 -_081C0786: - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySpriteAndFreeResources - b _081C08EC - .pool -_081C07A8: - ldr r4, =gUnknown_0203CF1C - ldr r0, [r4] - adds r0, 0xC - bl sub_81C0098 - ldr r0, [r4] - ldr r1, =0x000040f0 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - b _081C08EC - .pool -_081C07C8: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r0, 0xC - bl sub_81C00F0 - lsls r0, 24 - cmp r0, 0 - bne _081C07DA - b _081C08F2 -_081C07DA: - b _081C08EC - .pool -_081C07E0: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r0, 0xC - bl sub_81C49E0 - b _081C08EC - .pool -_081C07F0: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r0, 0xC - bl sub_81C4A08 - b _081C08EC - .pool -_081C0800: - ldr r4, =gUnknown_0203CF1C - ldr r0, [r4] - adds r0, 0x77 - ldrb r0, [r0] - cmp r0, 0 - beq _081C0816 - movs r1, 0x2 - negs r1, r1 - movs r0, 0xA - bl sub_81C2074 -_081C0816: - ldr r0, [r4] - adds r0, 0xC - bl sub_81C2228 - movs r0, 0 - strh r0, [r5, 0x2] - b _081C08EC - .pool -_081C0828: - ldr r4, =gUnknown_0203CF1C - ldr r0, [r4] - adds r0, 0xC - adds r1, r5, 0x2 - bl sub_81C45F4 - ldr r1, [r4] - ldr r2, =0x000040d3 - adds r1, r2 - strb r0, [r1] - ldr r0, [r4] - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0xFF - beq _081C08F2 - ldr r2, =gSprites - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x1 - strh r1, [r0, 0x32] - bl sub_81C0E24 - movs r0, 0 - strh r0, [r5, 0x2] - b _081C08EC - .pool -_081C086C: - bl sub_81C4280 - b _081C08EC -_081C0872: - bl sub_81C25E8 - b _081C08EC -_081C0878: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040c0 - adds r0, r1 - ldrb r0, [r0] - bl sub_81C2D9C - bl sub_81C2524 - b _081C08EC - .pool -_081C0894: - ldr r2, =gSprites - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040d3 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strh r1, [r0, 0x32] - b _081C08EC - .pool -_081C08BC: - bl sub_81221EC - lsls r0, 24 - cmp r0, 0 - bne _081C08F2 - ldr r0, =sub_81C20F0 - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _081C08F2 - strh r0, [r5] - adds r0, r6, 0 - subs r0, 0x8 - adds r0, r4, r0 - ldr r1, =sub_81C0510 - str r1, [r0] - b _081C08F2 - .pool -_081C08EC: - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] -_081C08F2: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81C0704 - - thumb_func_start sub_81C08F8 -sub_81C08F8: @ 81C08F8 - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0203CF1C - ldr r2, [r1] - ldr r7, [r2] - ldr r3, =0x000040c0 - adds r0, r2, r3 - ldrb r0, [r0] - adds r5, r1, 0 - cmp r0, 0 - bne _081C0960 - lsls r0, r4, 24 - asrs r3, r0, 24 - movs r1, 0x1 - negs r1, r1 - adds r6, r0, 0 - cmp r3, r1 - bne _081C0928 - ldr r1, =0x000040be - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _081C0988 -_081C0928: - asrs r0, r6, 24 - cmp r0, 0x1 - bne _081C0940 - ldr r0, [r5] - ldr r2, =0x000040be - adds r1, r0, r2 - ldr r3, =0x000040bf - adds r0, r3 - ldrb r1, [r1] - ldrb r0, [r0] - cmp r1, r0 - bcs _081C0988 -_081C0940: - ldr r0, [r5] - ldr r1, =0x000040be - adds r0, r1 - ldrb r0, [r0] - adds r0, r4 - lsls r0, 24 - asrs r0, 24 - b _081C09AE - .pool -_081C0960: - ldr r3, =0x000040be - adds r0, r2, r3 - ldrb r5, [r0] - lsls r6, r4, 24 -_081C0968: - lsls r0, r5, 24 - asrs r0, 24 - asrs r1, r6, 24 - adds r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - asrs r4, r0, 24 - cmp r4, 0 - blt _081C0988 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040bf - adds r0, r1 - ldrb r0, [r0] - cmp r4, r0 - ble _081C099C -_081C0988: - movs r0, 0x1 - negs r0, r0 - b _081C09AE - .pool -_081C099C: - movs r0, 0x64 - muls r0, r4 - adds r0, r7, r0 - movs r1, 0x2D - bl GetMonData - cmp r0, 0 - bne _081C0968 - adds r0, r4, 0 -_081C09AE: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81C08F8 - - thumb_func_start sub_81C09B4 -sub_81C09B4: @ 81C09B4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - mov r12, r0 - ldr r6, =gUnknown_0203CF1C - ldr r0, [r6] - ldr r1, [r0] - mov r8, r1 - movs r5, 0 - movs r2, 0 - ldr r3, =gUnknown_0861CC1C - movs r1, 0 - ldrsb r1, [r3, r1] - ldr r4, =0x000040be - adds r0, r4 - ldrb r0, [r0] - cmp r1, r0 - beq _081C09FC - adds r7, r3, 0 - adds r3, r4, 0 -_081C09E0: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x5 - bhi _081C09FC - adds r0, r2, r7 - movs r1, 0 - ldrsb r1, [r0, r1] - ldr r0, [r6] - adds r0, r3 - ldrb r0, [r0] - cmp r1, r0 - bne _081C09E0 - adds r5, r2, 0 -_081C09FC: - mov r0, r12 - lsls r6, r0, 24 - ldr r7, =gUnknown_0861CC1C -_081C0A02: - lsls r0, r5, 24 - asrs r0, 24 - asrs r1, r6, 24 - adds r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, r5, 24 - lsrs r0, r1, 24 - cmp r0, 0x5 - bhi _081C0A40 - asrs r0, r1, 24 - adds r0, r7 - movs r4, 0 - ldrsb r4, [r0, r4] - movs r0, 0x64 - muls r0, r4 - add r0, r8 - bl sub_81C0A50 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C0A02 - adds r0, r4, 0 - b _081C0A44 - .pool -_081C0A40: - movs r0, 0x1 - negs r0, r0 -_081C0A44: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81C09B4 - - thumb_func_start sub_81C0A50 -sub_81C0A50: @ 81C0A50 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081C0A84 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040be - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _081C0A78 - adds r0, r4, 0 - movs r1, 0x2D - bl GetMonData - cmp r0, 0 - bne _081C0A84 -_081C0A78: - movs r0, 0x1 - b _081C0A86 - .pool -_081C0A84: - movs r0, 0 -_081C0A86: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81C0A50 - - thumb_func_start sub_81C0A8C -sub_81C0A8C: @ 81C0A8C - 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 - str r6, [sp] - lsls r1, 24 - lsrs r3, r1, 24 - str r3, [sp, 0x4] - ldr r0, =gUnknown_0203CF1C - mov r8, r0 - ldr r2, [r0] - adds r1, r2, 0 - adds r1, 0x70 - lsls r0, r6, 2 - adds r0, r6 - lsls r7, r0, 3 - ldr r0, =gTasks + 0x8 - mov r9, r0 - adds r0, r7, r0 - str r0, [sp, 0x8] - ldrb r1, [r1, 0x4] - mov r10, r1 - cmp r1, 0 - bne _081C0B6E - lsls r0, r3, 24 - asrs r5, r0, 24 - movs r0, 0x1 - negs r0, r0 - cmp r5, r0 - bne _081C0AE0 - ldr r1, =0x000040c0 - adds r0, r2, r1 - ldr r3, =0x000040c1 - adds r1, r2, r3 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - beq _081C0B6E -_081C0AE0: - cmp r5, 0x1 - bne _081C0AF4 - ldr r1, =0x000040c0 - adds r0, r2, r1 - ldr r3, =0x000040c2 - adds r1, r2, r3 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - beq _081C0B6E -_081C0AF4: - movs r0, 0x5 - bl PlaySE - mov r1, r8 - ldr r0, [r1] - ldr r4, =0x000040c0 - adds r0, r4 - ldrb r0, [r0] - bl sub_81C2C38 - mov r2, r8 - ldr r1, [r2] - adds r1, r4 - ldrb r0, [r1] - ldr r3, [sp, 0x4] - adds r0, r3 - strb r0, [r1] - mov r1, r10 - ldr r0, [sp, 0x8] - strh r1, [r0] - cmp r5, 0x1 - bne _081C0B4C - ldr r1, =sub_81C0B8C - mov r0, r9 - subs r0, 0x8 - adds r0, r7, r0 - ldr r2, [r0] - adds r0, r6, 0 - bl SetTaskFuncWithFollowupFunc - b _081C0B5C - .pool -_081C0B4C: - ldr r1, =sub_81C0CC4 - mov r0, r9 - subs r0, 0x8 - adds r0, r7, r0 - ldr r2, [r0] - ldr r0, [sp] - bl SetTaskFuncWithFollowupFunc -_081C0B5C: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r2, =0x000040c0 - adds r0, r2 - ldrb r0, [r0] - bl sub_81C2DE4 - bl sub_81C424C -_081C0B6E: - 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_81C0A8C - - thumb_func_start sub_81C0B8C -sub_81C0B8C: @ 81C0B8C - 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 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081C0C2A - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r3, =0x000040c9 - adds r0, r3 - ldrb r0, [r0] - cmp r0, 0 - bne _081C0BE0 - movs r0, 0x1 - strh r0, [r4, 0x2] - movs r0, 0x1 - movs r1, 0x7 - movs r2, 0x1 - bl SetBgAttribute - movs r0, 0x2 - movs r1, 0x7 - movs r2, 0x2 - bl SetBgAttribute - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - b _081C0BFE - .pool -_081C0BE0: - movs r0, 0x2 - strh r0, [r4, 0x2] - movs r0, 0x2 - movs r1, 0x7 - movs r2, 0x1 - bl SetBgAttribute - movs r0, 0x1 - movs r1, 0x7 - movs r2, 0x2 - bl SetBgAttribute - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram -_081C0BFE: - ldrb r0, [r4, 0x2] - movs r1, 0 - movs r2, 0 - bl ChangeBgX - ldrb r0, [r4, 0x2] - ldr r1, =gUnknown_0203CF1C - ldr r1, [r1] - ldr r3, =0x000040c0 - adds r2, r1, r3 - ldrb r2, [r2] - lsls r2, 12 - adds r2, 0xBC - adds r1, r2 - bl SetBgTilemapBuffer - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg -_081C0C2A: - ldrb r0, [r4, 0x2] - movs r1, 0x80 - lsls r1, 6 - movs r2, 0x1 - bl ChangeBgX - ldrh r0, [r4] - adds r0, 0x20 - strh r0, [r4] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xFF - ble _081C0C52 - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81C0C68 - str r0, [r1] -_081C0C52: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C0B8C - - thumb_func_start sub_81C0C68 -sub_81C0C68: @ 81C0C68 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r2, r4, 2 - adds r2, r4 - lsls r2, 3 - ldr r0, =gTasks + 0x8 - adds r2, r0 - ldr r5, =gUnknown_0203CF1C - ldr r3, [r5] - ldr r0, =0x000040c9 - adds r3, r0 - ldrb r0, [r3] - movs r1, 0x1 - eors r0, r1 - movs r1, 0 - strb r0, [r3] - strh r1, [r2, 0x2] - strh r1, [r2] - bl sub_81C1BA0 - ldr r0, [r5] - ldr r1, =0x000040c0 - adds r0, r1 - ldrb r0, [r0] - bl sub_81C2AFC - bl sub_81C4280 - bl sub_81C0E24 - adds r0, r4, 0 - bl SwitchTaskToFollowupFunc - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C0C68 - - thumb_func_start sub_81C0CC4 -sub_81C0CC4: @ 81C0CC4 - 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 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081C0D0C - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040c9 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _081C0CFC - movs r0, 0x2 - b _081C0CFE - .pool -_081C0CFC: - movs r0, 0x1 -_081C0CFE: - strh r0, [r4, 0x2] - ldrb r0, [r4, 0x2] - movs r1, 0x80 - lsls r1, 9 - movs r2, 0 - bl ChangeBgX -_081C0D0C: - ldrb r0, [r4, 0x2] - movs r1, 0x80 - lsls r1, 6 - movs r2, 0x2 - bl ChangeBgX - ldrh r0, [r4] - adds r0, 0x20 - strh r0, [r4] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xFF - ble _081C0D34 - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81C0D44 - str r0, [r1] -_081C0D34: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C0CC4 - - thumb_func_start sub_81C0D44 -sub_81C0D44: @ 81C0D44 - push {r4-r7,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 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040c9 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _081C0D8C - movs r0, 0x1 - movs r1, 0x7 - movs r2, 0x1 - bl SetBgAttribute - movs r0, 0x2 - movs r1, 0x7 - movs r2, 0x2 - bl SetBgAttribute - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - b _081C0DA6 - .pool -_081C0D8C: - movs r0, 0x2 - movs r1, 0x7 - movs r2, 0x1 - bl SetBgAttribute - movs r0, 0x1 - movs r1, 0x7 - movs r2, 0x2 - bl SetBgAttribute - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram -_081C0DA6: - ldr r6, =gUnknown_0203CF1C - ldr r2, [r6] - ldr r7, =0x000040c0 - adds r1, r2, r7 - ldrb r0, [r1] - cmp r0, 0x1 - bls _081C0DD0 - ldrb r0, [r4, 0x2] - ldrb r1, [r1] - lsls r1, 12 - ldr r3, =0xfffff0bc - adds r1, r3 - adds r1, r2, r1 - bl SetBgTilemapBuffer - ldrb r0, [r4, 0x2] - movs r1, 0x80 - lsls r1, 9 - movs r2, 0 - bl ChangeBgX -_081C0DD0: - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - ldr r2, [r6] - ldr r0, =0x000040c9 - adds r2, r0 - ldrb r0, [r2] - movs r1, 0x1 - eors r0, r1 - movs r1, 0 - strb r0, [r2] - strh r1, [r4, 0x2] - strh r1, [r4] - bl sub_81C1BA0 - ldr r0, [r6] - adds r0, r7 - ldrb r0, [r0] - bl sub_81C2AFC - bl sub_81C4280 - bl sub_81C0E24 - adds r0, r5, 0 - bl SwitchTaskToFollowupFunc - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C0D44 - - thumb_func_start sub_81C0E24 -sub_81C0E24: @ 81C0E24 - push {lr} - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r2, =0x000040c0 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x1 - bne _081C0E3C - adds r0, r1, 0 - adds r0, 0xC - bl sub_81C22CC -_081C0E3C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C0E24 - - thumb_func_start sub_81C0E48 -sub_81C0E48: @ 81C0E48 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r5, =gUnknown_0203CF1C - ldr r0, [r5] - ldr r2, =0x000040c6 - adds r0, r2 - movs r1, 0 - strb r1, [r0] - ldr r1, [r5] - adds r2, r1, r2 - ldrb r0, [r2] - lsls r0, 1 - adds r1, 0x84 - adds r1, r0 - ldrh r6, [r1] - mov r8, r6 - movs r0, 0x13 - bl ClearWindowTilemap - ldr r2, =gSprites - ldr r0, [r5] - ldr r1, =0x000040d5 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _081C0E96 - movs r0, 0xD - bl ClearWindowTilemap -_081C0E96: - movs r4, 0x3 - negs r4, r4 - movs r0, 0x9 - adds r1, r4, 0 - bl sub_81C1DA4 - movs r0, 0x9 - adds r1, r4, 0 - adds r2, r6, 0 - bl sub_81C1EFC - ldr r0, [r5] - ldr r1, =0x000040c8 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _081C0EC4 - movs r0, 0x5 - bl ClearWindowTilemap - movs r0, 0x6 - bl PutWindowTilemap -_081C0EC4: - ldr r0, [r5] - ldr r1, =0x000020bc - adds r0, r1 - movs r1, 0x3 - movs r2, 0 - bl sub_81C2194 - ldr r0, [r5] - ldr r1, =0x000030bc - adds r0, r1 - movs r1, 0x1 - movs r2, 0 - bl sub_81C2194 - mov r0, r8 - bl sub_81C3E9C - bl sub_81C3F44 - bl sub_81C44F0 - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x8 - bl sub_81C4AF8 - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81C0F44 - str r1, [r0] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C0E48 - - thumb_func_start sub_81C0F44 -sub_81C0F44: @ 81C0F44 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C103A - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081C0F98 - movs r0, 0x4 - strh r0, [r4] - movs r1, 0x1 - negs r1, r1 - ldr r0, =gUnknown_0203CF1C - ldr r2, [r0] - ldr r0, =0x000040c6 - adds r2, r0 - adds r0, r4, 0 - bl sub_81C1070 - b _081C103A - .pool -_081C0F98: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081C0FC0 - movs r0, 0x4 - strh r0, [r4] - ldr r0, =gUnknown_0203CF1C - ldr r2, [r0] - ldr r0, =0x000040c6 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81C1070 - b _081C103A - .pool -_081C0FC0: - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081C1026 - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r2, =0x000040c8 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x1 - beq _081C0FE8 - subs r2, 0x4 - adds r0, r1, r2 - ldr r0, [r0] - ldr r1, =0x00ffffff - ands r0, r1 - movs r1, 0x80 - lsls r1, 11 - cmp r0, r1 - bne _081C1004 -_081C0FE8: - movs r0, 0x5 - bl PlaySE - adds r0, r5, 0 - bl sub_81C11F4 - b _081C103A - .pool -_081C1004: - bl sub_81C1040 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C101E - movs r0, 0x5 - bl PlaySE - adds r0, r5, 0 - bl sub_81C129C - b _081C103A -_081C101E: - movs r0, 0x20 - bl PlaySE - b _081C103A -_081C1026: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081C103A - movs r0, 0x5 - bl PlaySE - adds r0, r6, 0 - bl sub_81C11F4 -_081C103A: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81C0F44 - - thumb_func_start sub_81C1040 -sub_81C1040: @ 81C1040 - push {lr} - movs r1, 0x1 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r2, r0, 0 - adds r2, 0x84 -_081C104C: - lsls r0, r1, 1 - adds r0, r2, r0 - ldrh r0, [r0] - cmp r0, 0 - beq _081C1060 - movs r0, 0x1 - b _081C106C - .pool -_081C1060: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x3 - bls _081C104C - movs r0, 0 -_081C106C: - pop {r1} - bx r1 - thumb_func_end sub_81C1040 - - thumb_func_start sub_81C1070 -sub_81C1070: @ 81C1070 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r7, r0, 0 - adds r4, r1, 0 - mov r8, r2 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl PlaySE - mov r0, r8 - ldrb r6, [r0] - movs r2, 0 - lsls r4, 24 - asrs r4, 24 - mov r12, r4 - movs r1, 0 - ldrsh r4, [r7, r1] - ldrb r0, [r7] - lsls r3, r0, 24 -_081C109C: - lsls r0, r6, 24 - asrs r0, 24 - add r0, r12 - lsls r0, 24 - lsrs r6, r0, 24 - asrs r0, 24 - cmp r0, r4 - ble _081C10B0 - movs r6, 0 - b _081C10B6 -_081C10B0: - cmp r0, 0 - bge _081C10B6 - lsrs r6, r3, 24 -_081C10B6: - lsls r0, r6, 24 - asrs r1, r0, 24 - mov r9, r0 - cmp r1, 0x4 - bne _081C10C2 - b _081C11CC -_081C10C2: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - lsls r1, 1 - adds r0, 0x84 - adds r0, r1 - ldrh r5, [r0] - cmp r5, 0 - bne _081C10E2 - lsls r0, r2, 24 - movs r1, 0x80 - lsls r1, 17 - adds r0, r1 - lsrs r2, r0, 24 - asrs r0, 24 - cmp r0, 0x3 - ble _081C109C -_081C10E2: - adds r0, r5, 0 - bl sub_81C240C - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - adds r0, r5, 0 - bl sub_81C3E9C - mov r1, r8 - ldrb r0, [r1] - cmp r0, 0x4 - bne _081C1110 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040c4 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0 - beq _081C1118 -_081C1110: - movs r1, 0x2 - ldrsh r0, [r7, r1] - cmp r0, 0x1 - bne _081C115E -_081C1118: - movs r0, 0x13 - bl ClearWindowTilemap - ldr r2, =gSprites - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040d5 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _081C1142 - movs r0, 0xD - bl ClearWindowTilemap -_081C1142: - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r4, 0x3 - negs r4, r4 - movs r0, 0x9 - adds r1, r4, 0 - bl sub_81C1DA4 - movs r0, 0x9 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_81C1EFC -_081C115E: - mov r1, r8 - ldrb r0, [r1] - cmp r0, 0x4 - beq _081C11A0 - mov r1, r9 - asrs r0, r1, 24 - cmp r0, 0x4 - bne _081C11A0 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040c4 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0 - bne _081C11A0 - movs r0, 0xE - bl ClearWindowTilemap - movs r0, 0xF - bl ClearWindowTilemap - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0 - movs r1, 0x3 - bl sub_81C1DA4 - movs r0, 0 - movs r1, 0x3 - movs r2, 0 - bl sub_81C1EFC -_081C11A0: - mov r0, r8 - strb r6, [r0] - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040c6 - adds r0, r1 - cmp r8, r0 - bne _081C11E0 - movs r0, 0x8 - bl sub_81C4D18 - b _081C11E6 - .pool -_081C11CC: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040c4 - adds r0, r1 - ldrh r5, [r0] - b _081C10E2 - .pool -_081C11E0: - movs r0, 0x12 - bl sub_81C4D18 -_081C11E6: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81C1070 - - thumb_func_start sub_81C11F4 -sub_81C11F4: @ 81C11F4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0x8 - bl sub_81C4C60 - movs r0, 0x6 - bl ClearWindowTilemap - movs r0, 0x5 - bl PutWindowTilemap - movs r0, 0 - bl sub_81C3E9C - ldr r4, =gUnknown_0203CF1C - ldr r0, [r4] - ldr r1, =0x000020bc - adds r0, r1 - movs r1, 0x3 - movs r2, 0x1 - bl sub_81C2194 - ldr r0, [r4] - ldr r1, =0x000030bc - adds r0, r1 - movs r1, 0x1 - movs r2, 0x1 - bl sub_81C2194 - bl sub_81C4064 - ldr r0, [r4] - ldr r1, =0x000040c6 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x4 - beq _081C125E - movs r0, 0xE - bl ClearWindowTilemap - movs r0, 0xF - bl ClearWindowTilemap - movs r0, 0 - movs r1, 0x3 - bl sub_81C1DA4 - movs r0, 0 - movs r1, 0x3 - movs r2, 0 - bl sub_81C1EFC -_081C125E: - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81C0510 - str r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C11F4 - - thumb_func_start sub_81C129C -sub_81C129C: @ 81C129C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r2, =0x000040c6 - adds r1, r0, r2 - ldrb r1, [r1] - adds r2, 0x1 - adds r0, r2 - strb r1, [r0] - movs r0, 0x1 - bl sub_81C4C84 - movs r0, 0x12 - bl sub_81C4AF8 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81C12E4 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C129C - - thumb_func_start sub_81C12E4 -sub_81C12E4: @ 81C12E4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C13AA - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081C1338 - movs r0, 0x3 - strh r0, [r4] - movs r1, 0x1 - negs r1, r1 - ldr r0, =gUnknown_0203CF1C - ldr r2, [r0] - ldr r0, =0x000040c7 - adds r2, r0 - adds r0, r4, 0 - bl sub_81C1070 - b _081C13AA - .pool -_081C1338: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081C1360 - movs r0, 0x3 - strh r0, [r4] - ldr r0, =gUnknown_0203CF1C - ldr r2, [r0] - ldr r0, =0x000040c7 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81C1070 - b _081C13AA - .pool -_081C1360: - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081C139A - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r2, =0x000040c6 - adds r1, r0, r2 - adds r2, 0x1 - adds r0, r2 - ldrb r1, [r1] - ldrb r0, [r0] - cmp r1, r0 - bne _081C1390 - adds r0, r5, 0 - movs r1, 0 - bl sub_81C13B0 - b _081C13AA - .pool -_081C1390: - adds r0, r5, 0 - movs r1, 0x1 - bl sub_81C13B0 - b _081C13AA -_081C139A: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081C13AA - adds r0, r6, 0 - movs r1, 0 - bl sub_81C13B0 -_081C13AA: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81C12E4 - - thumb_func_start sub_81C13B0 -sub_81C13B0: @ 81C13B0 - push {r4-r7,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl PlaySE - movs r0, 0 - bl sub_81C4C84 - movs r0, 0x12 - bl sub_81C4C60 - cmp r4, 0x1 - bne _081C1464 - ldr r0, =gUnknown_0203CF1C - ldr r3, [r0] - ldr r1, =0x000040bd - adds r0, r3, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _081C1410 - ldr r0, [r3] - ldr r2, =0x000040be - adds r1, r3, r2 - ldrb r2, [r1] - movs r1, 0x64 - muls r1, r2 - adds r0, r1 - ldr r4, =0x000040c6 - adds r1, r3, r4 - ldrb r1, [r1] - adds r4, 0x1 - adds r2, r3, r4 - ldrb r2, [r2] - bl sub_81C14BC - b _081C1430 - .pool -_081C1410: - ldr r0, [r3] - ldr r2, =0x000040be - adds r1, r3, r2 - ldrb r2, [r1] - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 4 - adds r0, r1 - ldr r4, =0x000040c6 - adds r1, r3, r4 - ldrb r1, [r1] - adds r4, 0x1 - adds r2, r3, r4 - ldrb r2, [r2] - bl sub_81C15EC -_081C1430: - ldr r5, =gUnknown_0203CF1C - ldr r0, [r5] - adds r0, 0xC - bl sub_81C0098 - ldr r1, [r5] - ldr r6, =0x000040c6 - adds r0, r1, r6 - ldrb r0, [r0] - ldr r4, =0x000040c7 - adds r1, r4 - ldrb r1, [r1] - bl sub_81C40A0 - ldr r1, [r5] - adds r0, r1, r6 - ldrb r0, [r0] - adds r1, r4 - ldrb r1, [r1] - bl sub_81C4568 - ldr r0, [r5] - adds r4, r0, r4 - ldrb r1, [r4] - adds r0, r6 - strb r1, [r0] -_081C1464: - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r2, =0x000040c6 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 1 - adds r1, 0x84 - adds r1, r0 - ldrh r4, [r1] - adds r0, r4, 0 - bl sub_81C3E9C - adds r0, r4, 0 - bl sub_81C240C - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81C0F44 - str r1, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C13B0 - - thumb_func_start sub_81C14BC -sub_81C14BC: @ 81C14BC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x28 - adds r7, r0, 0 - adds r4, r1, 0 - adds r6, r2, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r6, 24 - lsrs r6, 24 - ldr r0, =gUnknown_0203CF1C - ldr r2, [r0] - lsls r0, r4, 1 - mov r10, r0 - adds r1, r2, 0 - adds r1, 0x84 - adds r0, r1, r0 - str r0, [sp, 0x8] - ldrh r0, [r0] - mov r3, sp - adds r3, 0x2 - str r3, [sp, 0x1C] - strh r0, [r3] - lsls r0, r6, 1 - mov r9, r0 - add r1, r9 - str r1, [sp, 0xC] - ldrh r1, [r1] - mov r0, sp - strh r1, [r0] - adds r1, r2, 0 - adds r1, 0x8C - adds r3, r1, r4 - str r3, [sp, 0x10] - ldrb r0, [r3] - mov r3, sp - adds r3, 0x5 - str r3, [sp, 0x24] - strb r0, [r3] - adds r1, r6 - str r1, [sp, 0x14] - ldrb r0, [r1] - mov r1, sp - adds r1, 0x4 - str r1, [sp, 0x20] - strb r0, [r1] - adds r2, 0xA4 - str r2, [sp, 0x18] - ldrb r0, [r2] - mov r5, sp - adds r5, 0x6 - strb r0, [r5] - ldr r1, =gUnknown_08329D22 - adds r0, r4, r1 - ldrb r0, [r0] - mov r8, r0 - ldrb r0, [r5] - adds r2, r0, 0 - mov r3, r8 - ands r2, r3 - mov r3, r10 - asrs r2, r3 - lsls r2, 24 - lsrs r2, 24 - adds r1, r6, r1 - ldrb r1, [r1] - mov r12, r1 - adds r1, r0, 0 - mov r3, r12 - ands r1, r3 - mov r3, r9 - asrs r1, r3 - lsls r1, 24 - lsrs r1, 24 - mov r3, r8 - bics r0, r3 - strb r0, [r5] - ldrb r0, [r5] - mov r3, r12 - bics r0, r3 - strb r0, [r5] - mov r0, r9 - lsls r2, r0 - mov r3, r10 - lsls r1, r3 - adds r2, r1 - ldrb r0, [r5] - orrs r0, r2 - strb r0, [r5] - adds r1, r4, 0 - adds r1, 0xD - adds r0, r7, 0 - mov r2, sp - bl SetMonData - adds r1, r6, 0 - adds r1, 0xD - adds r0, r7, 0 - ldr r2, [sp, 0x1C] - bl SetMonData - adds r4, 0x11 - adds r0, r7, 0 - adds r1, r4, 0 - ldr r2, [sp, 0x20] - bl SetMonData - adds r6, 0x11 - adds r0, r7, 0 - adds r1, r6, 0 - ldr r2, [sp, 0x24] - bl SetMonData - adds r0, r7, 0 - movs r1, 0x15 - adds r2, r5, 0 - bl SetMonData - mov r0, sp - ldrh r0, [r0] - ldr r1, [sp, 0x8] - strh r0, [r1] - ldr r3, [sp, 0x1C] - ldrh r0, [r3] - ldr r1, [sp, 0xC] - strh r0, [r1] - ldr r3, [sp, 0x20] - ldrb r0, [r3] - ldr r1, [sp, 0x10] - strb r0, [r1] - ldr r3, [sp, 0x24] - ldrb r0, [r3] - ldr r1, [sp, 0x14] - strb r0, [r1] - ldrb r0, [r5] - ldr r3, [sp, 0x18] - strb r0, [r3] - add sp, 0x28 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C14BC - - thumb_func_start sub_81C15EC -sub_81C15EC: @ 81C15EC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x28 - adds r7, r0, 0 - adds r4, r1, 0 - adds r6, r2, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r6, 24 - lsrs r6, 24 - ldr r0, =gUnknown_0203CF1C - ldr r2, [r0] - lsls r0, r4, 1 - mov r10, r0 - adds r1, r2, 0 - adds r1, 0x84 - adds r0, r1, r0 - str r0, [sp, 0x8] - ldrh r0, [r0] - mov r3, sp - adds r3, 0x2 - str r3, [sp, 0x1C] - strh r0, [r3] - lsls r0, r6, 1 - mov r9, r0 - add r1, r9 - str r1, [sp, 0xC] - ldrh r1, [r1] - mov r0, sp - strh r1, [r0] - adds r1, r2, 0 - adds r1, 0x8C - adds r3, r1, r4 - str r3, [sp, 0x10] - ldrb r0, [r3] - mov r3, sp - adds r3, 0x5 - str r3, [sp, 0x24] - strb r0, [r3] - adds r1, r6 - str r1, [sp, 0x14] - ldrb r0, [r1] - mov r1, sp - adds r1, 0x4 - str r1, [sp, 0x20] - strb r0, [r1] - adds r2, 0xA4 - str r2, [sp, 0x18] - ldrb r0, [r2] - mov r5, sp - adds r5, 0x6 - strb r0, [r5] - ldr r1, =gUnknown_08329D22 - adds r0, r4, r1 - ldrb r0, [r0] - mov r8, r0 - ldrb r0, [r5] - adds r2, r0, 0 - mov r3, r8 - ands r2, r3 - mov r3, r10 - asrs r2, r3 - lsls r2, 24 - lsrs r2, 24 - adds r1, r6, r1 - ldrb r1, [r1] - mov r12, r1 - adds r1, r0, 0 - mov r3, r12 - ands r1, r3 - mov r3, r9 - asrs r1, r3 - lsls r1, 24 - lsrs r1, 24 - mov r3, r8 - bics r0, r3 - strb r0, [r5] - ldrb r0, [r5] - mov r3, r12 - bics r0, r3 - strb r0, [r5] - mov r0, r9 - lsls r2, r0 - mov r3, r10 - lsls r1, r3 - adds r2, r1 - ldrb r0, [r5] - orrs r0, r2 - strb r0, [r5] - adds r1, r4, 0 - adds r1, 0xD - adds r0, r7, 0 - mov r2, sp - bl SetBoxMonData - adds r1, r6, 0 - adds r1, 0xD - adds r0, r7, 0 - ldr r2, [sp, 0x1C] - bl SetBoxMonData - adds r4, 0x11 - adds r0, r7, 0 - adds r1, r4, 0 - ldr r2, [sp, 0x20] - bl SetBoxMonData - adds r6, 0x11 - adds r0, r7, 0 - adds r1, r6, 0 - ldr r2, [sp, 0x24] - bl SetBoxMonData - adds r0, r7, 0 - movs r1, 0x15 - adds r2, r5, 0 - bl SetBoxMonData - mov r0, sp - ldrh r0, [r0] - ldr r1, [sp, 0x8] - strh r0, [r1] - ldr r3, [sp, 0x1C] - ldrh r0, [r3] - ldr r1, [sp, 0xC] - strh r0, [r1] - ldr r3, [sp, 0x20] - ldrb r0, [r3] - ldr r1, [sp, 0x10] - strb r0, [r1] - ldr r3, [sp, 0x24] - ldrb r0, [r3] - ldr r1, [sp, 0x14] - strb r0, [r1] - ldrb r0, [r5] - ldr r3, [sp, 0x18] - strb r0, [r3] - add sp, 0x28 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C15EC - - thumb_func_start sub_81C171C -sub_81C171C: @ 81C171C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_81C44F0 - movs r0, 0x8 - bl sub_81C4AF8 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81C174C - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C171C - - thumb_func_start sub_81C174C -sub_81C174C: @ 81C174C - push {r4-r6,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 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C176A - b _081C189A -_081C176A: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r2, 0x80 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _081C177A - b _081C189A -_081C177A: - ldr r6, =gMain - ldrh r1, [r6, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081C17B4 - movs r0, 0x4 - strh r0, [r4] - movs r1, 0x1 - negs r1, r1 - ldr r0, =gUnknown_0203CF1C - ldr r2, [r0] - ldr r0, =0x000040c6 - adds r2, r0 - adds r0, r4, 0 - bl sub_81C1070 - b _081C189A - .pool -_081C17B4: - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _081C17DC - movs r0, 0x4 - strh r0, [r4] - ldr r0, =gUnknown_0203CF1C - ldr r2, [r0] - ldr r1, =0x000040c6 - adds r2, r1 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81C1070 - b _081C189A - .pool -_081C17DC: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _081C17F0 - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C17FC -_081C17F0: - movs r1, 0x1 - negs r1, r1 - adds r0, r5, 0 - bl sub_81C0A8C - b _081C189A -_081C17FC: - ldrh r1, [r6, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _081C1812 - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _081C181C -_081C1812: - adds r0, r5, 0 - movs r1, 0x1 - bl sub_81C0A8C - b _081C189A -_081C181C: - ldrh r1, [r6, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081C1876 - bl sub_81C18A8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C1868 - bl sub_81C48F0 - movs r0, 0x5 - bl PlaySE - ldr r2, =gUnknown_0203CF21 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040c6 - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - ldr r1, =gSpecialVar_0x8005 - ldrb r0, [r2] - strh r0, [r1] - adds r0, r5, 0 - bl sub_81C044C - b _081C189A - .pool -_081C1868: - movs r0, 0x20 - bl PlaySE - adds r0, r5, 0 - bl sub_81C18F4 - b _081C189A -_081C1876: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081C189A - bl sub_81C48F0 - movs r0, 0x5 - bl PlaySE - ldr r1, =gUnknown_0203CF21 - movs r0, 0x4 - strb r0, [r1] - ldr r1, =gSpecialVar_0x8005 - movs r0, 0x4 - strh r0, [r1] - adds r0, r5, 0 - bl sub_81C044C -_081C189A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C174C - - thumb_func_start sub_81C18A8 -sub_81C18A8: @ 81C18A8 - push {lr} - ldr r0, =gUnknown_0203CF1C - ldr r2, [r0] - ldr r0, =0x000040c6 - adds r1, r2, r0 - ldrb r0, [r1] - cmp r0, 0x4 - beq _081C18DA - ldr r3, =0x000040c4 - adds r0, r2, r3 - ldrh r0, [r0] - cmp r0, 0 - beq _081C18DA - ldrb r1, [r1] - lsls r1, 1 - adds r0, r2, 0 - adds r0, 0x84 - adds r0, r1 - ldrh r0, [r0] - bl sub_81B6D14 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C18EC -_081C18DA: - movs r0, 0x1 - b _081C18EE - .pool -_081C18EC: - movs r0, 0 -_081C18EE: - pop {r1} - bx r1 - thumb_func_end sub_81C18A8 - - thumb_func_start sub_81C18F4 -sub_81C18F4: @ 81C18F4 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0xE - bl ClearWindowTilemap - movs r0, 0xF - bl ClearWindowTilemap - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0 - movs r1, 0x3 - bl sub_81C1DA4 - movs r0, 0 - movs r1, 0x3 - movs r2, 0 - bl sub_81C1EFC - bl sub_81C4154 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81C1940 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C18F4 - - thumb_func_start sub_81C1940 -sub_81C1940: @ 81C1940 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - mov r8, r0 - ldr r0, =gTasks + 0x8 - mov r9, r0 - mov r4, r8 - add r4, r9 - ldr r0, =sub_81C1E20 - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C196C - b _081C1B74 -_081C196C: - ldr r6, =gMain - ldrh r1, [r6, 0x2E] - movs r0, 0x40 - ands r0, r1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0 - beq _081C19B0 - movs r0, 0x1 - strh r0, [r4, 0x2] - movs r0, 0x4 - strh r0, [r4] - movs r1, 0x1 - negs r1, r1 - ldr r0, =gUnknown_0203CF1C - ldr r2, [r0] - ldr r0, =0x000040c6 - adds r2, r0 - adds r0, r4, 0 - bl sub_81C1070 - movs r0, 0 - strh r0, [r4, 0x2] - b _081C1B6A - .pool -_081C19B0: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081C19DC - movs r0, 0x1 - strh r0, [r4, 0x2] - movs r0, 0x4 - strh r0, [r4] - ldr r0, =gUnknown_0203CF1C - ldr r2, [r0] - ldr r1, =0x000040c6 - adds r2, r1 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81C1070 - strh r5, [r4, 0x2] - b _081C1B6A - .pool -_081C19DC: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _081C19F0 - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C1A64 -_081C19F0: - ldr r4, =gUnknown_0203CF1C - ldr r0, [r4] - ldr r2, =0x000040c0 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0x2 - bne _081C1A00 - b _081C1B74 -_081C1A00: - movs r0, 0x13 - bl ClearWindowTilemap - ldr r2, =gSprites - ldr r0, [r4] - ldr r1, =0x000040d5 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _081C1A28 - movs r0, 0xD - bl ClearWindowTilemap -_081C1A28: - ldr r1, [r4] - ldr r2, =0x000040c6 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 1 - adds r1, 0x84 - adds r1, r0 - ldrh r5, [r1] - mov r0, r9 - subs r0, 0x8 - add r0, r8 - ldr r1, =sub_81C174C - str r1, [r0] - movs r1, 0x1 - negs r1, r1 - adds r0, r7, 0 - b _081C1ACE - .pool -_081C1A64: - ldrh r1, [r6, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _081C1A7A - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _081C1B04 -_081C1A7A: - ldr r4, =gUnknown_0203CF1C - ldr r0, [r4] - ldr r1, =0x000040c0 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x3 - beq _081C1B74 - movs r0, 0x13 - bl ClearWindowTilemap - ldr r2, =gSprites - ldr r0, [r4] - ldr r1, =0x000040d5 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _081C1AB0 - movs r0, 0xD - bl ClearWindowTilemap -_081C1AB0: - ldr r1, [r4] - ldr r2, =0x000040c6 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 1 - adds r1, 0x84 - adds r1, r0 - ldrh r5, [r1] - mov r0, r9 - subs r0, 0x8 - add r0, r8 - ldr r1, =sub_81C174C - str r1, [r0] - adds r0, r7, 0 - movs r1, 0x1 -_081C1ACE: - bl sub_81C0A8C - movs r4, 0x2 - negs r4, r4 - movs r0, 0x9 - adds r1, r4, 0 - bl sub_81C1DA4 - movs r0, 0x9 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_81C1EFC - b _081C1B74 - .pool -_081C1B04: - ldrh r1, [r6, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _081C1B74 - movs r0, 0x13 - bl ClearWindowTilemap - ldr r2, =gSprites - ldr r4, =gUnknown_0203CF1C - ldr r0, [r4] - ldr r1, =0x000040d5 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _081C1B38 - movs r0, 0xD - bl ClearWindowTilemap -_081C1B38: - ldr r1, [r4] - ldr r2, =0x000040c6 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 1 - adds r1, 0x84 - adds r1, r0 - ldrh r5, [r1] - adds r0, r5, 0 - bl sub_81C3E9C - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r4, 0x3 - negs r4, r4 - movs r0, 0x9 - adds r1, r4, 0 - bl sub_81C1DA4 - movs r0, 0x9 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_81C1EFC -_081C1B6A: - mov r0, r9 - subs r0, 0x8 - add r0, r8 - ldr r1, =sub_81C174C - str r1, [r0] -_081C1B74: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C1940 - - thumb_func_start sub_81C1B94 -sub_81C1B94: @ 81C1B94 - ldr r0, =gUnknown_0203CF21 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_81C1B94 - - thumb_func_start sub_81C1BA0 -sub_81C1BA0: @ 81C1BA0 - push {r4-r7,lr} - sub sp, 0xC - movs r0, 0x20 - bl Alloc - adds r4, r0, 0 - movs r5, 0 -_081C1BAE: - lsls r0, r5, 25 - lsrs r1, r0, 24 - adds r6, r1, 0 - ldr r0, =gUnknown_0203CF1C - ldr r3, [r0] - ldr r2, =0x000040c1 - adds r0, r3, r2 - ldrb r0, [r0] - cmp r5, r0 - bcs _081C1BD8 - lsls r0, r1, 1 - adds r0, r4 - movs r1, 0x40 - strh r1, [r0] - strh r1, [r0, 0x2] - movs r1, 0x50 - b _081C1BEE - .pool -_081C1BD8: - ldr r7, =0x000040c2 - adds r0, r3, r7 - ldrb r2, [r0] - cmp r5, r2 - bls _081C1BF8 - lsls r0, r1, 1 - adds r0, r4 - movs r1, 0x4A - strh r1, [r0] - strh r1, [r0, 0x2] - movs r1, 0x5A -_081C1BEE: - strh r1, [r0, 0x10] - strh r1, [r0, 0x12] - b _081C1C78 - .pool -_081C1BF8: - ldr r7, =0x000040c0 - adds r0, r3, r7 - ldrb r0, [r0] - cmp r5, r0 - bcs _081C1C1C - lsls r1, 1 - adds r1, r4 - movs r0, 0x46 - strh r0, [r1] - movs r0, 0x47 - strh r0, [r1, 0x2] - movs r0, 0x56 - strh r0, [r1, 0x10] - movs r0, 0x57 - b _081C1C76 - .pool -_081C1C1C: - cmp r5, r0 - bne _081C1C4C - cmp r5, r2 - beq _081C1C38 - lsls r1, 1 - adds r1, r4 - movs r0, 0x41 - strh r0, [r1] - movs r0, 0x42 - strh r0, [r1, 0x2] - movs r0, 0x51 - strh r0, [r1, 0x10] - movs r0, 0x52 - b _081C1C76 -_081C1C38: - lsls r1, 1 - adds r1, r4 - movs r0, 0x4B - strh r0, [r1] - movs r0, 0x4C - strh r0, [r1, 0x2] - movs r0, 0x5B - strh r0, [r1, 0x10] - movs r0, 0x5C - b _081C1C76 -_081C1C4C: - cmp r5, r2 - beq _081C1C64 - lsls r1, 1 - adds r1, r4 - movs r0, 0x43 - strh r0, [r1] - movs r0, 0x44 - strh r0, [r1, 0x2] - movs r0, 0x53 - strh r0, [r1, 0x10] - movs r0, 0x54 - b _081C1C76 -_081C1C64: - lsls r1, r6, 1 - adds r1, r4 - movs r0, 0x48 - strh r0, [r1] - movs r0, 0x49 - strh r0, [r1, 0x2] - movs r0, 0x58 - strh r0, [r1, 0x10] - movs r0, 0x59 -_081C1C76: - strh r0, [r1, 0x12] -_081C1C78: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _081C1BAE - movs r0, 0x8 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x10 - str r0, [sp, 0x8] - movs r0, 0x3 - adds r1, r4, 0 - movs r2, 0xB - movs r3, 0 - bl CopyToBgTilemapBufferRect_ChangePalette - movs r0, 0x3 - bl schedule_bg_copy_tilemap_to_vram - adds r0, r4, 0 - bl Free - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81C1BA0 - - thumb_func_start sub_81C1CB0 -sub_81C1CB0: @ 81C1CB0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r4, r0, 0 - mov r8, r1 - lsls r2, 24 - lsrs r6, r2, 24 - lsls r3, 24 - lsrs r5, r3, 24 - ldrb r1, [r4, 0x6] - ldrb r0, [r4, 0x7] - lsls r0, 1 - muls r0, r1 - bl Alloc - adds r7, r0, 0 - mov r1, sp - ldrh r0, [r4, 0x4] - strh r0, [r1] - ldrb r1, [r4, 0x7] - ldrb r0, [r4, 0x6] - adds r2, r1, 0 - muls r2, r0 - movs r0, 0x80 - lsls r0, 17 - orrs r2, r0 - mov r0, sp - adds r1, r7, 0 - bl CpuSet - ldrb r0, [r4, 0x6] - cmp r0, r6 - beq _081C1D60 - cmp r5, 0 - bne _081C1D30 - movs r5, 0 - ldrb r0, [r4, 0x7] - cmp r5, r0 - bcs _081C1D60 -_081C1D00: - ldrb r2, [r4, 0x6] - adds r1, r2, 0 - muls r1, r5 - adds r3, r6, r1 - lsls r3, 1 - ldr r0, [r4] - adds r0, r3 - lsls r1, 1 - adds r1, r7, r1 - subs r2, r6 - ldr r3, =0x001fffff - ands r2, r3 - bl CpuSet - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - ldrb r3, [r4, 0x7] - cmp r5, r3 - bcc _081C1D00 - b _081C1D60 - .pool -_081C1D30: - movs r5, 0 - ldrb r0, [r4, 0x7] - cmp r5, r0 - bcs _081C1D60 -_081C1D38: - ldrb r2, [r4, 0x6] - adds r1, r2, 0 - muls r1, r5 - lsls r3, r1, 1 - ldr r0, [r4] - adds r0, r3 - adds r1, r6, r1 - lsls r1, 1 - adds r1, r7, r1 - subs r2, r6 - ldr r3, =0x001fffff - ands r2, r3 - bl CpuSet - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - ldrb r3, [r4, 0x7] - cmp r5, r3 - bcc _081C1D38 -_081C1D60: - movs r5, 0 - b _081C1D8A - .pool -_081C1D68: - ldrb r2, [r4, 0x6] - adds r0, r2, 0 - muls r0, r5 - lsls r0, 1 - adds r0, r7, r0 - ldrb r1, [r4, 0x9] - adds r1, r5 - lsls r1, 5 - ldrb r3, [r4, 0x8] - adds r1, r3 - lsls r1, 1 - add r1, r8 - bl CpuSet - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 -_081C1D8A: - ldrb r0, [r4, 0x7] - cmp r5, r0 - bcc _081C1D68 - adds r0, r7, 0 - bl Free - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81C1CB0 - - thumb_func_start sub_81C1DA4 -sub_81C1DA4: @ 81C1DA4 - push {r4-r6,lr} - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, 16 - lsrs r4, r1, 16 - asrs r1, 16 - ldr r3, =gUnknown_0861CC04 - ldrb r2, [r3, 0x6] - cmp r1, r2 - ble _081C1DBA - adds r4, r2, 0 -_081C1DBA: - lsls r0, r4, 16 - asrs r0, 16 - cmp r0, 0 - beq _081C1DC6 - cmp r0, r2 - bne _081C1DE8 -_081C1DC6: - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r0, =0x000020bc - adds r1, r0 - lsls r2, r4, 24 - lsrs r2, 24 - adds r0, r3, 0 - movs r3, 0x1 - bl sub_81C1CB0 - b _081C1E12 - .pool -_081C1DE8: - ldr r5, =sub_81C1E20 - adds r0, r5, 0 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - bne _081C1E04 - adds r0, r5, 0 - movs r1, 0x8 - bl CreateTask - lsls r0, 24 - lsrs r2, r0, 24 -_081C1E04: - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - strh r4, [r0, 0x8] - strh r6, [r0, 0xA] -_081C1E12: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C1DA4 - - thumb_func_start sub_81C1E20 -sub_81C1E20: @ 81C1E20 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldrh r0, [r4] - ldrh r1, [r4, 0x2] - adds r0, r1 - strh r0, [r4, 0x2] - lsls r0, 16 - cmp r0, 0 - bge _081C1E50 - movs r0, 0 - strh r0, [r4, 0x2] - ldr r7, =gUnknown_0861CC04 - b _081C1E60 - .pool -_081C1E50: - movs r0, 0x2 - ldrsh r1, [r4, r0] - ldr r0, =gUnknown_0861CC04 - ldrb r2, [r0, 0x6] - adds r7, r0, 0 - cmp r1, r2 - ble _081C1E60 - strh r2, [r4, 0x2] -_081C1E60: - ldr r5, =gUnknown_0203CF1C - ldr r1, [r5] - ldr r0, =0x000020bc - adds r1, r0 - ldrb r2, [r4, 0x2] - adds r0, r7, 0 - movs r3, 0x1 - bl sub_81C1CB0 - movs r1, 0x2 - ldrsh r0, [r4, r1] - cmp r0, 0 - ble _081C1E80 - ldrb r7, [r7, 0x6] - cmp r0, r7 - blt _081C1EE0 -_081C1E80: - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0 - bge _081C1EAC - ldr r0, [r5] - ldr r1, =0x000040c0 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x2 - bne _081C1ED4 - movs r0, 0xE - bl PutWindowTilemap - b _081C1ED4 - .pool -_081C1EAC: - ldr r2, =gSprites - ldr r0, [r5] - ldr r1, =0x000040d5 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _081C1ECE - movs r0, 0xD - bl PutWindowTilemap -_081C1ECE: - movs r0, 0x13 - bl PutWindowTilemap -_081C1ED4: - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - adds r0, r6, 0 - bl DestroyTask -_081C1EE0: - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C1E20 - - thumb_func_start sub_81C1EFC -sub_81C1EFC: @ 81C1EFC - push {r4-r7,lr} - lsls r0, 16 - lsrs r7, r0, 16 - lsls r1, 16 - lsls r2, 16 - lsrs r6, r2, 16 - lsrs r4, r1, 16 - asrs r1, 16 - ldr r3, =gUnknown_0861CC10 - ldrb r2, [r3, 0x6] - cmp r1, r2 - ble _081C1F16 - adds r4, r2, 0 -_081C1F16: - lsls r0, r4, 16 - asrs r0, 16 - cmp r0, 0 - beq _081C1F22 - cmp r0, r2 - bne _081C1F44 -_081C1F22: - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r0, =0x000030bc - adds r1, r0 - lsls r2, r4, 24 - lsrs r2, 24 - adds r0, r3, 0 - movs r3, 0x1 - bl sub_81C1CB0 - b _081C1F70 - .pool -_081C1F44: - ldr r5, =sub_81C1F80 - adds r0, r5, 0 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - bne _081C1F60 - adds r0, r5, 0 - movs r1, 0x8 - bl CreateTask - lsls r0, 24 - lsrs r2, r0, 24 -_081C1F60: - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - strh r4, [r0, 0x8] - strh r7, [r0, 0xA] - strh r6, [r0, 0xC] -_081C1F70: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C1EFC - - thumb_func_start sub_81C1F80 -sub_81C1F80: @ 81C1F80 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldrh r0, [r4] - ldrh r1, [r4, 0x2] - adds r0, r1 - strh r0, [r4, 0x2] - lsls r0, 16 - cmp r0, 0 - bge _081C1FB0 - movs r0, 0 - strh r0, [r4, 0x2] - ldr r7, =gUnknown_0861CC10 - b _081C1FC0 - .pool -_081C1FB0: - movs r0, 0x2 - ldrsh r1, [r4, r0] - ldr r0, =gUnknown_0861CC10 - ldrb r2, [r0, 0x6] - adds r7, r0, 0 - cmp r1, r2 - ble _081C1FC0 - strh r2, [r4, 0x2] -_081C1FC0: - ldr r5, =gUnknown_0203CF1C - ldr r1, [r5] - ldr r0, =0x000030bc - adds r1, r0 - ldrb r2, [r4, 0x2] - adds r0, r7, 0 - movs r3, 0x1 - bl sub_81C1CB0 - movs r1, 0x2 - ldrsh r0, [r4, r1] - cmp r0, 0 - ble _081C1FE0 - ldrb r7, [r7, 0x6] - cmp r0, r7 - blt _081C2058 -_081C1FE0: - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0 - bge _081C2024 - ldr r0, [r5] - ldr r1, =0x000040c0 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C2006 - ldr r0, =sub_81C0B8C - bl FuncIsActiveTask - lsls r0, 24 - cmp r0, 0 - bne _081C2006 - movs r0, 0xF - bl PutWindowTilemap -_081C2006: - ldrh r0, [r4, 0x4] - bl sub_81C240C - b _081C204C - .pool -_081C2024: - ldr r2, =gSprites - ldr r0, [r5] - ldr r1, =0x000040d5 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _081C2046 - movs r0, 0xD - bl PutWindowTilemap -_081C2046: - movs r0, 0x13 - bl PutWindowTilemap -_081C204C: - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - adds r0, r6, 0 - bl DestroyTask -_081C2058: - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C1F80 - - thumb_func_start sub_81C2074 -sub_81C2074: @ 81C2074 - push {r4,r5,lr} - lsls r0, 16 - lsrs r5, r0, 16 - lsls r1, 16 - lsrs r4, r1, 16 - asrs r1, 16 - ldr r3, =gUnknown_0861CBEC - ldrb r2, [r3, 0x6] - cmp r1, r2 - ble _081C208A - adds r4, r2, 0 -_081C208A: - lsls r0, r4, 16 - asrs r0, 16 - cmp r0, 0 - beq _081C2096 - cmp r0, r2 - bne _081C20C8 -_081C2096: - ldr r5, =gUnknown_0203CF1C - ldr r1, [r5] - adds r1, 0xBC - lsls r4, 24 - lsrs r4, 24 - adds r0, r3, 0 - adds r2, r4, 0 - movs r3, 0 - bl sub_81C1CB0 - ldr r0, =gUnknown_0861CBF8 - ldr r1, [r5] - adds r1, 0xBC - adds r2, r4, 0 - movs r3, 0 - bl sub_81C1CB0 - b _081C20E2 - .pool -_081C20C8: - ldr r0, =sub_81C20F0 - movs r1, 0x8 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x8] - strh r5, [r1, 0xA] -_081C20E2: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2074 - - thumb_func_start sub_81C20F0 -sub_81C20F0: @ 81C20F0 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r5, r0, r1 - ldrh r0, [r5] - ldrh r1, [r5, 0x2] - adds r0, r1 - strh r0, [r5, 0x2] - lsls r0, 16 - cmp r0, 0 - bge _081C2120 - movs r0, 0 - strh r0, [r5, 0x2] - ldr r7, =gUnknown_0861CBEC - b _081C2130 - .pool -_081C2120: - movs r0, 0x2 - ldrsh r1, [r5, r0] - ldr r0, =gUnknown_0861CBEC - ldrb r2, [r0, 0x6] - adds r7, r0, 0 - cmp r1, r2 - ble _081C2130 - strh r2, [r5, 0x2] -_081C2130: - ldr r4, =gUnknown_0203CF1C - ldr r1, [r4] - adds r1, 0xBC - ldrb r2, [r5, 0x2] - adds r0, r7, 0 - movs r3, 0 - bl sub_81C1CB0 - ldr r0, =gUnknown_0861CBF8 - ldr r1, [r4] - adds r1, 0xBC - ldrb r2, [r5, 0x2] - movs r3, 0 - bl sub_81C1CB0 - movs r0, 0x3 - bl schedule_bg_copy_tilemap_to_vram - movs r1, 0x2 - ldrsh r0, [r5, r1] - cmp r0, 0 - ble _081C2162 - ldrb r7, [r7, 0x6] - cmp r0, r7 - blt _081C2180 -_081C2162: - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0 - bge _081C217A - bl sub_81C4A88 - movs r0, 0xD - bl PutWindowTilemap - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram -_081C217A: - adds r0, r6, 0 - bl DestroyTask -_081C2180: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C20F0 - - thumb_func_start sub_81C2194 -sub_81C2194: @ 81C2194 - push {r4-r7,lr} - adds r6, r0, 0 - lsls r2, 24 - lsls r1, 28 - lsrs r4, r1, 16 - ldr r7, =0x0000056a - cmp r2, 0 - bne _081C21E4 - movs r3, 0 - ldr r5, =gUnknown_08DC3CD4 -_081C21A8: - adds r2, r7, r3 - lsls r2, 1 - adds r2, r6 - lsls r0, r3, 1 - adds r0, r5 - ldrh r1, [r0] - adds r1, r4, r1 - strh r1, [r2] - adds r0, r2, 0 - adds r0, 0x40 - strh r1, [r0] - adds r2, 0x80 - adds r0, r3, 0 - adds r0, 0x14 - lsls r0, 1 - adds r0, r5 - ldrh r0, [r0] - adds r0, r4, r0 - strh r0, [r2] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x13 - bls _081C21A8 - b _081C221C - .pool -_081C21E4: - movs r3, 0 - ldr r5, =gUnknown_08DC3CD4 -_081C21E8: - adds r1, r7, r3 - lsls r1, 1 - adds r1, r6 - adds r0, r3, 0 - adds r0, 0x14 - lsls r0, 1 - adds r0, r5 - ldrh r0, [r0] - adds r0, r4, r0 - strh r0, [r1] - adds r2, r1, 0 - adds r2, 0x40 - adds r0, r3, 0 - adds r0, 0x28 - lsls r0, 1 - adds r0, r5 - ldrh r0, [r0] - adds r0, r4, r0 - strh r0, [r2] - adds r1, 0x80 - strh r0, [r1] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x13 - bls _081C21E8 -_081C221C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2194 - - thumb_func_start sub_81C2228 -sub_81C2228: @ 81C2228 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0 - bl CheckPartyPokerus - lsls r0, 24 - cmp r0, 0 - bne _081C225C - adds r0, r4, 0 - movs r1, 0 - bl CheckPartyHasHadPokerus - lsls r0, 24 - cmp r0, 0 - beq _081C225C - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r2, =0x00000502 - adds r1, r0, r2 - movs r2, 0x2C - b _081C2266 - .pool -_081C225C: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r2, =0x00000502 - adds r1, r0, r2 - ldr r2, =0x0000081a -_081C2266: - strh r2, [r1] - ldr r1, =0x00000d02 - adds r0, r1 - strh r2, [r0] - movs r0, 0x3 - bl schedule_bg_copy_tilemap_to_vram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2228 - - thumb_func_start sub_81C228C -sub_81C228C: @ 81C228C - push {lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _081C22AC - movs r0, 0x8 - str r0, [sp] - str r1, [sp, 0x4] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0x4 - movs r3, 0x8 - bl sub_8199C30 - b _081C22C0 -_081C22AC: - movs r0, 0x8 - str r0, [sp] - movs r0, 0x5 - str r0, [sp, 0x4] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0x4 - movs r3, 0x8 - bl sub_8199C30 -_081C22C0: - movs r0, 0x3 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0x8 - pop {r0} - bx r0 - thumb_func_end sub_81C228C - - thumb_func_start sub_81C22CC -sub_81C22CC: @ 81C22CC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - adds r6, r1, 0 - adds r6, 0x70 - ldrb r1, [r6, 0x5] - mov r8, r0 - cmp r1, 0x63 - bhi _081C2340 - ldr r5, =gExperienceTables - adds r2, r1, 0 - adds r1, r2, 0x1 - lsls r1, 2 - ldr r4, =gBaseStats - ldrh r3, [r6] - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r4 - ldrb r3, [r0, 0x13] - movs r0, 0xCA - lsls r0, 1 - muls r0, r3 - adds r1, r0 - adds r1, r5 - lsls r2, 2 - adds r2, r0 - adds r2, r5 - ldr r1, [r1] - ldr r2, [r2] - subs r1, r2 - ldr r0, [r6, 0x10] - subs r4, r0, r2 - lsls r0, r4, 6 - bl __udivsi3 - adds r6, r0, 0 - movs r7, 0 - adds r0, r7, 0 - orrs r0, r6 - cmp r0, 0 - bne _081C2344 - cmp r4, 0 - beq _081C2344 - movs r6, 0x1 - movs r7, 0 - b _081C2344 - .pool -_081C2340: - movs r6, 0 - movs r7, 0 -_081C2344: - mov r1, r8 - ldr r0, [r1] - ldr r2, =0x00001d66 - adds r2, r0 - mov r9, r2 - movs r0, 0 - mov r12, r0 - ldr r1, =0x00002062 - mov r10, r1 -_081C2356: - cmp r7, 0 - bgt _081C2362 - cmp r7, 0 - bne _081C237C - cmp r6, 0x7 - bls _081C237C -_081C2362: - mov r2, r12 - lsls r0, r2, 1 - add r0, r9 - ldr r2, =0x0000206a - adds r1, r2, 0 - strh r1, [r0] - b _081C23B6 - .pool -_081C237C: - mov r1, r12 - lsls r0, r1, 1 - add r0, r9 - mov r8, r0 - adds r5, r7, 0 - adds r4, r6, 0 - cmp r7, 0 - bge _081C2394 - movs r4, 0x7 - movs r5, 0 - adds r4, r6 - adcs r5, r7 -_081C2394: - lsls r3, r5, 29 - lsrs r2, r4, 3 - adds r0, r3, 0 - orrs r0, r2 - asrs r1, r5, 3 - lsrs r5, r0, 29 - lsls r4, r1, 3 - adds r3, r5, 0 - orrs r3, r4 - lsls r2, r0, 3 - adds r1, r7, 0 - adds r0, r6, 0 - subs r0, r2 - sbcs r1, r3 - add r0, r10 - mov r2, r8 - strh r0, [r2] -_081C23B6: - movs r0, 0x8 - negs r0, r0 - asrs r1, r0, 31 - adds r6, r0 - adcs r7, r1 - cmp r7, 0 - bge _081C23C8 - movs r6, 0 - movs r7, 0 -_081C23C8: - mov r0, r12 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r12, r0 - cmp r0, 0x7 - bls _081C2356 - movs r0, 0x1 - bl GetBgTilemapBuffer - ldr r1, =gUnknown_0203CF1C - ldr r1, [r1] - ldr r2, =0x000010bc - adds r1, r2 - cmp r0, r1 - bne _081C23F8 - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - b _081C23FE - .pool -_081C23F8: - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram -_081C23FE: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81C22CC - - thumb_func_start sub_81C240C -sub_81C240C: @ 81C240C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 16 - lsrs r3, r0, 16 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000038bc - adds r5, r0, r1 - cmp r3, 0 - beq _081C2510 - ldr r1, =gContestEffects - ldr r2, =gContestMoves - lsls r3, 3 - adds r0, r3, r2 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldrb r4, [r0, 0x1] - mov r9, r1 - mov r8, r2 - mov r10, r3 - cmp r4, 0xFF - beq _081C244C - adds r0, r4, 0 - movs r1, 0xA - bl __udivsi3 - lsls r0, 24 - lsrs r4, r0, 24 -_081C244C: - movs r2, 0 - movs r6, 0x3 - movs r3, 0xF3 - lsls r3, 2 -_081C2454: - cmp r4, 0xFF - beq _081C2484 - cmp r2, r4 - bcs _081C2484 - lsrs r0, r2, 2 - adds r1, r2, 0 - ands r1, r6 - lsls r0, 5 - adds r0, r1 - lsls r0, 1 - adds r0, r5 - adds r0, r3 - ldr r7, =0x0000103a - b _081C2496 - .pool -_081C2484: - lsrs r0, r2, 2 - adds r1, r2, 0 - ands r1, r6 - lsls r0, 5 - adds r0, r1 - lsls r0, 1 - adds r0, r5 - adds r0, r3 - ldr r7, =0x00001039 -_081C2496: - adds r1, r7, 0 - strh r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x7 - bls _081C2454 - mov r0, r10 - add r0, r8 - ldrb r0, [r0] - lsls r0, 2 - add r0, r9 - ldrb r4, [r0, 0x2] - cmp r4, 0xFF - beq _081C24C0 - adds r0, r4, 0 - movs r1, 0xA - bl __udivsi3 - lsls r0, 24 - lsrs r4, r0, 24 -_081C24C0: - movs r2, 0 - movs r6, 0x3 - ldr r3, =0x0000044c -_081C24C6: - cmp r4, 0xFF - beq _081C24F0 - cmp r2, r4 - bcs _081C24F0 - lsrs r0, r2, 2 - adds r1, r2, 0 - ands r1, r6 - lsls r0, 5 - adds r0, r1 - lsls r0, 1 - adds r0, r5 - adds r0, r3 - ldr r7, =0x0000103c - b _081C2502 - .pool -_081C24F0: - lsrs r0, r2, 2 - adds r1, r2, 0 - ands r1, r6 - lsls r0, 5 - adds r0, r1 - lsls r0, 1 - adds r0, r5 - adds r0, r3 - ldr r7, =0x0000103d -_081C2502: - adds r1, r7, 0 - strh r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x7 - bls _081C24C6 -_081C2510: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C240C - - thumb_func_start sub_81C2524 -sub_81C2524: @ 81C2524 - push {lr} - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r0, 0x74 - ldrb r0, [r0] - cmp r0, 0 - beq _081C2544 - movs r1, 0x80 - lsls r1, 9 - movs r0, 0x3 - movs r2, 0 - bl ChangeBgX - b _081C254E - .pool -_081C2544: - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgX -_081C254E: - pop {r0} - bx r0 - thumb_func_end sub_81C2524 - - thumb_func_start sub_81C2554 -sub_81C2554: @ 81C2554 - push {r4,r5,lr} - ldr r0, =gUnknown_0861CC24 - bl InitWindows - bl DeactivateAllTextPrinters - movs r4, 0 -_081C2562: - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x13 - bls _081C2562 - movs r4, 0 - ldr r5, =gUnknown_0203CF1C - ldr r3, =0x000040cb - movs r2, 0xFF -_081C257C: - ldr r0, [r5] - adds r0, r3 - adds r0, r4 - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _081C257C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2554 - - thumb_func_start sub_81C25A4 -sub_81C25A4: @ 81C25A4 - push {r4-r6,lr} - sub sp, 0x14 - ldr r4, [sp, 0x24] - ldr r5, [sp, 0x28] - lsls r0, 24 - lsrs r0, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - movs r6, 0 - str r6, [sp] - str r4, [sp, 0x4] - lsls r4, r5, 1 - adds r4, r5 - ldr r5, =gUnknown_0861CD2C - adds r4, r5 - str r4, [sp, 0x8] - str r6, [sp, 0xC] - str r1, [sp, 0x10] - movs r1, 0x1 - bl AddTextPrinterParametrized2 - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C25A4 - - thumb_func_start sub_81C25E8 -sub_81C25E8: @ 81C25E8 - push {lr} - movs r0, 0x11 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x12 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x13 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r0, 0x74 - ldrb r0, [r0] - cmp r0, 0 - bne _081C2618 - bl sub_81C2628 - b _081C261C - .pool -_081C2618: - bl sub_81C2794 -_081C261C: - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - pop {r0} - bx r0 - thumb_func_end sub_81C25E8 - - thumb_func_start sub_81C2628 -sub_81C2628: @ 81C2628 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x18 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - movs r1, 0xC - adds r1, r0 - mov r8, r1 - adds r7, r0, 0 - adds r7, 0x70 - ldrh r0, [r7] - bl SpeciesToPokedexNum - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, =0x0000ffff - cmp r5, r0 - beq _081C26CE - ldr r6, =gStringVar1 - ldr r1, =gText_UnkCtrlF908Clear01 - adds r0, r6, 0 - bl StringCopy - ldr r4, =gStringVar2 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x2 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - adds r0, r6, 0 - adds r1, r4, 0 - bl StringAppend - mov r0, r8 - bl IsMonShiny - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _081C26AC - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r0, 0x11 - adds r1, r6, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - movs r0, 0 - bl sub_81C228C - b _081C26C6 - .pool -_081C26AC: - movs r0, 0 - str r0, [sp] - movs r0, 0x7 - str r0, [sp, 0x4] - movs r0, 0x11 - adds r1, r6, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - movs r0, 0x1 - bl sub_81C228C -_081C26C6: - movs r0, 0x11 - bl PutWindowTilemap - b _081C26EE -_081C26CE: - movs r0, 0x11 - bl ClearWindowTilemap - mov r0, r8 - bl IsMonShiny - lsls r0, 24 - cmp r0, 0 - bne _081C26E8 - movs r0, 0 - bl sub_81C228C - b _081C26EE -_081C26E8: - movs r0, 0x1 - bl sub_81C228C -_081C26EE: - ldr r4, =gStringVar1 - ldr r1, =gText_LevelSymbol - adds r0, r4, 0 - bl StringCopy - ldr r5, =gStringVar2 - ldrb r1, [r7, 0x5] - adds r0, r5, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - adds r0, r4, 0 - adds r1, r5, 0 - bl StringAppend - movs r6, 0 - str r6, [sp] - movs r5, 0x1 - str r5, [sp, 0x4] - movs r0, 0x13 - adds r1, r4, 0 - movs r2, 0x18 - movs r3, 0x11 - bl sub_81C25A4 - mov r0, r8 - adds r1, r4, 0 - bl GetMonNickname - str r6, [sp] - str r5, [sp, 0x4] - movs r0, 0x12 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - add r1, sp, 0x8 - movs r0, 0xBA - strb r0, [r1] - mov r0, sp - adds r0, 0x9 - ldrh r2, [r7, 0x2] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - str r6, [sp] - str r5, [sp, 0x4] - movs r0, 0x13 - add r1, sp, 0x8 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldrh r1, [r7, 0x2] - mov r0, r8 - bl sub_81C27DC - movs r0, 0x12 - bl PutWindowTilemap - movs r0, 0x13 - bl PutWindowTilemap - add sp, 0x18 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2628 - - thumb_func_start sub_81C2794 -sub_81C2794: @ 81C2794 - push {r4,lr} - sub sp, 0x8 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r0, 0xC - ldr r4, =gStringVar1 - adds r1, r4, 0 - bl GetMonNickname - movs r0, 0 - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r0, 0x12 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - movs r0, 0x12 - bl PutWindowTilemap - movs r0, 0x11 - bl ClearWindowTilemap - movs r0, 0x13 - bl ClearWindowTilemap - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2794 - - thumb_func_start sub_81C27DC -sub_81C27DC: @ 81C27DC - push {lr} - sub sp, 0x8 - lsls r1, 16 - lsrs r1, 16 - cmp r1, 0x20 - beq _081C282C - cmp r1, 0x1D - beq _081C282C - bl GetMonGender - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _081C27FE - cmp r0, 0xFE - beq _081C2818 - b _081C282C -_081C27FE: - ldr r1, =gText_MaleSymbol - str r0, [sp] - movs r0, 0x3 - str r0, [sp, 0x4] - movs r0, 0x13 - movs r2, 0x39 - movs r3, 0x11 - bl sub_81C25A4 - b _081C282C - .pool -_081C2818: - ldr r1, =gText_FemaleSymbol - movs r0, 0 - str r0, [sp] - movs r0, 0x4 - str r0, [sp, 0x4] - movs r0, 0x13 - movs r2, 0x39 - movs r3, 0x11 - bl sub_81C25A4 -_081C282C: - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C27DC - - thumb_func_start sub_81C2838 -sub_81C2838: @ 81C2838 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - ldr r3, =gUnknown_0861CDD3 - cmp r1, 0 - bne _081C284A - subs r3, 0x80 -_081C284A: - lsls r2, 16 - lsrs r2, 16 - movs r0, 0x10 - str r0, [sp] - str r0, [sp, 0x4] - adds r0, r4, 0 - adds r1, r3, 0 - movs r3, 0 - bl BlitBitmapToWindow - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2838 - - thumb_func_start sub_81C286C -sub_81C286C: @ 81C286C - push {r4-r7,lr} - sub sp, 0x8 - ldr r1, =gUnknown_085EA3CF - movs r5, 0 - str r5, [sp] - movs r6, 0x1 - str r6, [sp, 0x4] - movs r0, 0 - movs r2, 0x2 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gUnknown_085EA3DC - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0x1 - movs r2, 0x2 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gUnknown_085EA3EB - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0x2 - movs r2, 0x2 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gUnknown_085EA3F8 - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0x3 - movs r2, 0x2 - movs r3, 0x1 - bl sub_81C25A4 - ldr r7, =gText_Cancel2 - movs r0, 0x1 - adds r1, r7, 0 - movs r2, 0x3E - bl GetStringRightAlignXOffset - adds r4, r0, 0 - adds r2, r4, 0 - subs r2, 0x10 - cmp r2, 0 - bge _081C28CC - movs r2, 0 -_081C28CC: - movs r0, 0x4 - movs r1, 0 - bl sub_81C2838 - lsls r2, r4, 24 - lsrs r2, 24 - str r5, [sp] - str r5, [sp, 0x4] - movs r0, 0x4 - adds r1, r7, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r7, =gUnknown_085EA406 - movs r0, 0x1 - adds r1, r7, 0 - movs r2, 0x3E - bl GetStringRightAlignXOffset - adds r4, r0, 0 - adds r2, r4, 0 - subs r2, 0x10 - cmp r2, 0 - bge _081C28FE - movs r2, 0 -_081C28FE: - movs r0, 0x5 - movs r1, 0 - bl sub_81C2838 - lsls r2, r4, 24 - lsrs r2, 24 - str r5, [sp] - str r5, [sp, 0x4] - movs r0, 0x5 - adds r1, r7, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r7, =gUnknown_085EA3C8 - movs r0, 0x1 - adds r1, r7, 0 - movs r2, 0x3E - bl GetStringRightAlignXOffset - adds r4, r0, 0 - adds r2, r4, 0 - subs r2, 0x10 - cmp r2, 0 - bge _081C2930 - movs r2, 0 -_081C2930: - movs r0, 0x6 - movs r1, 0 - bl sub_81C2838 - lsls r2, r4, 24 - lsrs r2, 24 - str r5, [sp] - str r5, [sp, 0x4] - movs r0, 0x6 - adds r1, r7, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gUnknown_085EA369 - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0x8 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gUnknown_085EA378 - str r5, [sp] - str r5, [sp, 0x4] - movs r0, 0x9 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r4, =gUnknown_085EA361 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x2A - bl GetStringCenterAlignXOffset - adds r0, 0x6 - lsls r2, r0, 24 - lsrs r2, 24 - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xA - adds r1, r4, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r4, =gUnknown_085EA33C - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x2A - bl GetStringCenterAlignXOffset - adds r0, 0x6 - lsls r2, r0, 24 - lsrs r2, 24 - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xA - adds r1, r4, 0 - movs r3, 0x11 - bl sub_81C25A4 - ldr r4, =gUnknown_085EA343 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x2A - bl GetStringCenterAlignXOffset - adds r0, 0x6 - lsls r2, r0, 24 - lsrs r2, 24 - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xA - adds r1, r4, 0 - movs r3, 0x21 - bl sub_81C25A4 - ldr r4, =gUnknown_085EA34B - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x24 - bl GetStringCenterAlignXOffset - adds r0, 0x2 - lsls r2, r0, 24 - lsrs r2, 24 - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xB - adds r1, r4, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r4, =gUnknown_085EA353 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x24 - bl GetStringCenterAlignXOffset - adds r0, 0x2 - lsls r2, r0, 24 - lsrs r2, 24 - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xB - adds r1, r4, 0 - movs r3, 0x11 - bl sub_81C25A4 - ldr r4, =gUnknown_085EA35B - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x24 - bl GetStringCenterAlignXOffset - adds r0, 0x2 - lsls r2, r0, 24 - lsrs r2, 24 - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xB - adds r1, r4, 0 - movs r3, 0x21 - bl sub_81C25A4 - ldr r1, =gUnknown_085EA39F - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xC - movs r2, 0x6 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gUnknown_085EA3AB - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xC - movs r2, 0x6 - movs r3, 0x11 - bl sub_81C25A4 - ldr r1, =gUnknown_085EA398 - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xD - movs r2, 0x2 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gUnknown_085EA37E - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xE - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gUnknown_085EA384 - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xE - movs r2, 0 - movs r3, 0x11 - bl sub_81C25A4 - ldr r1, =gUnknown_085EA38D - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xF - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gUnknown_085EA394 - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xF - movs r2, 0 - movs r3, 0x11 - bl sub_81C25A4 - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C286C - - thumb_func_start sub_81C2AFC -sub_81C2AFC: @ 81C2AFC - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - movs r0, 0 - bl ClearWindowTilemap - movs r0, 0x1 - bl ClearWindowTilemap - movs r0, 0x2 - bl ClearWindowTilemap - movs r0, 0x3 - bl ClearWindowTilemap - cmp r4, 0x1 - beq _081C2B66 - cmp r4, 0x1 - bgt _081C2B2A - cmp r4, 0 - beq _081C2B34 - b _081C2C06 -_081C2B2A: - cmp r5, 0x2 - beq _081C2B80 - cmp r5, 0x3 - beq _081C2BC4 - b _081C2C06 -_081C2B34: - movs r0, 0 - bl PutWindowTilemap - movs r0, 0x4 - bl PutWindowTilemap - bl sub_81A6BF4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C2B58 - bl sub_81B9E94 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C2B5E -_081C2B58: - movs r0, 0x8 - bl PutWindowTilemap -_081C2B5E: - movs r0, 0x9 - bl PutWindowTilemap - b _081C2C06 -_081C2B66: - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0xA - bl PutWindowTilemap - movs r0, 0xB - bl PutWindowTilemap - movs r0, 0xC - bl PutWindowTilemap - b _081C2C06 -_081C2B80: - movs r0, 0x2 - bl PutWindowTilemap - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r2, =0x000040bc - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C2BBC - adds r2, 0x8 - adds r0, r1, r2 - ldr r0, [r0] - ldr r1, =0x00ffffff - ands r0, r1 - movs r1, 0x80 - lsls r1, 11 - cmp r0, r1 - beq _081C2C06 - movs r0, 0xE - bl PutWindowTilemap - b _081C2C06 - .pool -_081C2BBC: - movs r0, 0x5 - bl PutWindowTilemap - b _081C2C06 -_081C2BC4: - movs r0, 0x3 - bl PutWindowTilemap - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r2, =0x000040bc - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C2C00 - adds r2, 0x8 - adds r0, r1, r2 - ldr r0, [r0] - ldr r1, =0x00ffffff - ands r0, r1 - movs r1, 0x80 - lsls r1, 11 - cmp r0, r1 - beq _081C2C06 - movs r0, 0xF - bl PutWindowTilemap - b _081C2C06 - .pool -_081C2C00: - movs r0, 0x5 - bl PutWindowTilemap -_081C2C06: - movs r4, 0 - ldr r5, =gUnknown_0203CF1C -_081C2C0A: - ldr r0, [r5] - ldr r1, =0x000040cb - adds r0, r1 - adds r0, r4 - ldrb r0, [r0] - bl PutWindowTilemap - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _081C2C0A - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2AFC - - thumb_func_start sub_81C2C38 -sub_81C2C38: @ 81C2C38 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - cmp r0, 0x1 - beq _081C2C84 - cmp r0, 0x1 - bgt _081C2C4E - cmp r0, 0 - beq _081C2C58 - b _081C2D0E -_081C2C4E: - cmp r1, 0x2 - beq _081C2C98 - cmp r1, 0x3 - beq _081C2CD4 - b _081C2D0E -_081C2C58: - movs r0, 0x4 - bl ClearWindowTilemap - bl sub_81A6BF4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C2C76 - bl sub_81B9E94 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C2C7C -_081C2C76: - movs r0, 0x8 - bl ClearWindowTilemap -_081C2C7C: - movs r0, 0x9 - bl ClearWindowTilemap - b _081C2D0E -_081C2C84: - movs r0, 0xA - bl ClearWindowTilemap - movs r0, 0xB - bl ClearWindowTilemap - movs r0, 0xC - bl ClearWindowTilemap - b _081C2D0E -_081C2C98: - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r2, =0x000040bc - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C2CCC - adds r2, 0x8 - adds r0, r1, r2 - ldr r0, [r0] - ldr r1, =0x00ffffff - ands r0, r1 - movs r1, 0x80 - lsls r1, 11 - cmp r0, r1 - beq _081C2D0E - movs r0, 0xE - bl ClearWindowTilemap - b _081C2D0E - .pool -_081C2CCC: - movs r0, 0x5 - bl ClearWindowTilemap - b _081C2D0E -_081C2CD4: - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r2, =0x000040bc - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C2D08 - adds r2, 0x8 - adds r0, r1, r2 - ldr r0, [r0] - ldr r1, =0x00ffffff - ands r0, r1 - movs r1, 0x80 - lsls r1, 11 - cmp r0, r1 - beq _081C2D0E - movs r0, 0xF - bl ClearWindowTilemap - b _081C2D0E - .pool -_081C2D08: - movs r0, 0x5 - bl ClearWindowTilemap -_081C2D0E: - movs r4, 0 -_081C2D10: - adds r0, r4, 0 - bl sub_81C2D68 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _081C2D10 - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C2C38 - - thumb_func_start sub_81C2D2C -sub_81C2D2C: @ 81C2D2C - push {r4,lr} - adds r3, r0, 0 - lsls r1, 24 - lsrs r2, r1, 24 - ldr r0, =gUnknown_0203CF1C - ldr r4, =0x000040cb - adds r1, r2, r4 - ldr r0, [r0] - adds r4, r0, r1 - ldrb r0, [r4] - cmp r0, 0xFF - bne _081C2D56 - lsls r0, r2, 3 - adds r0, r3, r0 - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - movs r1, 0 - bl FillWindowPixelBuffer -_081C2D56: - ldrb r0, [r4] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81C2D2C - - thumb_func_start sub_81C2D68 -sub_81C2D68: @ 81C2D68 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0203CF1C - ldr r2, =0x000040cb - adds r0, r2 - ldr r1, [r1] - adds r4, r1, r0 - ldrb r0, [r4] - cmp r0, 0xFF - beq _081C2D8C - bl ClearWindowTilemap - ldrb r0, [r4] - bl RemoveWindow - movs r0, 0xFF - strb r0, [r4] -_081C2D8C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2D68 - - thumb_func_start sub_81C2D9C -sub_81C2D9C: @ 81C2D9C - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 -_081C2DA4: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040cb - adds r0, r1 - adds r1, r0, r4 - ldrb r0, [r1] - cmp r0, 0xFF - beq _081C2DBA - movs r1, 0 - bl FillWindowPixelBuffer -_081C2DBA: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x7 - bls _081C2DA4 - ldr r0, =gUnknown_0861CE54 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl _call_via_r0 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2D9C - - thumb_func_start sub_81C2DE4 -sub_81C2DE4: @ 81C2DE4 - push {lr} - lsls r0, 24 - ldr r1, =gUnknown_0861CE64 - lsrs r0, 22 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x10 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2DE4 - - thumb_func_start sub_81C2E00 -sub_81C2E00: @ 81C2E00 - push {lr} - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r0, 0x74 - ldrb r0, [r0] - cmp r0, 0 - beq _081C2E24 - bl sub_81C335C - bl sub_81C33CC - bl sub_81C3428 - bl sub_81C349C - b _081C2E3C - .pool -_081C2E24: - bl sub_81C2EC4 - bl sub_81C2F5C - bl sub_81C2FD8 - bl sub_81C302C - bl sub_81C307C - bl sub_81C3194 -_081C2E3C: - pop {r0} - bx r0 - thumb_func_end sub_81C2E00 - - thumb_func_start sub_81C2E40 -sub_81C2E40: @ 81C2E40 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldrh r0, [r4] - subs r0, 0x1 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - bhi _081C2EB8 - lsls r0, 2 - ldr r1, =_081C2E70 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081C2E70: - .4byte _081C2E8C - .4byte _081C2E92 - .4byte _081C2E98 - .4byte _081C2E9E - .4byte _081C2EA4 - .4byte _081C2EAA - .4byte _081C2EB0 -_081C2E8C: - bl sub_81C2EC4 - b _081C2EB8 -_081C2E92: - bl sub_81C2F5C - b _081C2EB8 -_081C2E98: - bl sub_81C2FD8 - b _081C2EB8 -_081C2E9E: - bl sub_81C302C - b _081C2EB8 -_081C2EA4: - bl sub_81C307C - b _081C2EB8 -_081C2EAA: - bl sub_81C3194 - b _081C2EB8 -_081C2EB0: - adds r0, r2, 0 - bl DestroyTask - b _081C2EBE -_081C2EB8: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_081C2EBE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C2E40 - - thumb_func_start sub_81C2EC4 -sub_81C2EC4: @ 81C2EC4 - push {r4-r6,lr} - sub sp, 0x8 - bl sub_81A6BF4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C2F54 - bl sub_81B9E94 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C2F54 - ldr r0, =gUnknown_0861CCCC - movs r1, 0 - bl sub_81C2D2C - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =gUnknown_085EA365 - movs r6, 0 - str r6, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0 - bl GetStringWidth - adds r2, r0, 0 - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0xA2 - ldrb r0, [r0] - cmp r0, 0 - bne _081C2F40 - adds r1, 0xA6 - lsls r2, 24 - lsrs r2, 24 - str r6, [sp] - movs r0, 0x5 - str r0, [sp, 0x4] - adds r0, r5, 0 - movs r3, 0x1 - bl sub_81C25A4 - b _081C2F54 - .pool -_081C2F40: - adds r1, 0xA6 - lsls r2, 24 - lsrs r2, 24 - str r6, [sp] - movs r0, 0x6 - str r0, [sp, 0x4] - adds r0, r5, 0 - movs r3, 0x1 - bl sub_81C25A4 -_081C2F54: - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81C2EC4 - - thumb_func_start sub_81C2F5C -sub_81C2F5C: @ 81C2F5C - push {r4,r5,lr} - sub sp, 0x8 - bl sub_81A6BF4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C2FC0 - bl sub_81B9E94 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C2FC0 - ldr r5, =gStringVar1 - ldr r1, =gText_UnkCtrlF907F908 - adds r0, r5, 0 - bl StringCopy - ldr r1, =gUnknown_0203CF1C - ldr r1, [r1] - adds r1, 0xB8 - ldrh r1, [r1] - movs r2, 0x2 - movs r3, 0x5 - bl ConvertIntToDecimalStringN - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x38 - bl GetStringRightAlignXOffset - adds r4, r0, 0 - ldr r0, =gUnknown_0861CCCC - movs r1, 0x1 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsrs r4, 24 - movs r1, 0 - str r1, [sp] - movs r1, 0x1 - str r1, [sp, 0x4] - adds r1, r5, 0 - adds r2, r4, 0 - movs r3, 0x1 - bl sub_81C25A4 -_081C2FC0: - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2F5C - - thumb_func_start sub_81C2FD8 -sub_81C2FD8: @ 81C2FD8 - push {r4,lr} - sub sp, 0x8 - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x70 - ldrh r0, [r0] - adds r1, 0x78 - ldrb r1, [r1] - bl GetAbilityBySpecies - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_0861CCCC - movs r1, 0x2 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - movs r1, 0xD - muls r1, r4 - ldr r2, =gAbilityNames - adds r1, r2 - movs r2, 0 - str r2, [sp] - movs r2, 0x1 - str r2, [sp, 0x4] - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2FD8 - - thumb_func_start sub_81C302C -sub_81C302C: @ 81C302C - push {r4,lr} - sub sp, 0x8 - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x70 - ldrh r0, [r0] - adds r1, 0x78 - ldrb r1, [r1] - bl GetAbilityBySpecies - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_0861CCCC - movs r1, 0x2 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gAbilityDescriptionPointers - lsls r4, 2 - adds r4, r1 - ldr r1, [r4] - movs r2, 0 - str r2, [sp] - str r2, [sp, 0x4] - movs r3, 0x11 - bl sub_81C25A4 - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C302C - - thumb_func_start sub_81C307C -sub_81C307C: @ 81C307C - push {r4-r6,lr} - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r4, r0, 0 - adds r4, 0x70 - bl sub_81AFBF0 - ldr r1, =gUnknown_0861CE74 - movs r0, 0 - bl sub_81AFC0C - ldr r1, =gUnknown_0861CE7B - movs r0, 0x1 - bl sub_81AFC0C - bl sub_81C31C0 - bl sub_81A6BF4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C30C2 - bl sub_81B9E94 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C30C2 - bl sub_81C3304 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C30E0 -_081C30C2: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EA5DB - bl sub_81AFC28 - b _081C3182 - .pool -_081C30E0: - movs r0, 0x20 - bl Alloc - adds r6, r0, 0 - movs r0, 0x20 - bl Alloc - adds r5, r0, 0 - adds r0, r6, 0 - bl sub_81C31F0 - ldrb r0, [r4, 0x9] - cmp r0, 0xD4 - bhi _081C310C - adds r1, r0, 0 - adds r0, r5, 0 - bl sub_8124610 - movs r0, 0x4 - adds r1, r5, 0 - bl sub_81AFC0C -_081C310C: - bl sub_81C3220 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C3148 - ldrb r0, [r4, 0xA] - cmp r0, 0 - bne _081C3134 - ldrb r0, [r4, 0x9] - ldr r1, =gUnknown_085EA516 - cmp r0, 0xD4 - bls _081C3170 - ldr r1, =gUnknown_085EA617 - b _081C3170 - .pool -_081C3134: - ldrb r0, [r4, 0x9] - ldr r1, =gUnknown_085EA4EC - cmp r0, 0xD4 - bls _081C3170 - ldr r1, =gUnknown_085EA5EB - b _081C3170 - .pool -_081C3148: - ldrb r0, [r4, 0x9] - cmp r0, 0xFF - bne _081C3158 - ldr r1, =gUnknown_085EA56A - b _081C3170 - .pool -_081C3158: - cmp r0, 0xFE - beq _081C316E - bl sub_81C32BC - lsls r0, 24 - cmp r0, 0 - beq _081C316E - ldrb r0, [r4, 0x9] - ldr r1, =gUnknown_085EA5A8 - cmp r0, 0xD4 - bls _081C3170 -_081C316E: - ldr r1, =gUnknown_085EA544 -_081C3170: - ldr r0, =gStringVar4 - bl sub_81AFC28 - adds r0, r6, 0 - bl Free - adds r0, r5, 0 - bl Free -_081C3182: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C307C - - thumb_func_start sub_81C3194 -sub_81C3194: @ 81C3194 - push {lr} - sub sp, 0x8 - ldr r0, =gUnknown_0861CCCC - movs r1, 0x3 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gStringVar4 - movs r2, 0 - str r2, [sp] - str r2, [sp, 0x4] - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3194 - - thumb_func_start sub_81C31C0 -sub_81C31C0: @ 81C31C0 - push {lr} - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =gNatureNamePointers - adds r0, 0xA3 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - movs r0, 0x2 - bl sub_81AFC0C - ldr r1, =gUnknown_085EA3C0 - movs r0, 0x5 - bl sub_81AFC0C - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C31C0 - - thumb_func_start sub_81C31F0 -sub_81C31F0: @ 81C31F0 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r0, 0x7A - ldrb r1, [r0] - cmp r1, 0 - bne _081C3202 - movs r1, 0x5 -_081C3202: - adds r0, r4, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - movs r0, 0x3 - adds r1, r4, 0 - bl sub_81AFC0C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C31F0 - - thumb_func_start sub_81C3220 -sub_81C3220: @ 81C3220 - push {r4-r6,lr} - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r6, r0, 0 - adds r6, 0x70 - ldr r1, [r0] - ldr r0, =gEnemyParty - cmp r1, r0 - bne _081C326C - bl GetMultiplayerId - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gLinkPlayers - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r0, r2, 0x4 - adds r0, r1, r0 - ldrh r4, [r0] - adds r0, r1, r2 - ldrb r5, [r0, 0x13] - ldr r0, =gStringVar1 - adds r2, 0x8 - adds r1, r2 - bl StringCopy - b _081C3282 - .pool -_081C326C: - bl sub_80F0020 - adds r4, r0, 0 - ldr r0, =0x0000ffff - ands r4, r0 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldrb r5, [r1, 0x8] - ldr r0, =gStringVar1 - bl StringCopy -_081C3282: - adds r0, r6, 0 - adds r0, 0x32 - ldrb r0, [r0] - cmp r5, r0 - bne _081C32A4 - ldr r0, [r6, 0x48] - ldr r1, =0x0000ffff - ands r0, r1 - cmp r4, r0 - bne _081C32A4 - ldr r0, =gStringVar1 - adds r1, r6, 0 - adds r1, 0x36 - bl StringCompareWithoutExtCtrlCodes - cmp r0, 0 - beq _081C32B4 -_081C32A4: - movs r0, 0 - b _081C32B6 - .pool -_081C32B4: - movs r0, 0x1 -_081C32B6: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81C3220 - - thumb_func_start sub_81C32BC -sub_81C32BC: @ 81C32BC - push {lr} - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r0, 0x70 - ldrb r0, [r0, 0xB] - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bls _081C32D8 - movs r0, 0 - b _081C32DA - .pool -_081C32D8: - movs r0, 0x1 -_081C32DA: - pop {r1} - bx r1 - thumb_func_end sub_81C32BC - - thumb_func_start sub_81C32E0 -sub_81C32E0: @ 81C32E0 - push {lr} - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r0, 0x70 - ldrb r0, [r0, 0xB] - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bls _081C32FC - movs r0, 0 - b _081C32FE - .pool -_081C32FC: - movs r0, 0x1 -_081C32FE: - pop {r1} - bx r1 - thumb_func_end sub_81C32E0 - - thumb_func_start sub_81C3304 -sub_81C3304: @ 81C3304 - push {lr} - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 15 - ands r0, r1 - cmp r0, 0 - beq _081C3354 - ldr r0, =gMain - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081C3354 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040be - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _081C333A - cmp r0, 0x4 - beq _081C333A - cmp r0, 0x5 - bne _081C3354 -_081C333A: - movs r0, 0x1 - b _081C3356 - .pool -_081C3354: - movs r0, 0 -_081C3356: - pop {r1} - bx r1 - thumb_func_end sub_81C3304 - - thumb_func_start sub_81C335C -sub_81C335C: @ 81C335C - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x8 - ldr r0, =gUnknown_0861CCCC - movs r1, 0 - bl sub_81C2D2C - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_085EA365 - mov r8, r0 - movs r0, 0x1 - mov r1, r8 - movs r2, 0 - bl GetStringWidth - adds r5, r0, 0 - movs r0, 0 - mov r9, r0 - str r0, [sp] - movs r6, 0x1 - str r6, [sp, 0x4] - adds r0, r4, 0 - mov r1, r8 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gText_FiveMarks - lsls r5, 24 - lsrs r5, 24 - mov r0, r9 - str r0, [sp] - str r6, [sp, 0x4] - adds r0, r4, 0 - adds r2, r5, 0 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C335C - - thumb_func_start sub_81C33CC -sub_81C33CC: @ 81C33CC - push {r4,r5,lr} - sub sp, 0x8 - ldr r5, =gStringVar1 - ldr r1, =gText_UnkCtrlF907F908 - adds r0, r5, 0 - bl StringCopy - ldr r1, =gText_FiveMarks - adds r0, r5, 0 - bl StringAppend - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x38 - bl GetStringRightAlignXOffset - adds r4, r0, 0 - ldr r0, =gUnknown_0861CCCC - movs r1, 0x1 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsrs r4, 24 - movs r1, 0 - str r1, [sp] - movs r1, 0x1 - str r1, [sp, 0x4] - adds r1, r5, 0 - adds r2, r4, 0 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C33CC - - thumb_func_start sub_81C3428 -sub_81C3428: @ 81C3428 - push {r4,lr} - sub sp, 0x8 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0x70 - adds r0, 0xA5 - ldrb r0, [r0] - cmp r0, 0x1 - bne _081C3448 - ldr r4, =gUnknown_085EA40B - b _081C346C - .pool -_081C3448: - ldrh r0, [r1, 0x30] - cmp r0, 0x5 - bhi _081C3458 - ldr r4, =gUnknown_085EA4A2 - b _081C346C - .pool -_081C3458: - cmp r0, 0xA - bhi _081C3464 - ldr r4, =gUnknown_085EA475 - b _081C346C - .pool -_081C3464: - ldr r4, =gUnknown_085EA40B - cmp r0, 0x28 - bhi _081C346C - ldr r4, =gUnknown_085EA442 -_081C346C: - ldr r0, =gUnknown_0861CCCC - movs r1, 0x2 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - str r1, [sp] - str r1, [sp, 0x4] - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3428 - - thumb_func_start sub_81C349C -sub_81C349C: @ 81C349C - push {r4,lr} - sub sp, 0x8 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r4, r0, 0 - adds r4, 0x70 - adds r0, 0xA5 - ldrb r0, [r0] - cmp r0, 0x1 - beq _081C3500 - ldrb r0, [r4, 0x9] - cmp r0, 0xFF - bne _081C34C4 - ldr r4, =gUnknown_085EA678 - b _081C3502 - .pool -_081C34C4: - bl sub_81C32BC - lsls r0, 24 - cmp r0, 0 - beq _081C34D8 - bl sub_81C3220 - lsls r0, 24 - cmp r0, 0 - bne _081C34E0 -_081C34D8: - ldr r4, =gUnknown_085EA6AB - b _081C3502 - .pool -_081C34E0: - ldrb r0, [r4, 0x9] - cmp r0, 0xFD - bne _081C3500 - bl sub_81C32E0 - lsls r0, 24 - lsrs r0, 24 - ldr r4, =gUnknown_085EA702 - cmp r0, 0x1 - bne _081C3502 - ldr r4, =gUnknown_085EA6D7 - b _081C3502 - .pool -_081C3500: - ldr r4, =gUnknown_085EA647 -_081C3502: - ldr r0, =gUnknown_0861CCCC - movs r1, 0x3 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - str r1, [sp] - str r1, [sp, 0x4] - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C349C - - thumb_func_start sub_81C3530 -sub_81C3530: @ 81C3530 - push {lr} - bl sub_81C35E4 - bl sub_81C3690 - bl sub_81C3710 - bl sub_81C37D8 - bl sub_81C3808 - bl sub_81C3890 - bl sub_81C38C0 - pop {r0} - bx r0 - thumb_func_end sub_81C3530 - - thumb_func_start sub_81C3554 -sub_81C3554: @ 81C3554 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldrh r0, [r4] - subs r0, 0x1 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - bhi _081C35D6 - lsls r0, 2 - ldr r1, =_081C3584 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081C3584: - .4byte _081C35A4 - .4byte _081C35AA - .4byte _081C35B0 - .4byte _081C35B6 - .4byte _081C35BC - .4byte _081C35C2 - .4byte _081C35C8 - .4byte _081C35CE -_081C35A4: - bl sub_81C35E4 - b _081C35D6 -_081C35AA: - bl sub_81C3690 - b _081C35D6 -_081C35B0: - bl sub_81C3710 - b _081C35D6 -_081C35B6: - bl sub_81C37D8 - b _081C35D6 -_081C35BC: - bl sub_81C3808 - b _081C35D6 -_081C35C2: - bl sub_81C3890 - b _081C35D6 -_081C35C8: - bl sub_81C38C0 - b _081C35D6 -_081C35CE: - adds r0, r2, 0 - bl DestroyTask - b _081C35DC -_081C35D6: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_081C35DC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C3554 - - thumb_func_start sub_81C35E4 -sub_81C35E4: @ 81C35E4 - push {r4,r5,lr} - sub sp, 0x8 - ldr r4, =gUnknown_0203CF1C - ldr r0, [r4] - adds r0, 0x9E - ldrh r0, [r0] - cmp r0, 0xAF - bne _081C3628 - bl sub_81B1250 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C3628 - ldr r0, [r4] - ldr r1, =0x000040be - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _081C3614 - cmp r0, 0x4 - beq _081C3614 - cmp r0, 0x5 - bne _081C3628 -_081C3614: - movs r0, 0xAF - bl ItemId_GetItem - adds r5, r0, 0 - b _081C3650 - .pool -_081C3628: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0x9E - ldrh r0, [r1] - cmp r0, 0 - bne _081C3644 - ldr r5, =gText_None - b _081C3650 - .pool -_081C3644: - ldrh r0, [r1] - ldr r4, =gStringVar1 - adds r1, r4, 0 - bl CopyItemName - adds r5, r4, 0 -_081C3650: - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x48 - bl GetStringCenterAlignXOffset - adds r4, r0, 0 - adds r4, 0x6 - ldr r0, =gUnknown_0861CCEC - movs r1, 0 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsrs r4, 24 - movs r1, 0 - str r1, [sp] - str r1, [sp, 0x4] - adds r1, r5, 0 - adds r2, r4, 0 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C35E4 - - thumb_func_start sub_81C3690 -sub_81C3690: @ 81C3690 - push {r4,r5,lr} - sub sp, 0x8 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0x76 - ldrb r0, [r1] - cmp r0, 0 - bne _081C36B0 - ldr r5, =gText_None - b _081C36C8 - .pool -_081C36B0: - ldr r0, =gStringVar1 - ldrb r1, [r1] - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EA3B4 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r5, r4, 0 -_081C36C8: - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x46 - bl GetStringCenterAlignXOffset - adds r4, r0, 0 - adds r4, 0x6 - ldr r0, =gUnknown_0861CCEC - movs r1, 0x1 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsrs r4, 24 - movs r1, 0 - str r1, [sp] - str r1, [sp, 0x4] - adds r1, r5, 0 - adds r2, r4, 0 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3690 - - thumb_func_start sub_81C3710 -sub_81C3710: @ 81C3710 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - movs r0, 0x8 - bl Alloc - mov r9, r0 - movs r0, 0x8 - bl Alloc - mov r8, r0 - movs r0, 0x8 - bl Alloc - adds r6, r0, 0 - movs r0, 0x8 - bl Alloc - adds r5, r0, 0 - ldr r4, =gUnknown_0203CF1C - ldr r0, [r4] - adds r0, 0x90 - ldrh r1, [r0] - mov r0, r9 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r0, [r4] - adds r0, 0x92 - ldrh r1, [r0] - mov r0, r8 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r0, [r4] - adds r0, 0x94 - ldrh r1, [r0] - adds r0, r6, 0 - movs r2, 0x1 - movs r3, 0x7 - bl ConvertIntToDecimalStringN - ldr r0, [r4] - adds r0, 0x96 - ldrh r1, [r0] - adds r0, r5, 0 - movs r2, 0x1 - movs r3, 0x7 - bl ConvertIntToDecimalStringN - bl sub_81AFBF0 - movs r0, 0 - mov r1, r9 - bl sub_81AFC0C - movs r0, 0x1 - mov r1, r8 - bl sub_81AFC0C - movs r0, 0x2 - adds r1, r6, 0 - bl sub_81AFC0C - movs r0, 0x3 - adds r1, r5, 0 - bl sub_81AFC0C - ldr r0, =gStringVar4 - ldr r1, =gUnknown_0861CE82 - bl sub_81AFC28 - mov r0, r9 - bl Free - mov r0, r8 - bl Free - adds r0, r6, 0 - bl Free - adds r0, r5, 0 - bl Free - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3710 - - thumb_func_start sub_81C37D8 -sub_81C37D8: @ 81C37D8 - push {lr} - sub sp, 0x8 - ldr r0, =gUnknown_0861CCEC - movs r1, 0x2 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gStringVar4 - movs r2, 0 - str r2, [sp] - str r2, [sp, 0x4] - movs r2, 0x4 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C37D8 - - thumb_func_start sub_81C3808 -sub_81C3808: @ 81C3808 - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r0, =gStringVar1 - mov r8, r0 - ldr r4, =gUnknown_0203CF1C - ldr r0, [r4] - adds r0, 0x98 - ldrh r1, [r0] - mov r0, r8 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r6, =gStringVar2 - ldr r0, [r4] - adds r0, 0x9A - ldrh r1, [r0] - adds r0, r6, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r5, =gStringVar3 - ldr r0, [r4] - adds r0, 0x9C - ldrh r1, [r0] - adds r0, r5, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - bl sub_81AFBF0 - movs r0, 0 - mov r1, r8 - bl sub_81AFC0C - movs r0, 0x1 - adds r1, r6, 0 - bl sub_81AFC0C - movs r0, 0x2 - adds r1, r5, 0 - bl sub_81AFC0C - ldr r0, =gStringVar4 - ldr r1, =gUnknown_0861CE8E - bl sub_81AFC28 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3808 - - thumb_func_start sub_81C3890 -sub_81C3890: @ 81C3890 - push {lr} - sub sp, 0x8 - ldr r0, =gUnknown_0861CCEC - movs r1, 0x3 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gStringVar4 - movs r2, 0 - str r2, [sp] - str r2, [sp, 0x4] - movs r2, 0x2 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3890 - - thumb_func_start sub_81C38C0 -sub_81C38C0: @ 81C38C0 - push {r4-r6,lr} - sub sp, 0x8 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r5, r0, 0 - adds r5, 0x70 - ldr r0, =gUnknown_0861CCEC - movs r1, 0x4 - bl sub_81C2D2C - lsls r0, 24 - lsrs r6, r0, 24 - ldr r4, =gStringVar1 - ldr r1, [r5, 0x10] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x7 - bl ConvertIntToDecimalStringN - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x2A - bl GetStringRightAlignXOffset - adds r0, 0x2 - lsls r2, r0, 24 - lsrs r2, 24 - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - adds r0, r6, 0 - adds r1, r4, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldrb r0, [r5, 0x5] - cmp r0, 0x63 - bhi _081C3948 - ldr r4, =gExperienceTables - adds r1, r0, 0 - adds r1, 0x1 - lsls r1, 2 - ldr r3, =gBaseStats - ldrh r2, [r5] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r3 - ldrb r2, [r0, 0x13] - movs r0, 0xCA - lsls r0, 1 - muls r0, r2 - adds r1, r0 - adds r1, r4 - ldr r1, [r1] - ldr r0, [r5, 0x10] - subs r1, r0 - b _081C394A - .pool -_081C3948: - movs r1, 0 -_081C394A: - ldr r4, =gStringVar1 - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x6 - bl ConvertIntToDecimalStringN - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x2A - bl GetStringRightAlignXOffset - adds r0, 0x2 - lsls r2, r0, 24 - lsrs r2, 24 - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - adds r0, r6, 0 - adds r1, r4, 0 - movs r3, 0x11 - bl sub_81C25A4 - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C38C0 - - thumb_func_start sub_81C3984 -sub_81C3984: @ 81C3984 - push {r4,lr} - movs r0, 0 - bl sub_81C3B08 - movs r0, 0x1 - bl sub_81C3B08 - movs r0, 0x2 - bl sub_81C3B08 - movs r0, 0x3 - bl sub_81C3B08 - ldr r4, =gUnknown_0203CF1C - ldr r0, [r4] - ldr r1, =0x000040bc - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C39EA - bl sub_81C3F44 - ldr r1, [r4] - ldr r0, =0x000040c6 - adds r2, r1, r0 - ldrb r0, [r2] - cmp r0, 0x4 - bne _081C39DC - ldr r0, =0x000040c4 - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0 - beq _081C39EA - bl sub_81C3E9C - b _081C39EA - .pool -_081C39DC: - ldrb r0, [r2] - lsls r0, 1 - adds r1, 0x84 - adds r1, r0 - ldrh r0, [r1] - bl sub_81C3E9C -_081C39EA: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C3984 - - thumb_func_start sub_81C39F0 -sub_81C39F0: @ 81C39F0 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldrh r0, [r4] - subs r0, 0x1 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - bhi _081C3AFC - lsls r0, 2 - ldr r1, =_081C3A20 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081C3A20: - .4byte _081C3A40 - .4byte _081C3A48 - .4byte _081C3A50 - .4byte _081C3A58 - .4byte _081C3A60 - .4byte _081C3A7C - .4byte _081C3ABE - .4byte _081C3AF4 -_081C3A40: - movs r0, 0 - bl sub_81C3B08 - b _081C3AFC -_081C3A48: - movs r0, 0x1 - bl sub_81C3B08 - b _081C3AFC -_081C3A50: - movs r0, 0x2 - bl sub_81C3B08 - b _081C3AFC -_081C3A58: - movs r0, 0x3 - bl sub_81C3B08 - b _081C3AFC -_081C3A60: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040bc - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C3AFC - bl sub_81C3F44 - b _081C3AFC - .pool -_081C3A7C: - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r2, =0x000040bc - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C3AFC - ldr r0, =0x000040c6 - adds r2, r1, r0 - ldrb r0, [r2] - cmp r0, 0x4 - bne _081C3AB0 - ldr r2, =0x000040c4 - adds r0, r1, r2 - ldrh r0, [r0] - strh r0, [r4, 0x2] - b _081C3AFC - .pool -_081C3AB0: - ldrb r0, [r2] - lsls r0, 1 - adds r1, 0x84 - adds r1, r0 - ldrh r0, [r1] - strh r0, [r4, 0x2] - b _081C3AFC -_081C3ABE: - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r2, =0x000040bc - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C3AFC - adds r2, 0x8 - adds r0, r1, r2 - ldr r0, [r0] - ldr r1, =0x00ffffff - ands r0, r1 - movs r1, 0x80 - lsls r1, 11 - cmp r0, r1 - beq _081C3AFC - ldrh r0, [r4, 0x2] - bl sub_81C3E9C - b _081C3AFC - .pool -_081C3AF4: - adds r0, r2, 0 - bl DestroyTask - b _081C3B02 -_081C3AFC: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_081C3B02: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C39F0 - - thumb_func_start sub_81C3B08 -sub_81C3B08: @ 81C3B08 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - mov r10, r0 - ldr r4, =gUnknown_0861CD14 - adds r0, r4, 0 - movs r1, 0 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x8] - lsls r1, r7, 1 - mov r0, r10 - adds r0, 0x84 - adds r0, r1 - ldrh r5, [r0] - cmp r5, 0 - beq _081C3C00 - mov r0, r10 - adds r0, 0xA4 - ldrb r1, [r0] - adds r0, r5, 0 - adds r2, r7, 0 - bl CalculatePPWithBonus - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - movs r0, 0xD - adds r1, r5, 0 - muls r1, r0 - ldr r0, =gMoveNames - adds r1, r0 - lsls r0, r7, 4 - mov r9, r0 - mov r3, r9 - adds r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0 - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - mov r0, r8 - movs r2, 0 - bl sub_81C25A4 - ldr r0, =gStringVar1 - mov r8, r0 - mov r5, r10 - adds r5, 0x8C - adds r5, r7 - ldrb r1, [r5] - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar2 - adds r0, r4, 0 - adds r1, r6, 0 - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - bl sub_81AFBF0 - movs r0, 0 - mov r1, r8 - bl sub_81AFC0C - movs r0, 0x1 - adds r1, r4, 0 - bl sub_81AFC0C - ldr r4, =gStringVar4 - ldr r1, =gUnknown_0861CE97 - adds r0, r4, 0 - bl sub_81AFC28 - adds r7, r4, 0 - ldrb r0, [r5] - adds r1, r6, 0 - bl sub_814FC20 - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - adds r5, 0x9 - movs r0, 0x1 - adds r1, r7, 0 - movs r2, 0x2C - bl GetStringRightAlignXOffset - mov r4, r9 - b _081C3C26 - .pool -_081C3C00: - ldr r1, =gText_OneDash - lsls r4, r7, 4 - adds r3, r4, 0x1 - lsls r3, 24 - lsrs r3, 24 - str r5, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - mov r0, r8 - movs r2, 0 - bl sub_81C25A4 - ldr r7, =gText_TwoDashes - movs r5, 0xC - movs r0, 0x1 - adds r1, r7, 0 - movs r2, 0x2C - bl GetStringCenterAlignXOffset -_081C3C26: - lsls r2, r0, 24 - lsrs r2, 24 - adds r3, r4, 0x1 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0 - str r0, [sp] - lsls r0, r5, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - ldr r0, [sp, 0x8] - adds r1, r7, 0 - bl sub_81C25A4 - 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_81C3B08 - - thumb_func_start sub_81C3C5C -sub_81C3C5C: @ 81C3C5C - push {r4-r6,lr} - sub sp, 0x8 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0 - beq _081C3CFC - movs r0, 0x13 - str r0, [sp] - movs r0, 0x20 - str r0, [sp, 0x4] - movs r0, 0xE - movs r1, 0 - movs r2, 0x35 - movs r3, 0 - bl FillWindowPixelRect - ldr r2, =gBattleMoves - lsls r1, r5, 1 - adds r0, r1, r5 - lsls r0, 2 - adds r2, r0, r2 - ldrb r0, [r2, 0x1] - adds r6, r1, 0 - cmp r0, 0x1 - bhi _081C3C9C - ldr r1, =gText_ThreeDashes - b _081C3CAC - .pool -_081C3C9C: - ldr r4, =gStringVar1 - ldrb r1, [r2, 0x1] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - adds r1, r4, 0 -_081C3CAC: - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0xE - movs r2, 0x35 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gBattleMoves - adds r0, r6, r5 - lsls r0, 2 - adds r1, r0, r1 - ldrb r0, [r1, 0x3] - cmp r0, 0 - bne _081C3CDC - ldr r1, =gText_ThreeDashes - b _081C3CEC - .pool -_081C3CDC: - ldr r4, =gStringVar1 - ldrb r1, [r1, 0x3] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - adds r1, r4, 0 -_081C3CEC: - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0xE - movs r2, 0x35 - movs r3, 0x11 - bl sub_81C25A4 -_081C3CFC: - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3C5C - - thumb_func_start sub_81C3D08 -sub_81C3D08: @ 81C3D08 - push {r4,lr} - movs r0, 0 - bl sub_81C3B08 - movs r0, 0x1 - bl sub_81C3B08 - movs r0, 0x2 - bl sub_81C3B08 - movs r0, 0x3 - bl sub_81C3B08 - ldr r4, =gUnknown_0203CF1C - ldr r0, [r4] - ldr r1, =0x000040bc - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C3D40 - bl sub_81C3F44 - ldr r0, [r4] - ldr r1, =0x000040c6 - adds r0, r1 - ldrb r0, [r0] - bl sub_81C3E2C -_081C3D40: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3D08 - - thumb_func_start sub_81C3D54 -sub_81C3D54: @ 81C3D54 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldrh r0, [r4] - subs r0, 0x1 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - bhi _081C3E20 - lsls r0, 2 - ldr r1, =_081C3D84 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081C3D84: - .4byte _081C3DA0 - .4byte _081C3DA8 - .4byte _081C3DB0 - .4byte _081C3DB8 - .4byte _081C3DC0 - .4byte _081C3DDC - .4byte _081C3E18 -_081C3DA0: - movs r0, 0 - bl sub_81C3B08 - b _081C3E20 -_081C3DA8: - movs r0, 0x1 - bl sub_81C3B08 - b _081C3E20 -_081C3DB0: - movs r0, 0x2 - bl sub_81C3B08 - b _081C3E20 -_081C3DB8: - movs r0, 0x3 - bl sub_81C3B08 - b _081C3E20 -_081C3DC0: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040bc - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C3E20 - bl sub_81C3F44 - b _081C3E20 - .pool -_081C3DDC: - ldr r0, =gUnknown_0203CF1C - ldr r2, [r0] - ldr r1, =0x000040bc - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C3E20 - adds r1, 0x8 - adds r0, r2, r1 - ldr r0, [r0] - ldr r1, =0x00ffffff - ands r0, r1 - movs r1, 0x80 - lsls r1, 11 - cmp r0, r1 - beq _081C3E20 - ldr r1, =0x000040c6 - adds r0, r2, r1 - ldrb r0, [r0] - bl sub_81C3E2C - b _081C3E20 - .pool -_081C3E18: - adds r0, r2, 0 - bl DestroyTask - b _081C3E26 -_081C3E20: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_081C3E26: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C3D54 - - thumb_func_start sub_81C3E2C -sub_81C3E2C: @ 81C3E2C - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x4 - bne _081C3E48 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040c4 - b _081C3E50 - .pool -_081C3E48: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - lsls r1, 1 - adds r0, 0x84 -_081C3E50: - adds r0, r1 - ldrh r4, [r0] - cmp r4, 0 - beq _081C3E82 - ldr r0, =gUnknown_0861CD14 - movs r1, 0x2 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - ldr r3, =gContestEffectDescriptionPointers - ldr r2, =gContestMoves - lsls r1, r4, 3 - adds r1, r2 - ldrb r1, [r1] - lsls r1, 2 - adds r1, r3 - ldr r1, [r1] - movs r2, 0 - str r2, [sp] - str r2, [sp, 0x4] - movs r2, 0x6 - movs r3, 0x1 - bl sub_81C25A4 -_081C3E82: - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3E2C - - thumb_func_start sub_81C3E9C -sub_81C3E9C: @ 81C3E9C - push {r4-r6,lr} - sub sp, 0x8 - lsls r0, 16 - lsrs r4, r0, 16 - adds r6, r4, 0 - ldr r0, =gUnknown_0861CD14 - movs r1, 0x2 - bl sub_81C2D2C - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r5, 0 - movs r1, 0 - bl FillWindowPixelBuffer - cmp r4, 0 - beq _081C3F30 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040c0 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x2 - bne _081C3F00 - adds r0, r4, 0 - bl sub_81C3C5C - ldr r1, =gMoveDescriptionPointers - subs r0, r4, 0x1 - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - adds r0, r5, 0 - movs r2, 0x6 - movs r3, 0x1 - bl sub_81C25A4 - b _081C3F20 - .pool -_081C3F00: - ldr r2, =gContestEffectDescriptionPointers - ldr r1, =gContestMoves - lsls r0, r6, 3 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r2 - ldr r1, [r0] - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - adds r0, r5, 0 - movs r2, 0x6 - movs r3, 0x1 - bl sub_81C25A4 -_081C3F20: - adds r0, r5, 0 - bl PutWindowTilemap - b _081C3F36 - .pool -_081C3F30: - adds r0, r5, 0 - bl ClearWindowTilemap -_081C3F36: - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81C3E9C - - thumb_func_start sub_81C3F44 -sub_81C3F44: @ 81C3F44 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - ldr r4, =gUnknown_0861CD14 - adds r0, r4, 0 - movs r1, 0 - bl sub_81C2D2C - lsls r0, 24 - lsrs r6, r0, 24 - adds r7, r6, 0 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r2, =0x000040c4 - adds r0, r1, r2 - ldrh r2, [r0] - cmp r2, 0 - bne _081C3F9C - ldr r1, =gText_Cancel - str r2, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - adds r0, r6, 0 - movs r2, 0 - movs r3, 0x41 - bl sub_81C25A4 - b _081C4044 - .pool -_081C3F9C: - ldrh r5, [r0] - ldr r2, =0x000040c0 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x2 - bne _081C3FD0 - movs r0, 0xD - adds r1, r5, 0 - muls r1, r0 - ldr r0, =gMoveNames - adds r1, r0 - movs r0, 0 - str r0, [sp] - movs r0, 0x6 - str r0, [sp, 0x4] - adds r0, r6, 0 - movs r2, 0 - movs r3, 0x41 - bl sub_81C25A4 - b _081C3FEC - .pool -_081C3FD0: - movs r0, 0xD - adds r1, r5, 0 - muls r1, r0 - ldr r0, =gMoveNames - adds r1, r0 - movs r0, 0 - str r0, [sp] - movs r0, 0x5 - str r0, [sp, 0x4] - adds r0, r7, 0 - movs r2, 0 - movs r3, 0x41 - bl sub_81C25A4 -_081C3FEC: - ldr r4, =gStringVar1 - ldr r1, =gBattleMoves - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x4] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - bl sub_81AFBF0 - movs r0, 0 - adds r1, r4, 0 - bl sub_81AFC0C - movs r0, 0x1 - adds r1, r4, 0 - bl sub_81AFC0C - ldr r4, =gStringVar4 - ldr r1, =gUnknown_0861CE97 - adds r0, r4, 0 - bl sub_81AFC28 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x2C - bl GetStringRightAlignXOffset - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0 - str r0, [sp] - movs r0, 0xC - str r0, [sp, 0x4] - mov r0, r8 - adds r1, r4, 0 - movs r3, 0x41 - bl sub_81C25A4 -_081C4044: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3F44 - - thumb_func_start sub_81C4064 -sub_81C4064: @ 81C4064 - push {r4,lr} - sub sp, 0x8 - ldr r0, =gUnknown_0861CD14 - movs r1, 0 - bl sub_81C2D2C - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x48 - str r0, [sp] - movs r0, 0x10 - str r0, [sp, 0x4] - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0x42 - bl FillWindowPixelRect - adds r0, r4, 0 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4064 - - thumb_func_start sub_81C40A0 -sub_81C40A0: @ 81C40A0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - mov r9, r0 - mov r10, r1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - mov r0, r10 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldr r5, =gUnknown_0861CD14 - adds r0, r5, 0 - movs r1, 0 - bl sub_81C2D2C - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_81C2D2C - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - mov r0, r9 - lsls r6, r0, 4 - movs r0, 0x48 - mov r8, r0 - str r0, [sp] - movs r0, 0x10 - str r0, [sp, 0x4] - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - adds r3, r6, 0 - bl FillWindowPixelRect - mov r0, r10 - lsls r7, r0, 4 - mov r0, r8 - str r0, [sp] - movs r0, 0x10 - str r0, [sp, 0x4] - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - adds r3, r7, 0 - bl FillWindowPixelRect - movs r4, 0x30 - str r4, [sp] - movs r0, 0x10 - str r0, [sp, 0x4] - adds r0, r5, 0 - movs r1, 0 - movs r2, 0 - adds r3, r6, 0 - bl FillWindowPixelRect - str r4, [sp] - movs r0, 0x10 - str r0, [sp, 0x4] - adds r0, r5, 0 - movs r1, 0 - movs r2, 0 - adds r3, r7, 0 - bl FillWindowPixelRect - mov r0, r9 - bl sub_81C3B08 - mov r0, r10 - bl sub_81C3B08 - 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_81C40A0 - - thumb_func_start sub_81C4154 -sub_81C4154: @ 81C4154 - push {r4,lr} - sub sp, 0x8 - ldr r0, =gUnknown_0861CD14 - movs r1, 0x2 - bl sub_81C2D2C - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r1, =gUnknown_085EA4CB - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - adds r0, r4, 0 - movs r2, 0x6 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4154 - - thumb_func_start sub_81C4190 -sub_81C4190: @ 81C4190 - push {r4,r5,lr} - movs r2, 0 - ldr r5, =gUnknown_0203CF1C - ldr r4, =0x000040d3 - movs r3, 0xFF -_081C419A: - ldr r0, [r5] - adds r0, r4 - adds r0, r2 - ldrb r1, [r0] - orrs r1, r3 - strb r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x1B - bls _081C419A - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4190 - - thumb_func_start sub_81C41C0 -sub_81C41C0: @ 81C41C0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r5, =gUnknown_0203CF1C - ldr r0, [r5] - ldr r1, =0x000040d3 - adds r0, r1 - adds r1, r0, r4 - ldrb r0, [r1] - cmp r0, 0xFF - beq _081C41F2 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySprite - ldr r0, [r5] - ldr r1, =0x000040d3 - adds r0, r1 - adds r0, r4 - movs r1, 0xFF - strb r1, [r0] -_081C41F2: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C41C0 - - thumb_func_start sub_81C4204 -sub_81C4204: @ 81C4204 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =gSprites - ldr r2, =gUnknown_0203CF1C - ldr r2, [r2] - ldr r4, =0x000040d3 - adds r2, r4 - adds r2, r0 - ldrb r0, [r2] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r3 - adds r2, 0x3E - movs r0, 0x1 - ands r1, r0 - lsls r1, 2 - ldrb r3, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4204 - - thumb_func_start sub_81C424C -sub_81C424C: @ 81C424C - push {r4,lr} - movs r4, 0x3 -_081C4250: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040d3 - adds r0, r1 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0xFF - beq _081C4268 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81C4204 -_081C4268: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1B - bls _081C4250 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C424C - - thumb_func_start sub_81C4280 -sub_81C4280: @ 81C4280 - push {lr} - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040c0 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x2 - beq _081C42B0 - cmp r0, 0x2 - bgt _081C42A4 - cmp r0, 0 - beq _081C42AA - b _081C42C2 - .pool -_081C42A4: - cmp r0, 0x3 - beq _081C42BA - b _081C42C2 -_081C42AA: - bl sub_81C43A0 - b _081C42C2 -_081C42B0: - bl sub_81C4420 - bl sub_81C44F0 - b _081C42C2 -_081C42BA: - bl sub_81C4484 - bl sub_81C44F0 -_081C42C2: - pop {r0} - bx r0 - thumb_func_end sub_81C4280 - - thumb_func_start sub_81C42C8 -sub_81C42C8: @ 81C42C8 - push {r4,r5,lr} - movs r4, 0x3 - ldr r5, =gUnknown_0203CF1C -_081C42CE: - ldr r0, [r5] - ldr r1, =0x000040d3 - adds r0, r1 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0xFF - bne _081C42F2 - ldr r0, =gUnknown_0861CFC4 - movs r1, 0 - movs r2, 0 - movs r3, 0x2 - bl CreateSprite - ldr r1, [r5] - ldr r2, =0x000040d3 - adds r1, r2 - adds r1, r4 - strb r0, [r1] -_081C42F2: - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81C4204 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _081C42CE - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C42C8 - - thumb_func_start sub_81C4318 -sub_81C4318: @ 81C4318 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x4 - adds r5, r0, 0 - adds r6, r1, 0 - mov r8, r2 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040d3 - adds r0, r1 - adds r0, r3 - ldrb r0, [r0] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =gSprites - adds r4, r0 - adds r0, r4, 0 - adds r1, r5, 0 - str r3, [sp] - bl StartSpriteAnim - ldr r0, =gUnknown_0861CFDC - adds r5, r0 - ldrb r1, [r5] - lsls r1, 4 - ldrb r2, [r4, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x5] - adds r6, 0x10 - strh r6, [r4, 0x20] - movs r0, 0x8 - add r8, r0 - mov r1, r8 - strh r1, [r4, 0x22] - ldr r3, [sp] - adds r0, r3, 0 - movs r1, 0 - bl sub_81C4204 - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4318 - - thumb_func_start sub_81C43A0 -sub_81C43A0: @ 81C43A0 - push {r4,r5,lr} - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r5, r0, 0 - adds r5, 0x70 - ldrb r0, [r5, 0x4] - cmp r0, 0 - beq _081C43CC - movs r0, 0x9 - movs r1, 0x78 - movs r2, 0x30 - movs r3, 0x3 - bl sub_81C4318 - movs r0, 0x4 - movs r1, 0x1 - bl sub_81C4204 - b _081C4418 - .pool -_081C43CC: - ldr r4, =gBaseStats - ldrh r1, [r5] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0, 0x6] - movs r1, 0x78 - movs r2, 0x30 - movs r3, 0x3 - bl sub_81C4318 - ldrh r1, [r5] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r1, r0, r4 - ldrb r0, [r1, 0x6] - ldrb r2, [r1, 0x7] - cmp r0, r2 - beq _081C4410 - ldrb r0, [r1, 0x7] - movs r1, 0xA0 - movs r2, 0x30 - movs r3, 0x4 - bl sub_81C4318 - movs r0, 0x4 - movs r1, 0 - bl sub_81C4204 - b _081C4418 - .pool -_081C4410: - movs r0, 0x4 - movs r1, 0x1 - bl sub_81C4204 -_081C4418: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81C43A0 - - thumb_func_start sub_81C4420 -sub_81C4420: @ 81C4420 - push {r4-r6,lr} - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r5, r0, 0 - adds r5, 0x70 - movs r4, 0 - ldr r6, =gBattleMoves -_081C442E: - lsls r0, r4, 1 - adds r1, r5, 0 - adds r1, 0x14 - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0 - beq _081C4468 - adds r1, r0, 0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x2] - lsls r2, r4, 28 - movs r1, 0x80 - lsls r1, 22 - adds r2, r1 - lsrs r2, 24 - adds r3, r4, 0x3 - lsls r3, 24 - lsrs r3, 24 - movs r1, 0x55 - bl sub_81C4318 - b _081C4474 - .pool -_081C4468: - adds r0, r4, 0x3 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl sub_81C4204 -_081C4474: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _081C442E - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81C4420 - - thumb_func_start sub_81C4484 -sub_81C4484: @ 81C4484 - push {r4,r5,lr} - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r5, r0, 0 - adds r5, 0x70 - movs r4, 0 -_081C4490: - lsls r0, r4, 1 - adds r1, r5, 0 - adds r1, 0x14 - adds r2, r1, r0 - ldrh r0, [r2] - cmp r0, 0 - beq _081C44D4 - ldr r1, =gContestMoves - lsls r0, 3 - adds r0, r1 - ldrb r0, [r0, 0x1] - lsls r0, 29 - lsrs r0, 5 - movs r1, 0x90 - lsls r1, 21 - adds r0, r1 - lsrs r0, 24 - lsls r2, r4, 28 - movs r1, 0x80 - lsls r1, 22 - adds r2, r1 - lsrs r2, 24 - adds r3, r4, 0x3 - lsls r3, 24 - lsrs r3, 24 - movs r1, 0x55 - bl sub_81C4318 - b _081C44E0 - .pool -_081C44D4: - adds r0, r4, 0x3 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl sub_81C4204 -_081C44E0: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _081C4490 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81C4484 - - thumb_func_start sub_81C44F0 -sub_81C44F0: @ 81C44F0 - push {lr} - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r0, =0x000040c4 - adds r3, r1, r0 - ldrh r0, [r3] - cmp r0, 0 - bne _081C4514 - movs r0, 0x7 - movs r1, 0x1 - bl sub_81C4204 - b _081C4560 - .pool -_081C4514: - ldr r2, =0x000040c0 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x2 - bne _081C4540 - ldr r2, =gBattleMoves - ldrh r1, [r3] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x2] - movs r1, 0x55 - movs r2, 0x60 - movs r3, 0x7 - bl sub_81C4318 - b _081C4560 - .pool -_081C4540: - ldr r1, =gContestMoves - ldrh r0, [r3] - lsls r0, 3 - adds r0, r1 - ldrb r0, [r0, 0x1] - lsls r0, 29 - lsrs r0, 5 - movs r1, 0x90 - lsls r1, 21 - adds r0, r1 - lsrs r0, 24 - movs r1, 0x55 - movs r2, 0x60 - movs r3, 0x7 - bl sub_81C4318 -_081C4560: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C44F0 - - thumb_func_start sub_81C4568 -sub_81C4568: @ 81C4568 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_0203CF1C - ldr r2, [r2] - adds r0, 0x3 - ldr r3, =0x000040d3 - adds r2, r3 - adds r0, r2, r0 - ldrb r0, [r0] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r5, =gSprites - adds r4, r5 - adds r1, 0x3 - adds r2, r1 - ldrb r0, [r2] - lsls r3, r0, 4 - adds r3, r0 - lsls r3, 2 - adds r3, r5 - adds r5, r4, 0 - adds r5, 0x2A - ldrb r1, [r5] - adds r2, r3, 0 - adds r2, 0x2A - ldrb r0, [r2] - strb r0, [r5] - strb r1, [r2] - ldrb r6, [r4, 0x5] - lsrs r5, r6, 4 - ldrb r2, [r3, 0x5] - lsrs r2, 4 - lsls r2, 4 - movs r1, 0xF - adds r0, r1, 0 - ands r0, r6 - orrs r0, r2 - strb r0, [r4, 0x5] - lsls r5, 4 - ldrb r0, [r3, 0x5] - ands r1, r0 - orrs r1, r5 - strb r1, [r3, 0x5] - adds r4, 0x3F - ldrb r0, [r4] - movs r2, 0x4 - orrs r0, r2 - movs r1, 0x11 - negs r1, r1 - ands r0, r1 - strb r0, [r4] - adds r3, 0x3F - ldrb r0, [r3] - orrs r0, r2 - ands r0, r1 - strb r0, [r3] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4568 - - thumb_func_start sub_81C45F4 -sub_81C45F4: @ 81C45F4 - push {r4-r6,lr} - adds r3, r0, 0 - adds r6, r1, 0 - ldr r0, =gUnknown_0203CF1C - ldr r2, [r0] - adds r5, r2, 0 - adds r5, 0x70 - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0 - beq _081C4620 - cmp r0, 0x1 - bne _081C4610 - b _081C4750 -_081C4610: - adds r0, r3, 0 - bl sub_81C47B4 - lsls r0, 24 - lsrs r0, 24 - b _081C4770 - .pool -_081C4620: - ldr r0, =gMain - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081C4680 - ldr r1, =0x000040be - adds r0, r2, r1 - ldrb r1, [r0] - movs r0, 0x3 - bl sub_80688F8 - lsls r0, 24 - cmp r0, 0 - beq _081C4668 - ldrh r2, [r5, 0x2] - lsls r0, r2, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - ldr r1, =gBattleSpritesGfx - ldr r1, [r1] - ldr r1, [r1, 0x8] - b _081C46D6 - .pool -_081C4668: - ldrh r2, [r5, 0x2] - lsls r0, r2, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - ldr r1, =gBattleSpritesGfx - ldr r1, [r1] - b _081C46B0 - .pool -_081C4680: - ldr r0, =gBattleSpritesGfx - ldr r3, [r0] - adds r4, r0, 0 - cmp r3, 0 - beq _081C46E4 - ldr r1, [r2] - ldr r0, =gPlayerParty - cmp r1, r0 - beq _081C46A6 - ldr r1, =0x000040bc - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0x2 - beq _081C46A6 - adds r1, 0x33 - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _081C46CC -_081C46A6: - ldrh r2, [r5, 0x2] - lsls r0, r2, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - ldr r1, [r4] -_081C46B0: - ldr r1, [r1, 0x8] - ldr r3, [r5, 0xC] - bl HandleLoadSpecialPokePic_2 - b _081C4768 - .pool -_081C46CC: - ldrh r2, [r5, 0x2] - lsls r0, r2, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - ldr r1, [r3, 0x8] -_081C46D6: - ldr r3, [r5, 0xC] - bl HandleLoadSpecialPokePic_DontHandleDeoxys - b _081C4768 - .pool -_081C46E4: - ldr r1, [r2] - ldr r0, =gPlayerParty - cmp r1, r0 - beq _081C4700 - ldr r1, =0x000040bc - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0x2 - beq _081C4700 - adds r1, 0x33 - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _081C472C -_081C4700: - ldrh r4, [r5, 0x2] - lsls r4, 3 - ldr r0, =gMonFrontPicTable - adds r4, r0 - movs r0, 0 - movs r1, 0x1 - bl sub_806F4F8 - adds r1, r0, 0 - ldrh r2, [r5, 0x2] - ldr r3, [r5, 0xC] - adds r0, r4, 0 - bl HandleLoadSpecialPokePic_2 - b _081C4768 - .pool -_081C472C: - ldrh r4, [r5, 0x2] - lsls r4, 3 - ldr r0, =gMonFrontPicTable - adds r4, r0 - movs r0, 0 - movs r1, 0x1 - bl sub_806F4F8 - adds r1, r0, 0 - ldrh r2, [r5, 0x2] - ldr r3, [r5, 0xC] - adds r0, r4, 0 - bl HandleLoadSpecialPokePic_DontHandleDeoxys - b _081C4768 - .pool -_081C4750: - ldrh r0, [r5, 0x2] - ldr r1, [r5, 0x48] - ldr r2, [r5, 0xC] - bl sub_806E7CC - adds r4, r0, 0 - bl LoadCompressedObjectPalette - ldrh r0, [r4, 0x4] - movs r1, 0x1 - bl sub_806A068 -_081C4768: - ldrh r0, [r6] - adds r0, 0x1 - strh r0, [r6] - movs r0, 0xFF -_081C4770: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81C45F4 - - thumb_func_start sub_81C4778 -sub_81C4778: @ 81C4778 - push {r4,lr} - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - adds r4, r1, 0 - adds r4, 0x70 - ldrb r0, [r4, 0x4] - cmp r0, 0 - bne _081C47AE - adds r0, r1, 0 - adds r0, 0xC - bl sub_805F110 - cmp r0, 0x1 - bne _081C47A4 - ldrh r0, [r4, 0x2] - movs r1, 0 - movs r2, 0 - bl PlayCry3 - b _081C47AE - .pool -_081C47A4: - ldrh r0, [r4, 0x2] - movs r1, 0 - movs r2, 0xB - bl PlayCry3 -_081C47AE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C4778 - - thumb_func_start sub_81C47B4 -sub_81C47B4: @ 81C47B4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =gUnknown_0203CF1C - ldr r6, [r0] - adds r6, 0x70 - ldr r0, =gUnknown_0202499C - movs r1, 0x28 - movs r2, 0x40 - movs r3, 0x5 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r4, r0, 4 - add r4, r8 - lsls r4, 2 - ldr r5, =gSprites - adds r7, r4, r5 - adds r0, r7, 0 - bl FreeSpriteOamMatrix - ldrh r0, [r6, 0x2] - movs r1, 0 - strh r0, [r7, 0x2E] - strh r1, [r7, 0x32] - adds r5, 0x1C - adds r4, r5 - ldr r0, =sub_81C4844 - str r0, [r4] - ldrb r1, [r7, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - strb r0, [r7, 0x5] - ldrh r0, [r6, 0x2] - bl IsPokeSpriteNotFlipped - lsls r0, 24 - cmp r0, 0 - bne _081C4828 - adds r0, r7, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0] - b _081C4836 - .pool -_081C4828: - adds r2, r7, 0 - adds r2, 0x3F - ldrb r1, [r2] - movs r0, 0x2 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_081C4836: - mov r0, r8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81C47B4 - - thumb_func_start sub_81C4844 -sub_81C4844: @ 81C4844 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r5, r0, 0 - adds r5, 0x70 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081C487E - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _081C487E - ldrh r0, [r4, 0x2E] - bl IsPokeSpriteNotFlipped - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x30] - bl sub_81C4778 - ldrh r1, [r4, 0x2E] - ldrb r2, [r5, 0x4] - adds r0, r4, 0 - bl PokemonSummaryDoMonAnimation -_081C487E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4844 - - thumb_func_start sub_81C488C -sub_81C488C: @ 81C488C - ldr r1, =gUnknown_0203CF24 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_81C488C - - thumb_func_start sub_81C4898 -sub_81C4898: @ 81C4898 - push {r4,lr} - ldr r4, =gUnknown_0203CF24 - ldrb r0, [r4] - cmp r0, 0xFF - beq _081C48AA - bl DestroyTask - movs r0, 0xFF - strb r0, [r4] -_081C48AA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4898 - - thumb_func_start sub_81C48B4 -sub_81C48B4: @ 81C48B4 - push {lr} - ldr r2, =gSprites - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040d3 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =SpriteCallbackDummy - cmp r1, r0 - beq _081C48E8 - movs r0, 0x1 - b _081C48EA - .pool -_081C48E8: - movs r0, 0 -_081C48EA: - pop {r1} - bx r1 - thumb_func_end sub_81C48B4 - - thumb_func_start sub_81C48F0 -sub_81C48F0: @ 81C48F0 - push {r4-r6,lr} - ldr r6, =gSprites - ldr r5, =gUnknown_0203CF1C - ldr r0, [r5] - ldr r4, =0x000040d3 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x2C - ldrb r1, [r0] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0] - ldr r0, [r5] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r6, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =SpriteCallbackDummy - str r1, [r0] - bl sub_806EE98 - ldr r0, [r5] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x5] - lsrs r0, 4 - lsls r3, r0, 4 - movs r1, 0x80 - lsls r1, 1 - adds r0, r1, 0 - orrs r3, r0 - movs r2, 0 - ldr r5, =gPlttBufferUnfaded - ldr r4, =gPlttBufferFaded -_081C494C: - adds r0, r2, r3 - lsls r0, 16 - lsrs r0, 15 - adds r1, r0, r5 - adds r0, r4 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0xF - bls _081C494C - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C48F0 - - thumb_func_start sub_81C4984 -sub_81C4984: @ 81C4984 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r1, =0x00007533 - ldr r2, =gUnknown_0861D120 - adds r0, r1, 0 - bl sub_811FF94 - adds r4, r0, 0 - ldr r6, =gUnknown_0203CF1C - ldr r0, [r6] - str r4, [r0, 0x8] - cmp r4, 0 - beq _081C49CE - adds r0, r5, 0 - movs r1, 0x8 - bl GetMonData - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartSpriteAnim - ldr r1, [r6] - ldr r2, [r1, 0x8] - movs r0, 0x3C - strh r0, [r2, 0x20] - ldr r2, [r1, 0x8] - movs r0, 0x1A - strh r0, [r2, 0x22] - ldr r2, [r1, 0x8] - ldrb r1, [r2, 0x5] - subs r0, 0x27 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2, 0x5] -_081C49CE: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4984 - - thumb_func_start sub_81C49E0 -sub_81C49E0: @ 81C49E0 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r0, [r0, 0x8] - bl DestroySprite - ldr r0, =0x00007533 - bl FreeSpriteTilesByTag - adds r0, r4, 0 - bl sub_81C4984 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C49E0 - - thumb_func_start sub_81C4A08 -sub_81C4A08: @ 81C4A08 - push {r4,lr} - movs r1, 0x26 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - bl ball_number_to_ball_processing_index - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl sub_8076A78 - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 3 - ldr r1, =gUnknown_0832C588 - adds r0, r1 - movs r1, 0x10 - movs r2, 0x88 - movs r3, 0 - bl CreateSprite - ldr r2, =gUnknown_0203CF1C - ldr r1, [r2] - ldr r3, =0x000040d4 - adds r1, r3 - strb r0, [r1] - ldr r4, =gSprites - ldr r2, [r2] - adds r2, r3 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =SpriteCallbackDummy - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0, 0x5] - movs r2, 0xC - orrs r1, r2 - strb r1, [r0, 0x5] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4A08 - - thumb_func_start sub_81C4A88 -sub_81C4A88: @ 81C4A88 - push {r4,r5,lr} - ldr r5, =gUnknown_0203CF1C - ldr r0, [r5] - ldr r1, =0x000040d5 - adds r4, r0, r1 - ldrb r0, [r4] - cmp r0, 0xFF - bne _081C4AA6 - ldr r0, =gUnknown_0861D108 - movs r1, 0x40 - movs r2, 0x98 - movs r3, 0 - bl CreateSprite - strb r0, [r4] -_081C4AA6: - ldr r0, [r5] - adds r0, 0xC - bl sub_81B205C - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - beq _081C4AE8 - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - subs r1, r2, 0x1 - lsls r1, 24 - lsrs r1, 24 - bl StartSpriteAnim - movs r0, 0x2 - movs r1, 0 - bl sub_81C4204 - b _081C4AF0 - .pool -_081C4AE8: - movs r0, 0x2 - movs r1, 0x1 - bl sub_81C4204 -_081C4AF0: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81C4A88 - - thumb_func_start sub_81C4AF8 -sub_81C4AF8: @ 81C4AF8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r0, =gUnknown_0203CF1C - ldr r1, =0x000040d3 - add r1, r8 - ldr r0, [r0] - adds r7, r0, r1 - ldr r1, =0x000040c0 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bls _081C4BD2 - movs r0, 0 - mov r9, r0 - mov r1, r8 - cmp r1, 0x8 - bne _081C4B2A - movs r0, 0x1 - mov r9, r0 -_081C4B2A: - movs r5, 0 - ldr r6, =gSprites - mov r10, r5 -_081C4B30: - lsls r1, r5, 20 - movs r0, 0xB2 - lsls r0, 15 - adds r1, r0 - asrs r1, 16 - ldr r0, =gUnknown_0861D084 - movs r2, 0x28 - mov r3, r9 - bl CreateSprite - adds r1, r7, r5 - strb r0, [r1] - adds r4, r1, 0 - cmp r5, 0 - bne _081C4B74 - ldrb r1, [r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x4 - bl StartSpriteAnim - b _081C4B9A - .pool -_081C4B74: - cmp r5, 0x9 - bne _081C4B8A - ldrb r1, [r7, 0x9] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x5 - bl StartSpriteAnim - b _081C4B9A -_081C4B8A: - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x6 - bl StartSpriteAnim -_081C4B9A: - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r6, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_81C4BE4 - str r1, [r0] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - mov r1, r8 - strh r1, [r0, 0x2E] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - mov r1, r10 - strh r1, [r0, 0x30] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x9 - bls _081C4B30 -_081C4BD2: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4AF8 - - thumb_func_start sub_81C4BE4 -sub_81C4BE4: @ 81C4BE4 - push {lr} - adds r3, r0, 0 - adds r0, 0x2A - ldrb r0, [r0] - subs r0, 0x4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bhi _081C4C1C - ldrh r0, [r3, 0x30] - adds r0, 0x1 - movs r1, 0x1F - ands r0, r1 - strh r0, [r3, 0x30] - cmp r0, 0x18 - ble _081C4C10 - adds r2, r3, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - b _081C4C2A -_081C4C10: - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - b _081C4C28 -_081C4C1C: - movs r0, 0 - strh r0, [r3, 0x30] - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - subs r0, 0x5 -_081C4C28: - ands r0, r1 -_081C4C2A: - strb r0, [r2] - movs r1, 0x2E - ldrsh r0, [r3, r1] - cmp r0, 0x8 - bne _081C4C44 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040c6 - b _081C4C4A - .pool -_081C4C44: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040c7 -_081C4C4A: - adds r0, r1 - ldrb r0, [r0] - lsls r0, 4 - strh r0, [r3, 0x26] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4BE4 - - thumb_func_start sub_81C4C60 -sub_81C4C60: @ 81C4C60 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 -_081C4C68: - adds r0, r5, r4 - lsls r0, 24 - lsrs r0, 24 - bl sub_81C41C0 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x9 - bls _081C4C68 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81C4C60 - - thumb_func_start sub_81C4C84 -sub_81C4C84: @ 81C4C84 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040db - adds r5, r0, r1 - lsls r0, r6, 1 - adds r0, r6 - lsls r0, 24 - movs r4, 0 - ldr r7, =gSprites - movs r2, 0x80 - lsls r2, 19 - adds r2, r0 - mov r9, r2 - lsrs r6, r0, 24 - movs r1, 0xA0 - lsls r1, 19 - adds r1, r0 - mov r8, r1 -_081C4CB4: - cmp r4, 0 - bne _081C4CD4 - ldrb r1, [r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - mov r2, r9 - b _081C4CE4 - .pool -_081C4CD4: - cmp r4, 0x9 - bne _081C4CEC - ldrb r1, [r5, 0x9] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - mov r2, r8 -_081C4CE4: - lsrs r1, r2, 24 - bl StartSpriteAnim - b _081C4D02 -_081C4CEC: - adds r0, r5, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - adds r1, r6, 0x6 - lsls r1, 24 - lsrs r1, 24 - bl StartSpriteAnim -_081C4D02: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x9 - bls _081C4CB4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81C4C84 - - thumb_func_start sub_81C4D18 -sub_81C4D18: @ 81C4D18 - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0203CF1C - ldr r2, =0x000040d3 - adds r0, r2 - ldr r1, [r1] - adds r5, r1, r0 - movs r3, 0 - ldr r4, =gSprites - movs r7, 0x5 - negs r7, r7 - movs r6, 0 -_081C4D32: - adds r2, r5, r3 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r6, [r0, 0x30] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - adds r1, 0x3E - ldrb r2, [r1] - adds r0, r7, 0 - ands r0, r2 - strb r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x9 - bls _081C4D32 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4D18 - - thumb_func_start sub_81C4D70 -sub_81C4D70: @ 81C4D70 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - ldr r4, =gUnknown_0203CF28 - movs r0, 0x4 - bl Alloc - str r0, [r4] - ldr r1, [r5] - lsls r0, r1, 20 - lsrs r4, r0, 30 - cmp r4, 0 - bne _081C4DDC - lsls r0, r1, 30 - lsrs r0, 30 - movs r1, 0x8 - movs r2, 0 - bl SetBgAttribute - ldr r3, [r5] - lsls r0, r3, 30 - lsrs r0, 30 - ldr r1, =gUnknown_0861D1A0 - lsls r3, 22 - lsrs r3, 24 - str r4, [sp] - movs r2, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r0, [r5] - lsls r0, 30 - lsrs r0, 30 - ldr r1, =gUnknown_0861DEF4 - movs r2, 0x1 - str r2, [sp] - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r1, [r5] - lsls r1, 22 - lsrs r1, 24 - str r4, [sp] - movs r2, 0x20 - movs r3, 0x20 - bl sub_8199D3C - b _081C4E2E - .pool -_081C4DDC: - lsls r0, r1, 30 - lsrs r0, 30 - movs r1, 0x8 - movs r2, 0x2 - bl SetBgAttribute - ldr r0, [r5] - lsls r0, 30 - lsrs r0, 30 - movs r1, 0x9 - movs r2, 0x1 - bl SetBgAttribute - ldr r3, [r5] - lsls r0, r3, 30 - lsrs r0, 30 - ldr r1, =gUnknown_0861E208 - lsls r3, 22 - lsrs r3, 24 - movs r2, 0 - str r2, [sp] - bl decompress_and_copy_tile_data_to_vram - ldr r0, [r5] - lsls r0, 30 - lsrs r0, 30 - ldr r1, =gUnknown_0861EF64 - movs r4, 0x1 - str r4, [sp] - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r1, [r5] - lsls r1, 22 - lsrs r1, 24 - str r4, [sp] - movs r2, 0x40 - movs r3, 0x40 - bl sub_8199D3C -_081C4E2E: - ldr r0, [r5] - lsls r0, 30 - lsrs r0, 30 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - ldr r0, [r5] - lsls r0, 30 - lsrs r0, 30 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - ldr r0, [r5] - lsls r0, 30 - lsrs r0, 30 - movs r1, 0x4 - movs r2, 0x1 - bl SetBgAttribute - ldr r0, =gUnknown_0861D140 - ldr r1, =gPlttBufferUnfaded + 0xE0 - ldr r2, =0x04000018 - bl CpuSet - ldr r0, =gUnknown_0203CF28 - ldr r1, [r0] - ldr r0, [r5] - lsls r0, 30 - lsrs r0, 30 - strb r0, [r1] - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4D70 - - thumb_func_start sub_81C4E90 -sub_81C4E90: @ 81C4E90 - push {lr} - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - beq _081C4EA0 - movs r0, 0x1 - b _081C4EAC -_081C4EA0: - ldr r0, =gUnknown_0203CF28 - ldr r0, [r0] - ldrb r0, [r0] - bl ShowBg - movs r0, 0 -_081C4EAC: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81C4E90 - - thumb_func_start sub_81C4EB4 -sub_81C4EB4: @ 81C4EB4 - push {r4,lr} - ldr r4, =gUnknown_0203CF28 - ldr r0, [r4] - cmp r0, 0 - beq _081C4EC6 - bl Free - movs r0, 0 - str r0, [r4] -_081C4EC6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4EB4 - - thumb_func_start sub_81C4ED0 -sub_81C4ED0: @ 81C4ED0 - push {lr} - adds r1, r0, 0 - ldr r0, =gUnknown_0203CF28 - ldr r0, [r0] - ldrb r0, [r0] - lsls r1, 8 - movs r2, 0 - bl ChangeBgY - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4ED0 - - thumb_func_start sub_81C4EEC -sub_81C4EEC: @ 81C4EEC - ldr r1, =gUnknown_0203CF30 - movs r0, 0 - strh r0, [r1, 0x6] - strh r0, [r1, 0x8] - bx lr - .pool - thumb_func_end sub_81C4EEC - - thumb_func_start sub_81C4EFC -sub_81C4EFC: @ 81C4EFC - push {lr} - ldr r1, =sub_8086194 - movs r0, 0 - bl sub_81C4F98 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4EFC - - thumb_func_start sub_81C4F10 -sub_81C4F10: @ 81C4F10 - push {lr} - ldr r1, =sub_8059D50 - movs r0, 0x1 - bl sub_81C4F98 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4F10 - - thumb_func_start sub_81C4F24 -sub_81C4F24: @ 81C4F24 - push {lr} - bl ScriptContext2_Enable - movs r0, 0x1 - movs r1, 0 - bl fade_screen - ldr r0, =sub_81C4F44 - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4F24 - - thumb_func_start sub_81C4F44 -sub_81C4F44: @ 81C4F44 - 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 _081C4F6E - bl overworld_free_bg_tilemaps - ldr r0, =gUnknown_03005DB0 - ldr r1, =hm_add_c3_without_phase_2 - str r1, [r0] - ldr r1, =c2_exit_to_overworld_2_switch - movs r0, 0x3 - bl sub_81C4F98 - adds r0, r4, 0 - bl DestroyTask -_081C4F6E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4F44 - - thumb_func_start sub_81C4F84 -sub_81C4F84: @ 81C4F84 - push {lr} - ldr r0, =gUnknown_0203CF30 - ldr r1, [r0] - movs r0, 0x4 - bl sub_81C4F98 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4F84 - - thumb_func_start sub_81C4F98 -sub_81C4F98: @ 81C4F98 - push {r4-r6,lr} - adds r5, r1, 0 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r6, =gUnknown_0203CF2C - ldr r0, =0x0000098c - bl AllocZeroed - str r0, [r6] - cmp r4, 0x4 - beq _081C4FB2 - ldr r0, =gUnknown_0203CF30 - strb r4, [r0, 0x4] -_081C4FB2: - cmp r5, 0 - beq _081C4FBA - ldr r0, =gUnknown_0203CF30 - str r5, [r0] -_081C4FBA: - ldr r0, [r6] - movs r1, 0 - str r1, [r0] - ldr r1, =0x00000814 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldr r0, [r6] - ldr r1, =0x00000816 - adds r0, r1 - movs r1, 0x1 - negs r1, r1 - strb r1, [r0] - ldr r0, [r6] - ldr r1, =0x00000804 - adds r0, r1 - movs r1, 0xFF - movs r2, 0xB - bl memset - ldr r0, [r6] - ldr r1, =0x0000080f - adds r0, r1 - movs r1, 0xFF - movs r2, 0x5 - bl memset - ldr r0, =sub_81C504C - bl SetMainCallback2 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4F98 - - thumb_func_start sub_81C501C -sub_81C501C: @ 81C501C - push {lr} - bl RunTasks - bl AnimateSprites - bl BuildOamBuffer - bl do_scheduled_bg_tilemap_copies_to_vram - bl UpdatePaletteFade - pop {r0} - bx r0 - thumb_func_end sub_81C501C - - thumb_func_start sub_81C5038 -sub_81C5038: @ 81C5038 - push {lr} - bl LoadOam - bl ProcessSpriteCopyRequests - bl TransferPlttBuffer - pop {r0} - bx r0 - thumb_func_end sub_81C5038 - - thumb_func_start sub_81C504C -sub_81C504C: @ 81C504C - push {lr} -_081C504E: - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C5072 - bl sub_81C5078 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C5072 - bl sub_81221AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C504E -_081C5072: - pop {r0} - bx r0 - thumb_func_end sub_81C504C - - thumb_func_start sub_81C5078 -sub_81C5078: @ 81C5078 - push {lr} - sub sp, 0x4 - ldr r0, =gMain - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x10 - bls _081C508C - b _081C51BC -_081C508C: - lsls r0, 2 - ldr r1, =_081C50A0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081C50A0: - .4byte _081C50E4 - .4byte _081C50EE - .4byte _081C50F4 - .4byte _081C50FA - .4byte _081C510C - .4byte _081C5112 - .4byte _081C5122 - .4byte _081C513C - .4byte _081C5148 - .4byte _081C514E - .4byte _081C515C - .4byte _081C5162 - .4byte _081C5168 - .4byte _081C516E - .4byte _081C5174 - .4byte _081C517A - .4byte _081C5188 -_081C50E4: - bl SetVBlankHBlankCallbacksToNull - bl clear_scheduled_bg_copies_to_vram - b _081C51A2 -_081C50EE: - bl remove_some_task - b _081C51A2 -_081C50F4: - bl FreeAllSpritePalettes - b _081C51A2 -_081C50FA: - bl ResetPaletteFade - ldr r2, =gPaletteFade - ldrb r0, [r2, 0x8] - movs r1, 0x80 - orrs r0, r1 - b _081C51A0 - .pool -_081C510C: - bl ResetSpriteData - b _081C51A2 -_081C5112: - bl sub_81221AC - lsls r0, 24 - cmp r0, 0 - bne _081C51A2 - bl ResetTasks - b _081C51A2 -_081C5122: - bl sub_81C51DC - ldr r0, =gUnknown_0203CF2C - ldr r0, [r0] - ldr r1, =0x00000984 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - b _081C51A2 - .pool -_081C513C: - bl sub_81C5238 - lsls r0, 24 - cmp r0, 0 - beq _081C51D4 - b _081C51A2 -_081C5148: - bl sub_81C6BD8 - b _081C51A2 -_081C514E: - bl sub_81C5924 - bl sub_81C59BC - bl sub_81C5A20 - b _081C51A2 -_081C515C: - bl sub_81C5314 - b _081C51A2 -_081C5162: - bl sub_81C56F8 - b _081C51A2 -_081C5168: - bl sub_81C6EF4 - b _081C51A2 -_081C516E: - bl sub_81C5674 - b _081C51A2 -_081C5174: - bl sub_81C700C - b _081C51A2 -_081C517A: - movs r0, 0x1 - negs r0, r0 - movs r1, 0x10 - movs r2, 0 - bl BlendPalettes - b _081C51A2 -_081C5188: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - ldr r2, =gPaletteFade - ldrb r1, [r2, 0x8] - movs r0, 0x7F - ands r0, r1 -_081C51A0: - strb r0, [r2, 0x8] -_081C51A2: - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _081C51D4 - .pool -_081C51BC: - ldr r0, =sub_81C5038 - bl SetVBlankCallback - ldr r0, =sub_81C501C - bl SetMainCallback2 - movs r0, 0x1 - b _081C51D6 - .pool -_081C51D4: - movs r0, 0 -_081C51D6: - add sp, 0x4 - pop {r1} - bx r1 - thumb_func_end sub_81C5078 - - thumb_func_start sub_81C51DC -sub_81C51DC: @ 81C51DC - push {lr} - bl sub_8121DA0 - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0861F2B4 - movs r0, 0 - movs r2, 0x3 - bl InitBgsFromTemplates - ldr r0, =gUnknown_0203CF2C - ldr r1, [r0] - adds r1, 0x4 - movs r0, 0x2 - bl SetBgTilemapBuffer - bl sub_8121E10 - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C51DC - - thumb_func_start sub_81C5238 -sub_81C5238: @ 81C5238 - push {r4,lr} - sub sp, 0x4 - ldr r4, =gUnknown_0203CF2C - ldr r0, [r4] - ldr r1, =0x00000984 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0x4 - bhi _081C52F0 - lsls r0, 2 - ldr r1, =_081C5264 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081C5264: - .4byte _081C5278 - .4byte _081C5294 - .4byte _081C52B8 - .4byte _081C52C8 - .4byte _081C52D4 -_081C5278: - bl reset_temp_tile_data_buffers - ldr r1, =gUnknown_08D9A620 - movs r0, 0 - str r0, [sp] - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - b _081C52D8 - .pool -_081C5294: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C5308 - ldr r0, =gUnknown_08D9AE04 - ldr r4, =gUnknown_0203CF2C - ldr r1, [r4] - adds r1, 0x4 - bl LZDecompressWram - ldr r1, [r4] - b _081C52DC - .pool -_081C52B8: - ldr r0, =gUnknown_08D9AF44 - movs r1, 0 - movs r2, 0x20 - bl LoadCompressedPalette - b _081C52D8 - .pool -_081C52C8: - ldr r0, =gUnknown_0861F3CC - bl LoadCompressedObjectPic - b _081C52D8 - .pool -_081C52D4: - bl sub_81C6E98 -_081C52D8: - ldr r0, =gUnknown_0203CF2C - ldr r1, [r0] -_081C52DC: - ldr r0, =0x00000984 - adds r1, r0 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _081C5308 - .pool -_081C52F0: - bl sub_8122328 - ldr r0, [r4] - ldr r1, =0x00000984 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - movs r0, 0x1 - b _081C530A - .pool -_081C5308: - movs r0, 0 -_081C530A: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81C5238 - - thumb_func_start sub_81C5314 -sub_81C5314: @ 81C5314 - push {r4-r7,lr} - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r1, =0x00000ca9 - adds r0, r2, r1 - ldrb r1, [r0] - lsls r1, 30 - lsrs r1, 30 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - ldr r3, =0x00000e2c - adds r0, r3 - adds r7, r2, r0 - movs r6, 0 - ldr r1, =gUnknown_0203CF2C - ldr r0, [r1] - ldr r4, =0x00000821 - adds r0, r4 - ldrb r0, [r0] - subs r0, 0x1 - cmp r6, r0 - bge _081C5382 - adds r5, r1, 0 -_081C5344: - lsls r1, r6, 1 - adds r4, r1, r6 - lsls r4, 3 - ldr r0, =0x0000087c - adds r4, r0 - ldr r0, [r5] - adds r0, r4 - adds r1, r7 - ldrh r1, [r1] - bl sub_81C540C - ldr r1, [r5] - lsls r2, r6, 3 - ldr r3, =0x00000824 - adds r0, r1, r3 - adds r0, r2 - adds r4, r1, r4 - str r4, [r0] - ldr r4, =0x00000828 - adds r0, r1, r4 - adds r0, r2 - str r6, [r0] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, =0x00000821 - adds r1, r0 - ldrb r0, [r1] - subs r0, 0x1 - cmp r6, r0 - blt _081C5344 -_081C5382: - ldr r5, =gUnknown_0203CF2C - lsls r4, r6, 1 - adds r4, r6 - lsls r4, 3 - ldr r1, =0x0000087c - adds r4, r1 - ldr r0, [r5] - adds r0, r4 - ldr r1, =gText_CloseBag - bl StringCopy - ldr r1, [r5] - lsls r2, r6, 3 - ldr r3, =0x00000824 - adds r0, r1, r3 - adds r0, r2 - adds r4, r1, r4 - str r4, [r0] - ldr r4, =0x00000828 - adds r1, r4 - adds r1, r2 - movs r0, 0x2 - negs r0, r0 - str r0, [r1] - ldr r2, =gUnknown_03006310 - adds r1, r2, 0 - ldr r0, =gUnknown_0861F2C0 - ldm r0!, {r4,r6,r7} - stm r1!, {r4,r6,r7} - ldm r0!, {r4,r6,r7} - stm r1!, {r4,r6,r7} - ldr r1, [r5] - ldr r6, =0x00000821 - adds r0, r1, r6 - ldrb r0, [r0] - strh r0, [r2, 0xC] - adds r3, r1, r3 - str r3, [r2] - ldr r7, =0x00000822 - adds r1, r7 - ldrb r0, [r1] - strh r0, [r2, 0xE] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C5314 - - thumb_func_start sub_81C540C -sub_81C540C: @ 81C540C - push {r4,r5,lr} - adds r5, r0, 0 - lsls r1, 16 - lsrs r4, r1, 16 - adds r0, r4, 0 - bl ItemId_GetPocket - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bne _081C5450 - ldr r0, =gStringVar1 - adds r1, r4, 0 - subs r1, 0x84 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - ldr r1, =gStringVar2 - adds r0, r4, 0 - bl CopyItemName - ldr r1, =gUnknown_085E9210 - adds r0, r5, 0 - bl StringExpandPlaceholders - b _081C5458 - .pool -_081C5450: - adds r0, r4, 0 - adds r1, r5, 0 - bl CopyItemName -_081C5458: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81C540C - - thumb_func_start sub_81C5460 -sub_81C5460: @ 81C5460 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x1 - beq _081C5476 - movs r0, 0x5 - bl PlaySE - bl sub_81C6F20 -_081C5476: - ldr r5, =gUnknown_0203CF2C - ldr r1, [r5] - ldr r2, =0x00000814 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0xFF - bne _081C5504 - adds r2, 0x1 - adds r0, r1, r2 - ldrb r1, [r0] - movs r0, 0x1 - eors r0, r1 - bl sub_81C6FF8 - movs r0, 0x2 - negs r0, r0 - cmp r4, r0 - beq _081C54E0 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - lsls r3, r4, 1 - ldr r1, =0x00000ca9 - adds r0, r2, r1 - ldrb r1, [r0] - lsls r1, 30 - lsrs r1, 30 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r3, r0 - ldr r0, =0x00000e2c - adds r2, r0 - adds r2, r3 - ldrh r0, [r2] - ldr r1, [r5] - ldr r2, =0x00000815 - adds r1, r2 - ldrb r1, [r1] - bl sub_81C6F90 - b _081C54EE - .pool -_081C54E0: - ldr r0, =0x0000ffff - ldr r1, [r5] - ldr r2, =0x00000815 - adds r1, r2 - ldrb r1, [r1] - bl sub_81C6F90 -_081C54EE: - ldr r0, =gUnknown_0203CF2C - ldr r1, [r0] - ldr r0, =0x00000815 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x1 - eors r0, r2 - strb r0, [r1] - adds r0, r4, 0 - bl sub_81C55D8 -_081C5504: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C5460 - - thumb_func_start sub_81C5518 -sub_81C5518: @ 81C5518 - push {r4-r6,lr} - sub sp, 0x10 - adds r4, r1, 0 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r2, 24 - lsrs r5, r2, 24 - movs r0, 0x2 - negs r0, r0 - cmp r4, r0 - beq _081C55B8 - ldr r0, =gUnknown_0203CF2C - ldr r0, [r0] - ldr r1, =0x00000814 - adds r0, r1 - ldrb r1, [r0] - cmp r1, 0xFF - beq _081C5560 - lsls r0, r4, 24 - lsrs r0, 24 - cmp r1, r0 - bne _081C5558 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_81C5AB8 - b _081C5560 - .pool -_081C5558: - adds r0, r5, 0 - movs r1, 0xFF - bl sub_81C5AB8 -_081C5560: - ldr r0, =gStringVar1 - ldr r1, =gSaveBlock2Ptr - ldr r3, [r1] - ldr r2, =0x00000ca9 - adds r1, r3, r2 - ldrb r2, [r1] - lsls r2, 30 - lsrs r2, 30 - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 1 - adds r1, r4, r1 - ldr r2, =0x00000e54 - adds r3, r2 - adds r3, r1 - ldrb r1, [r3] - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gText_xVar1 - adds r0, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x7 - adds r1, r4, 0 - movs r2, 0x77 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - movs r1, 0 - str r1, [sp] - str r1, [sp, 0x4] - movs r0, 0xFF - str r0, [sp, 0x8] - str r1, [sp, 0xC] - adds r0, r6, 0 - adds r1, r4, 0 - adds r3, r5, 0 - bl sub_81C6C94 -_081C55B8: - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C5518 - - thumb_func_start sub_81C55D8 -sub_81C55D8: @ 81C55D8 - push {r4,lr} - sub sp, 0x10 - adds r3, r0, 0 - movs r0, 0x2 - negs r0, r0 - cmp r3, r0 - beq _081C561C - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - lsls r3, 1 - ldr r1, =0x00000ca9 - adds r0, r2, r1 - ldrb r1, [r0] - lsls r1, 30 - lsrs r1, 30 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r3, r0 - ldr r0, =0x00000e2c - adds r2, r0 - adds r2, r3 - ldrh r0, [r2] - bl ItemId_GetDescription - adds r4, r0, 0 - b _081C5638 - .pool -_081C561C: - ldr r0, =gStringVar1 - ldr r2, =gUnknown_085E91B0 - ldr r1, =gUnknown_0203CF30 - ldrb r1, [r1, 0x4] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl StringCopy - ldr r4, =gStringVar4 - ldr r1, =gText_ReturnToVar1 - adds r0, r4, 0 - bl StringExpandPlaceholders -_081C5638: - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r1, 0 - str r1, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - str r1, [sp, 0x8] - str r1, [sp, 0xC] - adds r1, r4, 0 - movs r2, 0x3 - movs r3, 0 - bl sub_81C6C3C - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C55D8 - - thumb_func_start sub_81C5674 -sub_81C5674: @ 81C5674 - push {r4,lr} - sub sp, 0x10 - ldr r4, =gUnknown_0203CF2C - ldr r1, [r4] - ldr r2, =0x00000816 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0xFF - bne _081C56B4 - adds r2, 0xB - adds r0, r1, r2 - ldrb r0, [r0] - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - subs r0, r1 - str r0, [sp] - ldr r0, =0x00000b5e - str r0, [sp, 0x4] - str r0, [sp, 0x8] - ldr r0, =gUnknown_0203CF38 - str r0, [sp, 0xC] - movs r0, 0x2 - movs r1, 0xAC - movs r2, 0xC - movs r3, 0x94 - bl AddScrollIndicatorArrowPairParametrized - ldr r1, [r4] - ldr r2, =0x00000816 - adds r1, r2 - strb r0, [r1] -_081C56B4: - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C5674 - - thumb_func_start sub_81C56CC -sub_81C56CC: @ 81C56CC - push {r4,lr} - ldr r4, =gUnknown_0203CF2C - ldr r0, [r4] - ldr r2, =0x00000816 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0xFF - beq _081C56EA - bl RemoveScrollIndicatorArrowPair - ldr r0, [r4] - ldr r1, =0x00000816 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] -_081C56EA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C56CC - - thumb_func_start sub_81C56F8 -sub_81C56F8: @ 81C56F8 - push {r4,lr} - ldr r0, =sub_81C5BC8 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - ldr r0, =gUnknown_03006310 - ldr r2, =gUnknown_0203CF30 - ldrh r1, [r2, 0x8] - ldrh r2, [r2, 0x6] - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C56F8 - - thumb_func_start sub_81C5738 -sub_81C5738: @ 81C5738 - push {r4-r6,lr} - mov r6, r8 - push {r6} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gSaveBlock2Ptr - ldr r6, [r2] - ldr r3, =0x00000ca9 - adds r2, r6, r3 - ldrb r3, [r2] - lsls r3, 30 - lsrs r2, r3, 30 - lsls r4, r2, 2 - adds r4, r2 - lsls r4, 2 - ldr r2, =0x00000e2c - adds r4, r2 - adds r4, r6, r4 - lsrs r3, 30 - lsls r2, r3, 2 - adds r2, r3 - lsls r2, 1 - ldr r3, =0x00000e54 - adds r2, r3 - adds r6, r2 - lsls r5, r0, 1 - adds r5, r4 - ldrh r2, [r5] - mov r8, r2 - lsls r2, r1, 1 - adds r2, r4 - ldrh r3, [r2] - strh r3, [r5] - mov r3, r8 - strh r3, [r2] - adds r0, r6, r0 - ldrb r2, [r0] - adds r6, r1 - ldrb r1, [r6] - strb r1, [r0] - strb r2, [r6] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C5738 - - thumb_func_start sub_81C57A8 -sub_81C57A8: @ 81C57A8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r4, r0, 24 - adds r7, r4, 0 - lsls r1, 24 - lsrs r5, r1, 24 - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r1, =0x00000ca9 - adds r0, r3, r1 - ldrb r1, [r0] - lsls r1, 30 - lsrs r2, r1, 30 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x00000e2c - adds r0, r2 - adds r6, r3, r0 - lsrs r1, 30 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 1 - ldr r1, =0x00000e54 - adds r0, r1 - adds r3, r0 - cmp r4, r5 - beq _081C5862 - lsls r0, r4, 1 - adds r0, r6 - ldrh r0, [r0] - mov r12, r0 - adds r0, r3, r4 - ldrb r0, [r0] - mov r8, r0 - cmp r5, r4 - bls _081C5830 - subs r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r2, r4, 16 - cmp r4, r5 - bge _081C5854 -_081C5802: - asrs r2, 16 - lsls r0, r2, 1 - adds r0, r6 - ldrh r1, [r0, 0x2] - strh r1, [r0] - adds r1, r3, r2 - ldrb r0, [r1, 0x1] - strb r0, [r1] - adds r2, 0x1 - lsls r2, 16 - asrs r0, r2, 16 - cmp r0, r5 - blt _081C5802 - b _081C5854 - .pool -_081C5830: - lsls r2, r7, 16 - cmp r7, r5 - ble _081C5854 -_081C5836: - asrs r2, 16 - lsls r1, r2, 1 - adds r1, r6 - subs r0, r1, 0x2 - ldrh r0, [r0] - strh r0, [r1] - adds r1, r3, r2 - subs r0, r1, 0x1 - ldrb r0, [r0] - strb r0, [r1] - subs r2, 0x1 - lsls r2, 16 - asrs r0, r2, 16 - cmp r0, r5 - bgt _081C5836 -_081C5854: - lsls r0, r5, 1 - adds r0, r6 - mov r2, r12 - strh r2, [r0] - adds r0, r3, r5 - mov r1, r8 - strb r1, [r0] -_081C5862: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81C57A8 - - thumb_func_start sub_81C586C -sub_81C586C: @ 81C586C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r1, =0x00000ca9 - adds r0, r3, r1 - ldrb r1, [r0] - lsls r1, 30 - lsrs r2, r1, 30 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x00000e2c - adds r0, r2 - adds r0, r3 - mov r9, r0 - lsrs r1, 30 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 1 - ldr r4, =0x00000e54 - adds r0, r4 - adds r3, r0 - mov r8, r3 - movs r5, 0 - movs r3, 0 -_081C58A4: - lsls r0, r5, 1 - mov r1, r9 - adds r2, r0, r1 - ldrh r0, [r2] - mov r4, r8 - adds r1, r4, r5 - cmp r0, 0 - beq _081C58BA - ldrb r0, [r1] - cmp r0, 0 - bne _081C58BE -_081C58BA: - strh r3, [r2] - strb r3, [r1] -_081C58BE: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x9 - bls _081C58A4 - movs r5, 0 -_081C58CA: - adds r1, r5, 0x1 - lsls r0, r1, 24 - lsrs r4, r0, 24 - adds r7, r1, 0 - cmp r4, 0x9 - bhi _081C58FE - lsls r0, r5, 1 - mov r1, r9 - adds r6, r0, r1 -_081C58DC: - ldrh r0, [r6] - cmp r0, 0 - beq _081C58EC - mov r2, r8 - adds r0, r2, r5 - ldrb r0, [r0] - cmp r0, 0 - bne _081C58F4 -_081C58EC: - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_81C5738 -_081C58F4: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x9 - bls _081C58DC -_081C58FE: - lsls r0, r7, 24 - lsrs r5, r0, 24 - cmp r5, 0x8 - bls _081C58CA - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C586C - - thumb_func_start sub_81C5924 -sub_81C5924: @ 81C5924 - push {r4-r6,lr} - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r1, =0x00000ca9 - adds r0, r2, r1 - ldrb r1, [r0] - lsls r1, 30 - lsrs r1, 30 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x00000e2c - adds r0, r1 - adds r5, r2, r0 - bl sub_81C586C - ldr r3, =gUnknown_0203CF2C - ldr r0, [r3] - ldr r2, =0x00000821 - adds r0, r2 - movs r1, 0 - strb r1, [r0] - movs r4, 0 - adds r6, r3, 0 -_081C5954: - lsls r0, r4, 1 - adds r0, r5 - ldrh r0, [r0] - ldr r3, =gUnknown_0203CF2C - cmp r0, 0 - beq _081C596A - ldr r1, [r6] - adds r1, r2 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_081C596A: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x9 - bls _081C5954 - ldr r0, [r3] - ldr r2, =0x00000821 - adds r0, r2 - ldrb r1, [r0] - adds r1, 0x1 - strb r1, [r0] - ldr r0, [r3] - adds r2, r0, r2 - ldrb r2, [r2] - cmp r2, 0x8 - bls _081C59AC - ldr r2, =0x00000822 - adds r1, r0, r2 - movs r0, 0x8 - strb r0, [r1] - b _081C59B2 - .pool -_081C59AC: - ldr r1, =0x00000822 - adds r0, r1 - strb r2, [r0] -_081C59B2: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C5924 - - thumb_func_start sub_81C59BC -sub_81C59BC: @ 81C59BC - push {r4,r5,lr} - ldr r0, =gUnknown_0203CF30 - ldrh r1, [r0, 0x8] - adds r3, r0, 0 - ldr r4, =gUnknown_0203CF2C - cmp r1, 0 - beq _081C59E4 - ldrh r0, [r3, 0x8] - ldr r1, [r4] - ldr r5, =0x00000822 - adds r2, r1, r5 - ldrb r2, [r2] - adds r0, r2 - subs r5, 0x1 - adds r1, r5 - ldrb r1, [r1] - cmp r0, r1 - ble _081C59E4 - subs r0, r1, r2 - strh r0, [r3, 0x8] -_081C59E4: - adds r2, r3, 0 - ldrh r1, [r2, 0x8] - ldrh r0, [r2, 0x6] - adds r1, r0 - ldr r0, [r4] - ldr r4, =0x00000821 - adds r0, r4 - ldrb r0, [r0] - cmp r1, r0 - blt _081C5A18 - adds r1, r0, 0 - cmp r1, 0 - bne _081C5A14 - strh r1, [r2, 0x6] - b _081C5A18 - .pool -_081C5A14: - subs r0, 0x1 - strh r0, [r3, 0x6] -_081C5A18: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81C59BC - - thumb_func_start sub_81C5A20 -sub_81C5A20: @ 81C5A20 - push {r4-r7,lr} - ldr r0, =gUnknown_0203CF30 - ldrh r1, [r0, 0x6] - adds r5, r0, 0 - cmp r1, 0x4 - bls _081C5A80 - movs r4, 0 - ldrh r0, [r5, 0x6] - subs r0, 0x4 - cmp r4, r0 - bgt _081C5A80 - ldrh r2, [r5, 0x8] - ldr r6, =gUnknown_0203CF2C - ldr r0, [r6] - ldr r3, =0x00000822 - adds r1, r0, r3 - ldrb r1, [r1] - adds r2, r1 - ldr r7, =0x00000821 - adds r0, r7 - ldrb r0, [r0] - cmp r2, r0 - beq _081C5A80 - adds r3, r5, 0 -_081C5A50: - ldrh r0, [r3, 0x6] - subs r0, 0x1 - strh r0, [r3, 0x6] - ldrh r0, [r3, 0x8] - adds r0, 0x1 - strh r0, [r3, 0x8] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - ldrh r0, [r3, 0x6] - subs r0, 0x4 - cmp r4, r0 - bgt _081C5A80 - ldrh r2, [r5, 0x8] - ldr r1, [r6] - ldr r7, =0x00000822 - adds r0, r1, r7 - ldrb r0, [r0] - adds r2, r0 - ldr r0, =0x00000821 - adds r1, r0 - ldrb r1, [r1] - cmp r2, r1 - bne _081C5A50 -_081C5A80: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C5A20 - - thumb_func_start sub_81C5A98 -sub_81C5A98: @ 81C5A98 - push {r4,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsrs r4, 24 - bl ListMenuGetYCoordForPrintingArrowCursor - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - bl sub_81C5AB8 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C5A98 - - thumb_func_start sub_81C5AB8 -sub_81C5AB8: @ 81C5AB8 - push {r4,r5,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r2, r1, 24 - cmp r2, 0xFF - bne _081C5AF4 - movs r0, 0x1 - movs r1, 0 - bl GetMenuCursorDimensionByFont - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - movs r1, 0x1 - bl GetMenuCursorDimensionByFont - lsls r0, 24 - lsrs r0, 24 - str r4, [sp] - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - adds r3, r5, 0 - bl FillWindowPixelRect - b _081C5B08 -_081C5AF4: - ldr r1, =gText_SelectorArrow2 - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r2, [sp, 0xC] - movs r2, 0 - adds r3, r5, 0 - bl sub_81C6C3C -_081C5B08: - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C5AB8 - - thumb_func_start sub_81C5B14 -sub_81C5B14: @ 81C5B14 - 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_81C5B4C - str r1, [r0] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C5B14 - - thumb_func_start sub_81C5B4C -sub_81C5B4C: @ 81C5B4C - 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 r2, r0, r1 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081C5BBC - ldrb r0, [r2] - ldr r4, =gUnknown_0203CF38 - subs r2, r4, 0x2 - adds r1, r4, 0 - bl sub_81AE6C8 - ldr r0, =gUnknown_0203CF2C - ldr r0, [r0] - ldr r0, [r0] - cmp r0, 0 - beq _081C5B94 - bl SetMainCallback2 - b _081C5B9E - .pool -_081C5B94: - adds r0, r4, 0 - subs r0, 0x8 - ldr r0, [r0] - bl SetMainCallback2 -_081C5B9E: - bl sub_81C56CC - bl ResetSpriteData - bl FreeAllSpritePalettes - bl FreeAllWindowBuffers - ldr r0, =gUnknown_0203CF2C - ldr r0, [r0] - bl Free - adds r0, r5, 0 - bl DestroyTask -_081C5BBC: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C5B4C - - thumb_func_start sub_81C5BC8 -sub_81C5BC8: @ 81C5BC8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r7, r0, r1 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C5BEA - b _081C5D16 -_081C5BEA: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081C5BF8 - b _081C5D16 -_081C5BF8: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x4 - ands r0, r1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - beq _081C5C5C - ldr r4, =gUnknown_0203CF30 - ldrb r0, [r4, 0x4] - cmp r0, 0x2 - bne _081C5C12 - b _081C5D16 -_081C5C12: - ldrb r0, [r7] - adds r1, r4, 0 - adds r1, 0x8 - adds r2, r4, 0x6 - bl get_coro_args_x18_x1A - ldrh r1, [r4, 0x8] - ldrh r0, [r4, 0x6] - adds r1, r0 - ldr r0, =gUnknown_0203CF2C - ldr r0, [r0] - ldr r2, =0x00000821 - adds r0, r2 - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - beq _081C5D16 - movs r0, 0x5 - bl PlaySE - adds r0, r5, 0 - bl sub_81C67CC - b _081C5D16 - .pool -_081C5C5C: - ldrb r0, [r7] - bl ListMenuHandleInput - adds r6, r0, 0 - ldrb r0, [r7] - ldr r1, =gUnknown_0203CF38 - mov r8, r1 - mov r2, r8 - subs r2, 0x2 - bl get_coro_args_x18_x1A - movs r0, 0x2 - negs r0, r0 - cmp r6, r0 - beq _081C5C88 - adds r0, 0x1 - cmp r6, r0 - bne _081C5CA0 - b _081C5D16 - .pool -_081C5C88: - movs r0, 0x5 - bl PlaySE - ldr r0, =gScriptItemId - strh r4, [r0] - adds r0, r5, 0 - bl sub_81C5B14 - b _081C5D16 - .pool -_081C5CA0: - movs r0, 0x5 - bl PlaySE - ldr r2, =gScriptItemId - mov r12, r2 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - lsls r3, r6, 1 - ldr r0, =0x00000ca9 - adds r4, r2, r0 - ldrb r1, [r4] - lsls r1, 30 - lsrs r1, 30 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r3, r0 - ldr r1, =0x00000e2c - adds r0, r2, r1 - adds r0, r3 - ldrh r0, [r0] - mov r1, r12 - strh r0, [r1] - strh r6, [r7, 0x2] - ldrb r1, [r4] - lsls r1, 30 - lsrs r1, 30 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 1 - adds r0, r6, r0 - ldr r1, =0x00000e54 - adds r2, r1 - adds r2, r0 - ldrb r0, [r2] - strh r0, [r7, 0x4] - mov r0, r8 - subs r0, 0x8 - ldrb r0, [r0, 0x4] - cmp r0, 0x2 - bne _081C5D10 - adds r0, r5, 0 - bl sub_81C674C - b _081C5D16 - .pool -_081C5D10: - adds r0, r5, 0 - bl sub_81C5D20 -_081C5D16: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81C5BC8 - - thumb_func_start sub_81C5D20 -sub_81C5D20: @ 81C5D20 - push {r4,r5,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - bl sub_81C56CC - ldrb r0, [r4] - movs r1, 0x1 - bl sub_81C5A98 - ldr r0, =gUnknown_0203CF30 - ldrb r4, [r0, 0x4] - cmp r4, 0x1 - beq _081C5D74 - cmp r4, 0x3 - beq _081C5DC4 - ldr r0, =gUnknown_0203CF2C - ldr r1, [r0] - ldr r0, =0x00000818 - adds r2, r1, r0 - ldr r0, =gUnknown_0861F308 - str r0, [r2] - movs r0, 0x82 - lsls r0, 4 - adds r1, r0 - movs r0, 0x4 - b _081C5DD8 - .pool -_081C5D74: - ldr r0, =gScriptItemId - ldrh r0, [r0] - bl ItemId_GetBattleUsage - lsls r0, 24 - cmp r0, 0 - beq _081C5DA0 - ldr r0, =gUnknown_0203CF2C - ldr r1, [r0] - ldr r0, =0x00000818 - adds r2, r1, r0 - ldr r0, =gUnknown_0861F30E - b _081C5DCE - .pool -_081C5DA0: - ldr r0, =gUnknown_0203CF2C - ldr r0, [r0] - ldr r1, =0x00000818 - adds r2, r0, r1 - ldr r1, =gUnknown_0861F310 - str r1, [r2] - movs r1, 0x82 - lsls r1, 4 - adds r0, r1 - strb r4, [r0] - b _081C5DDA - .pool -_081C5DC4: - ldr r0, =gUnknown_0203CF2C - ldr r1, [r0] - ldr r0, =0x00000818 - adds r2, r1, r0 - ldr r0, =gUnknown_0861F30C -_081C5DCE: - str r0, [r2] - movs r0, 0x82 - lsls r0, 4 - adds r1, r0 - movs r0, 0x2 -_081C5DD8: - strb r0, [r1] -_081C5DDA: - ldr r0, =gScriptItemId - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gText_Var1IsSelected - adds r0, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r1, 0 - str r1, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - str r1, [sp, 0x8] - str r1, [sp, 0xC] - adds r1, r4, 0 - movs r2, 0x3 - movs r3, 0 - bl sub_81C6C3C - ldr r0, =gUnknown_0203CF2C - ldr r0, [r0] - movs r1, 0x82 - lsls r1, 4 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _081C5E3C - movs r0, 0 - b _081C5E42 - .pool -_081C5E3C: - cmp r0, 0x2 - bne _081C5E50 - movs r0, 0x1 -_081C5E42: - bl sub_81C6D24 - lsls r0, 24 - lsrs r0, 24 - bl sub_81C5EAC - b _081C5E62 -_081C5E50: - movs r0, 0x2 - bl sub_81C6D24 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - movs r2, 0x2 - bl sub_81C5F08 -_081C5E62: - ldr r0, =gUnknown_0203CF2C - ldr r0, [r0] - movs r1, 0x82 - lsls r1, 4 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x4 - bne _081C5E8C - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81C5FE4 - b _081C5E98 - .pool -_081C5E8C: - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81C5F68 -_081C5E98: - str r0, [r1] - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C5D20 - - thumb_func_start sub_81C5EAC -sub_81C5EAC: @ 81C5EAC - push {r4-r6,lr} - sub sp, 0x14 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - str r0, [sp] - movs r0, 0x10 - str r0, [sp, 0x4] - ldr r6, =gUnknown_0203CF2C - ldr r1, [r6] - movs r5, 0x82 - lsls r5, 4 - adds r0, r1, r5 - ldrb r0, [r0] - str r0, [sp, 0x8] - ldr r0, =gUnknown_0861F2D8 - str r0, [sp, 0xC] - ldr r0, =0x00000818 - adds r1, r0 - ldr r0, [r1] - str r0, [sp, 0x10] - adds r0, r4, 0 - movs r1, 0x7 - movs r2, 0x8 - movs r3, 0x1 - bl AddItemMenuActionTextPrinters - ldr r0, [r6] - adds r0, r5 - ldrb r1, [r0] - adds r0, r4, 0 - movs r2, 0 - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C5EAC - - thumb_func_start sub_81C5F08 -sub_81C5F08: @ 81C5F08 - push {r4-r6,lr} - sub sp, 0x14 - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - movs r0, 0x38 - str r0, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - ldr r0, =gUnknown_0861F2D8 - str r0, [sp, 0xC] - ldr r0, =gUnknown_0203CF2C - ldr r0, [r0] - ldr r1, =0x00000818 - adds r0, r1 - ldr r0, [r0] - str r0, [sp, 0x10] - adds r0, r4, 0 - movs r1, 0x7 - movs r2, 0x8 - movs r3, 0x1 - bl sub_8198DBC - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r1, 0x38 - adds r2, r5, 0 - adds r3, r6, 0 - bl sub_8199944 - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C5F08 - - thumb_func_start sub_81C5F68 -sub_81C5F68: @ 81C5F68 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C5FD0 - bl ProcessMenuInputNoWrapAround - lsls r0, 24 - asrs r4, r0, 24 - movs r0, 0x2 - negs r0, r0 - cmp r4, r0 - beq _081C5FD0 - adds r0, 0x1 - cmp r4, r0 - bne _081C5FA8 - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0861F2D8 - ldr r1, [r0, 0x1C] - adds r0, r5, 0 - bl _call_via_r1 - b _081C5FD0 - .pool -_081C5FA8: - movs r0, 0x5 - bl PlaySE - ldr r1, =gUnknown_0861F2D8 - ldr r0, =gUnknown_0203CF2C - ldr r0, [r0] - ldr r2, =0x00000818 - adds r0, r2 - ldr r0, [r0] - adds r0, r4 - ldrb r0, [r0] - lsls r0, 3 - adds r1, 0x4 - adds r0, r1 - ldr r1, [r0] - cmp r1, 0 - beq _081C5FD0 - adds r0, r6, 0 - bl _call_via_r1 -_081C5FD0: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C5F68 - - thumb_func_start sub_81C5FE4 -sub_81C5FE4: @ 81C5FE4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C5FF8 - b _081C6160 -_081C5FF8: - bl GetMenuCursorPos - lsls r0, 24 - lsrs r4, r0, 24 - ldr r5, =gMain - ldrh r1, [r5, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081C6040 - lsls r0, r4, 24 - asrs r0, 24 - cmp r0, 0 - bgt _081C6016 - b _081C6160 -_081C6016: - subs r0, 0x2 - lsls r0, 24 - asrs r0, 24 - bl sub_81C616C - lsls r0, 24 - cmp r0, 0 - bne _081C6028 - b _081C6160 -_081C6028: - movs r0, 0x5 - bl PlaySE - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - bl sub_8199134 - b _081C6160 - .pool -_081C6040: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081C6084 - lsls r0, r4, 24 - asrs r1, r0, 24 - ldr r0, =gUnknown_0203CF2C - ldr r0, [r0] - movs r2, 0x82 - lsls r2, 4 - adds r0, r2 - ldrb r0, [r0] - subs r0, 0x2 - cmp r1, r0 - blt _081C6060 - b _081C6160 -_081C6060: - adds r0, r1, 0x2 - lsls r0, 24 - asrs r0, 24 - bl sub_81C616C - lsls r0, 24 - cmp r0, 0 - beq _081C6160 - movs r0, 0x5 - bl PlaySE - movs r0, 0 - movs r1, 0x1 - bl sub_8199134 - b _081C6160 - .pool -_081C6084: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _081C6098 - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C60C0 -_081C6098: - lsls r0, r4, 24 - asrs r1, r0, 24 - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081C6160 - subs r0, r1, 0x1 - lsls r0, 24 - asrs r0, 24 - bl sub_81C616C - lsls r0, 24 - cmp r0, 0 - beq _081C6160 - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - negs r0, r0 - b _081C60FA -_081C60C0: - ldrh r1, [r5, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _081C60D6 - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _081C6102 -_081C60D6: - lsls r0, r4, 24 - asrs r1, r0, 24 - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081C6160 - adds r0, r1, 0x1 - lsls r0, 24 - asrs r0, 24 - bl sub_81C616C - lsls r0, 24 - cmp r0, 0 - beq _081C6160 - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 -_081C60FA: - movs r1, 0 - bl sub_8199134 - b _081C6160 -_081C6102: - ldrh r1, [r5, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081C6148 - movs r0, 0x5 - bl PlaySE - ldr r2, =gUnknown_0861F2D8 - ldr r0, =gUnknown_0203CF2C - ldr r0, [r0] - lsls r1, r4, 24 - asrs r1, 24 - ldr r3, =0x00000818 - adds r0, r3 - ldr r0, [r0] - adds r0, r1 - ldrb r0, [r0] - lsls r0, 3 - adds r2, 0x4 - adds r0, r2 - ldr r1, [r0] - cmp r1, 0 - beq _081C6160 - adds r0, r6, 0 - bl _call_via_r1 - b _081C6160 - .pool -_081C6148: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081C6160 - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0861F2D8 - ldr r1, [r0, 0x1C] - adds r0, r6, 0 - bl _call_via_r1 -_081C6160: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C5FE4 - - thumb_func_start sub_81C616C -sub_81C616C: @ 81C616C - push {lr} - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - blt _081C61A0 - ldr r0, =gUnknown_0203CF2C - ldr r2, [r0] - movs r3, 0x82 - lsls r3, 4 - adds r0, r2, r3 - ldrb r0, [r0] - cmp r1, r0 - bgt _081C61A0 - ldr r3, =0x00000818 - adds r0, r2, r3 - ldr r0, [r0] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x5 - beq _081C61A0 - movs r0, 0x1 - b _081C61A2 - .pool -_081C61A0: - movs r0, 0 -_081C61A2: - pop {r1} - bx r1 - thumb_func_end sub_81C616C - - thumb_func_start sub_81C61A8 -sub_81C61A8: @ 81C61A8 - push {lr} - ldr r0, =gUnknown_0203CF2C - ldr r0, [r0] - movs r1, 0x82 - lsls r1, 4 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _081C61C8 - movs r0, 0 - bl sub_81C6D6C - b _081C61DA - .pool -_081C61C8: - cmp r0, 0x2 - bne _081C61D4 - movs r0, 0x1 - bl sub_81C6D6C - b _081C61DA -_081C61D4: - movs r0, 0x2 - bl sub_81C6D6C -_081C61DA: - pop {r0} - bx r0 - thumb_func_end sub_81C61A8 - - thumb_func_start sub_81C61E0 -sub_81C61E0: @ 81C61E0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =gScriptItemId - ldrh r0, [r4] - bl ItemId_GetPocket - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x5 - beq _081C620C - cmp r0, 0x2 - beq _081C620C - cmp r0, 0x3 - beq _081C620C - ldrh r0, [r4] - bl itemid_is_mail - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C6228 -_081C620C: - bl sub_81C61A8 - ldr r1, =gText_DadsAdvice - ldr r2, =sub_81C6714 - adds r0, r5, 0 - bl DisplayItemMessageInBattlePyramid - b _081C6252 - .pool -_081C6228: - ldrh r0, [r4] - bl ItemId_GetFieldFunc - cmp r0, 0 - beq _081C6252 - bl sub_81C61A8 - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldrh r0, [r4] - bl ItemId_GetFieldFunc - adds r1, r0, 0 - adds r0, r5, 0 - bl _call_via_r1 -_081C6252: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81C61E0 - - thumb_func_start sub_81C6258 -sub_81C6258: @ 81C6258 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - bl sub_81C61A8 - movs r1, 0x2 - ldrsh r0, [r4, r1] - bl sub_81C55D8 - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - ldrb r0, [r4] - movs r1, 0 - bl sub_81C5A98 - adds r0, r5, 0 - bl sub_81C629C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C6258 - - thumb_func_start sub_81C629C -sub_81C629C: @ 81C629C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_81C5674 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81C5BC8 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C629C - - thumb_func_start sub_81C62C4 -sub_81C62C4: @ 81C62C4 - push {r4-r7,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r6, r0, 3 - ldr r7, =gTasks + 0x8 - adds r4, r6, r7 - bl sub_81C61A8 - movs r0, 0x1 - strh r0, [r4, 0x10] - movs r1, 0x4 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - bne _081C62F4 - adds r0, r5, 0 - bl sub_81C6350 - b _081C6334 - .pool -_081C62F4: - ldr r0, =gScriptItemId - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gText_TossHowManyVar1s - adds r0, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r1, 0 - str r1, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - str r1, [sp, 0x8] - str r1, [sp, 0xC] - adds r1, r4, 0 - movs r2, 0x3 - movs r3, 0 - bl sub_81C6C3C - bl sub_81C6404 - adds r0, r7, 0 - subs r0, 0x8 - adds r0, r6, r0 - ldr r1, =sub_81C64B4 - str r1, [r0] -_081C6334: - add sp, 0x10 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C62C4 - - thumb_func_start sub_81C6350 -sub_81C6350: @ 81C6350 - push {r4,r5,lr} - sub sp, 0x10 - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - ldr r0, =gScriptItemId - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r0, =gStringVar2 - movs r2, 0x10 - ldrsh r1, [r4, r2] - movs r2, 0 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gText_ConfirmTossItems - adds r0, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r1, 0 - str r1, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - str r1, [sp, 0x8] - str r1, [sp, 0xC] - adds r1, r4, 0 - movs r2, 0x3 - movs r3, 0 - bl sub_81C6C3C - ldr r1, =gUnknown_0861F314 - adds r0, r5, 0 - bl sub_81C6DAC - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C6350 - - thumb_func_start sub_81C63D0 -sub_81C63D0: @ 81C63D0 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - movs r1, 0x2 - ldrsh r0, [r4, r1] - bl sub_81C55D8 - ldrb r0, [r4] - movs r1, 0 - bl sub_81C5A98 - adds r0, r5, 0 - bl sub_81C629C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C63D0 - - thumb_func_start sub_81C6404 -sub_81C6404: @ 81C6404 - push {r4,lr} - sub sp, 0xC - ldr r0, =gStringVar1 - movs r1, 0x1 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gText_xVar1 - adds r0, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x3 - bl sub_81C6CEC - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x28 - bl GetStringCenterAlignXOffset - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x2 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - adds r2, r4, 0 - bl PrintTextOnWindow - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C6404 - - thumb_func_start sub_81C645C -sub_81C645C: @ 81C645C - push {r4,lr} - sub sp, 0xC - adds r1, r0, 0 - ldr r0, =gStringVar1 - lsls r1, 16 - asrs r1, 16 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gText_xVar1 - adds r0, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x28 - bl GetStringCenterAlignXOffset - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x2 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - adds r2, r4, 0 - bl PrintTextOnWindow - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C645C - - thumb_func_start sub_81C64B4 -sub_81C64B4: @ 81C64B4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - adds r0, r4, 0 - adds r0, 0x10 - ldrh r1, [r4, 0x4] - bl AdjustQuantityAccordingToDPadInput - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C64E8 - movs r1, 0x10 - ldrsh r0, [r4, r1] - bl sub_81C645C - b _081C6544 - .pool -_081C64E8: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081C651C - movs r0, 0x5 - bl PlaySE - movs r0, 0x3 - movs r1, 0 - bl sub_8198070 - movs r0, 0x3 - bl ClearWindowTilemap - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - adds r0, r5, 0 - bl sub_81C6350 - b _081C6544 - .pool -_081C651C: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081C6544 - movs r0, 0x5 - bl PlaySE - movs r0, 0x3 - movs r1, 0 - bl sub_8198070 - movs r0, 0x3 - bl ClearWindowTilemap - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - adds r0, r6, 0 - bl sub_81C63D0 -_081C6544: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81C64B4 - - thumb_func_start sub_81C654C -sub_81C654C: @ 81C654C - push {r4-r6,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r5, =gTasks + 0x8 - adds r6, r4, r5 - ldr r0, =gScriptItemId - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r0, =gStringVar2 - movs r2, 0x10 - ldrsh r1, [r6, r2] - movs r2, 0 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - ldr r6, =gStringVar4 - ldr r1, =gText_ThrewAwayVar2Var1s - adds r0, r6, 0 - bl StringExpandPlaceholders - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r1, 0 - str r1, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - str r1, [sp, 0x8] - str r1, [sp, 0xC] - adds r1, r6, 0 - movs r2, 0x3 - movs r3, 0 - bl sub_81C6C3C - subs r5, 0x8 - adds r4, r5 - ldr r0, =sub_81C65CC - str r0, [r4] - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C654C - - thumb_func_start sub_81C65CC -sub_81C65CC: @ 81C65CC - push {r4-r7,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 - ldr r6, =gUnknown_0203CF38 - subs r7, r6, 0x2 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _081C662E - movs r0, 0x5 - bl PlaySE - ldr r0, =gScriptItemId - ldrh r0, [r0] - ldrh r1, [r4, 0x10] - bl RemovePyramidBagItem - ldrb r0, [r4] - adds r1, r6, 0 - adds r2, r7, 0 - bl sub_81AE6C8 - bl sub_81C5924 - bl sub_81C59BC - bl sub_81C5314 - ldr r0, =gUnknown_03006310 - ldrh r1, [r6] - ldrh r2, [r7] - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - adds r0, r5, 0 - bl sub_81C629C -_081C662E: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C65CC - - thumb_func_start sub_81C6648 -sub_81C6648: @ 81C6648 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r6, r4, 0 - bl sub_81C61A8 - ldr r5, =gScriptItemId - ldrh r0, [r5] - bl itemid_is_mail - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C667C - ldr r1, =gText_CantWriteMail - ldr r2, =sub_81C66EC - adds r0, r4, 0 - bl DisplayItemMessageInBattlePyramid - b _081C66A6 - .pool -_081C667C: - ldrh r0, [r5] - bl itemid_is_unique - lsls r0, 24 - cmp r0, 0 - bne _081C66A0 - ldr r0, =gUnknown_0203CF2C - ldr r1, [r0] - ldr r0, =sub_81B7F60 - str r0, [r1] - adds r0, r4, 0 - bl sub_81C5B14 - b _081C66A6 - .pool -_081C66A0: - adds r0, r6, 0 - bl sub_81C66AC -_081C66A6: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81C6648 - - thumb_func_start sub_81C66AC -sub_81C66AC: @ 81C66AC - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gScriptItemId - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r5, =gStringVar4 - ldr r1, =gText_Var1CantBeHeld - adds r0, r5, 0 - bl StringExpandPlaceholders - ldr r2, =sub_81C66EC - adds r0, r4, 0 - adds r1, r5, 0 - bl DisplayItemMessageInBattlePyramid - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C66AC - - thumb_func_start sub_81C66EC -sub_81C66EC: @ 81C66EC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081C670A - movs r0, 0x5 - bl PlaySE - adds r0, r4, 0 - bl sub_81C6714 -_081C670A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C66EC - - thumb_func_start sub_81C6714 -sub_81C6714: @ 81C6714 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - bl sub_81C6E1C - movs r1, 0x2 - ldrsh r0, [r4, r1] - bl sub_81C55D8 - ldrb r0, [r4] - movs r1, 0 - bl sub_81C5A98 - adds r0, r5, 0 - bl sub_81C629C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C6714 - - thumb_func_start sub_81C674C -sub_81C674C: @ 81C674C - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r6, r4, 0 - ldr r5, =gScriptItemId - ldrh r0, [r5] - bl itemid_80BF6D8_mail_related - lsls r0, 24 - cmp r0, 0 - bne _081C677C - ldr r1, =gText_CantWriteMail - ldr r2, =sub_81C66EC - adds r0, r4, 0 - bl DisplayItemMessageInBattlePyramid - b _081C6796 - .pool -_081C677C: - ldrh r0, [r5] - bl itemid_is_unique - lsls r0, 24 - cmp r0, 0 - bne _081C6790 - adds r0, r4, 0 - bl sub_81C5B14 - b _081C6796 -_081C6790: - adds r0, r6, 0 - bl sub_81C66AC -_081C6796: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81C674C - - thumb_func_start sub_81C679C -sub_81C679C: @ 81C679C - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =gScriptItemId - ldrh r0, [r4] - bl ItemId_GetBattleFunc - cmp r0, 0 - beq _081C67C0 - bl sub_81C61A8 - ldrh r0, [r4] - bl ItemId_GetBattleFunc - adds r1, r0, 0 - adds r0, r5, 0 - bl _call_via_r1 -_081C67C0: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C679C - - thumb_func_start sub_81C67CC -sub_81C67CC: @ 81C67CC - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - mov r9, r0 - adds r5, r4, r0 - ldr r0, =gUnknown_0203CF30 - ldrh r1, [r0, 0x6] - ldrh r0, [r0, 0x8] - adds r1, r0 - strh r1, [r5, 0x2] - ldr r0, =gUnknown_0203CF2C - ldr r0, [r0] - ldr r2, =0x00000814 - adds r0, r2 - movs r2, 0 - mov r8, r2 - strb r1, [r0] - ldrb r0, [r5] - movs r1, 0x10 - movs r2, 0x1 - bl sub_81AF15C - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - movs r0, 0x2 - ldrsh r2, [r5, r0] - lsls r2, 1 - ldr r1, =0x00000ca9 - adds r0, r3, r1 - ldrb r1, [r0] - lsls r1, 30 - lsrs r1, 30 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, r0 - ldr r0, =0x00000e2c - adds r3, r0 - adds r3, r2 - ldrh r0, [r3] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r6, =gStringVar4 - ldr r1, =gText_MoveVar1Where - adds r0, r6, 0 - bl StringExpandPlaceholders - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - mov r1, r8 - str r1, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - str r1, [sp, 0x8] - str r1, [sp, 0xC] - adds r1, r6, 0 - movs r2, 0x3 - movs r3, 0 - bl sub_81C6C3C - ldrb r0, [r5] - movs r1, 0x1 - bl sub_81C5A98 - ldrb r0, [r5, 0x2] - bl sub_81C704C - movs r2, 0x8 - negs r2, r2 - add r9, r2 - add r4, r9 - ldr r0, =sub_81C68B0 - str r0, [r4] - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C67CC - - thumb_func_start sub_81C68B0 -sub_81C68B0: @ 81C68B0 - push {r4-r7,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 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C695C - ldr r7, =gMain - ldrh r1, [r7, 0x2E] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _081C68F8 - movs r0, 0x5 - bl PlaySE - ldrb r0, [r4] - ldr r1, =gUnknown_0203CF38 - subs r2, r1, 0x2 - bl get_coro_args_x18_x1A - b _081C6940 - .pool -_081C68F8: - ldrb r0, [r4] - bl ListMenuHandleInput - adds r6, r0, 0 - ldrb r0, [r4] - ldr r4, =gUnknown_0203CF38 - subs r2, r4, 0x2 - adds r1, r4, 0 - bl get_coro_args_x18_x1A - movs r0, 0 - bl sub_81C7028 - subs r4, 0x8 - ldrb r0, [r4, 0x6] - bl sub_81C704C - movs r0, 0x2 - negs r0, r0 - cmp r6, r0 - beq _081C6930 - adds r0, 0x1 - cmp r6, r0 - bne _081C6950 - b _081C695C - .pool -_081C6930: - movs r0, 0x5 - bl PlaySE - ldrh r1, [r7, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081C6948 -_081C6940: - adds r0, r5, 0 - bl sub_81C6964 - b _081C695C -_081C6948: - adds r0, r5, 0 - bl sub_81C6A14 - b _081C695C -_081C6950: - movs r0, 0x5 - bl PlaySE - adds r0, r5, 0 - bl sub_81C6964 -_081C695C: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81C68B0 - - thumb_func_start sub_81C6964 -sub_81C6964: @ 81C6964 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r5, r0, r1 - ldr r7, =gUnknown_0203CF38 - subs r0, r7, 0x2 - mov r8, r0 - ldrh r0, [r0] - ldrh r1, [r7] - adds r0, r1 - lsls r0, 16 - lsrs r4, r0, 16 - movs r3, 0x2 - ldrsh r1, [r5, r3] - cmp r1, r4 - beq _081C6996 - subs r0, r4, 0x1 - cmp r1, r0 - bne _081C69A8 -_081C6996: - adds r0, r6, 0 - bl sub_81C6A14 - b _081C69FC - .pool -_081C69A8: - ldrb r0, [r5, 0x2] - lsls r1, r4, 24 - lsrs r1, 24 - bl sub_81C57A8 - ldr r0, =gUnknown_0203CF2C - ldr r0, [r0] - ldr r1, =0x00000814 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - movs r0, 0x1 - bl sub_81C7028 - ldrb r0, [r5] - adds r1, r7, 0 - mov r2, r8 - bl sub_81AE6C8 - movs r3, 0x2 - ldrsh r0, [r5, r3] - cmp r0, r4 - bge _081C69E0 - adds r1, r7, 0 - subs r1, 0x8 - ldrh r0, [r1, 0x6] - subs r0, 0x1 - strh r0, [r1, 0x6] -_081C69E0: - bl sub_81C5314 - ldr r0, =gUnknown_03006310 - ldrh r1, [r7] - mov r3, r8 - ldrh r2, [r3] - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5] - adds r0, r6, 0 - bl sub_81C629C -_081C69FC: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C6964 - - thumb_func_start sub_81C6A14 -sub_81C6A14: @ 81C6A14 - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldr r5, =gUnknown_0203CF38 - subs r7, r5, 0x2 - ldr r0, =gUnknown_0203CF2C - ldr r0, [r0] - ldr r1, =0x00000814 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - movs r0, 0x1 - bl sub_81C7028 - ldrb r0, [r4] - adds r1, r5, 0 - adds r2, r7, 0 - bl sub_81AE6C8 - movs r0, 0x2 - ldrsh r2, [r4, r0] - ldrh r0, [r5] - ldrh r1, [r7] - adds r0, r1 - cmp r2, r0 - bge _081C6A5E - adds r1, r5, 0 - subs r1, 0x8 - ldrh r0, [r1, 0x6] - subs r0, 0x1 - strh r0, [r1, 0x6] -_081C6A5E: - bl sub_81C5314 - ldr r0, =gUnknown_03006310 - ldrh r1, [r5] - ldrh r2, [r7] - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - adds r0, r6, 0 - bl sub_81C629C - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C6A14 - - thumb_func_start sub_81C6A94 -sub_81C6A94: @ 81C6A94 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - ldr r0, =gPlayerParty - mov r9, r0 - movs r0, 0x14 - bl Alloc - adds r7, r0, 0 - movs r0, 0xA - bl Alloc - adds r5, r0, 0 - ldr r1, =gSaveBlock2Ptr - mov r8, r1 - ldr r2, [r1] - ldr r4, =0x00000ca9 - adds r0, r2, r4 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldr r0, =0x00000e2c - adds r1, r0 - adds r0, r7, 0 - movs r2, 0x14 - bl memcpy - mov r1, r8 - ldr r2, [r1] - adds r0, r2, r4 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 1 - adds r1, r2 - ldr r0, =0x00000e54 - adds r1, r0 - adds r0, r5, 0 - movs r2, 0xA - bl memcpy - movs r6, 0 -_081C6AF8: - movs r0, 0x64 - muls r0, r6 - add r0, r9 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - mov r1, sp - strh r0, [r1] - cmp r0, 0 - beq _081C6B88 - movs r1, 0x1 - bl AddBagItem - lsls r0, 24 - cmp r0, 0 - bne _081C6B88 - mov r1, r8 - ldr r2, [r1] - adds r0, r2, r4 - ldrb r1, [r0] - lsls r1, 30 - lsrs r1, 30 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x00000e2c - adds r0, r1 - adds r1, r7, 0 - movs r2, 0x14 - bl memcpy - mov r0, r8 - ldr r2, [r0] - adds r0, r2, r4 - ldrb r1, [r0] - lsls r1, 30 - lsrs r1, 30 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 1 - adds r0, r2 - ldr r1, =0x00000e54 - adds r0, r1 - adds r1, r5, 0 - movs r2, 0xA - bl memcpy - adds r0, r7, 0 - bl Free - adds r0, r5, 0 - bl Free - ldr r1, =gScriptResult - movs r0, 0x1 - strh r0, [r1] - b _081C6BC6 - .pool -_081C6B88: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x2 - bls _081C6AF8 - movs r1, 0 - mov r0, sp - strh r1, [r0] - movs r6, 0 - movs r4, 0x64 -_081C6B9C: - adds r0, r6, 0 - muls r0, r4 - add r0, r9 - movs r1, 0xC - mov r2, sp - bl SetMonData - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x2 - bls _081C6B9C - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - adds r0, r7, 0 - bl Free - adds r0, r5, 0 - bl Free -_081C6BC6: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C6A94 - - thumb_func_start sub_81C6BD8 -sub_81C6BD8: @ 81C6BD8 - push {r4,lr} - ldr r0, =gUnknown_0861F328 - bl InitWindows - bl DeactivateAllTextPrinters - movs r0, 0 - movs r1, 0x1 - movs r2, 0xE0 - bl sub_809882C - movs r0, 0 - movs r1, 0xA - movs r2, 0xD0 - bl copy_textbox_border_tile_patterns_to_vram - ldr r0, =gUnknown_0860F074 - movs r1, 0xF0 - movs r2, 0x20 - bl LoadPalette - movs r4, 0 -_081C6C04: - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x4 - bls _081C6C04 - movs r0, 0 - bl PutWindowTilemap - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C6BD8 - - thumb_func_start sub_81C6C3C -sub_81C6C3C: @ 81C6C3C - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x14 - ldr r4, [sp, 0x28] - ldr r6, [sp, 0x2C] - ldr r5, [sp, 0x30] - mov r8, r5 - ldr r5, [sp, 0x34] - lsls r0, 24 - lsrs r0, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r5, 24 - lsrs r5, 24 - str r4, [sp] - str r6, [sp, 0x4] - lsls r4, r5, 1 - adds r4, r5 - ldr r5, =gUnknown_0861F31C - adds r4, r5 - str r4, [sp, 0x8] - mov r4, r8 - lsls r4, 24 - asrs r4, 24 - str r4, [sp, 0xC] - str r1, [sp, 0x10] - movs r1, 0x1 - bl AddTextPrinterParametrized2 - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C6C3C - - thumb_func_start sub_81C6C94 -sub_81C6C94: @ 81C6C94 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x14 - ldr r4, [sp, 0x28] - ldr r6, [sp, 0x2C] - ldr r5, [sp, 0x30] - mov r8, r5 - ldr r5, [sp, 0x34] - lsls r0, 24 - lsrs r0, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r5, 24 - lsrs r5, 24 - str r4, [sp] - str r6, [sp, 0x4] - lsls r4, r5, 1 - adds r4, r5 - ldr r5, =gUnknown_0861F31C - adds r4, r5 - str r4, [sp, 0x8] - mov r4, r8 - lsls r4, 24 - asrs r4, 24 - str r4, [sp, 0xC] - str r1, [sp, 0x10] - movs r1, 0x7 - bl AddTextPrinterParametrized2 - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C6C94 - - thumb_func_start sub_81C6CEC -sub_81C6CEC: @ 81C6CEC - push {lr} - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - movs r2, 0x1 - movs r3, 0xE - bl SetWindowBorderStyle - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - pop {r0} - bx r0 - thumb_func_end sub_81C6CEC - - thumb_func_start sub_81C6D08 -sub_81C6D08: @ 81C6D08 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0203CF2C - ldr r1, [r1] - ldr r2, =0x0000080f - adds r1, r2 - adds r1, r0 - ldrb r0, [r1] - bx lr - .pool - thumb_func_end sub_81C6D08 - - thumb_func_start sub_81C6D24 -sub_81C6D24: @ 81C6D24 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gUnknown_0203CF2C - ldr r3, =0x0000080f - adds r1, r2, r3 - ldr r0, [r0] - adds r4, r0, r1 - ldrb r0, [r4] - cmp r0, 0xFF - bne _081C6D58 - lsls r0, r2, 3 - ldr r1, =gUnknown_0861F350 - adds r0, r1 - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - movs r1, 0 - movs r2, 0x1 - movs r3, 0xE - bl SetWindowBorderStyle - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram -_081C6D58: - ldrb r0, [r4] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81C6D24 - - thumb_func_start sub_81C6D6C -sub_81C6D6C: @ 81C6D6C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0203CF2C - ldr r2, =0x0000080f - adds r0, r2 - ldr r1, [r1] - adds r4, r1, r0 - ldrb r0, [r4] - cmp r0, 0xFF - beq _081C6D9E - movs r1, 0 - bl sub_8198070 - ldrb r0, [r4] - bl ClearWindowTilemap - ldrb r0, [r4] - bl RemoveWindow - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0xFF - strb r0, [r4] -_081C6D9E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C6D6C - - thumb_func_start sub_81C6DAC -sub_81C6DAC: @ 81C6DAC - push {lr} - sub sp, 0x10 - adds r3, r1, 0 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0861F370 - movs r2, 0x2 - str r2, [sp] - movs r2, 0x1 - str r2, [sp, 0x4] - movs r2, 0xE - str r2, [sp, 0x8] - str r3, [sp, 0xC] - movs r2, 0x1 - movs r3, 0 - bl CreateYesNoMenuWithCallbacks - add sp, 0x10 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C6DAC - - thumb_func_start DisplayItemMessageInBattlePyramid -@ void DisplayItemMessageInBattlePyramid(u8 taskId, u8 *str, void ( *callback)(u8 taskId)) -DisplayItemMessageInBattlePyramid: @ 81C6DD8 - push {r4-r6,lr} - sub sp, 0x10 - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x2 - movs r1, 0x11 - bl FillWindowPixelBuffer - bl sav2_get_text_speed - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - str r1, [sp] - str r0, [sp, 0x4] - str r5, [sp, 0x8] - str r6, [sp, 0xC] - adds r0, r4, 0 - movs r1, 0x2 - movs r2, 0xA - movs r3, 0xD - bl DisplayMessageAndContinueTask - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end DisplayItemMessageInBattlePyramid - - thumb_func_start sub_81C6E1C -sub_81C6E1C: @ 81C6E1C - push {lr} - movs r0, 0x2 - movs r1, 0 - bl sub_8197DF8 - movs r0, 0x2 - bl ClearWindowTilemap - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - pop {r0} - bx r0 - thumb_func_end sub_81C6E1C - - thumb_func_start sub_81C6E38 -sub_81C6E38: @ 81C6E38 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gUnknown_0203CF2C - ldr r2, =0x00000804 - adds r1, r4, r2 - ldr r0, [r0] - adds r5, r0, r1 - ldrb r0, [r5] - cmp r0, 0xFF - beq _081C6E80 - ldr r0, =0x00001024 - adds r4, r0 - 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] -_081C6E80: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C6E38 - - thumb_func_start sub_81C6E98 -sub_81C6E98: @ 81C6E98 - push {r4,lr} - sub sp, 0x8 - movs r0, 0x40 - bl Alloc - adds r4, r0, 0 - ldr r0, =gUnknown_08D9ADD0 - adds r1, r4, 0 - bl LZDecompressWram - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 25 - adds r0, r4, r0 - str r0, [sp] - ldr r1, =0xffff0000 - ldr r0, [sp, 0x4] - ands r0, r1 - ldr r1, =0x00001024 - orrs r0, r1 - str r0, [sp, 0x4] - mov r0, sp - bl LoadSpritePalette - adds r0, r4, 0 - bl Free - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C6E98 - - thumb_func_start sub_81C6EF4 -sub_81C6EF4: @ 81C6EF4 - push {r4,lr} - ldr r0, =gUnknown_0203CF2C - ldr r4, [r0] - ldr r0, =0x00000804 - adds r4, r0 - ldr r0, =gUnknown_0861F3D4 - movs r1, 0x44 - movs r2, 0x38 - movs r3, 0 - bl CreateSprite - strb r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C6EF4 - - thumb_func_start sub_81C6F20 -sub_81C6F20: @ 81C6F20 - push {r4,lr} - ldr r0, =gUnknown_0203CF2C - 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 _081C6F50 - adds r0, r4, 0 - movs r1, 0x1 - bl StartSpriteAffineAnim - ldr r0, =sub_81C6F68 - str r0, [r4, 0x1C] -_081C6F50: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C6F20 - - thumb_func_start sub_81C6F68 -sub_81C6F68: @ 81C6F68 - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _081C6F84 - adds r0, r4, 0 - movs r1, 0 - bl StartSpriteAffineAnim - ldr r0, =SpriteCallbackDummy - str r0, [r4, 0x1C] -_081C6F84: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C6F68 - - thumb_func_start sub_81C6F90 -sub_81C6F90: @ 81C6F90 - push {r4-r6,lr} - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, 24 - lsrs r4, r1, 24 - ldr r0, =gUnknown_0203CF2C - ldr r2, =0x00000805 - adds r1, r4, r2 - ldr r0, [r0] - adds r5, r0, r1 - ldrb r0, [r5] - cmp r0, 0xFF - bne _081C6FE0 - ldr r0, =0x00001025 - adds r4, r0 - 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 _081C6FE0 - 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] -_081C6FE0: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C6F90 - - thumb_func_start sub_81C6FF8 -sub_81C6FF8: @ 81C6FF8 - push {lr} - lsls r0, 24 - movs r1, 0x80 - lsls r1, 17 - adds r0, r1 - lsrs r0, 24 - bl sub_81C6E38 - pop {r0} - bx r0 - thumb_func_end sub_81C6FF8 - - thumb_func_start sub_81C700C -sub_81C700C: @ 81C700C - push {lr} - ldr r0, =gUnknown_0203CF2C - ldr r0, [r0] - ldr r1, =0x00000807 - adds r0, r1 - movs r1, 0x8 - bl sub_8122344 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C700C - - thumb_func_start sub_81C7028 -sub_81C7028: @ 81C7028 - push {lr} - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_0203CF2C - ldr r0, [r0] - ldr r1, =0x00000807 - adds r0, r1 - movs r1, 0x8 - bl sub_81223FC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C7028 - - thumb_func_start sub_81C704C -sub_81C704C: @ 81C704C - push {lr} - adds r3, r0, 0 - lsls r3, 24 - ldr r0, =gUnknown_0203CF2C - ldr r0, [r0] - ldr r1, =0x00000807 - 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_81C704C - - thumb_func_start sub_81C7078 -sub_81C7078: @ 81C7078 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - bl is_c1_link_related_active - cmp r0, 0 - bne _081C7090 - ldr r0, =sub_81C7170 - b _081C7092 - .pool -_081C7090: - ldr r0, =sub_81C71E4 -_081C7092: - lsls r1, r4, 24 - lsrs r1, 24 - bl CreateTask - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - movs r1, 0x1 - adds r2, r5, 0 - bl SetWordTaskArg - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r2, =gUnknown_0203CF3C - ldrb r1, [r2] - strh r1, [r0, 0xE] - ldrb r0, [r2] - adds r1, r0, 0x1 - strb r1, [r2] - lsls r0, 24 - lsrs r0, 8 - orrs r0, r4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81C7078 - - thumb_func_start sub_81C70D8 -sub_81C70D8: @ 81C70D8 - push {lr} - ldr r1, =0x0000ffff - ands r1, r0 - lsrs r3, r0, 16 - ldr r2, =gTasks - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r1, r0, r2 - ldrb r0, [r1, 0x4] - cmp r0, 0 - beq _081C711C - ldr r2, [r1] - ldr r0, =sub_81C7170 - cmp r2, r0 - beq _081C70FE - ldr r0, =sub_81C71E4 - cmp r2, r0 - bne _081C711C -_081C70FE: - movs r2, 0xE - ldrsh r0, [r1, r2] - cmp r0, r3 - bne _081C711C - movs r0, 0x1 - b _081C711E - .pool -_081C711C: - movs r0, 0 -_081C711E: - pop {r1} - bx r1 - thumb_func_end sub_81C70D8 - - thumb_func_start sub_81C7124 -sub_81C7124: @ 81C7124 - push {r4-r6,lr} - adds r6, r0, 0 - movs r5, 0 - ldr r4, =gTasks -_081C712C: - ldrb r0, [r4, 0x4] - cmp r0, 0 - beq _081C7160 - ldr r1, [r4] - ldr r0, =sub_81C7170 - cmp r1, r0 - beq _081C7140 - ldr r0, =sub_81C71E4 - cmp r1, r0 - bne _081C7160 -_081C7140: - lsls r0, r5, 24 - lsrs r0, 24 - movs r1, 0x1 - bl GetWordTaskArg - cmp r0, r6 - bne _081C7160 - movs r0, 0x1 - b _081C716A - .pool -_081C7160: - adds r4, 0x28 - adds r5, 0x1 - cmp r5, 0xF - ble _081C712C - movs r0, 0 -_081C716A: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81C7124 - - thumb_func_start sub_81C7170 -sub_81C7170: @ 81C7170 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r5, 0 - movs r1, 0x1 - bl GetWordTaskArg - adds r6, r0, 0 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - movs r7, 0 -_081C718C: - movs r1, 0 - ldrsh r0, [r4, r1] - bl _call_via_r6 - cmp r0, 0x4 - bhi _081C71D6 - lsls r0, 2 - ldr r1, =_081C71AC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081C71AC: - .4byte _081C71C6 - .4byte _081C71C0 - .4byte _081C71DE - .4byte _081C71DA - .4byte _081C71CE -_081C71C0: - ldrh r0, [r4] - adds r0, 0x1 - b _081C71D8 -_081C71C6: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - b _081C71DE -_081C71CE: - adds r0, r5, 0 - bl DestroyTask - b _081C71DE -_081C71D6: - subs r0, 0x5 -_081C71D8: - strh r0, [r4] -_081C71DA: - cmp r7, 0 - beq _081C718C -_081C71DE: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81C7170 - - thumb_func_start sub_81C71E4 -sub_81C71E4: @ 81C71E4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_8087598 - cmp r0, 0 - bne _081C724A - adds r0, r5, 0 - movs r1, 0x1 - bl GetWordTaskArg - adds r2, r0, 0 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - movs r1, 0 - ldrsh r0, [r4, r1] - bl _call_via_r2 - cmp r0, 0x4 - bhi _081C7246 - lsls r0, 2 - ldr r1, =_081C7224 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081C7224: - .4byte _081C7238 - .4byte _081C7238 - .4byte _081C724A - .4byte _081C724A - .4byte _081C723E -_081C7238: - ldrh r0, [r4] - adds r0, 0x1 - b _081C7248 -_081C723E: - adds r0, r5, 0 - bl DestroyTask - b _081C724A -_081C7246: - subs r0, 0x5 -_081C7248: - strh r0, [r4] -_081C724A: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81C71E4 thumb_func_start CB2_PokeNav CB2_PokeNav: @ 81C7250 @@ -47110,9650 +31051,4 @@ _081D6704: .pool thumb_func_end sub_81D6640 - thumb_func_start sub_81D6720 -sub_81D6720: @ 81D6720 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r4, r0, 0 - adds r5, r1, 0 - mov r8, r2 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - ldr r6, =gUnknown_0203CF60 - ldr r0, =0x00002018 - bl AllocZeroed - str r0, [r6] - ldr r1, =0x00002006 - adds r0, r1 - strb r4, [r0] - ldr r0, [r6] - mov r1, r8 - str r1, [r0] - ldr r1, =0x00002007 - adds r0, r1 - strb r5, [r0] - ldr r0, =sub_81D6774 - bl SetMainCallback2 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D6720 - - thumb_func_start sub_81D6774 -sub_81D6774: @ 81D6774 - push {lr} - bl SetVBlankHBlankCallbacksToNull - bl clear_scheduled_bg_copies_to_vram - bl remove_some_task - bl FreeAllSpritePalettes - bl ResetPaletteFade - bl ResetSpriteData - bl ResetTasks - movs r0, 0 - movs r1, 0xF0 - movs r2, 0x20 - bl FillPalette - ldr r1, =gUnknown_0862A6A0 - ldr r0, =gUnknown_0203CF60 - ldr r0, [r0] - ldr r2, =0x00002006 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0 - bl CreateTask - ldr r0, =sub_81D67D0 - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D6774 - - thumb_func_start sub_81D67D0 -sub_81D67D0: @ 81D67D0 - push {lr} - bl RunTasks - bl AnimateSprites - bl BuildOamBuffer - bl do_scheduled_bg_tilemap_copies_to_vram - bl UpdatePaletteFade - pop {r0} - bx r0 - thumb_func_end sub_81D67D0 - - thumb_func_start sub_81D67EC -sub_81D67EC: @ 81D67EC - push {lr} - bl LoadOam - bl ProcessSpriteCopyRequests - bl TransferPlttBuffer - pop {r0} - bx r0 - thumb_func_end sub_81D67EC - - thumb_func_start sub_81D6800 -sub_81D6800: @ 81D6800 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081D6830 - bl ResetSpriteData - bl FreeAllSpritePalettes - ldr r4, =gUnknown_0203CF60 - ldr r0, [r4] - ldr r0, [r0] - bl SetMainCallback2 - ldr r0, [r4] - bl Free - adds r0, r5, 0 - bl DestroyTask -_081D6830: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D6800 - - thumb_func_start sub_81D6840 -sub_81D6840: @ 81D6840 - push {r4-r6,lr} - lsls r0, 24 - lsrs r3, r0, 24 - adds r6, r3, 0 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _081D68B2 - ldr r2, =gUnknown_0203CF60 - ldr r1, [r2] - ldr r4, =0x00002007 - adds r0, r1, r4 - ldrb r0, [r0] - cmp r0, 0x1 - bne _081D6888 - ldr r0, =gTasks - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81D6800 - b _081D68B0 - .pool -_081D6888: - ldr r4, =0x00002006 - adds r1, r4 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r2, [r2] - ldr r1, =0x00002004 - adds r0, r2, r1 - strh r5, [r0] - ldr r0, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r3, =gUnknown_0862A6A0 - adds r2, r4 - ldrb r0, [r2] - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] -_081D68B0: - str r0, [r1] -_081D68B2: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D6840 - - thumb_func_start sub_81D68C8 -sub_81D68C8: @ 81D68C8 - push {lr} - movs r0, 0x48 - movs r1, 0x3F - bl SetGpuReg - movs r0, 0x4A - movs r1, 0 - bl SetGpuReg - movs r0, 0x40 - movs r1, 0xF0 - bl SetGpuReg - ldr r1, =0x00001888 - movs r0, 0x44 - bl SetGpuReg - ldr r0, =gPlttBufferUnfaded - movs r1, 0 - strh r1, [r0] - ldr r0, =gPlttBufferFaded - strh r1, [r0] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D68C8 - - thumb_func_start sub_81D6904 -sub_81D6904: @ 81D6904 - push {lr} - movs r0, 0x48 - movs r1, 0x3F - bl SetGpuReg - movs r0, 0x4A - movs r1, 0x3F - bl SetGpuReg - pop {r0} - bx r0 - thumb_func_end sub_81D6904 - - thumb_func_start sub_81D691C -sub_81D691C: @ 81D691C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r5, r0, r1 - bl sub_81D750C - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081D697E - movs r0, 0 - ldrsh r1, [r5, r0] - cmp r1, 0x40 - bne _081D6954 - bl sub_81D7438 - b _081D6978 - .pool -_081D6954: - cmp r1, 0x90 - bne _081D695E - bl sub_81D7480 - b _081D6978 -_081D695E: - cmp r1, 0x94 - beq _081D6974 - movs r0, 0xA4 - lsls r0, 1 - cmp r1, r0 - bne _081D6978 - adds r0, r4, 0 - movs r1, 0 - bl sub_81D75B4 - b _081D697E -_081D6974: - bl sub_81D74C8 -_081D6978: - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] -_081D697E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81D691C - - thumb_func_start sub_81D6984 -sub_81D6984: @ 81D6984 - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r0, =gUnknown_0862A72C - mov r8, r0 - movs r1, 0x58 - movs r2, 0x48 - movs r3, 0x3 - bl CreateSprite - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r6, =gSprites - lsls r4, r5, 4 - adds r4, r5 - lsls r4, 2 - adds r0, r6, 0 - adds r0, 0x1C - adds r0, r4, r0 - ldr r1, =sub_81D6A20 - str r1, [r0] - adds r0, r6, 0 - adds r0, 0x2E - adds r4, r0 - mov r0, r8 - movs r1, 0x38 - movs r2, 0x68 - movs r3, 0x3 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - ldr r0, =gUnknown_0862A750 - movs r1, 0x4B - movs r2, 0x65 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x2] - ldr r0, =gUnknown_0862A774 - movs r1, 0x6D - movs r2, 0x72 - movs r3, 0x1 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x4] - movs r0, 0 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x1 - bl StartSpriteAnim - adds r0, r5, 0 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D6984 - - thumb_func_start sub_81D6A20 -sub_81D6A20: @ 81D6A20 - push {r4,lr} - adds r3, r0, 0 - movs r0, 0x2E - adds r0, r3 - mov r12, r0 - ldrh r0, [r0, 0xA] - adds r0, 0x1 - movs r1, 0x1F - ands r0, r1 - mov r1, r12 - strh r0, [r1, 0xA] - cmp r0, 0 - bne _081D6A84 - ldrh r1, [r3, 0x20] - movs r2, 0x20 - ldrsh r0, [r3, r2] - cmp r0, 0x48 - beq _081D6A84 - subs r0, r1, 0x1 - strh r0, [r3, 0x20] - ldr r2, =gSprites - movs r4, 0x2E - ldrsh r1, [r3, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x20] - subs r1, 0x1 - strh r1, [r0, 0x20] - mov r0, r12 - movs r4, 0x2 - ldrsh r1, [r0, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x20] - subs r1, 0x1 - strh r1, [r0, 0x20] - mov r0, r12 - movs r4, 0x4 - ldrsh r1, [r0, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x20] - subs r1, 0x1 - strh r1, [r0, 0x20] -_081D6A84: - adds r0, r3, 0 - adds r0, 0x2B - ldrb r3, [r0] - cmp r3, 0x1 - beq _081D6AE4 - cmp r3, 0x1 - bgt _081D6A9C - cmp r3, 0 - beq _081D6AA6 - b _081D6B68 - .pool -_081D6A9C: - cmp r3, 0x2 - beq _081D6B24 - cmp r3, 0x3 - beq _081D6AE4 - b _081D6B68 -_081D6AA6: - ldr r2, =gSprites - mov r0, r12 - movs r4, 0x2 - ldrsh r1, [r0, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r3, [r0, 0x24] - mov r0, r12 - movs r4, 0x2 - ldrsh r1, [r0, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r3, [r0, 0x26] - mov r0, r12 - movs r4, 0x4 - ldrsh r1, [r0, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r3, [r0, 0x24] - mov r0, r12 - movs r4, 0x4 - ldrsh r1, [r0, r4] - b _081D6B5E - .pool -_081D6AE4: - ldr r2, =gSprites - mov r0, r12 - movs r3, 0x2 - ldrsh r1, [r0, r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x0000ffff - strh r1, [r0, 0x24] - mov r4, r12 - movs r0, 0x2 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r3, 0 - strh r3, [r0, 0x26] - movs r0, 0x4 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x1 - negs r1, r1 - b _081D6B58 - .pool -_081D6B24: - ldr r2, =gSprites - mov r3, r12 - movs r4, 0x2 - ldrsh r1, [r3, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x0000ffff - strh r1, [r0, 0x24] - movs r0, 0x2 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r3, 0x1 - strh r3, [r0, 0x26] - mov r4, r12 - movs r0, 0x4 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x0000fffe -_081D6B58: - strh r1, [r0, 0x24] - movs r0, 0x4 - ldrsh r1, [r4, r0] -_081D6B5E: - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r3, [r0, 0x26] -_081D6B68: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D6A20 - - thumb_func_start sub_81D6B7C -sub_81D6B7C: @ 81D6B7C - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r5, =gUnknown_0862A81C - adds r0, r5, 0 - movs r1, 0x88 - movs r2, 0x60 - movs r3, 0x1 - bl CreateSprite - mov r8, r0 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r6, =gSprites - lsls r4, r0, 4 - add r4, r8 - lsls r4, 2 - adds r0, r6, 0 - adds r0, 0x1C - adds r0, r4, r0 - ldr r1, =sub_81D6D20 - str r1, [r0] - adds r0, r6, 0 - adds r0, 0x2E - adds r4, r0 - adds r0, r5, 0 - movs r1, 0xA8 - movs r2, 0x60 - movs r3, 0x1 - bl CreateSprite - lsls r0, 8 - strh r0, [r4] - adds r0, r5, 0 - movs r1, 0x88 - movs r2, 0x70 - movs r3, 0x1 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4] - orrs r0, r1 - strh r0, [r4] - adds r0, r5, 0 - movs r1, 0xA8 - movs r2, 0x70 - movs r3, 0x1 - bl CreateSprite - lsls r0, 8 - strh r0, [r4, 0x2] - adds r0, r5, 0 - movs r1, 0x88 - movs r2, 0x80 - movs r3, 0x1 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x2] - orrs r0, r1 - strh r0, [r4, 0x2] - adds r0, r5, 0 - movs r1, 0xA8 - movs r2, 0x80 - movs r3, 0x1 - bl CreateSprite - lsls r0, 8 - strh r0, [r4, 0x4] - adds r0, r5, 0 - movs r1, 0x68 - movs r2, 0x80 - movs r3, 0x2 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x4] - orrs r0, r1 - strh r0, [r4, 0x4] - adds r0, r5, 0 - movs r1, 0x88 - movs r2, 0x80 - movs r3, 0x2 - bl CreateSprite - lsls r0, 8 - strh r0, [r4, 0x6] - adds r0, r5, 0 - movs r1, 0xB8 - movs r2, 0x80 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x6] - orrs r0, r1 - strh r0, [r4, 0x6] - ldr r0, =gUnknown_0862A84C - movs r1, 0xD0 - movs r2, 0x84 - movs r3, 0 - bl CreateSprite - lsls r0, 8 - strh r0, [r4, 0x8] - ldr r0, =gUnknown_0862A864 - movs r1, 0xC8 - movs r2, 0x78 - movs r3, 0x1 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x8] - orrs r0, r1 - strh r0, [r4, 0x8] - ldrh r1, [r4] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x1 - bl StartSpriteAnim - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x2 - bl StartSpriteAnim - ldrh r1, [r4, 0x2] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x3 - bl StartSpriteAnim - ldrb r1, [r4, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x4 - bl StartSpriteAnim - ldrh r1, [r4, 0x4] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x5 - bl StartSpriteAnim - ldrb r1, [r4, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x6 - bl StartSpriteAnim - ldrh r1, [r4, 0x6] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x7 - bl StartSpriteAnim - ldrb r1, [r4, 0x6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x8 - bl StartSpriteAnim - mov r0, r8 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D6B7C - - thumb_func_start sub_81D6D20 -sub_81D6D20: @ 81D6D20 - push {r4-r7,lr} - adds r4, r0, 0 - adds r3, r4, 0 - adds r3, 0x2E - ldrh r0, [r3, 0xA] - adds r0, 0x1 - movs r1, 0x1F - ands r0, r1 - strh r0, [r3, 0xA] - ldr r7, =gSprites - cmp r0, 0 - bne _081D6E0E - ldrh r1, [r4, 0x20] - movs r2, 0x20 - ldrsh r0, [r4, r2] - cmp r0, 0x98 - beq _081D6E0E - adds r0, r1, 0x1 - strh r0, [r4, 0x20] - ldrh r1, [r4, 0x2E] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - ldrh r0, [r4, 0x2E] - movs r2, 0xFF - adds r1, r2, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - ldrh r1, [r3, 0x2] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - ldrh r0, [r3, 0x2] - adds r1, r2, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - ldrh r1, [r3, 0x4] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - ldrh r0, [r3, 0x4] - adds r1, r2, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - ldrh r1, [r3, 0x6] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - ldrh r0, [r3, 0x6] - adds r1, r2, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - ldrh r1, [r3, 0x8] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - ldrh r0, [r3, 0x8] - ands r2, r0 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] -_081D6E0E: - adds r6, r7, 0 - movs r5, 0xFF - ldrb r1, [r3, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x2B - ldrb r2, [r0] - cmp r2, 0x1 - beq _081D6EE0 - cmp r2, 0x1 - bgt _081D6E34 - cmp r2, 0 - beq _081D6E40 - b _081D6FC8 - .pool -_081D6E34: - cmp r2, 0x2 - bne _081D6E3A - b _081D6F68 -_081D6E3A: - cmp r2, 0x3 - beq _081D6EE0 - b _081D6FC8 -_081D6E40: - strh r2, [r4, 0x26] - ldrh r1, [r3] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x26] - ldrh r0, [r3] - adds r1, r5, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x2] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x26] - ldrh r0, [r3, 0x2] - adds r1, r5, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x4] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x26] - ldrh r0, [r3, 0x4] - adds r1, r5, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x6] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x26] - ldrh r0, [r3, 0x6] - adds r1, r5, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x8] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x8] - ands r1, r5 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - b _081D6FC6 -_081D6EE0: - movs r2, 0x1 - strh r2, [r4, 0x26] - ldrh r1, [r3] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x2] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrb r1, [r3, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x4] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrb r1, [r3, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x6] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrb r1, [r3, 0x6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x8] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrb r1, [r3, 0x8] - b _081D6FBE -_081D6F68: - strh r2, [r4, 0x26] - ldrh r1, [r3] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r0, [r3] - adds r1, r5, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x2] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r0, [r3, 0x2] - adds r1, r5, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x4] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x8] - ands r1, r5 -_081D6FBE: - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 -_081D6FC6: - strh r2, [r0, 0x26] -_081D6FC8: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81D6D20 - - thumb_func_start sub_81D6FD0 -sub_81D6FD0: @ 81D6FD0 - push {lr} - bl sub_81D67EC - bl sub_80BA0A8 - pop {r0} - bx r0 - thumb_func_end sub_81D6FD0 - - thumb_func_start sub_81D6FE0 -sub_81D6FE0: @ 81D6FE0 - push {r4,lr} - bl sub_8121DA0 - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0862A888 - movs r0, 0 - movs r2, 0x3 - bl InitBgsFromTemplates - ldr r4, =gUnknown_0203CF60 - ldr r1, [r4] - adds r1, 0x4 - movs r0, 0 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00000804 - adds r1, r0 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00001004 - adds r1, r0 - movs r0, 0x2 - bl SetBgTilemapBuffer - bl sub_8121E10 - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D6FE0 - - thumb_func_start sub_81D706C -sub_81D706C: @ 81D706C - push {r4,lr} - sub sp, 0x4 - bl reset_temp_tile_data_buffers - ldr r1, =gUnknown_08DA33C0 - movs r0, 0 - str r0, [sp] - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram -_081D7082: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - bne _081D7082 - ldr r0, =gUnknown_08DA3988 - ldr r4, =gUnknown_0203CF60 - ldr r1, [r4] - adds r1, 0x4 - bl LZDecompressWram - ldr r0, =gUnknown_08DA3824 - ldr r1, [r4] - ldr r2, =0x00000804 - adds r1, r2 - bl LZDecompressWram - ldr r0, =gUnknown_08DA3A88 - ldr r1, [r4] - ldr r2, =0x00001004 - adds r1, r2 - bl LZDecompressWram - ldr r0, =gUnknown_08DA37E8 - movs r1, 0 - movs r2, 0x40 - bl LoadCompressedPalette - ldr r0, =gUnknown_0862A8C4 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0862A8F8 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0862A924 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0862A9D4 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0862AA14 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0862AA34 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0862A8CC - bl LoadCompressedObjectPalette - ldr r0, =gUnknown_0862A9DC - bl LoadCompressedObjectPalette - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D706C - - thumb_func_start task_add_00_WIN0V_open_close_above_and_more -task_add_00_WIN0V_open_close_above_and_more: @ 81D7134 - push {r4-r7,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r6, r1, 3 - ldr r7, =gTasks + 0x8 - adds r5, r6, r7 - bl dp12_8087EA4 - bl sub_81D6FE0 - bl sub_81D706C - movs r4, 0 - str r4, [sp, 0x4] - ldr r1, =gUnknown_02038C28 - ldr r2, =0x010003c0 - add r0, sp, 0x4 - bl CpuFastSet - ldr r2, =gUnknown_0862A87C - ldr r0, [r2] - ldr r1, [r2, 0x4] - ldr r2, [r2, 0x8] - bl sub_80BA038 - strh r4, [r5] - ldr r0, =sub_81D7228 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x2] - ldr r0, =gUnknown_0203CF60 - ldr r0, [r0] - ldr r1, =0x00002006 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _081D71CC - bl sub_81D6984 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x4] - bl sub_81D6B7C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x6] - adds r0, r7, 0 - subs r0, 0x8 - adds r0, r6, r0 - ldr r1, =sub_81D691C - str r1, [r0] - b _081D71EE - .pool -_081D71CC: - bl sub_81D7664 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x4] - bl sub_81D78BC - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x6] - adds r0, r7, 0 - subs r0, 0x8 - adds r0, r6, r0 - ldr r1, =sub_81D736C - str r1, [r0] - bl StopMapMusic -_081D71EE: - movs r4, 0x1 - negs r4, r4 - adds r0, r4, 0 - movs r1, 0x10 - movs r2, 0 - bl BlendPalettes - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - ldr r0, =sub_81D6FD0 - bl SetVBlankCallback - movs r0, 0x53 - bl PlaySE - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end task_add_00_WIN0V_open_close_above_and_more - - thumb_func_start sub_81D7228 -sub_81D7228: @ 81D7228 - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r3, r1, r0 - movs r1, 0x18 - ldr r7, =gUnknown_0203CF60 - ldr r4, =gUnknown_02038C28 - movs r0, 0xF0 - lsls r0, 3 - adds r5, r4, r0 -_081D7244: - lsls r0, r1, 16 - asrs r1, r0, 16 - adds r6, r0, 0 - cmp r1, 0x2F - bgt _081D726C - lsls r1, 1 - adds r2, r1, r4 - ldrh r0, [r3] - lsrs r0, 8 - strh r0, [r2] - adds r1, r5 - ldrh r0, [r3] - b _081D72CA - .pool -_081D726C: - cmp r1, 0x3F - bgt _081D7280 - lsls r1, 1 - adds r2, r1, r4 - ldrh r0, [r3, 0x2] - lsrs r0, 8 - strh r0, [r2] - adds r1, r5 - ldrh r0, [r3, 0x2] - b _081D72CA -_081D7280: - cmp r1, 0x4B - bgt _081D7294 - lsls r1, 1 - adds r2, r1, r4 - ldrh r0, [r3, 0x4] - lsrs r0, 8 - strh r0, [r2] - adds r1, r5 - ldrh r0, [r3, 0x4] - b _081D72CA -_081D7294: - cmp r1, 0x53 - bgt _081D72A8 - lsls r1, 1 - adds r2, r1, r4 - ldrh r0, [r3, 0x6] - lsrs r0, 8 - strh r0, [r2] - adds r1, r5 - ldrh r0, [r3, 0x6] - b _081D72CA -_081D72A8: - cmp r1, 0x57 - bgt _081D72BC - lsls r1, 1 - adds r2, r1, r4 - ldrh r0, [r3, 0x8] - lsrs r0, 8 - strh r0, [r2] - adds r1, r5 - ldrh r0, [r3, 0x8] - b _081D72CA -_081D72BC: - lsls r1, 1 - adds r2, r1, r4 - ldrh r0, [r3, 0xA] - lsrs r0, 8 - strh r0, [r2] - adds r1, r5 - ldrh r0, [r3, 0xA] -_081D72CA: - lsrs r0, 8 - strh r0, [r1] - movs r1, 0x80 - lsls r1, 9 - adds r0, r6, r1 - lsrs r1, r0, 16 - asrs r0, 16 - cmp r0, 0x5B - ble _081D7244 - ldr r0, [r7] - ldr r1, =0x00002006 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _081D7324 - movs r1, 0xE0 - lsls r1, 1 - adds r0, r1, 0 - ldrh r1, [r3] - adds r0, r1 - strh r0, [r3] - movs r1, 0xC0 - lsls r1, 1 - adds r0, r1, 0 - ldrh r1, [r3, 0x2] - adds r0, r1 - strh r0, [r3, 0x2] - movs r1, 0xA0 - lsls r1, 1 - adds r0, r1, 0 - ldrh r1, [r3, 0x4] - adds r0, r1 - strh r0, [r3, 0x4] - movs r1, 0x80 - lsls r1, 1 - adds r0, r1, 0 - ldrh r1, [r3, 0x6] - adds r0, r1 - strh r0, [r3, 0x6] - ldrh r0, [r3, 0x8] - adds r0, 0xC0 - b _081D735E - .pool -_081D7324: - movs r1, 0xC0 - lsls r1, 2 - adds r0, r1, 0 - ldrh r1, [r3] - adds r0, r1 - strh r0, [r3] - movs r1, 0xA0 - lsls r1, 2 - adds r0, r1, 0 - ldrh r1, [r3, 0x2] - adds r0, r1 - strh r0, [r3, 0x2] - movs r1, 0x80 - lsls r1, 2 - adds r0, r1, 0 - ldrh r1, [r3, 0x4] - adds r0, r1 - strh r0, [r3, 0x4] - movs r1, 0xC0 - lsls r1, 1 - adds r0, r1, 0 - ldrh r1, [r3, 0x6] - adds r0, r1 - strh r0, [r3, 0x6] - movs r1, 0x80 - lsls r1, 1 - adds r0, r1, 0 - ldrh r1, [r3, 0x8] - adds r0, r1 -_081D735E: - strh r0, [r3, 0x8] - ldrh r0, [r3, 0xA] - adds r0, 0x80 - strh r0, [r3, 0xA] - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81D7228 - - thumb_func_start sub_81D736C -sub_81D736C: @ 81D736C - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r7, =gTasks + 0x8 - adds r4, r0, r7 - bl sub_81D750C - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - bne _081D742E - movs r0, 0 - ldrsh r1, [r4, r0] - cmp r1, 0x20 - beq _081D739C - cmp r1, 0x70 - bne _081D73AC -_081D739C: - bl sub_81D7438 - b _081D7428 - .pool -_081D73AC: - cmp r1, 0xD8 - bne _081D73B6 - bl sub_81D7480 - b _081D7428 -_081D73B6: - cmp r1, 0xDC - bne _081D73C0 - bl sub_81D74C8 - b _081D7428 -_081D73C0: - movs r0, 0xBE - lsls r0, 1 - cmp r1, r0 - beq _081D73D8 - adds r0, 0x20 - cmp r1, r0 - bne _081D7428 - adds r0, r5, 0 - movs r1, 0x2 - bl sub_81D75B4 - b _081D742E -_081D73D8: - movs r1, 0x91 - lsls r1, 2 - movs r0, 0x50 - bl SetGpuReg - adds r2, r7, 0 - subs r2, 0x8 - movs r0, 0x2 - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldr r1, =sub_81D752C - str r1, [r0] - movs r0, 0x2 - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - strh r6, [r0, 0x8] - movs r0, 0x2 - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrh r1, [r4, 0x4] - strh r1, [r0, 0xC] - movs r0, 0x2 - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrh r1, [r4, 0x6] - strh r1, [r0, 0xE] - bl remove_some_task -_081D7428: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_081D742E: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D736C - - thumb_func_start sub_81D7438 -sub_81D7438: @ 81D7438 - push {r4,lr} - sub sp, 0xC - movs r0, 0x57 - bl PlaySE - ldr r0, =0x00007fff - ldr r1, =0x0000ffff - str r1, [sp] - movs r4, 0 - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl sub_80A2C44 - ldr r0, =0xffff0000 - str r4, [sp] - str r4, [sp, 0x4] - movs r1, 0x1 - str r1, [sp, 0x8] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl sub_80A2C44 - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D7438 - - thumb_func_start sub_81D7480 -sub_81D7480: @ 81D7480 - push {r4,lr} - sub sp, 0xC - movs r0, 0x57 - bl PlaySE - ldr r0, =0x00007fff - ldr r1, =0x0000ffff - str r1, [sp] - movs r4, 0 - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0 - movs r2, 0x10 - movs r3, 0x10 - bl sub_80A2C44 - ldr r0, =0xffff0000 - str r4, [sp] - str r4, [sp, 0x4] - movs r1, 0x1 - str r1, [sp, 0x8] - movs r1, 0 - movs r2, 0x10 - movs r3, 0x10 - bl sub_80A2C44 - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D7480 - - thumb_func_start sub_81D74C8 -sub_81D74C8: @ 81D74C8 - push {r4,lr} - sub sp, 0xC - ldr r0, =0x00007fff - ldr r1, =0x0000ffff - str r1, [sp] - movs r4, 0 - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x4 - movs r2, 0x10 - movs r3, 0 - bl sub_80A2C44 - ldr r0, =0xffff0000 - str r4, [sp] - str r4, [sp, 0x4] - movs r1, 0x1 - str r1, [sp, 0x8] - movs r1, 0x4 - movs r2, 0x10 - movs r3, 0 - bl sub_80A2C44 - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D74C8 - - thumb_func_start sub_81D750C -sub_81D750C: @ 81D750C - push {lr} - movs r1, 0x80 - lsls r1, 3 - movs r0, 0x2 - movs r2, 0x1 - bl ChangeBgX - movs r1, 0x80 - lsls r1, 4 - movs r0, 0x2 - movs r2, 0x2 - bl ChangeBgY - pop {r0} - bx r0 - thumb_func_end sub_81D750C - - thumb_func_start sub_81D752C -sub_81D752C: @ 81D752C - 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 r5, r1, r0 - movs r0, 0x4 - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =gSprites - adds r0, r4 - bl sub_81D7860 - movs r0, 0x6 - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl sub_81D7D14 - movs r0, 0x1 - bl GetBgY - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0x1 - bl GetBgY - cmp r0, 0 - beq _081D757A - movs r0, 0x80 - lsls r0, 8 - cmp r4, r0 - bls _081D7586 -_081D757A: - movs r1, 0x80 - lsls r1, 3 - movs r0, 0x1 - movs r2, 0x2 - bl ChangeBgY -_081D7586: - ldrh r2, [r5] - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0x10 - beq _081D75A6 - adds r2, 0x1 - strh r2, [r5] - lsls r1, r2, 8 - movs r0, 0x10 - subs r0, r2 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg -_081D75A6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D752C - - thumb_func_start sub_81D75B4 -sub_81D75B4: @ 81D75B4 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - adds r4, r1, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x54 - bl PlaySE - movs r0, 0x1 - negs r0, r0 - lsls r4, 24 - asrs r4, 24 - movs r1, 0 - str r1, [sp] - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81D7600 - str r1, [r0] - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D75B4 - - thumb_func_start sub_81D7600 -sub_81D7600: @ 81D7600 - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r6, r1, 3 - ldr r7, =gTasks + 0x8 - adds r5, r6, r7 - bl sub_81D750C - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _081D7652 - ldrb r0, [r5, 0x2] - bl DestroyTask - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0 - bl SetVBlankCallback - bl remove_some_task - bl ResetSpriteData - bl FreeAllSpritePalettes - strh r4, [r5] - adds r0, r7, 0 - subs r0, 0x8 - adds r0, r6, r0 - ldr r1, =sub_81D6840 - str r1, [r0] -_081D7652: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D7600 - - thumb_func_start sub_81D7664 -sub_81D7664: @ 81D7664 - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r0, =gUnknown_0862A8D4 - mov r8, r0 - movs r1, 0x62 - movs r2, 0x48 - movs r3, 0x3 - bl CreateSprite - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r6, =gSprites - lsls r4, r5, 4 - adds r4, r5 - lsls r4, 2 - adds r0, r6, 0 - adds r0, 0x1C - adds r0, r4, r0 - ldr r1, =sub_81D7700 - str r1, [r0] - adds r0, r6, 0 - adds r0, 0x2E - adds r4, r0 - mov r0, r8 - movs r1, 0x42 - movs r2, 0x68 - movs r3, 0x3 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - ldr r0, =gUnknown_0862A900 - movs r1, 0x55 - movs r2, 0x65 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x2] - ldr r0, =gUnknown_0862A92C - movs r1, 0x77 - movs r2, 0x72 - movs r3, 0x1 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x4] - movs r0, 0 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x1 - bl StartSpriteAnim - adds r0, r5, 0 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D7664 - - thumb_func_start sub_81D7700 -sub_81D7700: @ 81D7700 - push {r4,lr} - adds r3, r0, 0 - movs r0, 0x2E - adds r0, r3 - mov r12, r0 - ldrh r0, [r0, 0xA] - adds r0, 0x1 - movs r1, 0xF - ands r0, r1 - mov r1, r12 - strh r0, [r1, 0xA] - movs r1, 0x7 - ands r1, r0 - cmp r1, 0 - bne _081D7768 - ldrh r1, [r3, 0x20] - movs r2, 0x20 - ldrsh r0, [r3, r2] - cmp r0, 0x48 - beq _081D7768 - subs r0, r1, 0x1 - strh r0, [r3, 0x20] - ldr r2, =gSprites - movs r4, 0x2E - ldrsh r1, [r3, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x20] - subs r1, 0x1 - strh r1, [r0, 0x20] - mov r0, r12 - movs r4, 0x2 - ldrsh r1, [r0, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x20] - subs r1, 0x1 - strh r1, [r0, 0x20] - mov r0, r12 - movs r4, 0x4 - ldrsh r1, [r0, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x20] - subs r1, 0x1 - strh r1, [r0, 0x20] -_081D7768: - adds r0, r3, 0 - adds r0, 0x2B - ldrb r3, [r0] - cmp r3, 0x1 - beq _081D77C8 - cmp r3, 0x1 - bgt _081D7780 - cmp r3, 0 - beq _081D778A - b _081D784C - .pool -_081D7780: - cmp r3, 0x2 - beq _081D7808 - cmp r3, 0x3 - beq _081D77C8 - b _081D784C -_081D778A: - ldr r2, =gSprites - mov r0, r12 - movs r4, 0x2 - ldrsh r1, [r0, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r3, [r0, 0x24] - mov r0, r12 - movs r4, 0x2 - ldrsh r1, [r0, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r3, [r0, 0x26] - mov r0, r12 - movs r4, 0x4 - ldrsh r1, [r0, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r3, [r0, 0x24] - mov r0, r12 - movs r4, 0x4 - ldrsh r1, [r0, r4] - b _081D7842 - .pool -_081D77C8: - ldr r2, =gSprites - mov r0, r12 - movs r3, 0x2 - ldrsh r1, [r0, r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x0000ffff - strh r1, [r0, 0x24] - mov r4, r12 - movs r0, 0x2 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r3, 0 - strh r3, [r0, 0x26] - movs r0, 0x4 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x1 - negs r1, r1 - b _081D783C - .pool -_081D7808: - ldr r2, =gSprites - mov r3, r12 - movs r4, 0x2 - ldrsh r1, [r3, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x0000ffff - strh r1, [r0, 0x24] - movs r0, 0x2 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r3, 0x1 - strh r3, [r0, 0x26] - mov r4, r12 - movs r0, 0x4 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x0000fffe -_081D783C: - strh r1, [r0, 0x24] - movs r0, 0x4 - ldrsh r1, [r4, r0] -_081D7842: - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r3, [r0, 0x26] -_081D784C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D7700 - - thumb_func_start sub_81D7860 -sub_81D7860: @ 81D7860 - push {r4,lr} - adds r1, r0, 0 - adds r3, r1, 0 - adds r3, 0x2E - ldrh r2, [r1, 0x22] - movs r4, 0x22 - ldrsh r0, [r1, r4] - cmp r0, 0xA0 - bgt _081D78B0 - adds r0, r2, 0 - adds r0, 0x8 - strh r0, [r1, 0x22] - ldr r2, =gSprites - movs r0, 0x2E - ldrsh r1, [r1, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x22] - adds r1, 0x8 - strh r1, [r0, 0x22] - movs r4, 0x2 - ldrsh r1, [r3, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x22] - adds r1, 0x8 - strh r1, [r0, 0x22] - movs r0, 0x4 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x22] - adds r1, 0x8 - strh r1, [r0, 0x22] -_081D78B0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D7860 - - thumb_func_start sub_81D78BC -sub_81D78BC: @ 81D78BC - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r5, =gUnknown_0862A9E4 - adds r0, r5, 0 - movs r1, 0x7E - movs r2, 0x60 - movs r3, 0x1 - bl CreateSprite - mov r8, r0 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r6, =gSprites - lsls r4, r0, 4 - add r4, r8 - lsls r4, 2 - adds r0, r6, 0 - adds r0, 0x1C - adds r0, r4, r0 - ldr r1, =sub_81D7A60 - str r1, [r0] - adds r0, r6, 0 - adds r0, 0x2E - adds r4, r0 - adds r0, r5, 0 - movs r1, 0x9E - movs r2, 0x60 - movs r3, 0x1 - bl CreateSprite - lsls r0, 8 - strh r0, [r4] - adds r0, r5, 0 - movs r1, 0x7E - movs r2, 0x70 - movs r3, 0x1 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4] - orrs r0, r1 - strh r0, [r4] - adds r0, r5, 0 - movs r1, 0x9E - movs r2, 0x70 - movs r3, 0x1 - bl CreateSprite - lsls r0, 8 - strh r0, [r4, 0x2] - adds r0, r5, 0 - movs r1, 0x7E - movs r2, 0x80 - movs r3, 0x1 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x2] - orrs r0, r1 - strh r0, [r4, 0x2] - adds r0, r5, 0 - movs r1, 0x9E - movs r2, 0x80 - movs r3, 0x1 - bl CreateSprite - lsls r0, 8 - strh r0, [r4, 0x4] - adds r0, r5, 0 - movs r1, 0x5E - movs r2, 0x80 - movs r3, 0x2 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x4] - orrs r0, r1 - strh r0, [r4, 0x4] - adds r0, r5, 0 - movs r1, 0x7E - movs r2, 0x80 - movs r3, 0x2 - bl CreateSprite - lsls r0, 8 - strh r0, [r4, 0x6] - adds r0, r5, 0 - movs r1, 0xAE - movs r2, 0x80 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x6] - orrs r0, r1 - strh r0, [r4, 0x6] - ldr r0, =gUnknown_0862AA1C - movs r1, 0xC6 - movs r2, 0x84 - movs r3, 0 - bl CreateSprite - lsls r0, 8 - strh r0, [r4, 0x8] - ldr r0, =gUnknown_0862AA3C - movs r1, 0xBE - movs r2, 0x78 - movs r3, 0x1 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x8] - orrs r0, r1 - strh r0, [r4, 0x8] - ldrh r1, [r4] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x1 - bl StartSpriteAnim - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x2 - bl StartSpriteAnim - ldrh r1, [r4, 0x2] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x3 - bl StartSpriteAnim - ldrb r1, [r4, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x4 - bl StartSpriteAnim - ldrh r1, [r4, 0x4] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x5 - bl StartSpriteAnim - ldrb r1, [r4, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x6 - bl StartSpriteAnim - ldrh r1, [r4, 0x6] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x7 - bl StartSpriteAnim - ldrb r1, [r4, 0x6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x8 - bl StartSpriteAnim - mov r0, r8 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D78BC - - thumb_func_start sub_81D7A60 -sub_81D7A60: @ 81D7A60 - push {r4-r7,lr} - adds r4, r0, 0 - adds r3, r4, 0 - adds r3, 0x2E - ldrh r0, [r3, 0xA] - adds r0, 0x1 - movs r1, 0xF - ands r0, r1 - strh r0, [r3, 0xA] - movs r1, 0x7 - ands r1, r0 - ldr r7, =gSprites - cmp r1, 0 - bne _081D7B52 - ldrh r1, [r4, 0x20] - movs r2, 0x20 - ldrsh r0, [r4, r2] - cmp r0, 0x98 - beq _081D7B52 - adds r0, r1, 0x1 - strh r0, [r4, 0x20] - ldrh r1, [r4, 0x2E] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - ldrh r0, [r4, 0x2E] - movs r2, 0xFF - adds r1, r2, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - ldrh r1, [r3, 0x2] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - ldrh r0, [r3, 0x2] - adds r1, r2, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - ldrh r1, [r3, 0x4] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - ldrh r0, [r3, 0x4] - adds r1, r2, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - ldrh r1, [r3, 0x6] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - ldrh r0, [r3, 0x6] - adds r1, r2, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - ldrh r1, [r3, 0x8] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - ldrh r0, [r3, 0x8] - ands r2, r0 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] -_081D7B52: - adds r6, r7, 0 - movs r5, 0xFF - ldrb r1, [r3, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x2B - ldrb r2, [r0] - cmp r2, 0x1 - beq _081D7C24 - cmp r2, 0x1 - bgt _081D7B78 - cmp r2, 0 - beq _081D7B84 - b _081D7D0C - .pool -_081D7B78: - cmp r2, 0x2 - bne _081D7B7E - b _081D7CAC -_081D7B7E: - cmp r2, 0x3 - beq _081D7C24 - b _081D7D0C -_081D7B84: - strh r2, [r4, 0x26] - ldrh r1, [r3] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x26] - ldrh r0, [r3] - adds r1, r5, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x2] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x26] - ldrh r0, [r3, 0x2] - adds r1, r5, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x4] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x26] - ldrh r0, [r3, 0x4] - adds r1, r5, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x6] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x26] - ldrh r0, [r3, 0x6] - adds r1, r5, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x8] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x8] - ands r1, r5 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - b _081D7D0A -_081D7C24: - movs r2, 0x1 - strh r2, [r4, 0x26] - ldrh r1, [r3] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x2] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrb r1, [r3, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x4] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrb r1, [r3, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x6] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrb r1, [r3, 0x6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x8] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrb r1, [r3, 0x8] - b _081D7D02 -_081D7CAC: - strh r2, [r4, 0x26] - ldrh r1, [r3] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r0, [r3] - adds r1, r5, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x2] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r0, [r3, 0x2] - adds r1, r5, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x4] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x8] - ands r1, r5 -_081D7D02: - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 -_081D7D0A: - strh r2, [r0, 0x26] -_081D7D0C: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81D7A60 - - thumb_func_start sub_81D7D14 -sub_81D7D14: @ 81D7D14 - push {lr} - adds r2, r0, 0 - movs r0, 0x2E - adds r0, r2 - mov r12, r0 - ldrh r1, [r2, 0x22] - movs r3, 0x22 - ldrsh r0, [r2, r3] - cmp r0, 0xA0 - bgt _081D7E08 - adds r0, r1, 0 - adds r0, 0x8 - strh r0, [r2, 0x22] - ldr r3, =gSprites - ldrh r1, [r2, 0x2E] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x22] - adds r1, 0x8 - strh r1, [r0, 0x22] - ldrh r0, [r2, 0x2E] - movs r2, 0xFF - adds r1, r2, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x22] - adds r1, 0x8 - strh r1, [r0, 0x22] - mov r0, r12 - ldrh r1, [r0, 0x2] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x22] - adds r1, 0x8 - strh r1, [r0, 0x22] - mov r1, r12 - ldrh r0, [r1, 0x2] - adds r1, r2, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x22] - adds r1, 0x8 - strh r1, [r0, 0x22] - mov r0, r12 - ldrh r1, [r0, 0x4] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x22] - adds r1, 0x8 - strh r1, [r0, 0x22] - mov r1, r12 - ldrh r0, [r1, 0x4] - adds r1, r2, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x22] - adds r1, 0x8 - strh r1, [r0, 0x22] - mov r0, r12 - ldrh r1, [r0, 0x6] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x22] - adds r1, 0x8 - strh r1, [r0, 0x22] - mov r1, r12 - ldrh r0, [r1, 0x6] - adds r1, r2, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x22] - adds r1, 0x8 - strh r1, [r0, 0x22] - mov r0, r12 - ldrh r1, [r0, 0x8] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x22] - adds r1, 0x8 - strh r1, [r0, 0x22] - mov r1, r12 - ldrh r0, [r1, 0x8] - ands r2, r0 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x22] - adds r1, 0x8 - strh r1, [r0, 0x22] -_081D7E08: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D7D14 - - thumb_func_start sub_81D7E10 -sub_81D7E10: @ 81D7E10 - push {r4,lr} - bl sub_8121DA0 - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0862AA54 - movs r0, 0x1 - movs r2, 0x3 - bl InitBgsFromTemplates - ldr r4, =gUnknown_0203CF60 - ldr r1, [r4] - adds r1, 0x4 - movs r0, 0 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00000804 - adds r1, r0 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00001004 - adds r1, r0 - movs r0, 0x2 - bl SetBgTilemapBuffer - bl sub_8121E10 - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D7E10 - - thumb_func_start sub_81D7E9C -sub_81D7E9C: @ 81D7E9C - push {r4,lr} - sub sp, 0x4 - bl reset_temp_tile_data_buffers - ldr r1, =gUnknown_08DA33C0 - movs r4, 0 - str r4, [sp] - movs r0, 0 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r1, =gUnknown_08DA4F70 - str r4, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r1, =gUnknown_08DA3C94 - str r4, [sp] - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram -_081D7ED0: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - bne _081D7ED0 - ldr r0, =gUnknown_08DA3988 - ldr r4, =gUnknown_0203CF60 - ldr r1, [r4] - adds r1, 0x4 - bl LZDecompressWram - ldr r0, =gUnknown_08DA60B8 - ldr r1, [r4] - ldr r2, =0x00000804 - adds r1, r2 - bl LZDecompressWram - ldr r0, =gUnknown_08DA4DEC - ldr r1, [r4] - ldr r2, =0x00001004 - adds r1, r2 - bl LZDecompressWram - ldr r0, =gUnknown_08DA4DA8 - movs r1, 0 - movs r2, 0x40 - bl LoadCompressedPalette - ldr r0, =gUnknown_0862AA90 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0862AA98 - bl LoadCompressedObjectPalette - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D7E9C - - thumb_func_start sub_81D7F4C -sub_81D7F4C: @ 81D7F4C - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r5, =gTasks + 0x8 - adds r6, r4, r5 - movs r0, 0xE8 - lsls r0, 1 - bl PlayNewMapMusic - bl sub_81D7E10 - bl sub_81D7E9C - movs r1, 0x94 - lsls r1, 2 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x00000808 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x1 - negs r0, r0 - movs r1, 0x10 - movs r2, 0 - bl BlendPalettes - ldr r0, =sub_81D67EC - bl SetVBlankCallback - ldr r0, =sub_81D81A4 - movs r1, 0 - bl CreateTask - movs r0, 0 - strh r0, [r6] - strh r0, [r6, 0x2] - subs r5, 0x8 - adds r4, r5 - ldr r0, =sub_81D7FC0 - str r0, [r4] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D7F4C - - thumb_func_start sub_81D7FC0 -sub_81D7FC0: @ 81D7FC0 - push {r4-r6,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - movs r0, 0 - ldrsh r5, [r4, r0] - cmp r5, 0x1 - beq _081D802A - cmp r5, 0x1 - bgt _081D7FE8 - cmp r5, 0 - beq _081D7FF4 - b _081D815A - .pool -_081D7FE8: - cmp r5, 0x2 - beq _081D80A4 - cmp r5, 0x3 - bne _081D7FF2 - b _081D8124 -_081D7FF2: - b _081D815A -_081D7FF4: - ldrh r1, [r4, 0x2] - movs r2, 0x2 - ldrsh r0, [r4, r2] - cmp r0, 0x8 - bne _081D8024 - movs r0, 0x1 - negs r0, r0 - str r5, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - strh r5, [r4, 0x4] - movs r0, 0x1E - strh r0, [r4, 0x6] - strh r5, [r4, 0x8] - movs r0, 0x7 - strh r0, [r4, 0xA] - strh r5, [r4, 0x2] - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - b _081D815A -_081D8024: - adds r0, r1, 0x1 - strh r0, [r4, 0x2] - b _081D815A -_081D802A: - ldrh r1, [r4, 0x6] - ldrh r3, [r4, 0x4] - adds r0, r1, r3 - strh r0, [r4, 0x4] - ldrh r2, [r4, 0xA] - ldrh r3, [r4, 0x8] - adds r0, r2, r3 - strh r0, [r4, 0x8] - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _081D8046 - subs r0, r1, 0x3 - strh r0, [r4, 0x6] -_081D8046: - lsls r0, r2, 16 - cmp r0, 0 - beq _081D8050 - subs r0, r2, 0x1 - strh r0, [r4, 0xA] -_081D8050: - movs r1, 0x4 - ldrsh r0, [r4, r1] - cmp r0, 0xFF - ble _081D8078 - movs r2, 0x80 - lsls r2, 1 - adds r0, r2, 0 - strh r0, [r4, 0x4] - movs r1, 0 - strh r1, [r4, 0x6] - movs r0, 0xC - strh r0, [r4, 0xC] - movs r3, 0x1 - negs r3, r3 - adds r0, r3, 0 - strh r0, [r4, 0xE] - strh r1, [r4, 0x2] - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_081D8078: - movs r1, 0xF0 - lsls r1, 7 - movs r2, 0xC0 - lsls r2, 5 - ldrh r0, [r4, 0x8] - adds r0, 0x20 - lsls r0, 16 - asrs r0, 16 - str r0, [sp] - movs r3, 0x4 - ldrsh r0, [r4, r3] - str r0, [sp, 0x4] - movs r3, 0x4 - ldrsh r0, [r4, r3] - str r0, [sp, 0x8] - movs r0, 0 - str r0, [sp, 0xC] - movs r0, 0x2 - movs r3, 0x78 - bl SetBgAffine - b _081D815A -_081D80A4: - ldrh r0, [r4, 0x2] - adds r0, 0x1 - strh r0, [r4, 0x2] - movs r1, 0xF0 - lsls r1, 7 - movs r2, 0xC0 - lsls r2, 5 - ldrh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 18 - adds r0, 0x20 - ldrh r3, [r4, 0x8] - adds r0, r3 - lsls r0, 16 - asrs r0, 16 - str r0, [sp] - movs r3, 0x4 - ldrsh r0, [r4, r3] - str r0, [sp, 0x4] - movs r3, 0x4 - ldrsh r0, [r4, r3] - str r0, [sp, 0x8] - movs r5, 0 - str r5, [sp, 0xC] - movs r0, 0x2 - movs r3, 0x78 - bl SetBgAffine - ldrh r0, [r4, 0xE] - ldrh r1, [r4, 0xC] - adds r0, r1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r1, r0, 16 - cmp r1, 0xC - beq _081D80F4 - movs r0, 0xC - negs r0, r0 - cmp r1, r0 - bne _081D815A -_081D80F4: - movs r2, 0xE - ldrsh r0, [r4, r2] - negs r0, r0 - strh r0, [r4, 0xE] - movs r3, 0x2 - ldrsh r1, [r4, r3] - ldr r0, =0x00000127 - cmp r1, r0 - ble _081D815A - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - movs r0, 0x1 - negs r0, r0 - str r5, [sp] - movs r1, 0x6 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - b _081D815A - .pool -_081D8124: - ldrh r0, [r4, 0x4] - adds r0, 0x10 - strh r0, [r4, 0x4] - movs r1, 0xF0 - lsls r1, 7 - movs r2, 0xC0 - lsls r2, 5 - ldrh r0, [r4, 0x8] - adds r0, 0x20 - lsls r0, 16 - asrs r0, 16 - str r0, [sp] - movs r3, 0x4 - ldrsh r0, [r4, r3] - str r0, [sp, 0x4] - movs r3, 0x4 - ldrsh r0, [r4, r3] - str r0, [sp, 0x8] - movs r0, 0 - str r0, [sp, 0xC] - movs r0, 0x2 - movs r3, 0x78 - bl SetBgAffine - adds r0, r6, 0 - bl sub_81D8164 -_081D815A: - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81D7FC0 - - thumb_func_start sub_81D8164 -sub_81D8164: @ 81D8164 - 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 _081D8192 - movs r0, 0 - bl SetVBlankCallback - bl ResetSpriteData - bl FreeAllSpritePalettes - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81D6840 - str r0, [r1] -_081D8192: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D8164 - - thumb_func_start sub_81D81A4 -sub_81D81A4: @ 81D81A4 - push {r4-r6,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 r1, [r4, 0x2] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - bne _081D8254 - ldr r0, =gUnknown_0862AAA0 - ldr r3, =gUnknown_0862AAB8 - movs r1, 0 - ldrsh r2, [r4, r1] - lsls r2, 1 - adds r1, r2, r3 - ldrb r1, [r1] - lsls r1, 24 - asrs r1, 24 - lsls r1, 18 - movs r6, 0xF0 - lsls r6, 15 - adds r1, r6 - asrs r1, 16 - adds r3, 0x1 - adds r2, r3 - ldrb r2, [r2] - lsls r2, 24 - asrs r2, 24 - lsls r2, 18 - movs r3, 0xA0 - lsls r3, 15 - adds r2, r3 - asrs r2, 16 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gSprites - lsls r3, r0, 4 - adds r3, r0 - lsls r3, 2 - adds r3, r1 - movs r0, 0 - ldrsb r0, [r4, r0] - strh r0, [r3, 0x2E] - ldrb r2, [r3, 0x1] - movs r1, 0xD - negs r1, r1 - adds r0, r1, 0 - ands r0, r2 - movs r2, 0x4 - orrs r0, r2 - movs r2, 0x3 - orrs r0, r2 - strb r0, [r3, 0x1] - ldrb r0, [r3, 0x5] - ands r1, r0 - movs r0, 0x8 - orrs r1, r0 - strb r1, [r3, 0x5] - adds r0, r3, 0 - bl InitSpriteAffineAnim - ldrh r1, [r4] - movs r6, 0 - ldrsh r0, [r4, r6] - cmp r0, 0x9 - bne _081D8250 - adds r0, r5, 0 - bl DestroyTask - b _081D825A - .pool -_081D8250: - adds r0, r1, 0x1 - strh r0, [r4] -_081D8254: - ldrh r0, [r4, 0x2] - adds r0, 0x1 - strh r0, [r4, 0x2] -_081D825A: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81D81A4 - - thumb_func_start sub_81D8260 -sub_81D8260: @ 81D8260 - push {lr} - adds r2, r0, 0 - movs r1, 0x30 - ldrsh r0, [r2, r1] - cmp r0, 0 - bne _081D8270 - strh r0, [r2, 0x24] - b _081D829A -_081D8270: - ldr r1, =gUnknown_0862AAB8 - movs r3, 0x2E - ldrsh r0, [r2, r3] - lsls r0, 1 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - ldrh r3, [r2, 0x24] - adds r0, r3 - strh r0, [r2, 0x24] - movs r3, 0x2E - ldrsh r0, [r2, r3] - lsls r0, 1 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - ldrh r1, [r2, 0x26] - adds r0, r1 -_081D829A: - strh r0, [r2, 0x26] - ldrh r0, [r2, 0x30] - adds r0, 0x1 - movs r1, 0xF - ands r0, r1 - strh r0, [r2, 0x30] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D8260 - - thumb_func_start sub_81D82B0 -sub_81D82B0: @ 81D82B0 - push {r4,lr} - bl sub_8121DA0 - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0862AACC - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - ldr r4, =gUnknown_0203CF60 - ldr r1, [r4] - adds r1, 0x4 - movs r0, 0 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00000804 - adds r1, r0 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00001004 - adds r1, r0 - movs r0, 0x2 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00001804 - adds r1, r0 - movs r0, 0x3 - bl SetBgTilemapBuffer - bl sub_8121E10 - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x3 - bl schedule_bg_copy_tilemap_to_vram - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D82B0 - - thumb_func_start sub_81D8358 -sub_81D8358: @ 81D8358 - push {r4-r7,lr} - sub sp, 0xC - bl reset_temp_tile_data_buffers - ldr r1, =gUnknown_08DA7528 - movs r4, 0 - str r4, [sp] - movs r0, 0 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r1, =gUnknown_08DA69BC - str r4, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - add r7, sp, 0x8 -_081D8380: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - bne _081D8380 - ldr r0, =gUnknown_08DA7AAC - ldr r5, =gUnknown_0203CF60 - ldr r1, [r5] - adds r1, 0x4 - bl LZDecompressWram - ldr r0, =gUnknown_08DA7784 - ldr r1, [r5] - ldr r4, =0x00001804 - adds r1, r4 - bl LZDecompressWram - str r6, [sp, 0x4] - ldr r1, [r5] - ldr r0, =0x00001004 - adds r1, r0 - ldr r2, =0x01000200 - add r0, sp, 0x4 - bl CpuFastSet - ldr r1, [r5] - adds r4, r1, r4 - ldr r0, =0x00000804 - adds r1, r0 - movs r2, 0x80 - lsls r2, 2 - adds r0, r4, 0 - bl CpuFastSet - str r6, [sp, 0x8] - ldr r1, [r5] - ldr r0, =0x00000904 - adds r1, r0 - ldr r2, =0x010000d0 - adds r0, r7, 0 - bl CpuFastSet - ldr r0, =gUnknown_08DA7744 - movs r1, 0 - movs r2, 0x40 - bl LoadCompressedPalette - ldr r0, =gPlttBufferUnfaded - ldr r1, =0x00007fff - strh r1, [r0] - ldr r0, =gPlttBufferFaded - strh r1, [r0] - ldr r0, =gUnknown_0862AAFC - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0862AB04 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0862AB0C - bl LoadCompressedObjectPalette - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D8358 - - thumb_func_start sub_81D844C -sub_81D844C: @ 81D844C - push {r4,r5,lr} - movs r0, 0x6 - bl GetGpuReg - lsls r0, 16 - lsrs r2, r0, 16 - adds r1, r2, 0 - subs r1, 0x18 - lsls r0, r1, 16 - lsrs r0, 16 - cmp r0, 0x6F - bhi _081D848C - ldr r0, =gUnknown_0203CF60 - ldr r0, [r0] - ldr r3, =0x00002008 - adds r0, r3 - movs r3, 0 - ldrsh r0, [r0, r3] - cmp r1, r0 - bgt _081D848C - ldr r1, =0x04000052 - ldr r3, =0x00000d08 - b _081D8492 - .pool -_081D848C: - ldr r1, =0x04000052 - movs r3, 0x80 - lsls r3, 5 -_081D8492: - adds r0, r3, 0 - strh r0, [r1] - cmp r2, 0 - bne _081D84E0 - ldr r0, =gUnknown_0203CF60 - ldr r1, [r0] - ldr r2, =0x00002008 - adds r3, r1, r2 - ldrh r4, [r3] - movs r1, 0 - ldrsh r2, [r3, r1] - ldr r1, =0x00001fff - adds r5, r0, 0 - cmp r2, r1 - bgt _081D84D4 - cmp r2, 0x27 - bgt _081D84C8 - adds r0, r4, 0x4 - b _081D84D2 - .pool -_081D84C8: - cmp r2, 0x4F - bgt _081D84D0 - adds r0, r4, 0x2 - b _081D84D2 -_081D84D0: - adds r0, r4, 0x1 -_081D84D2: - strh r0, [r3] -_081D84D4: - ldr r1, [r5] - ldr r2, =0x0000200a - adds r1, r2 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_081D84E0: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D844C - - thumb_func_start sub_81D84EC -sub_81D84EC: @ 81D84EC - push {r4-r6,lr} - mov r6, r8 - push {r6} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r6, =gTasks + 0x8 - adds r5, r4, r6 - bl sub_81D82B0 - bl sub_81D8358 - ldr r1, =0x00001e41 - movs r0, 0x50 - bl SetGpuRegBits - movs r0, 0x80 - lsls r0, 5 - mov r8, r0 - movs r0, 0x52 - mov r1, r8 - bl SetGpuReg - movs r0, 0x1 - negs r0, r0 - movs r1, 0x10 - movs r2, 0 - bl BlendPalettes - ldr r0, =sub_81D67EC - bl SetVBlankCallback - ldr r0, =gUnknown_0203CF60 - ldr r0, [r0] - ldr r1, =0x00002008 - adds r2, r0, r1 - movs r1, 0 - strh r1, [r2] - ldr r2, =0x0000200a - adds r0, r2 - strh r1, [r0] - strh r1, [r5] - strh r1, [r5, 0x2] - strh r1, [r5, 0x4] - strh r1, [r5, 0x6] - mov r0, r8 - strh r0, [r5, 0x8] - subs r6, 0x8 - adds r4, r6 - ldr r0, =sub_81D857C - str r0, [r4] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D84EC - - thumb_func_start sub_81D857C -sub_81D857C: @ 81D857C - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r5, r0, r1 - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0x4 - bhi _081D8674 - lsls r0, 2 - ldr r1, =_081D85A8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081D85A8: - .4byte _081D85BC - .4byte _081D85DC - .4byte _081D861A - .4byte _081D863A - .4byte _081D8656 -_081D85BC: - ldrh r1, [r5, 0x2] - movs r2, 0x2 - ldrsh r0, [r5, r2] - cmp r0, 0x8 - bne _081D8634 - movs r0, 0x1 - negs r0, r0 - movs r4, 0 - str r4, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - strh r4, [r5, 0x2] - b _081D864E -_081D85DC: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _081D8674 - ldrh r2, [r5, 0x2] - movs r3, 0x2 - ldrsh r0, [r5, r3] - cmp r0, 0xA - bne _081D8614 - strh r1, [r5, 0x2] - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - ldr r0, =sub_81D844C - bl SetHBlankCallback - movs r0, 0x3 - bl EnableInterrupts - b _081D8674 - .pool -_081D8614: - adds r0, r2, 0x1 - strh r0, [r5, 0x2] - b _081D8674 -_081D861A: - ldrh r1, [r5, 0x2] - movs r2, 0x2 - ldrsh r0, [r5, r2] - cmp r0, 0x50 - bne _081D8634 - movs r0, 0 - strh r0, [r5, 0x2] - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - bl sub_81D86CC - b _081D8674 -_081D8634: - adds r0, r1, 0x1 - strh r0, [r5, 0x2] - b _081D8674 -_081D863A: - ldrh r0, [r5, 0x2] - adds r0, 0x1 - strh r0, [r5, 0x2] - lsls r0, 16 - movs r1, 0xB8 - lsls r1, 17 - cmp r0, r1 - bne _081D8674 - movs r0, 0 - strh r0, [r5, 0x2] -_081D864E: - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - b _081D8674 -_081D8656: - 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_81D8684 - str r1, [r0] -_081D8674: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D857C - - thumb_func_start sub_81D8684 -sub_81D8684: @ 81D8684 - 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 _081D86B8 - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - bl SetHBlankCallback - bl ResetSpriteData - bl FreeAllSpritePalettes - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81D6840 - str r0, [r1] -_081D86B8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D8684 - - thumb_func_start sub_81D86CC -sub_81D86CC: @ 81D86CC - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r0, =gUnknown_0862AB14 - movs r1, 0xA0 - movs r2, 0 - movs r3, 0 - bl CreateSprite - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - lsls r5, r6, 4 - adds r5, r6 - lsls r5, 2 - ldr r4, =gSprites + 0x2E - adds r0, r5, r4 - mov r8, r0 - ldr r0, =gUnknown_0862AB2C - movs r2, 0x30 - negs r2, r2 - movs r1, 0xB8 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - mov r1, r8 - strh r0, [r1] - adds r3, r4, 0 - subs r3, 0x2E - subs r4, 0x12 - adds r4, r5, r4 - ldr r0, =sub_81D874C - str r0, [r4] - adds r5, r3 - ldrb r0, [r5, 0x5] - movs r2, 0xC - orrs r0, r2 - strb r0, [r5, 0x5] - movs r4, 0 - ldrsh r1, [r1, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r1, [r0, 0x5] - orrs r1, r2 - strb r1, [r0, 0x5] - adds r0, r6, 0 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D86CC - - thumb_func_start sub_81D874C -sub_81D874C: @ 81D874C - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r5, 0 - adds r4, 0x2E - movs r0, 0x4 - ldrsh r1, [r4, r0] - cmp r1, 0 - bne _081D8764 - movs r0, 0xC - strh r0, [r4, 0x6] - movs r0, 0x8 - b _081D87C2 -_081D8764: - movs r0, 0x80 - lsls r0, 1 - cmp r1, r0 - bne _081D8774 - movs r0, 0x9 - strh r0, [r4, 0x6] - movs r0, 0x7 - b _081D87C2 -_081D8774: - movs r0, 0x86 - lsls r0, 1 - cmp r1, r0 - bne _081D8784 - movs r0, 0x8 - strh r0, [r4, 0x6] - movs r0, 0x6 - b _081D87C2 -_081D8784: - movs r0, 0x8C - lsls r0, 1 - cmp r1, r0 - bne _081D8794 - movs r0, 0x7 - strh r0, [r4, 0x6] - movs r0, 0x5 - b _081D87C2 -_081D8794: - movs r0, 0x92 - lsls r0, 1 - cmp r1, r0 - bne _081D87A4 - movs r0, 0x6 - strh r0, [r4, 0x6] - movs r0, 0x4 - b _081D87C2 -_081D87A4: - movs r0, 0x98 - lsls r0, 1 - cmp r1, r0 - bne _081D87B4 - movs r0, 0x5 - strh r0, [r4, 0x6] - movs r0, 0x3 - b _081D87C2 -_081D87B4: - movs r0, 0xA0 - lsls r0, 1 - cmp r1, r0 - bne _081D87C4 - movs r0, 0x4 - strh r0, [r4, 0x6] - movs r0, 0x2 -_081D87C2: - strh r0, [r4, 0x8] -_081D87C4: - movs r1, 0x4 - ldrsh r0, [r4, r1] - movs r2, 0x6 - ldrsh r1, [r4, r2] - bl __modsi3 - cmp r0, 0 - bne _081D87EE - ldrh r0, [r5, 0x24] - subs r0, 0x1 - strh r0, [r5, 0x24] - ldr r2, =gSprites - movs r0, 0 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x24] - subs r1, 0x1 - strh r1, [r0, 0x24] -_081D87EE: - movs r1, 0x4 - ldrsh r0, [r4, r1] - movs r2, 0x8 - ldrsh r1, [r4, r2] - bl __modsi3 - cmp r0, 0 - bne _081D8818 - ldrh r0, [r5, 0x26] - adds r0, 0x1 - strh r0, [r5, 0x26] - ldr r2, =gSprites - movs r0, 0 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x26] - adds r1, 0x1 - strh r1, [r0, 0x26] -_081D8818: - ldrh r0, [r4, 0x4] - adds r0, 0x1 - strh r0, [r4, 0x4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D874C - - thumb_func_start sub_81D8828 -sub_81D8828: @ 81D8828 - push {r4,lr} - bl sub_8121DA0 - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0862AB44 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - ldr r4, =gUnknown_0203CF60 - ldr r1, [r4] - adds r1, 0x4 - movs r0, 0 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00000804 - adds r1, r0 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00001004 - adds r1, r0 - movs r0, 0x2 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00001804 - adds r1, r0 - movs r0, 0x3 - bl SetBgTilemapBuffer - bl sub_8121E10 - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x3 - bl schedule_bg_copy_tilemap_to_vram - movs r1, 0xC1 - lsls r1, 6 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D8828 - - thumb_func_start sub_81D88D0 -sub_81D88D0: @ 81D88D0 - push {r4,lr} - sub sp, 0x4 - bl reset_temp_tile_data_buffers - ldr r1, =gUnknown_08DA80BC - movs r4, 0 - str r4, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r1, =gUnknown_08DA7EAC - str r4, [sp] - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r1, =gUnknown_08DA7C30 - str r4, [sp] - movs r0, 0x3 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram -_081D8904: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - bne _081D8904 - ldr r0, =gUnknown_08DA8D6C - ldr r4, =gUnknown_0203CF60 - ldr r1, [r4] - adds r1, 0x4 - bl LZDecompressWram - ldr r0, =gUnknown_08DA8B40 - ldr r1, [r4] - ldr r2, =0x00000804 - adds r1, r2 - bl LZDecompressWram - ldr r0, =gUnknown_08DA7FB4 - ldr r1, [r4] - ldr r2, =0x00001004 - adds r1, r2 - bl LZDecompressWram - ldr r0, =gUnknown_08DA7D6C - ldr r1, [r4] - ldr r2, =0x00001804 - adds r1, r2 - bl LZDecompressWram - ldr r0, =gUnknown_08DA8E84 - movs r1, 0 - movs r2, 0x80 - bl LoadCompressedPalette - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D88D0 - - thumb_func_start sub_81D8980 -sub_81D8980: @ 81D8980 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r5, =gTasks + 0x8 - adds r6, r4, r5 - bl sub_81D8828 - bl sub_81D88D0 - bl sub_81D68C8 - movs r0, 0x1 - negs r0, r0 - movs r1, 0x10 - movs r2, 0 - bl BlendPalettes - ldr r0, =sub_81D67EC - bl SetVBlankCallback - movs r0, 0 - strh r0, [r6] - strh r0, [r6, 0x2] - ldr r0, =sub_81D8AD8 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x4] - subs r5, 0x8 - adds r4, r5 - ldr r0, =sub_81D89E0 - str r0, [r4] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D8980 - - thumb_func_start sub_81D89E0 -sub_81D89E0: @ 81D89E0 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - bl sub_81D8BB4 - ldrh r1, [r4, 0x6] - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - bne _081D8A16 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - bgt _081D8A16 - movs r2, 0x2 - ldrsh r0, [r4, r2] - cmp r0, 0x59 - bgt _081D8A16 - movs r0, 0x67 - bl PlaySE -_081D8A16: - ldrh r0, [r4, 0x6] - adds r0, 0x1 - strh r0, [r4, 0x6] - movs r0, 0 - ldrsh r5, [r4, r0] - cmp r5, 0x1 - beq _081D8A5C - cmp r5, 0x1 - bgt _081D8A34 - cmp r5, 0 - beq _081D8A3E - b _081D8AC6 - .pool -_081D8A34: - cmp r5, 0x2 - beq _081D8A8C - cmp r5, 0x3 - beq _081D8AA8 - b _081D8AC6 -_081D8A3E: - ldrh r1, [r4, 0x2] - movs r2, 0x2 - ldrsh r0, [r4, r2] - cmp r0, 0x8 - bne _081D8AA2 - movs r0, 0x1 - negs r0, r0 - str r5, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - strh r5, [r4, 0x2] - b _081D8A9A -_081D8A5C: - ldrh r1, [r4, 0x2] - movs r2, 0x2 - ldrsh r0, [r4, r2] - cmp r0, 0x7F - bne _081D8AA2 - movs r0, 0 - strh r0, [r4, 0x2] - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - ldr r2, =gTasks - movs r0, 0x4 - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldr r1, =sub_81D8B2C - b _081D8AC4 - .pool -_081D8A8C: - ldrh r1, [r4, 0x2] - movs r2, 0x2 - ldrsh r0, [r4, r2] - cmp r0, 0xC - bne _081D8AA2 - movs r0, 0 - strh r0, [r4, 0x2] -_081D8A9A: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - b _081D8AC6 -_081D8AA2: - adds r0, r1, 0x1 - strh r0, [r4, 0x2] - b _081D8AC6 -_081D8AA8: - 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, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81D8BEC -_081D8AC4: - str r1, [r0] -_081D8AC6: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D89E0 - - thumb_func_start sub_81D8AD8 -sub_81D8AD8: @ 81D8AD8 - 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 r5, r1, r0 - ldrh r1, [r5, 0x1E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - bne _081D8B1C - bl Random - movs r4, 0x7 - adds r1, r4, 0 - ands r1, r0 - subs r1, 0x4 - lsls r1, 8 - movs r0, 0x1 - movs r2, 0 - bl ChangeBgX - bl Random - ands r4, r0 - subs r4, 0x4 - lsls r4, 8 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0 - bl ChangeBgY -_081D8B1C: - ldrh r0, [r5, 0x1E] - adds r0, 0x1 - strh r0, [r5, 0x1E] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D8AD8 - - thumb_func_start sub_81D8B2C -sub_81D8B2C: @ 81D8B2C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r4, r1, r0 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081D8B70 - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - movs r0, 0xA - strh r0, [r4, 0x2] - movs r1, 0x1 - negs r1, r1 - adds r0, r1, 0 - b _081D8BAA - .pool -_081D8B70: - cmp r0, 0x1 - bne _081D8BAC - movs r0, 0x2 - ldrsh r1, [r4, r0] - lsls r1, 8 - movs r0, 0x1 - movs r2, 0x2 - bl ChangeBgX - movs r0, 0x2 - ldrsh r1, [r4, r0] - lsls r1, 8 - movs r0, 0x1 - movs r2, 0x1 - bl ChangeBgY - ldrh r0, [r4, 0x4] - ldrh r1, [r4, 0x2] - adds r0, r1 - strh r0, [r4, 0x2] - lsls r0, 16 - asrs r0, 16 - movs r1, 0xA - negs r1, r1 - cmp r0, r1 - bne _081D8BAC - movs r1, 0x4 - ldrsh r0, [r4, r1] - negs r0, r0 -_081D8BAA: - strh r0, [r4, 0x4] -_081D8BAC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81D8B2C - - thumb_func_start sub_81D8BB4 -sub_81D8BB4: @ 81D8BB4 - push {r4,lr} - movs r4, 0x80 - lsls r4, 3 - movs r0, 0x2 - adds r1, r4, 0 - movs r2, 0x2 - bl ChangeBgX - movs r0, 0x2 - adds r1, r4, 0 - movs r2, 0x1 - bl ChangeBgY - movs r4, 0x80 - lsls r4, 4 - movs r0, 0 - adds r1, r4, 0 - movs r2, 0x2 - bl ChangeBgX - movs r0, 0 - adds r1, r4, 0 - movs r2, 0x1 - bl ChangeBgY - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81D8BB4 - - thumb_func_start sub_81D8BEC -sub_81D8BEC: @ 81D8BEC - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r5, r1, 3 - ldr r6, =gTasks + 0x8 - adds r4, r5, r6 - bl sub_81D8BB4 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081D8C26 - movs r0, 0 - bl SetVBlankCallback - bl sub_81D6904 - ldrb r0, [r4, 0x4] - bl DestroyTask - adds r0, r6, 0 - subs r0, 0x8 - adds r0, r5, r0 - ldr r1, =sub_81D6840 - str r1, [r0] -_081D8C26: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D8BEC - - thumb_func_start sub_81D8C38 -sub_81D8C38: @ 81D8C38 - push {r4,lr} - bl sub_8121DA0 - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0862AD08 - movs r0, 0x1 - movs r2, 0x3 - bl InitBgsFromTemplates - ldr r4, =gUnknown_0203CF60 - ldr r1, [r4] - adds r1, 0x4 - movs r0, 0 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00000804 - adds r1, r0 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00001004 - adds r1, r0 - movs r0, 0x2 - bl SetBgTilemapBuffer - bl sub_8121E10 - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - movs r1, 0xC1 - lsls r1, 6 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D8C38 - - thumb_func_start sub_81D8CC4 -sub_81D8CC4: @ 81D8CC4 - push {r4,lr} - sub sp, 0x4 - bl reset_temp_tile_data_buffers - ldr r1, =gUnknown_08DAAB24 - movs r4, 0 - str r4, [sp] - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r1, =gUnknown_08DAA8B4 - str r4, [sp] - movs r0, 0 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram -_081D8CEA: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - bne _081D8CEA - ldr r0, =gUnknown_08DAAE54 - ldr r4, =gUnknown_0203CF60 - ldr r1, [r4] - ldr r2, =0x00000804 - adds r1, r2 - bl LZDecompressWram - ldr r0, =gUnknown_08DAAC1C - ldr r1, [r4] - adds r1, 0x4 - bl LZDecompressWram - ldr r0, =gUnknown_08DAAF98 - ldr r1, [r4] - ldr r2, =0x00001004 - adds r1, r2 - bl LZDecompressWram - ldr r0, =gUnknown_08DAAFEC - movs r1, 0 - movs r2, 0x60 - bl LoadCompressedPalette - ldr r0, =gUnknown_0862AC28 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0862AC30 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0862AC38 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0862AC40 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0862AC48 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0862AC50 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0862AC58 - bl LoadCompressedObjectPalette - ldr r0, =gUnknown_0862AC60 - bl LoadCompressedObjectPalette - ldr r0, =gUnknown_0862AC68 - bl LoadCompressedObjectPalette - ldr r0, =gUnknown_0862AC70 - bl LoadCompressedObjectPalette - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D8CC4 - - thumb_func_start sub_81D8DB4 -sub_81D8DB4: @ 81D8DB4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r5, =gTasks + 0x8 - adds r6, r4, r5 - bl sub_81D8C38 - bl sub_81D8CC4 - bl sub_81D68C8 - movs r1, 0x80 - lsls r1, 3 - movs r0, 0 - bl ClearGpuRegBits - ldr r1, =0x00000241 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x00000e09 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x1 - negs r0, r0 - movs r1, 0x10 - movs r2, 0 - bl BlendPalettes - ldr r0, =sub_81D67EC - bl SetVBlankCallback - movs r0, 0 - strh r0, [r6] - strh r0, [r6, 0x2] - subs r5, 0x8 - adds r4, r5 - ldr r0, =sub_81D8E80 - str r0, [r4] - ldr r0, =sub_81D8FB0 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x4] - movs r0, 0x4 - ldrsh r1, [r6, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - movs r2, 0 - strh r2, [r0, 0x8] - movs r0, 0x4 - ldrsh r1, [r6, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - strh r2, [r0, 0xA] - movs r0, 0x4 - ldrsh r1, [r6, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - strh r2, [r0, 0xC] - movs r0, 0x4 - ldrsh r1, [r6, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - movs r2, 0x1 - strh r2, [r0, 0xE] - movs r0, 0x4 - ldrsh r1, [r6, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - strh r2, [r0, 0x10] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D8DB4 - - thumb_func_start sub_81D8E80 -sub_81D8E80: @ 81D8E80 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r7, r0, 3 - ldr r0, =gTasks + 0x8 - mov r8, r0 - adds r4, r7, r0 - movs r1, 0 - ldrsh r5, [r4, r1] - cmp r5, 0x1 - beq _081D8EDE - cmp r5, 0x1 - bgt _081D8EB0 - cmp r5, 0 - beq _081D8EBA - b _081D8FA0 - .pool -_081D8EB0: - cmp r5, 0x2 - beq _081D8F1E - cmp r5, 0x3 - beq _081D8F84 - b _081D8FA0 -_081D8EBA: - ldrh r1, [r4, 0x2] - movs r2, 0x2 - ldrsh r0, [r4, r2] - cmp r0, 0x8 - bne _081D8F18 - adds r0, r6, 0 - bl sub_81D90A8 - movs r0, 0x1 - negs r0, r0 - str r5, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - strh r5, [r4, 0x2] - b _081D8F30 -_081D8EDE: - ldr r2, =gSprites - movs r0, 0xA - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =sub_81D97E0 - cmp r1, r0 - bne _081D8FA0 - ldrh r1, [r4, 0x2] - movs r2, 0x2 - ldrsh r0, [r4, r2] - cmp r0, 0x40 - bne _081D8F18 - adds r0, r6, 0 - bl sub_81D94D4 - adds r0, r6, 0 - bl sub_81D93D8 - b _081D8F2C - .pool -_081D8F18: - adds r0, r1, 0x1 - strh r0, [r4, 0x2] - b _081D8FA0 -_081D8F1E: - ldrh r2, [r4, 0x2] - movs r0, 0x2 - ldrsh r1, [r4, r0] - movs r0, 0xE0 - lsls r0, 1 - cmp r1, r0 - bne _081D8F38 -_081D8F2C: - movs r0, 0 - strh r0, [r4, 0x2] -_081D8F30: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - b _081D8FA0 -_081D8F38: - adds r0, r2, 0x1 - strh r0, [r4, 0x2] - movs r1, 0x2 - ldrsh r0, [r4, r1] - movs r1, 0x90 - bl __modsi3 - lsls r0, 16 - asrs r4, r0, 16 - cmp r4, 0 - bne _081D8FA0 - ldr r0, =0x0000fffe - ldr r1, =0x0000ffff - str r1, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl sub_80A2C44 - ldr r0, =0xffff0000 - str r4, [sp] - str r4, [sp, 0x4] - movs r1, 0x1 - str r1, [sp, 0x8] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl sub_80A2C44 - b _081D8FA0 - .pool -_081D8F84: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r1, 0x4 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - mov r0, r8 - subs r0, 0x8 - adds r0, r7, r0 - ldr r1, =sub_81D9034 - str r1, [r0] -_081D8FA0: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D8E80 - - thumb_func_start sub_81D8FB0 -sub_81D8FB0: @ 81D8FB0 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r4, r1, r0 - ldrh r1, [r4] - movs r0, 0xF - ands r0, r1 - cmp r0, 0 - bne _081D9024 - ldrh r1, [r4, 0x2] - adds r1, 0xE - lsls r1, 8 - movs r2, 0xF8 - lsls r2, 5 - adds r0, r2, 0 - ands r1, r0 - ldrh r0, [r4, 0x4] - adds r0, 0x9 - movs r2, 0xF - ands r0, r2 - orrs r1, r0 - movs r0, 0x52 - bl SetGpuReg - ldrh r1, [r4, 0x2] - ldrh r0, [r4, 0x6] - subs r1, r0 - strh r1, [r4, 0x2] - ldrh r0, [r4, 0x8] - ldrh r2, [r4, 0x4] - adds r0, r2 - strh r0, [r4, 0x4] - lsls r1, 16 - asrs r1, 16 - movs r0, 0x3 - negs r0, r0 - cmp r1, r0 - beq _081D9008 - cmp r1, 0 - bne _081D9010 -_081D9008: - movs r1, 0x6 - ldrsh r0, [r4, r1] - negs r0, r0 - strh r0, [r4, 0x6] -_081D9010: - movs r2, 0x4 - ldrsh r0, [r4, r2] - cmp r0, 0x3 - beq _081D901C - cmp r0, 0 - bne _081D9024 -_081D901C: - movs r1, 0x8 - ldrsh r0, [r4, r1] - negs r0, r0 - strh r0, [r4, 0x8] -_081D9024: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D8FB0 - - thumb_func_start sub_81D9034 -sub_81D9034: @ 81D9034 - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r6, r1, 3 - ldr r7, =gTasks + 0x8 - adds r4, r6, r7 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _081D90A0 - bl StopMapMusic - movs r1, 0x2 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081D9078 - movs r0, 0 - bl SetVBlankCallback - bl sub_81D6904 - bl ResetSpriteData - bl FreeAllSpritePalettes - ldrb r0, [r4, 0x4] - bl DestroyTask -_081D9078: - ldrh r1, [r4, 0x2] - movs r2, 0x2 - ldrsh r0, [r4, r2] - cmp r0, 0x20 - bne _081D909C - strh r5, [r4, 0x2] - adds r0, r7, 0 - subs r0, 0x8 - adds r0, r6, r0 - ldr r1, =sub_81D6840 - str r1, [r0] - b _081D90A0 - .pool -_081D909C: - adds r0, r1, 0x1 - strh r0, [r4, 0x2] -_081D90A0: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81D9034 - - thumb_func_start sub_81D90A8 -sub_81D90A8: @ 81D90A8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - ldr r0, =gUnknown_0862AC78 - movs r1, 0x40 - movs r2, 0x78 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x6] - movs r0, 0x6 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites + 0x2E - mov r10, r1 - adds r7, r0, r1 - ldr r0, =gUnknown_0862AC90 - movs r1, 0x10 - movs r2, 0x82 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7] - movs r2, 0x2E - negs r2, r2 - add r2, r10 - mov r8, r2 - movs r1, 0x6 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r8 - ldrb r2, [r1, 0x5] - movs r6, 0xD - negs r6, r6 - adds r0, r6, 0 - ands r0, r2 - movs r2, 0x4 - mov r9, r2 - mov r2, r9 - orrs r0, r2 - strb r0, [r1, 0x5] - movs r1, 0 - ldrsh r0, [r7, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r8 - ldrb r2, [r1, 0x5] - adds r0, r6, 0 - ands r0, r2 - mov r2, r9 - orrs r0, r2 - strb r0, [r1, 0x5] - ldr r5, =gUnknown_0862ACA8 - adds r0, r5, 0 - movs r1, 0xA0 - movs r2, 0x80 - movs r3, 0x1 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x8] - movs r0, 0x8 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - mov r1, r10 - adds r7, r0, r1 - adds r0, r5, 0 - movs r1, 0xC0 - movs r2, 0x80 - movs r3, 0x1 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7] - adds r0, r5, 0 - movs r1, 0xE0 - movs r2, 0x80 - movs r3, 0x1 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7, 0x2] - movs r2, 0x8 - ldrsh r0, [r4, r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r8 - ldrb r2, [r1, 0x5] - adds r0, r6, 0 - ands r0, r2 - mov r2, r9 - orrs r0, r2 - strb r0, [r1, 0x5] - movs r1, 0 - ldrsh r0, [r7, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r8 - ldrb r2, [r1, 0x5] - adds r0, r6, 0 - ands r0, r2 - mov r2, r9 - orrs r0, r2 - strb r0, [r1, 0x5] - movs r1, 0x2 - ldrsh r0, [r7, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r8 - ldrb r2, [r1, 0x5] - adds r0, r6, 0 - ands r0, r2 - mov r2, r9 - orrs r0, r2 - strb r0, [r1, 0x5] - movs r0, 0 - ldrsh r1, [r7, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - movs r1, 0x1 - bl StartSpriteAnim - movs r2, 0x2 - ldrsh r1, [r7, r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - movs r1, 0x2 - bl StartSpriteAnim - ldr r0, =gUnknown_0862ACC0 - movs r2, 0x41 - negs r2, r2 - movs r1, 0x78 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0xA] - movs r0, 0xA - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - mov r1, r10 - adds r7, r0, r1 - ldr r0, =gUnknown_0862ACD8 - movs r2, 0x71 - negs r2, r2 - movs r1, 0x78 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7] - movs r2, 0xA - ldrsh r0, [r4, r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r8 - ldrb r2, [r1, 0x5] - adds r0, r6, 0 - ands r0, r2 - mov r2, r9 - orrs r0, r2 - strb r0, [r1, 0x5] - movs r0, 0 - ldrsh r1, [r7, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - ldrb r1, [r0, 0x5] - ands r6, r1 - orrs r6, r2 - strb r6, [r0, 0x5] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D90A8 - - thumb_func_start sub_81D9274 -sub_81D9274: @ 81D9274 - push {r4-r6,lr} - mov r6, r8 - push {r6} - lsls r0, 24 - lsrs r0, 24 - lsls r2, r0, 2 - adds r2, r0 - lsls r2, 3 - ldr r0, =gTasks + 0x8 - adds r2, r0 - ldr r3, =gSprites - movs r0, 0x6 - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - movs r1, 0x1C - adds r1, r3 - mov r8, r1 - add r0, r8 - ldr r6, =pokemon_alive_on_battle_side - str r6, [r0] - movs r0, 0x6 - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r4, 0 - strh r4, [r0, 0x36] - movs r0, 0x6 - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x38] - movs r0, 0x6 - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r5, 0x4 - strh r5, [r0, 0x3A] - movs r0, 0x6 - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x3C] - movs r0, 0x8 - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - str r6, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x36] - movs r0, 0x8 - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x38] - movs r0, 0x8 - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r5, [r0, 0x3A] - movs r0, 0x8 - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0x1 - strh r1, [r0, 0x3C] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D9274 - - thumb_func_start pokemon_alive_on_battle_side -pokemon_alive_on_battle_side: @ 81D9338 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x36] - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - bne _081D93CC - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081D9370 - ldrh r0, [r4, 0x20] - ldrh r3, [r4, 0x3A] - subs r0, r3 - strh r0, [r4, 0x20] - ldr r2, =gSprites - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x20] - subs r1, r3 - b _081D939E - .pool -_081D9370: - ldrh r2, [r4, 0x3A] - ldrh r1, [r4, 0x20] - adds r0, r2, r1 - strh r0, [r4, 0x20] - ldr r3, =gSprites - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x20] - adds r2, r1 - strh r2, [r0, 0x20] - movs r2, 0x30 - ldrsh r1, [r4, r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r4, 0x3A] - ldrh r2, [r0, 0x20] - adds r1, r2 -_081D939E: - strh r1, [r0, 0x20] - ldrh r1, [r4, 0x38] - adds r1, 0x1 - movs r2, 0 - strh r1, [r4, 0x38] - ldrh r0, [r4, 0x3A] - subs r0, r1 - strh r0, [r4, 0x3A] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x3 - bne _081D93CC - strh r2, [r4, 0x36] - strh r2, [r4, 0x38] - strh r2, [r4, 0x3A] - ldr r0, =SpriteCallbackDummy - str r0, [r4, 0x1C] - b _081D93D2 - .pool -_081D93CC: - ldrh r0, [r4, 0x36] - adds r0, 0x1 - strh r0, [r4, 0x36] -_081D93D2: - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemon_alive_on_battle_side - - thumb_func_start sub_81D93D8 -sub_81D93D8: @ 81D93D8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r2, r0, 2 - adds r2, r0 - lsls r2, 3 - ldr r0, =gTasks + 0x8 - adds r2, r0 - ldr r3, =gSprites - movs r0, 0x6 - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r3, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_81D9420 - str r1, [r0] - movs r0, 0x6 - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0x1 - bl StartSpriteAnim - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D93D8 - - thumb_func_start sub_81D9420 -sub_81D9420: @ 81D9420 - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x2B - ldrb r0, [r0] - cmp r0, 0x1 - beq _081D9488 - cmp r0, 0x1 - bgt _081D9436 - cmp r0, 0 - beq _081D9440 - b _081D94C4 -_081D9436: - cmp r0, 0x2 - beq _081D9440 - cmp r0, 0x3 - beq _081D9488 - b _081D94C4 -_081D9440: - adds r0, r4, 0 - adds r0, 0x2C - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 26 - movs r1, 0xC - bl __umodsi3 - lsls r0, 24 - ldr r2, =gSprites - cmp r0, 0 - bne _081D9470 - ldrh r0, [r4, 0x20] - subs r0, 0x2 - strh r0, [r4, 0x20] - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x20] - subs r1, 0x2 - strh r1, [r0, 0x20] -_081D9470: - movs r1, 0x2E - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0 - strh r0, [r1, 0x26] - b _081D94C4 - .pool -_081D9488: - ldr r2, =gSprites - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x0000fffe - strh r1, [r0, 0x26] - adds r0, r4, 0 - adds r0, 0x2C - ldrb r1, [r0] - lsls r1, 26 - lsrs r1, 26 - movs r0, 0xF - ands r0, r1 - cmp r0, 0 - bne _081D94C4 - ldrh r0, [r4, 0x22] - adds r0, 0x1 - strh r0, [r4, 0x22] - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x22] - adds r1, 0x1 - strh r1, [r0, 0x22] -_081D94C4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D9420 - - thumb_func_start sub_81D94D4 -sub_81D94D4: @ 81D94D4 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r1, r0 - movs r0, 0x8 - ldrsh r1, [r1, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r2, =gSprites + 0x2E - adds r4, r0, r2 - subs r2, 0x12 - adds r0, r2 - ldr r3, =sub_81D9528 - str r3, [r0] - movs r0, 0 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - str r3, [r0] - movs r0, 0x2 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - str r3, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D94D4 - - thumb_func_start sub_81D9528 -sub_81D9528: @ 81D9528 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r7, r0, 0 - ldrh r1, [r7, 0x36] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - bne _081D9550 - ldrh r1, [r7, 0x24] - movs r2, 0x24 - ldrsh r0, [r7, r2] - cmp r0, 0x1 - bne _081D954C - ldr r0, =0x0000ffff - b _081D954E - .pool -_081D954C: - movs r0, 0x1 -_081D954E: - strh r0, [r7, 0x24] -_081D9550: - movs r1, 0x38 - ldrsh r0, [r7, r1] - cmp r0, 0x80 - bne _081D95CE - ldr r2, =gUnknown_0862ACF0 - mov r8, r2 - mov r0, r8 - movs r1, 0x98 - movs r2, 0x84 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7, 0x3C] - ldr r5, =gSprites - movs r1, 0x3C - ldrsh r0, [r7, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r2, [r1, 0x5] - movs r4, 0xD - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - movs r6, 0x4 - orrs r0, r6 - strb r0, [r1, 0x5] - mov r0, r8 - movs r1, 0xE0 - movs r2, 0x84 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7, 0x3C] - movs r2, 0x3C - ldrsh r1, [r7, r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r1, [r0, 0x5] - ands r4, r1 - orrs r4, r6 - strb r4, [r0, 0x5] - movs r0, 0x3C - ldrsh r1, [r7, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3F - ldrb r1, [r0] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0] - ldrh r0, [r7, 0x38] - adds r0, 0x1 - strh r0, [r7, 0x38] -_081D95CE: - ldrh r1, [r7, 0x38] - movs r2, 0x38 - ldrsh r0, [r7, r2] - cmp r0, 0x7F - ble _081D95F8 - movs r1, 0x26 - ldrsh r0, [r7, r1] - cmp r0, 0x20 - beq _081D95FC - ldrh r0, [r7, 0x3A] - adds r0, 0x1 - strh r0, [r7, 0x3A] - lsls r0, 16 - asrs r0, 20 - strh r0, [r7, 0x26] - b _081D95FC - .pool -_081D95F8: - adds r0, r1, 0x1 - strh r0, [r7, 0x38] -_081D95FC: - ldrh r0, [r7, 0x36] - movs r1, 0x3F - ands r0, r1 - cmp r0, 0 - bne _081D960C - movs r0, 0xA5 - bl PlaySE -_081D960C: - ldrh r0, [r7, 0x36] - adds r0, 0x1 - strh r0, [r7, 0x36] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81D9528 - - thumb_func_start sub_81D961C -sub_81D961C: @ 81D961C - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x3C - ldrsh r1, [r4, r0] - cmp r1, 0x40 - bgt _081D968C - ldrh r0, [r4, 0x26] - adds r0, 0x2 - strh r0, [r4, 0x26] - ldr r5, =gSprites - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrh r1, [r0, 0x26] - adds r1, 0x2 - strh r1, [r0, 0x26] - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0x40 - beq _081D964C - b _081D979E -_081D964C: - movs r3, 0x30 - negs r3, r3 - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0 - bl sub_81D9868 - movs r2, 0x5 - strh r2, [r4, 0x36] - ldr r0, =0x0000ffff - strh r0, [r4, 0x38] - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x3 - strh r1, [r0, 0x36] - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r2, [r0, 0x38] - b _081D979E - .pool -_081D968C: - cmp r1, 0x6F - bgt _081D96BE - adds r0, r4, 0 - bl sub_81D97E0 - movs r1, 0x36 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081D96A4 - movs r0, 0x68 - bl PlaySE -_081D96A4: - movs r0, 0x36 - ldrsh r1, [r4, r0] - movs r0, 0x3 - negs r0, r0 - cmp r1, r0 - bne _081D979E - adds r0, r4, 0 - movs r1, 0x2 - movs r2, 0x30 - movs r3, 0x10 - bl sub_81D9868 - b _081D979E -_081D96BE: - cmp r1, 0x70 - bne _081D96EC - ldr r2, =gSprites - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x7 - strh r1, [r0, 0x36] - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x3 - strh r1, [r0, 0x38] - b _081D96F2 - .pool -_081D96EC: - ldr r0, =0x00000147 - cmp r1, r0 - bgt _081D9700 -_081D96F2: - adds r0, r4, 0 - bl sub_81D97E0 - b _081D979E - .pool -_081D9700: - movs r0, 0xA4 - lsls r0, 1 - cmp r1, r0 - bne _081D974C - adds r0, r4, 0 - bl sub_81D97E0 - adds r0, r4, 0 - movs r1, 0x3 - movs r2, 0x30 - movs r3, 0x10 - bl sub_81D9868 - movs r3, 0x1 - strh r3, [r4, 0x24] - ldr r2, =gSprites - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r3, [r0, 0x24] - movs r0, 0xCB - lsls r0, 1 - movs r1, 0 - bl PlayCry1 - ldr r0, =sub_81D98B4 - movs r1, 0 - bl CreateTask - b _081D979E - .pool -_081D974C: - movs r0, 0xB0 - lsls r0, 1 - cmp r1, r0 - beq _081D9790 - adds r0, 0x18 - cmp r1, r0 - bne _081D979E - movs r3, 0 - strh r3, [r4, 0x24] - ldr r2, =gSprites - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r3, [r0, 0x24] - adds r0, r4, 0 - bl sub_81D97E0 - adds r0, r4, 0 - movs r1, 0x2 - movs r2, 0x30 - movs r3, 0x10 - bl sub_81D9868 - ldr r0, =sub_81D97E0 - str r0, [r4, 0x1C] - b _081D97D2 - .pool -_081D9790: - ldr r0, =sub_81D8E80 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl sub_81D9274 -_081D979E: - ldrh r2, [r4, 0x3C] - movs r0, 0x3C - ldrsh r1, [r4, r0] - movs r0, 0xA4 - lsls r0, 1 - cmp r1, r0 - ble _081D97CC - movs r0, 0x1 - ands r0, r2 - cmp r0, 0 - bne _081D97CC - movs r1, 0x24 - ldrsh r2, [r4, r1] - negs r2, r2 - strh r2, [r4, 0x24] - ldr r3, =gSprites - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r2, [r0, 0x24] -_081D97CC: - ldrh r0, [r4, 0x3C] - adds r0, 0x1 - strh r0, [r4, 0x3C] -_081D97D2: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D961C - - thumb_func_start sub_81D97E0 -sub_81D97E0: @ 81D97E0 - push {r4-r7,lr} - adds r3, r0, 0 - movs r0, 0x2E - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r5, =gSprites - adds r4, r0, r5 - ldrh r1, [r3, 0x3A] - ldrh r0, [r4, 0x36] - ands r0, r1 - cmp r0, 0 - bne _081D985C - ldrh r2, [r3, 0x36] - ldrh r1, [r3, 0x26] - adds r0, r2, r1 - strh r0, [r3, 0x26] - movs r7, 0x2E - ldrsh r1, [r3, r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrh r1, [r0, 0x26] - adds r2, r1 - strh r2, [r0, 0x26] - ldrh r0, [r3, 0x38] - ldrh r2, [r3, 0x36] - adds r0, r2 - strh r0, [r3, 0x36] - lsls r0, 16 - asrs r5, r0, 16 - ldrh r6, [r4, 0x38] - movs r7, 0x38 - ldrsh r2, [r4, r7] - cmp r5, r2 - bge _081D9836 - movs r0, 0x36 - ldrsh r1, [r3, r0] - adds r0, r2, 0 - cmn r1, r0 - bgt _081D985C -_081D9836: - cmp r5, r2 - ble _081D9844 - strh r6, [r3, 0x36] - b _081D9854 - .pool -_081D9844: - movs r0, 0x36 - ldrsh r1, [r3, r0] - movs r2, 0x38 - ldrsh r0, [r4, r2] - cmn r1, r0 - bge _081D9854 - negs r0, r6 - strh r0, [r3, 0x36] -_081D9854: - movs r7, 0x38 - ldrsh r0, [r3, r7] - negs r0, r0 - strh r0, [r3, 0x38] -_081D985C: - ldrh r0, [r3, 0x3A] - adds r0, 0x1 - strh r0, [r3, 0x3A] - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81D97E0 - - thumb_func_start sub_81D9868 -sub_81D9868: @ 81D9868 - push {r4,r5,lr} - adds r5, r1, 0 - lsls r5, 24 - lsrs r5, 24 - movs r4, 0x2E - ldrsh r1, [r0, r4] - lsls r4, r1, 4 - adds r4, r1 - lsls r4, 2 - ldr r1, =gSprites - adds r4, r1 - lsls r2, 16 - asrs r2, 16 - ldrh r1, [r0, 0x20] - adds r2, r1 - strh r2, [r4, 0x20] - lsls r3, 16 - asrs r3, 16 - ldrh r1, [r0, 0x22] - adds r3, r1 - strh r3, [r4, 0x22] - ldrh r1, [r0, 0x24] - strh r1, [r4, 0x24] - ldrh r1, [r0, 0x26] - strh r1, [r4, 0x26] - adds r1, r5, 0 - bl StartSpriteAnim - adds r0, r4, 0 - adds r1, r5, 0 - bl StartSpriteAnim - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D9868 - - thumb_func_start sub_81D98B4 -sub_81D98B4: @ 81D98B4 - push {r4,r5,lr} - sub sp, 0x10 - 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 - movs r0, 0 - ldrsh r1, [r4, r0] - cmp r1, 0x1 - beq _081D990C - cmp r1, 0x1 - bgt _081D98DC - cmp r1, 0 - beq _081D98E2 - b _081D99B4 - .pool -_081D98DC: - cmp r1, 0x2 - beq _081D99A4 - b _081D99B4 -_081D98E2: - movs r2, 0x80 - lsls r2, 7 - movs r0, 0x40 - str r0, [sp] - adds r0, 0xC0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r1, [sp, 0xC] - movs r0, 0x2 - adds r1, r2, 0 - movs r3, 0x78 - bl SetBgAffine - movs r1, 0x80 - lsls r1, 3 - movs r0, 0 - bl SetGpuRegBits - movs r0, 0x10 - strh r0, [r4, 0x8] - b _081D9922 -_081D990C: - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0x8 - bne _081D991A - movs r0, 0x12 - bl PlaySE -_081D991A: - movs r3, 0x4 - ldrsh r0, [r4, r3] - cmp r0, 0x2 - bne _081D992A -_081D9922: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - b _081D99B4 -_081D992A: - ldrh r5, [r4, 0x8] - ldrh r1, [r4, 0x2] - adds r0, r5, r1 - strh r0, [r4, 0x2] - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - movs r3, 0x6 - ldrsh r0, [r4, r3] - movs r1, 0x3 - bl __modsi3 - lsls r0, 16 - cmp r0, 0 - bne _081D9954 - lsls r0, r5, 16 - asrs r0, 16 - cmp r0, 0x4 - beq _081D9954 - subs r0, r5, 0x2 - strh r0, [r4, 0x8] -_081D9954: - ldrh r0, [r4, 0x6] - adds r0, 0x1 - strh r0, [r4, 0x6] - movs r2, 0x80 - lsls r2, 7 - movs r0, 0x40 - str r0, [sp] - ldrh r0, [r4, 0x2] - movs r3, 0x80 - lsls r3, 1 - adds r1, r3, 0 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - str r0, [sp, 0x4] - ldrh r0, [r4, 0x2] - subs r1, r0 - lsls r1, 16 - asrs r1, 16 - str r1, [sp, 0x8] - movs r5, 0 - str r5, [sp, 0xC] - movs r0, 0x2 - adds r1, r2, 0 - movs r3, 0x78 - bl SetBgAffine - movs r1, 0x2 - ldrsh r0, [r4, r1] - cmp r0, 0xFF - ble _081D99B4 - strh r5, [r4, 0x2] - strh r5, [r4, 0x6] - strh r5, [r4, 0xA] - movs r0, 0x10 - strh r0, [r4, 0x8] - ldrh r0, [r4, 0x4] - adds r0, 0x1 - strh r0, [r4, 0x4] - b _081D99B4 -_081D99A4: - movs r1, 0x80 - lsls r1, 3 - movs r0, 0 - bl ClearGpuRegBits - adds r0, r5, 0 - bl DestroyTask -_081D99B4: - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81D98B4 - - thumb_func_start sub_81D99BC -sub_81D99BC: @ 81D99BC - push {r4,lr} - bl sub_80D2578 - cmp r0, 0 - bne _081D99DC - ldr r4, =gStringVar1 - bl sub_80D2548 - adds r1, r0, 0 - adds r0, r4, 0 - bl StringCopy - movs r0, 0x1 - b _081D99DE - .pool -_081D99DC: - movs r0, 0 -_081D99DE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81D99BC - - 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 - - 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 - - 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 - - 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 - - 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 - - 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 - - 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. - - \ No newline at end of file diff --git a/asm/rayquaza_scene.s b/asm/rayquaza_scene.s new file mode 100755 index 000000000..fdfd22979 --- /dev/null +++ b/asm/rayquaza_scene.s @@ -0,0 +1,5993 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_81D6720 +sub_81D6720: @ 81D6720 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r4, r0, 0 + adds r5, r1, 0 + mov r8, r2 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r6, =gUnknown_0203CF60 + ldr r0, =0x00002018 + bl AllocZeroed + str r0, [r6] + ldr r1, =0x00002006 + adds r0, r1 + strb r4, [r0] + ldr r0, [r6] + mov r1, r8 + str r1, [r0] + ldr r1, =0x00002007 + adds r0, r1 + strb r5, [r0] + ldr r0, =sub_81D6774 + bl SetMainCallback2 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D6720 + + thumb_func_start sub_81D6774 +sub_81D6774: @ 81D6774 + push {lr} + bl SetVBlankHBlankCallbacksToNull + bl clear_scheduled_bg_copies_to_vram + bl remove_some_task + bl FreeAllSpritePalettes + bl ResetPaletteFade + bl ResetSpriteData + bl ResetTasks + movs r0, 0 + movs r1, 0xF0 + movs r2, 0x20 + bl FillPalette + ldr r1, =gUnknown_0862A6A0 + ldr r0, =gUnknown_0203CF60 + ldr r0, [r0] + ldr r2, =0x00002006 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0 + bl CreateTask + ldr r0, =sub_81D67D0 + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D6774 + + thumb_func_start sub_81D67D0 +sub_81D67D0: @ 81D67D0 + push {lr} + bl RunTasks + bl AnimateSprites + bl BuildOamBuffer + bl do_scheduled_bg_tilemap_copies_to_vram + bl UpdatePaletteFade + pop {r0} + bx r0 + thumb_func_end sub_81D67D0 + + thumb_func_start sub_81D67EC +sub_81D67EC: @ 81D67EC + push {lr} + bl LoadOam + bl ProcessSpriteCopyRequests + bl TransferPlttBuffer + pop {r0} + bx r0 + thumb_func_end sub_81D67EC + + thumb_func_start sub_81D6800 +sub_81D6800: @ 81D6800 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081D6830 + bl ResetSpriteData + bl FreeAllSpritePalettes + ldr r4, =gUnknown_0203CF60 + ldr r0, [r4] + ldr r0, [r0] + bl SetMainCallback2 + ldr r0, [r4] + bl Free + adds r0, r5, 0 + bl DestroyTask +_081D6830: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D6800 + + thumb_func_start sub_81D6840 +sub_81D6840: @ 81D6840 + push {r4-r6,lr} + lsls r0, 24 + lsrs r3, r0, 24 + adds r6, r3, 0 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _081D68B2 + ldr r2, =gUnknown_0203CF60 + ldr r1, [r2] + ldr r4, =0x00002007 + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081D6888 + ldr r0, =gTasks + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81D6800 + b _081D68B0 + .pool +_081D6888: + ldr r4, =0x00002006 + adds r1, r4 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r2, [r2] + ldr r1, =0x00002004 + adds r0, r2, r1 + strh r5, [r0] + ldr r0, =gTasks + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r3, =gUnknown_0862A6A0 + adds r2, r4 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] +_081D68B0: + str r0, [r1] +_081D68B2: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D6840 + + thumb_func_start sub_81D68C8 +sub_81D68C8: @ 81D68C8 + push {lr} + movs r0, 0x48 + movs r1, 0x3F + bl SetGpuReg + movs r0, 0x4A + movs r1, 0 + bl SetGpuReg + movs r0, 0x40 + movs r1, 0xF0 + bl SetGpuReg + ldr r1, =0x00001888 + movs r0, 0x44 + bl SetGpuReg + ldr r0, =gPlttBufferUnfaded + movs r1, 0 + strh r1, [r0] + ldr r0, =gPlttBufferFaded + strh r1, [r0] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D68C8 + + thumb_func_start sub_81D6904 +sub_81D6904: @ 81D6904 + push {lr} + movs r0, 0x48 + movs r1, 0x3F + bl SetGpuReg + movs r0, 0x4A + movs r1, 0x3F + bl SetGpuReg + pop {r0} + bx r0 + thumb_func_end sub_81D6904 + + thumb_func_start sub_81D691C +sub_81D691C: @ 81D691C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r5, r0, r1 + bl sub_81D750C + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081D697E + movs r0, 0 + ldrsh r1, [r5, r0] + cmp r1, 0x40 + bne _081D6954 + bl sub_81D7438 + b _081D6978 + .pool +_081D6954: + cmp r1, 0x90 + bne _081D695E + bl sub_81D7480 + b _081D6978 +_081D695E: + cmp r1, 0x94 + beq _081D6974 + movs r0, 0xA4 + lsls r0, 1 + cmp r1, r0 + bne _081D6978 + adds r0, r4, 0 + movs r1, 0 + bl sub_81D75B4 + b _081D697E +_081D6974: + bl sub_81D74C8 +_081D6978: + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] +_081D697E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81D691C + + thumb_func_start sub_81D6984 +sub_81D6984: @ 81D6984 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, =gUnknown_0862A72C + mov r8, r0 + movs r1, 0x58 + movs r2, 0x48 + movs r3, 0x3 + bl CreateSprite + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r6, =gSprites + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + adds r0, r6, 0 + adds r0, 0x1C + adds r0, r4, r0 + ldr r1, =sub_81D6A20 + str r1, [r0] + adds r0, r6, 0 + adds r0, 0x2E + adds r4, r0 + mov r0, r8 + movs r1, 0x38 + movs r2, 0x68 + movs r3, 0x3 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + ldr r0, =gUnknown_0862A750 + movs r1, 0x4B + movs r2, 0x65 + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2] + ldr r0, =gUnknown_0862A774 + movs r1, 0x6D + movs r2, 0x72 + movs r3, 0x1 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x4] + movs r0, 0 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x1 + bl StartSpriteAnim + adds r0, r5, 0 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D6984 + + thumb_func_start sub_81D6A20 +sub_81D6A20: @ 81D6A20 + push {r4,lr} + adds r3, r0, 0 + movs r0, 0x2E + adds r0, r3 + mov r12, r0 + ldrh r0, [r0, 0xA] + adds r0, 0x1 + movs r1, 0x1F + ands r0, r1 + mov r1, r12 + strh r0, [r1, 0xA] + cmp r0, 0 + bne _081D6A84 + ldrh r1, [r3, 0x20] + movs r2, 0x20 + ldrsh r0, [r3, r2] + cmp r0, 0x48 + beq _081D6A84 + subs r0, r1, 0x1 + strh r0, [r3, 0x20] + ldr r2, =gSprites + movs r4, 0x2E + ldrsh r1, [r3, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x20] + subs r1, 0x1 + strh r1, [r0, 0x20] + mov r0, r12 + movs r4, 0x2 + ldrsh r1, [r0, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x20] + subs r1, 0x1 + strh r1, [r0, 0x20] + mov r0, r12 + movs r4, 0x4 + ldrsh r1, [r0, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x20] + subs r1, 0x1 + strh r1, [r0, 0x20] +_081D6A84: + adds r0, r3, 0 + adds r0, 0x2B + ldrb r3, [r0] + cmp r3, 0x1 + beq _081D6AE4 + cmp r3, 0x1 + bgt _081D6A9C + cmp r3, 0 + beq _081D6AA6 + b _081D6B68 + .pool +_081D6A9C: + cmp r3, 0x2 + beq _081D6B24 + cmp r3, 0x3 + beq _081D6AE4 + b _081D6B68 +_081D6AA6: + ldr r2, =gSprites + mov r0, r12 + movs r4, 0x2 + ldrsh r1, [r0, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r3, [r0, 0x24] + mov r0, r12 + movs r4, 0x2 + ldrsh r1, [r0, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r3, [r0, 0x26] + mov r0, r12 + movs r4, 0x4 + ldrsh r1, [r0, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r3, [r0, 0x24] + mov r0, r12 + movs r4, 0x4 + ldrsh r1, [r0, r4] + b _081D6B5E + .pool +_081D6AE4: + ldr r2, =gSprites + mov r0, r12 + movs r3, 0x2 + ldrsh r1, [r0, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =0x0000ffff + strh r1, [r0, 0x24] + mov r4, r12 + movs r0, 0x2 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r3, 0 + strh r3, [r0, 0x26] + movs r0, 0x4 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x1 + negs r1, r1 + b _081D6B58 + .pool +_081D6B24: + ldr r2, =gSprites + mov r3, r12 + movs r4, 0x2 + ldrsh r1, [r3, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =0x0000ffff + strh r1, [r0, 0x24] + movs r0, 0x2 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r3, 0x1 + strh r3, [r0, 0x26] + mov r4, r12 + movs r0, 0x4 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =0x0000fffe +_081D6B58: + strh r1, [r0, 0x24] + movs r0, 0x4 + ldrsh r1, [r4, r0] +_081D6B5E: + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r3, [r0, 0x26] +_081D6B68: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D6A20 + + thumb_func_start sub_81D6B7C +sub_81D6B7C: @ 81D6B7C + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r5, =gUnknown_0862A81C + adds r0, r5, 0 + movs r1, 0x88 + movs r2, 0x60 + movs r3, 0x1 + bl CreateSprite + mov r8, r0 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r6, =gSprites + lsls r4, r0, 4 + add r4, r8 + lsls r4, 2 + adds r0, r6, 0 + adds r0, 0x1C + adds r0, r4, r0 + ldr r1, =sub_81D6D20 + str r1, [r0] + adds r0, r6, 0 + adds r0, 0x2E + adds r4, r0 + adds r0, r5, 0 + movs r1, 0xA8 + movs r2, 0x60 + movs r3, 0x1 + bl CreateSprite + lsls r0, 8 + strh r0, [r4] + adds r0, r5, 0 + movs r1, 0x88 + movs r2, 0x70 + movs r3, 0x1 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4] + orrs r0, r1 + strh r0, [r4] + adds r0, r5, 0 + movs r1, 0xA8 + movs r2, 0x70 + movs r3, 0x1 + bl CreateSprite + lsls r0, 8 + strh r0, [r4, 0x2] + adds r0, r5, 0 + movs r1, 0x88 + movs r2, 0x80 + movs r3, 0x1 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x2] + orrs r0, r1 + strh r0, [r4, 0x2] + adds r0, r5, 0 + movs r1, 0xA8 + movs r2, 0x80 + movs r3, 0x1 + bl CreateSprite + lsls r0, 8 + strh r0, [r4, 0x4] + adds r0, r5, 0 + movs r1, 0x68 + movs r2, 0x80 + movs r3, 0x2 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x4] + orrs r0, r1 + strh r0, [r4, 0x4] + adds r0, r5, 0 + movs r1, 0x88 + movs r2, 0x80 + movs r3, 0x2 + bl CreateSprite + lsls r0, 8 + strh r0, [r4, 0x6] + adds r0, r5, 0 + movs r1, 0xB8 + movs r2, 0x80 + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x6] + orrs r0, r1 + strh r0, [r4, 0x6] + ldr r0, =gUnknown_0862A84C + movs r1, 0xD0 + movs r2, 0x84 + movs r3, 0 + bl CreateSprite + lsls r0, 8 + strh r0, [r4, 0x8] + ldr r0, =gUnknown_0862A864 + movs r1, 0xC8 + movs r2, 0x78 + movs r3, 0x1 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x8] + orrs r0, r1 + strh r0, [r4, 0x8] + ldrh r1, [r4] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x1 + bl StartSpriteAnim + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x2 + bl StartSpriteAnim + ldrh r1, [r4, 0x2] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x3 + bl StartSpriteAnim + ldrb r1, [r4, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x4 + bl StartSpriteAnim + ldrh r1, [r4, 0x4] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x5 + bl StartSpriteAnim + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x6 + bl StartSpriteAnim + ldrh r1, [r4, 0x6] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x7 + bl StartSpriteAnim + ldrb r1, [r4, 0x6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x8 + bl StartSpriteAnim + mov r0, r8 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D6B7C + + thumb_func_start sub_81D6D20 +sub_81D6D20: @ 81D6D20 + push {r4-r7,lr} + adds r4, r0, 0 + adds r3, r4, 0 + adds r3, 0x2E + ldrh r0, [r3, 0xA] + adds r0, 0x1 + movs r1, 0x1F + ands r0, r1 + strh r0, [r3, 0xA] + ldr r7, =gSprites + cmp r0, 0 + bne _081D6E0E + ldrh r1, [r4, 0x20] + movs r2, 0x20 + ldrsh r0, [r4, r2] + cmp r0, 0x98 + beq _081D6E0E + adds r0, r1, 0x1 + strh r0, [r4, 0x20] + ldrh r1, [r4, 0x2E] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + ldrh r0, [r4, 0x2E] + movs r2, 0xFF + adds r1, r2, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + ldrh r1, [r3, 0x2] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + ldrh r0, [r3, 0x2] + adds r1, r2, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + ldrh r1, [r3, 0x4] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + ldrh r0, [r3, 0x4] + adds r1, r2, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + ldrh r1, [r3, 0x6] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + ldrh r0, [r3, 0x6] + adds r1, r2, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + ldrh r1, [r3, 0x8] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + ldrh r0, [r3, 0x8] + ands r2, r0 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] +_081D6E0E: + adds r6, r7, 0 + movs r5, 0xFF + ldrb r1, [r3, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x2B + ldrb r2, [r0] + cmp r2, 0x1 + beq _081D6EE0 + cmp r2, 0x1 + bgt _081D6E34 + cmp r2, 0 + beq _081D6E40 + b _081D6FC8 + .pool +_081D6E34: + cmp r2, 0x2 + bne _081D6E3A + b _081D6F68 +_081D6E3A: + cmp r2, 0x3 + beq _081D6EE0 + b _081D6FC8 +_081D6E40: + strh r2, [r4, 0x26] + ldrh r1, [r3] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x26] + ldrh r0, [r3] + adds r1, r5, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x2] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x26] + ldrh r0, [r3, 0x2] + adds r1, r5, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x4] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x26] + ldrh r0, [r3, 0x4] + adds r1, r5, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x6] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x26] + ldrh r0, [r3, 0x6] + adds r1, r5, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x8] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x8] + ands r1, r5 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + b _081D6FC6 +_081D6EE0: + movs r2, 0x1 + strh r2, [r4, 0x26] + ldrh r1, [r3] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x2] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrb r1, [r3, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x4] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrb r1, [r3, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x6] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrb r1, [r3, 0x6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x8] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrb r1, [r3, 0x8] + b _081D6FBE +_081D6F68: + strh r2, [r4, 0x26] + ldrh r1, [r3] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r0, [r3] + adds r1, r5, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x2] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r0, [r3, 0x2] + adds r1, r5, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x4] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x8] + ands r1, r5 +_081D6FBE: + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 +_081D6FC6: + strh r2, [r0, 0x26] +_081D6FC8: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81D6D20 + + thumb_func_start sub_81D6FD0 +sub_81D6FD0: @ 81D6FD0 + push {lr} + bl sub_81D67EC + bl sub_80BA0A8 + pop {r0} + bx r0 + thumb_func_end sub_81D6FD0 + + thumb_func_start sub_81D6FE0 +sub_81D6FE0: @ 81D6FE0 + push {r4,lr} + bl sub_8121DA0 + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_0862A888 + movs r0, 0 + movs r2, 0x3 + bl InitBgsFromTemplates + ldr r4, =gUnknown_0203CF60 + ldr r1, [r4] + adds r1, 0x4 + movs r0, 0 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x00000804 + adds r1, r0 + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x00001004 + adds r1, r0 + movs r0, 0x2 + bl SetBgTilemapBuffer + bl sub_8121E10 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D6FE0 + + thumb_func_start sub_81D706C +sub_81D706C: @ 81D706C + push {r4,lr} + sub sp, 0x4 + bl reset_temp_tile_data_buffers + ldr r1, =gUnknown_08DA33C0 + movs r0, 0 + str r0, [sp] + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram +_081D7082: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + bne _081D7082 + ldr r0, =gUnknown_08DA3988 + ldr r4, =gUnknown_0203CF60 + ldr r1, [r4] + adds r1, 0x4 + bl LZDecompressWram + ldr r0, =gUnknown_08DA3824 + ldr r1, [r4] + ldr r2, =0x00000804 + adds r1, r2 + bl LZDecompressWram + ldr r0, =gUnknown_08DA3A88 + ldr r1, [r4] + ldr r2, =0x00001004 + adds r1, r2 + bl LZDecompressWram + ldr r0, =gUnknown_08DA37E8 + movs r1, 0 + movs r2, 0x40 + bl LoadCompressedPalette + ldr r0, =gUnknown_0862A8C4 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0862A8F8 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0862A924 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0862A9D4 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0862AA14 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0862AA34 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0862A8CC + bl LoadCompressedObjectPalette + ldr r0, =gUnknown_0862A9DC + bl LoadCompressedObjectPalette + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D706C + + thumb_func_start task_add_00_WIN0V_open_close_above_and_more +task_add_00_WIN0V_open_close_above_and_more: @ 81D7134 + push {r4-r7,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r6, r1, 3 + ldr r7, =gTasks + 0x8 + adds r5, r6, r7 + bl dp12_8087EA4 + bl sub_81D6FE0 + bl sub_81D706C + movs r4, 0 + str r4, [sp, 0x4] + ldr r1, =gUnknown_02038C28 + ldr r2, =0x010003c0 + add r0, sp, 0x4 + bl CpuFastSet + ldr r2, =gUnknown_0862A87C + ldr r0, [r2] + ldr r1, [r2, 0x4] + ldr r2, [r2, 0x8] + bl sub_80BA038 + strh r4, [r5] + ldr r0, =sub_81D7228 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x2] + ldr r0, =gUnknown_0203CF60 + ldr r0, [r0] + ldr r1, =0x00002006 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _081D71CC + bl sub_81D6984 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x4] + bl sub_81D6B7C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x6] + adds r0, r7, 0 + subs r0, 0x8 + adds r0, r6, r0 + ldr r1, =sub_81D691C + str r1, [r0] + b _081D71EE + .pool +_081D71CC: + bl sub_81D7664 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x4] + bl sub_81D78BC + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x6] + adds r0, r7, 0 + subs r0, 0x8 + adds r0, r6, r0 + ldr r1, =sub_81D736C + str r1, [r0] + bl StopMapMusic +_081D71EE: + movs r4, 0x1 + negs r4, r4 + adds r0, r4, 0 + movs r1, 0x10 + movs r2, 0 + bl BlendPalettes + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade + ldr r0, =sub_81D6FD0 + bl SetVBlankCallback + movs r0, 0x53 + bl PlaySE + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end task_add_00_WIN0V_open_close_above_and_more + + thumb_func_start sub_81D7228 +sub_81D7228: @ 81D7228 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r3, r1, r0 + movs r1, 0x18 + ldr r7, =gUnknown_0203CF60 + ldr r4, =gUnknown_02038C28 + movs r0, 0xF0 + lsls r0, 3 + adds r5, r4, r0 +_081D7244: + lsls r0, r1, 16 + asrs r1, r0, 16 + adds r6, r0, 0 + cmp r1, 0x2F + bgt _081D726C + lsls r1, 1 + adds r2, r1, r4 + ldrh r0, [r3] + lsrs r0, 8 + strh r0, [r2] + adds r1, r5 + ldrh r0, [r3] + b _081D72CA + .pool +_081D726C: + cmp r1, 0x3F + bgt _081D7280 + lsls r1, 1 + adds r2, r1, r4 + ldrh r0, [r3, 0x2] + lsrs r0, 8 + strh r0, [r2] + adds r1, r5 + ldrh r0, [r3, 0x2] + b _081D72CA +_081D7280: + cmp r1, 0x4B + bgt _081D7294 + lsls r1, 1 + adds r2, r1, r4 + ldrh r0, [r3, 0x4] + lsrs r0, 8 + strh r0, [r2] + adds r1, r5 + ldrh r0, [r3, 0x4] + b _081D72CA +_081D7294: + cmp r1, 0x53 + bgt _081D72A8 + lsls r1, 1 + adds r2, r1, r4 + ldrh r0, [r3, 0x6] + lsrs r0, 8 + strh r0, [r2] + adds r1, r5 + ldrh r0, [r3, 0x6] + b _081D72CA +_081D72A8: + cmp r1, 0x57 + bgt _081D72BC + lsls r1, 1 + adds r2, r1, r4 + ldrh r0, [r3, 0x8] + lsrs r0, 8 + strh r0, [r2] + adds r1, r5 + ldrh r0, [r3, 0x8] + b _081D72CA +_081D72BC: + lsls r1, 1 + adds r2, r1, r4 + ldrh r0, [r3, 0xA] + lsrs r0, 8 + strh r0, [r2] + adds r1, r5 + ldrh r0, [r3, 0xA] +_081D72CA: + lsrs r0, 8 + strh r0, [r1] + movs r1, 0x80 + lsls r1, 9 + adds r0, r6, r1 + lsrs r1, r0, 16 + asrs r0, 16 + cmp r0, 0x5B + ble _081D7244 + ldr r0, [r7] + ldr r1, =0x00002006 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _081D7324 + movs r1, 0xE0 + lsls r1, 1 + adds r0, r1, 0 + ldrh r1, [r3] + adds r0, r1 + strh r0, [r3] + movs r1, 0xC0 + lsls r1, 1 + adds r0, r1, 0 + ldrh r1, [r3, 0x2] + adds r0, r1 + strh r0, [r3, 0x2] + movs r1, 0xA0 + lsls r1, 1 + adds r0, r1, 0 + ldrh r1, [r3, 0x4] + adds r0, r1 + strh r0, [r3, 0x4] + movs r1, 0x80 + lsls r1, 1 + adds r0, r1, 0 + ldrh r1, [r3, 0x6] + adds r0, r1 + strh r0, [r3, 0x6] + ldrh r0, [r3, 0x8] + adds r0, 0xC0 + b _081D735E + .pool +_081D7324: + movs r1, 0xC0 + lsls r1, 2 + adds r0, r1, 0 + ldrh r1, [r3] + adds r0, r1 + strh r0, [r3] + movs r1, 0xA0 + lsls r1, 2 + adds r0, r1, 0 + ldrh r1, [r3, 0x2] + adds r0, r1 + strh r0, [r3, 0x2] + movs r1, 0x80 + lsls r1, 2 + adds r0, r1, 0 + ldrh r1, [r3, 0x4] + adds r0, r1 + strh r0, [r3, 0x4] + movs r1, 0xC0 + lsls r1, 1 + adds r0, r1, 0 + ldrh r1, [r3, 0x6] + adds r0, r1 + strh r0, [r3, 0x6] + movs r1, 0x80 + lsls r1, 1 + adds r0, r1, 0 + ldrh r1, [r3, 0x8] + adds r0, r1 +_081D735E: + strh r0, [r3, 0x8] + ldrh r0, [r3, 0xA] + adds r0, 0x80 + strh r0, [r3, 0xA] + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81D7228 + + thumb_func_start sub_81D736C +sub_81D736C: @ 81D736C + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r7, =gTasks + 0x8 + adds r4, r0, r7 + bl sub_81D750C + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _081D742E + movs r0, 0 + ldrsh r1, [r4, r0] + cmp r1, 0x20 + beq _081D739C + cmp r1, 0x70 + bne _081D73AC +_081D739C: + bl sub_81D7438 + b _081D7428 + .pool +_081D73AC: + cmp r1, 0xD8 + bne _081D73B6 + bl sub_81D7480 + b _081D7428 +_081D73B6: + cmp r1, 0xDC + bne _081D73C0 + bl sub_81D74C8 + b _081D7428 +_081D73C0: + movs r0, 0xBE + lsls r0, 1 + cmp r1, r0 + beq _081D73D8 + adds r0, 0x20 + cmp r1, r0 + bne _081D7428 + adds r0, r5, 0 + movs r1, 0x2 + bl sub_81D75B4 + b _081D742E +_081D73D8: + movs r1, 0x91 + lsls r1, 2 + movs r0, 0x50 + bl SetGpuReg + adds r2, r7, 0 + subs r2, 0x8 + movs r0, 0x2 + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldr r1, =sub_81D752C + str r1, [r0] + movs r0, 0x2 + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + strh r6, [r0, 0x8] + movs r0, 0x2 + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrh r1, [r4, 0x4] + strh r1, [r0, 0xC] + movs r0, 0x2 + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrh r1, [r4, 0x6] + strh r1, [r0, 0xE] + bl remove_some_task +_081D7428: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_081D742E: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D736C + + thumb_func_start sub_81D7438 +sub_81D7438: @ 81D7438 + push {r4,lr} + sub sp, 0xC + movs r0, 0x57 + bl PlaySE + ldr r0, =0x00007fff + ldr r1, =0x0000ffff + str r1, [sp] + movs r4, 0 + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A2C44 + ldr r0, =0xffff0000 + str r4, [sp] + str r4, [sp, 0x4] + movs r1, 0x1 + str r1, [sp, 0x8] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A2C44 + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D7438 + + thumb_func_start sub_81D7480 +sub_81D7480: @ 81D7480 + push {r4,lr} + sub sp, 0xC + movs r0, 0x57 + bl PlaySE + ldr r0, =0x00007fff + ldr r1, =0x0000ffff + str r1, [sp] + movs r4, 0 + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0 + movs r2, 0x10 + movs r3, 0x10 + bl sub_80A2C44 + ldr r0, =0xffff0000 + str r4, [sp] + str r4, [sp, 0x4] + movs r1, 0x1 + str r1, [sp, 0x8] + movs r1, 0 + movs r2, 0x10 + movs r3, 0x10 + bl sub_80A2C44 + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D7480 + + thumb_func_start sub_81D74C8 +sub_81D74C8: @ 81D74C8 + push {r4,lr} + sub sp, 0xC + ldr r0, =0x00007fff + ldr r1, =0x0000ffff + str r1, [sp] + movs r4, 0 + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x4 + movs r2, 0x10 + movs r3, 0 + bl sub_80A2C44 + ldr r0, =0xffff0000 + str r4, [sp] + str r4, [sp, 0x4] + movs r1, 0x1 + str r1, [sp, 0x8] + movs r1, 0x4 + movs r2, 0x10 + movs r3, 0 + bl sub_80A2C44 + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D74C8 + + thumb_func_start sub_81D750C +sub_81D750C: @ 81D750C + push {lr} + movs r1, 0x80 + lsls r1, 3 + movs r0, 0x2 + movs r2, 0x1 + bl ChangeBgX + movs r1, 0x80 + lsls r1, 4 + movs r0, 0x2 + movs r2, 0x2 + bl ChangeBgY + pop {r0} + bx r0 + thumb_func_end sub_81D750C + + thumb_func_start sub_81D752C +sub_81D752C: @ 81D752C + 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 r5, r1, r0 + movs r0, 0x4 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =gSprites + adds r0, r4 + bl sub_81D7860 + movs r0, 0x6 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl sub_81D7D14 + movs r0, 0x1 + bl GetBgY + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x1 + bl GetBgY + cmp r0, 0 + beq _081D757A + movs r0, 0x80 + lsls r0, 8 + cmp r4, r0 + bls _081D7586 +_081D757A: + movs r1, 0x80 + lsls r1, 3 + movs r0, 0x1 + movs r2, 0x2 + bl ChangeBgY +_081D7586: + ldrh r2, [r5] + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0x10 + beq _081D75A6 + adds r2, 0x1 + strh r2, [r5] + lsls r1, r2, 8 + movs r0, 0x10 + subs r0, r2 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg +_081D75A6: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D752C + + thumb_func_start sub_81D75B4 +sub_81D75B4: @ 81D75B4 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r4, r1, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x54 + bl PlaySE + movs r0, 0x1 + negs r0, r0 + lsls r4, 24 + asrs r4, 24 + movs r1, 0 + str r1, [sp] + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81D7600 + str r1, [r0] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D75B4 + + thumb_func_start sub_81D7600 +sub_81D7600: @ 81D7600 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r6, r1, 3 + ldr r7, =gTasks + 0x8 + adds r5, r6, r7 + bl sub_81D750C + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _081D7652 + ldrb r0, [r5, 0x2] + bl DestroyTask + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0 + bl SetVBlankCallback + bl remove_some_task + bl ResetSpriteData + bl FreeAllSpritePalettes + strh r4, [r5] + adds r0, r7, 0 + subs r0, 0x8 + adds r0, r6, r0 + ldr r1, =sub_81D6840 + str r1, [r0] +_081D7652: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D7600 + + thumb_func_start sub_81D7664 +sub_81D7664: @ 81D7664 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, =gUnknown_0862A8D4 + mov r8, r0 + movs r1, 0x62 + movs r2, 0x48 + movs r3, 0x3 + bl CreateSprite + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r6, =gSprites + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + adds r0, r6, 0 + adds r0, 0x1C + adds r0, r4, r0 + ldr r1, =sub_81D7700 + str r1, [r0] + adds r0, r6, 0 + adds r0, 0x2E + adds r4, r0 + mov r0, r8 + movs r1, 0x42 + movs r2, 0x68 + movs r3, 0x3 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + ldr r0, =gUnknown_0862A900 + movs r1, 0x55 + movs r2, 0x65 + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2] + ldr r0, =gUnknown_0862A92C + movs r1, 0x77 + movs r2, 0x72 + movs r3, 0x1 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x4] + movs r0, 0 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x1 + bl StartSpriteAnim + adds r0, r5, 0 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D7664 + + thumb_func_start sub_81D7700 +sub_81D7700: @ 81D7700 + push {r4,lr} + adds r3, r0, 0 + movs r0, 0x2E + adds r0, r3 + mov r12, r0 + ldrh r0, [r0, 0xA] + adds r0, 0x1 + movs r1, 0xF + ands r0, r1 + mov r1, r12 + strh r0, [r1, 0xA] + movs r1, 0x7 + ands r1, r0 + cmp r1, 0 + bne _081D7768 + ldrh r1, [r3, 0x20] + movs r2, 0x20 + ldrsh r0, [r3, r2] + cmp r0, 0x48 + beq _081D7768 + subs r0, r1, 0x1 + strh r0, [r3, 0x20] + ldr r2, =gSprites + movs r4, 0x2E + ldrsh r1, [r3, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x20] + subs r1, 0x1 + strh r1, [r0, 0x20] + mov r0, r12 + movs r4, 0x2 + ldrsh r1, [r0, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x20] + subs r1, 0x1 + strh r1, [r0, 0x20] + mov r0, r12 + movs r4, 0x4 + ldrsh r1, [r0, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x20] + subs r1, 0x1 + strh r1, [r0, 0x20] +_081D7768: + adds r0, r3, 0 + adds r0, 0x2B + ldrb r3, [r0] + cmp r3, 0x1 + beq _081D77C8 + cmp r3, 0x1 + bgt _081D7780 + cmp r3, 0 + beq _081D778A + b _081D784C + .pool +_081D7780: + cmp r3, 0x2 + beq _081D7808 + cmp r3, 0x3 + beq _081D77C8 + b _081D784C +_081D778A: + ldr r2, =gSprites + mov r0, r12 + movs r4, 0x2 + ldrsh r1, [r0, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r3, [r0, 0x24] + mov r0, r12 + movs r4, 0x2 + ldrsh r1, [r0, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r3, [r0, 0x26] + mov r0, r12 + movs r4, 0x4 + ldrsh r1, [r0, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r3, [r0, 0x24] + mov r0, r12 + movs r4, 0x4 + ldrsh r1, [r0, r4] + b _081D7842 + .pool +_081D77C8: + ldr r2, =gSprites + mov r0, r12 + movs r3, 0x2 + ldrsh r1, [r0, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =0x0000ffff + strh r1, [r0, 0x24] + mov r4, r12 + movs r0, 0x2 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r3, 0 + strh r3, [r0, 0x26] + movs r0, 0x4 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x1 + negs r1, r1 + b _081D783C + .pool +_081D7808: + ldr r2, =gSprites + mov r3, r12 + movs r4, 0x2 + ldrsh r1, [r3, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =0x0000ffff + strh r1, [r0, 0x24] + movs r0, 0x2 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r3, 0x1 + strh r3, [r0, 0x26] + mov r4, r12 + movs r0, 0x4 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =0x0000fffe +_081D783C: + strh r1, [r0, 0x24] + movs r0, 0x4 + ldrsh r1, [r4, r0] +_081D7842: + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r3, [r0, 0x26] +_081D784C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D7700 + + thumb_func_start sub_81D7860 +sub_81D7860: @ 81D7860 + push {r4,lr} + adds r1, r0, 0 + adds r3, r1, 0 + adds r3, 0x2E + ldrh r2, [r1, 0x22] + movs r4, 0x22 + ldrsh r0, [r1, r4] + cmp r0, 0xA0 + bgt _081D78B0 + adds r0, r2, 0 + adds r0, 0x8 + strh r0, [r1, 0x22] + ldr r2, =gSprites + movs r0, 0x2E + ldrsh r1, [r1, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x22] + adds r1, 0x8 + strh r1, [r0, 0x22] + movs r4, 0x2 + ldrsh r1, [r3, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x22] + adds r1, 0x8 + strh r1, [r0, 0x22] + movs r0, 0x4 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x22] + adds r1, 0x8 + strh r1, [r0, 0x22] +_081D78B0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D7860 + + thumb_func_start sub_81D78BC +sub_81D78BC: @ 81D78BC + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r5, =gUnknown_0862A9E4 + adds r0, r5, 0 + movs r1, 0x7E + movs r2, 0x60 + movs r3, 0x1 + bl CreateSprite + mov r8, r0 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r6, =gSprites + lsls r4, r0, 4 + add r4, r8 + lsls r4, 2 + adds r0, r6, 0 + adds r0, 0x1C + adds r0, r4, r0 + ldr r1, =sub_81D7A60 + str r1, [r0] + adds r0, r6, 0 + adds r0, 0x2E + adds r4, r0 + adds r0, r5, 0 + movs r1, 0x9E + movs r2, 0x60 + movs r3, 0x1 + bl CreateSprite + lsls r0, 8 + strh r0, [r4] + adds r0, r5, 0 + movs r1, 0x7E + movs r2, 0x70 + movs r3, 0x1 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4] + orrs r0, r1 + strh r0, [r4] + adds r0, r5, 0 + movs r1, 0x9E + movs r2, 0x70 + movs r3, 0x1 + bl CreateSprite + lsls r0, 8 + strh r0, [r4, 0x2] + adds r0, r5, 0 + movs r1, 0x7E + movs r2, 0x80 + movs r3, 0x1 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x2] + orrs r0, r1 + strh r0, [r4, 0x2] + adds r0, r5, 0 + movs r1, 0x9E + movs r2, 0x80 + movs r3, 0x1 + bl CreateSprite + lsls r0, 8 + strh r0, [r4, 0x4] + adds r0, r5, 0 + movs r1, 0x5E + movs r2, 0x80 + movs r3, 0x2 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x4] + orrs r0, r1 + strh r0, [r4, 0x4] + adds r0, r5, 0 + movs r1, 0x7E + movs r2, 0x80 + movs r3, 0x2 + bl CreateSprite + lsls r0, 8 + strh r0, [r4, 0x6] + adds r0, r5, 0 + movs r1, 0xAE + movs r2, 0x80 + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x6] + orrs r0, r1 + strh r0, [r4, 0x6] + ldr r0, =gUnknown_0862AA1C + movs r1, 0xC6 + movs r2, 0x84 + movs r3, 0 + bl CreateSprite + lsls r0, 8 + strh r0, [r4, 0x8] + ldr r0, =gUnknown_0862AA3C + movs r1, 0xBE + movs r2, 0x78 + movs r3, 0x1 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x8] + orrs r0, r1 + strh r0, [r4, 0x8] + ldrh r1, [r4] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x1 + bl StartSpriteAnim + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x2 + bl StartSpriteAnim + ldrh r1, [r4, 0x2] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x3 + bl StartSpriteAnim + ldrb r1, [r4, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x4 + bl StartSpriteAnim + ldrh r1, [r4, 0x4] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x5 + bl StartSpriteAnim + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x6 + bl StartSpriteAnim + ldrh r1, [r4, 0x6] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x7 + bl StartSpriteAnim + ldrb r1, [r4, 0x6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x8 + bl StartSpriteAnim + mov r0, r8 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D78BC + + thumb_func_start sub_81D7A60 +sub_81D7A60: @ 81D7A60 + push {r4-r7,lr} + adds r4, r0, 0 + adds r3, r4, 0 + adds r3, 0x2E + ldrh r0, [r3, 0xA] + adds r0, 0x1 + movs r1, 0xF + ands r0, r1 + strh r0, [r3, 0xA] + movs r1, 0x7 + ands r1, r0 + ldr r7, =gSprites + cmp r1, 0 + bne _081D7B52 + ldrh r1, [r4, 0x20] + movs r2, 0x20 + ldrsh r0, [r4, r2] + cmp r0, 0x98 + beq _081D7B52 + adds r0, r1, 0x1 + strh r0, [r4, 0x20] + ldrh r1, [r4, 0x2E] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + ldrh r0, [r4, 0x2E] + movs r2, 0xFF + adds r1, r2, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + ldrh r1, [r3, 0x2] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + ldrh r0, [r3, 0x2] + adds r1, r2, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + ldrh r1, [r3, 0x4] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + ldrh r0, [r3, 0x4] + adds r1, r2, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + ldrh r1, [r3, 0x6] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + ldrh r0, [r3, 0x6] + adds r1, r2, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + ldrh r1, [r3, 0x8] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + ldrh r0, [r3, 0x8] + ands r2, r0 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] +_081D7B52: + adds r6, r7, 0 + movs r5, 0xFF + ldrb r1, [r3, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x2B + ldrb r2, [r0] + cmp r2, 0x1 + beq _081D7C24 + cmp r2, 0x1 + bgt _081D7B78 + cmp r2, 0 + beq _081D7B84 + b _081D7D0C + .pool +_081D7B78: + cmp r2, 0x2 + bne _081D7B7E + b _081D7CAC +_081D7B7E: + cmp r2, 0x3 + beq _081D7C24 + b _081D7D0C +_081D7B84: + strh r2, [r4, 0x26] + ldrh r1, [r3] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x26] + ldrh r0, [r3] + adds r1, r5, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x2] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x26] + ldrh r0, [r3, 0x2] + adds r1, r5, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x4] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x26] + ldrh r0, [r3, 0x4] + adds r1, r5, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x6] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x26] + ldrh r0, [r3, 0x6] + adds r1, r5, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x8] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x8] + ands r1, r5 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + b _081D7D0A +_081D7C24: + movs r2, 0x1 + strh r2, [r4, 0x26] + ldrh r1, [r3] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x2] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrb r1, [r3, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x4] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrb r1, [r3, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x6] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrb r1, [r3, 0x6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x8] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrb r1, [r3, 0x8] + b _081D7D02 +_081D7CAC: + strh r2, [r4, 0x26] + ldrh r1, [r3] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r0, [r3] + adds r1, r5, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x2] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r0, [r3, 0x2] + adds r1, r5, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x4] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x8] + ands r1, r5 +_081D7D02: + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 +_081D7D0A: + strh r2, [r0, 0x26] +_081D7D0C: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81D7A60 + + thumb_func_start sub_81D7D14 +sub_81D7D14: @ 81D7D14 + push {lr} + adds r2, r0, 0 + movs r0, 0x2E + adds r0, r2 + mov r12, r0 + ldrh r1, [r2, 0x22] + movs r3, 0x22 + ldrsh r0, [r2, r3] + cmp r0, 0xA0 + bgt _081D7E08 + adds r0, r1, 0 + adds r0, 0x8 + strh r0, [r2, 0x22] + ldr r3, =gSprites + ldrh r1, [r2, 0x2E] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x22] + adds r1, 0x8 + strh r1, [r0, 0x22] + ldrh r0, [r2, 0x2E] + movs r2, 0xFF + adds r1, r2, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x22] + adds r1, 0x8 + strh r1, [r0, 0x22] + mov r0, r12 + ldrh r1, [r0, 0x2] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x22] + adds r1, 0x8 + strh r1, [r0, 0x22] + mov r1, r12 + ldrh r0, [r1, 0x2] + adds r1, r2, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x22] + adds r1, 0x8 + strh r1, [r0, 0x22] + mov r0, r12 + ldrh r1, [r0, 0x4] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x22] + adds r1, 0x8 + strh r1, [r0, 0x22] + mov r1, r12 + ldrh r0, [r1, 0x4] + adds r1, r2, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x22] + adds r1, 0x8 + strh r1, [r0, 0x22] + mov r0, r12 + ldrh r1, [r0, 0x6] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x22] + adds r1, 0x8 + strh r1, [r0, 0x22] + mov r1, r12 + ldrh r0, [r1, 0x6] + adds r1, r2, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x22] + adds r1, 0x8 + strh r1, [r0, 0x22] + mov r0, r12 + ldrh r1, [r0, 0x8] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x22] + adds r1, 0x8 + strh r1, [r0, 0x22] + mov r1, r12 + ldrh r0, [r1, 0x8] + ands r2, r0 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x22] + adds r1, 0x8 + strh r1, [r0, 0x22] +_081D7E08: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D7D14 + + thumb_func_start sub_81D7E10 +sub_81D7E10: @ 81D7E10 + push {r4,lr} + bl sub_8121DA0 + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_0862AA54 + movs r0, 0x1 + movs r2, 0x3 + bl InitBgsFromTemplates + ldr r4, =gUnknown_0203CF60 + ldr r1, [r4] + adds r1, 0x4 + movs r0, 0 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x00000804 + adds r1, r0 + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x00001004 + adds r1, r0 + movs r0, 0x2 + bl SetBgTilemapBuffer + bl sub_8121E10 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D7E10 + + thumb_func_start sub_81D7E9C +sub_81D7E9C: @ 81D7E9C + push {r4,lr} + sub sp, 0x4 + bl reset_temp_tile_data_buffers + ldr r1, =gUnknown_08DA33C0 + movs r4, 0 + str r4, [sp] + movs r0, 0 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r1, =gUnknown_08DA4F70 + str r4, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r1, =gUnknown_08DA3C94 + str r4, [sp] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram +_081D7ED0: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + bne _081D7ED0 + ldr r0, =gUnknown_08DA3988 + ldr r4, =gUnknown_0203CF60 + ldr r1, [r4] + adds r1, 0x4 + bl LZDecompressWram + ldr r0, =gUnknown_08DA60B8 + ldr r1, [r4] + ldr r2, =0x00000804 + adds r1, r2 + bl LZDecompressWram + ldr r0, =gUnknown_08DA4DEC + ldr r1, [r4] + ldr r2, =0x00001004 + adds r1, r2 + bl LZDecompressWram + ldr r0, =gUnknown_08DA4DA8 + movs r1, 0 + movs r2, 0x40 + bl LoadCompressedPalette + ldr r0, =gUnknown_0862AA90 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0862AA98 + bl LoadCompressedObjectPalette + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D7E9C + + thumb_func_start sub_81D7F4C +sub_81D7F4C: @ 81D7F4C + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r5, =gTasks + 0x8 + adds r6, r4, r5 + movs r0, 0xE8 + lsls r0, 1 + bl PlayNewMapMusic + bl sub_81D7E10 + bl sub_81D7E9C + movs r1, 0x94 + lsls r1, 2 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x00000808 + movs r0, 0x52 + bl SetGpuReg + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl BlendPalettes + ldr r0, =sub_81D67EC + bl SetVBlankCallback + ldr r0, =sub_81D81A4 + movs r1, 0 + bl CreateTask + movs r0, 0 + strh r0, [r6] + strh r0, [r6, 0x2] + subs r5, 0x8 + adds r4, r5 + ldr r0, =sub_81D7FC0 + str r0, [r4] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D7F4C + + thumb_func_start sub_81D7FC0 +sub_81D7FC0: @ 81D7FC0 + push {r4-r6,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + movs r0, 0 + ldrsh r5, [r4, r0] + cmp r5, 0x1 + beq _081D802A + cmp r5, 0x1 + bgt _081D7FE8 + cmp r5, 0 + beq _081D7FF4 + b _081D815A + .pool +_081D7FE8: + cmp r5, 0x2 + beq _081D80A4 + cmp r5, 0x3 + bne _081D7FF2 + b _081D8124 +_081D7FF2: + b _081D815A +_081D7FF4: + ldrh r1, [r4, 0x2] + movs r2, 0x2 + ldrsh r0, [r4, r2] + cmp r0, 0x8 + bne _081D8024 + movs r0, 0x1 + negs r0, r0 + str r5, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade + strh r5, [r4, 0x4] + movs r0, 0x1E + strh r0, [r4, 0x6] + strh r5, [r4, 0x8] + movs r0, 0x7 + strh r0, [r4, 0xA] + strh r5, [r4, 0x2] + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _081D815A +_081D8024: + adds r0, r1, 0x1 + strh r0, [r4, 0x2] + b _081D815A +_081D802A: + ldrh r1, [r4, 0x6] + ldrh r3, [r4, 0x4] + adds r0, r1, r3 + strh r0, [r4, 0x4] + ldrh r2, [r4, 0xA] + ldrh r3, [r4, 0x8] + adds r0, r2, r3 + strh r0, [r4, 0x8] + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _081D8046 + subs r0, r1, 0x3 + strh r0, [r4, 0x6] +_081D8046: + lsls r0, r2, 16 + cmp r0, 0 + beq _081D8050 + subs r0, r2, 0x1 + strh r0, [r4, 0xA] +_081D8050: + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0xFF + ble _081D8078 + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r4, 0x4] + movs r1, 0 + strh r1, [r4, 0x6] + movs r0, 0xC + strh r0, [r4, 0xC] + movs r3, 0x1 + negs r3, r3 + adds r0, r3, 0 + strh r0, [r4, 0xE] + strh r1, [r4, 0x2] + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_081D8078: + movs r1, 0xF0 + lsls r1, 7 + movs r2, 0xC0 + lsls r2, 5 + ldrh r0, [r4, 0x8] + adds r0, 0x20 + lsls r0, 16 + asrs r0, 16 + str r0, [sp] + movs r3, 0x4 + ldrsh r0, [r4, r3] + str r0, [sp, 0x4] + movs r3, 0x4 + ldrsh r0, [r4, r3] + str r0, [sp, 0x8] + movs r0, 0 + str r0, [sp, 0xC] + movs r0, 0x2 + movs r3, 0x78 + bl SetBgAffine + b _081D815A +_081D80A4: + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + movs r1, 0xF0 + lsls r1, 7 + movs r2, 0xC0 + lsls r2, 5 + ldrh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 18 + adds r0, 0x20 + ldrh r3, [r4, 0x8] + adds r0, r3 + lsls r0, 16 + asrs r0, 16 + str r0, [sp] + movs r3, 0x4 + ldrsh r0, [r4, r3] + str r0, [sp, 0x4] + movs r3, 0x4 + ldrsh r0, [r4, r3] + str r0, [sp, 0x8] + movs r5, 0 + str r5, [sp, 0xC] + movs r0, 0x2 + movs r3, 0x78 + bl SetBgAffine + ldrh r0, [r4, 0xE] + ldrh r1, [r4, 0xC] + adds r0, r1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0xC + beq _081D80F4 + movs r0, 0xC + negs r0, r0 + cmp r1, r0 + bne _081D815A +_081D80F4: + movs r2, 0xE + ldrsh r0, [r4, r2] + negs r0, r0 + strh r0, [r4, 0xE] + movs r3, 0x2 + ldrsh r1, [r4, r3] + ldr r0, =0x00000127 + cmp r1, r0 + ble _081D815A + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + movs r0, 0x1 + negs r0, r0 + str r5, [sp] + movs r1, 0x6 + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + b _081D815A + .pool +_081D8124: + ldrh r0, [r4, 0x4] + adds r0, 0x10 + strh r0, [r4, 0x4] + movs r1, 0xF0 + lsls r1, 7 + movs r2, 0xC0 + lsls r2, 5 + ldrh r0, [r4, 0x8] + adds r0, 0x20 + lsls r0, 16 + asrs r0, 16 + str r0, [sp] + movs r3, 0x4 + ldrsh r0, [r4, r3] + str r0, [sp, 0x4] + movs r3, 0x4 + ldrsh r0, [r4, r3] + str r0, [sp, 0x8] + movs r0, 0 + str r0, [sp, 0xC] + movs r0, 0x2 + movs r3, 0x78 + bl SetBgAffine + adds r0, r6, 0 + bl sub_81D8164 +_081D815A: + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81D7FC0 + + thumb_func_start sub_81D8164 +sub_81D8164: @ 81D8164 + 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 _081D8192 + movs r0, 0 + bl SetVBlankCallback + bl ResetSpriteData + bl FreeAllSpritePalettes + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81D6840 + str r0, [r1] +_081D8192: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D8164 + + thumb_func_start sub_81D81A4 +sub_81D81A4: @ 81D81A4 + push {r4-r6,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 r1, [r4, 0x2] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _081D8254 + ldr r0, =gUnknown_0862AAA0 + ldr r3, =gUnknown_0862AAB8 + movs r1, 0 + ldrsh r2, [r4, r1] + lsls r2, 1 + adds r1, r2, r3 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + lsls r1, 18 + movs r6, 0xF0 + lsls r6, 15 + adds r1, r6 + asrs r1, 16 + adds r3, 0x1 + adds r2, r3 + ldrb r2, [r2] + lsls r2, 24 + asrs r2, 24 + lsls r2, 18 + movs r3, 0xA0 + lsls r3, 15 + adds r2, r3 + asrs r2, 16 + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gSprites + lsls r3, r0, 4 + adds r3, r0 + lsls r3, 2 + adds r3, r1 + movs r0, 0 + ldrsb r0, [r4, r0] + strh r0, [r3, 0x2E] + ldrb r2, [r3, 0x1] + movs r1, 0xD + negs r1, r1 + adds r0, r1, 0 + ands r0, r2 + movs r2, 0x4 + orrs r0, r2 + movs r2, 0x3 + orrs r0, r2 + strb r0, [r3, 0x1] + ldrb r0, [r3, 0x5] + ands r1, r0 + movs r0, 0x8 + orrs r1, r0 + strb r1, [r3, 0x5] + adds r0, r3, 0 + bl InitSpriteAffineAnim + ldrh r1, [r4] + movs r6, 0 + ldrsh r0, [r4, r6] + cmp r0, 0x9 + bne _081D8250 + adds r0, r5, 0 + bl DestroyTask + b _081D825A + .pool +_081D8250: + adds r0, r1, 0x1 + strh r0, [r4] +_081D8254: + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] +_081D825A: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81D81A4 + + thumb_func_start sub_81D8260 +sub_81D8260: @ 81D8260 + push {lr} + adds r2, r0, 0 + movs r1, 0x30 + ldrsh r0, [r2, r1] + cmp r0, 0 + bne _081D8270 + strh r0, [r2, 0x24] + b _081D829A +_081D8270: + ldr r1, =gUnknown_0862AAB8 + movs r3, 0x2E + ldrsh r0, [r2, r3] + lsls r0, 1 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldrh r3, [r2, 0x24] + adds r0, r3 + strh r0, [r2, 0x24] + movs r3, 0x2E + ldrsh r0, [r2, r3] + lsls r0, 1 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldrh r1, [r2, 0x26] + adds r0, r1 +_081D829A: + strh r0, [r2, 0x26] + ldrh r0, [r2, 0x30] + adds r0, 0x1 + movs r1, 0xF + ands r0, r1 + strh r0, [r2, 0x30] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D8260 + + thumb_func_start sub_81D82B0 +sub_81D82B0: @ 81D82B0 + push {r4,lr} + bl sub_8121DA0 + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_0862AACC + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + ldr r4, =gUnknown_0203CF60 + ldr r1, [r4] + adds r1, 0x4 + movs r0, 0 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x00000804 + adds r1, r0 + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x00001004 + adds r1, r0 + movs r0, 0x2 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x00001804 + adds r1, r0 + movs r0, 0x3 + bl SetBgTilemapBuffer + bl sub_8121E10 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x3 + bl schedule_bg_copy_tilemap_to_vram + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D82B0 + + thumb_func_start sub_81D8358 +sub_81D8358: @ 81D8358 + push {r4-r7,lr} + sub sp, 0xC + bl reset_temp_tile_data_buffers + ldr r1, =gUnknown_08DA7528 + movs r4, 0 + str r4, [sp] + movs r0, 0 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r1, =gUnknown_08DA69BC + str r4, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + add r7, sp, 0x8 +_081D8380: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _081D8380 + ldr r0, =gUnknown_08DA7AAC + ldr r5, =gUnknown_0203CF60 + ldr r1, [r5] + adds r1, 0x4 + bl LZDecompressWram + ldr r0, =gUnknown_08DA7784 + ldr r1, [r5] + ldr r4, =0x00001804 + adds r1, r4 + bl LZDecompressWram + str r6, [sp, 0x4] + ldr r1, [r5] + ldr r0, =0x00001004 + adds r1, r0 + ldr r2, =0x01000200 + add r0, sp, 0x4 + bl CpuFastSet + ldr r1, [r5] + adds r4, r1, r4 + ldr r0, =0x00000804 + adds r1, r0 + movs r2, 0x80 + lsls r2, 2 + adds r0, r4, 0 + bl CpuFastSet + str r6, [sp, 0x8] + ldr r1, [r5] + ldr r0, =0x00000904 + adds r1, r0 + ldr r2, =0x010000d0 + adds r0, r7, 0 + bl CpuFastSet + ldr r0, =gUnknown_08DA7744 + movs r1, 0 + movs r2, 0x40 + bl LoadCompressedPalette + ldr r0, =gPlttBufferUnfaded + ldr r1, =0x00007fff + strh r1, [r0] + ldr r0, =gPlttBufferFaded + strh r1, [r0] + ldr r0, =gUnknown_0862AAFC + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0862AB04 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0862AB0C + bl LoadCompressedObjectPalette + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D8358 + + thumb_func_start sub_81D844C +sub_81D844C: @ 81D844C + push {r4,r5,lr} + movs r0, 0x6 + bl GetGpuReg + lsls r0, 16 + lsrs r2, r0, 16 + adds r1, r2, 0 + subs r1, 0x18 + lsls r0, r1, 16 + lsrs r0, 16 + cmp r0, 0x6F + bhi _081D848C + ldr r0, =gUnknown_0203CF60 + ldr r0, [r0] + ldr r3, =0x00002008 + adds r0, r3 + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r1, r0 + bgt _081D848C + ldr r1, =0x04000052 + ldr r3, =0x00000d08 + b _081D8492 + .pool +_081D848C: + ldr r1, =0x04000052 + movs r3, 0x80 + lsls r3, 5 +_081D8492: + adds r0, r3, 0 + strh r0, [r1] + cmp r2, 0 + bne _081D84E0 + ldr r0, =gUnknown_0203CF60 + ldr r1, [r0] + ldr r2, =0x00002008 + adds r3, r1, r2 + ldrh r4, [r3] + movs r1, 0 + ldrsh r2, [r3, r1] + ldr r1, =0x00001fff + adds r5, r0, 0 + cmp r2, r1 + bgt _081D84D4 + cmp r2, 0x27 + bgt _081D84C8 + adds r0, r4, 0x4 + b _081D84D2 + .pool +_081D84C8: + cmp r2, 0x4F + bgt _081D84D0 + adds r0, r4, 0x2 + b _081D84D2 +_081D84D0: + adds r0, r4, 0x1 +_081D84D2: + strh r0, [r3] +_081D84D4: + ldr r1, [r5] + ldr r2, =0x0000200a + adds r1, r2 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_081D84E0: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D844C + + thumb_func_start sub_81D84EC +sub_81D84EC: @ 81D84EC + push {r4-r6,lr} + mov r6, r8 + push {r6} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r6, =gTasks + 0x8 + adds r5, r4, r6 + bl sub_81D82B0 + bl sub_81D8358 + ldr r1, =0x00001e41 + movs r0, 0x50 + bl SetGpuRegBits + movs r0, 0x80 + lsls r0, 5 + mov r8, r0 + movs r0, 0x52 + mov r1, r8 + bl SetGpuReg + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl BlendPalettes + ldr r0, =sub_81D67EC + bl SetVBlankCallback + ldr r0, =gUnknown_0203CF60 + ldr r0, [r0] + ldr r1, =0x00002008 + adds r2, r0, r1 + movs r1, 0 + strh r1, [r2] + ldr r2, =0x0000200a + adds r0, r2 + strh r1, [r0] + strh r1, [r5] + strh r1, [r5, 0x2] + strh r1, [r5, 0x4] + strh r1, [r5, 0x6] + mov r0, r8 + strh r0, [r5, 0x8] + subs r6, 0x8 + adds r4, r6 + ldr r0, =sub_81D857C + str r0, [r4] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D84EC + + thumb_func_start sub_81D857C +sub_81D857C: @ 81D857C + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r5, r0, r1 + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0x4 + bhi _081D8674 + lsls r0, 2 + ldr r1, =_081D85A8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081D85A8: + .4byte _081D85BC + .4byte _081D85DC + .4byte _081D861A + .4byte _081D863A + .4byte _081D8656 +_081D85BC: + ldrh r1, [r5, 0x2] + movs r2, 0x2 + ldrsh r0, [r5, r2] + cmp r0, 0x8 + bne _081D8634 + movs r0, 0x1 + negs r0, r0 + movs r4, 0 + str r4, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade + strh r4, [r5, 0x2] + b _081D864E +_081D85DC: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _081D8674 + ldrh r2, [r5, 0x2] + movs r3, 0x2 + ldrsh r0, [r5, r3] + cmp r0, 0xA + bne _081D8614 + strh r1, [r5, 0x2] + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + ldr r0, =sub_81D844C + bl SetHBlankCallback + movs r0, 0x3 + bl EnableInterrupts + b _081D8674 + .pool +_081D8614: + adds r0, r2, 0x1 + strh r0, [r5, 0x2] + b _081D8674 +_081D861A: + ldrh r1, [r5, 0x2] + movs r2, 0x2 + ldrsh r0, [r5, r2] + cmp r0, 0x50 + bne _081D8634 + movs r0, 0 + strh r0, [r5, 0x2] + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + bl sub_81D86CC + b _081D8674 +_081D8634: + adds r0, r1, 0x1 + strh r0, [r5, 0x2] + b _081D8674 +_081D863A: + ldrh r0, [r5, 0x2] + adds r0, 0x1 + strh r0, [r5, 0x2] + lsls r0, 16 + movs r1, 0xB8 + lsls r1, 17 + cmp r0, r1 + bne _081D8674 + movs r0, 0 + strh r0, [r5, 0x2] +_081D864E: + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + b _081D8674 +_081D8656: + 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_81D8684 + str r1, [r0] +_081D8674: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D857C + + thumb_func_start sub_81D8684 +sub_81D8684: @ 81D8684 + 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 _081D86B8 + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + bl SetHBlankCallback + bl ResetSpriteData + bl FreeAllSpritePalettes + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81D6840 + str r0, [r1] +_081D86B8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D8684 + + thumb_func_start sub_81D86CC +sub_81D86CC: @ 81D86CC + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, =gUnknown_0862AB14 + movs r1, 0xA0 + movs r2, 0 + movs r3, 0 + bl CreateSprite + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + lsls r5, r6, 4 + adds r5, r6 + lsls r5, 2 + ldr r4, =gSprites + 0x2E + adds r0, r5, r4 + mov r8, r0 + ldr r0, =gUnknown_0862AB2C + movs r2, 0x30 + negs r2, r2 + movs r1, 0xB8 + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + mov r1, r8 + strh r0, [r1] + adds r3, r4, 0 + subs r3, 0x2E + subs r4, 0x12 + adds r4, r5, r4 + ldr r0, =sub_81D874C + str r0, [r4] + adds r5, r3 + ldrb r0, [r5, 0x5] + movs r2, 0xC + orrs r0, r2 + strb r0, [r5, 0x5] + movs r4, 0 + ldrsh r1, [r1, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r1, [r0, 0x5] + orrs r1, r2 + strb r1, [r0, 0x5] + adds r0, r6, 0 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D86CC + + thumb_func_start sub_81D874C +sub_81D874C: @ 81D874C + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r5, 0 + adds r4, 0x2E + movs r0, 0x4 + ldrsh r1, [r4, r0] + cmp r1, 0 + bne _081D8764 + movs r0, 0xC + strh r0, [r4, 0x6] + movs r0, 0x8 + b _081D87C2 +_081D8764: + movs r0, 0x80 + lsls r0, 1 + cmp r1, r0 + bne _081D8774 + movs r0, 0x9 + strh r0, [r4, 0x6] + movs r0, 0x7 + b _081D87C2 +_081D8774: + movs r0, 0x86 + lsls r0, 1 + cmp r1, r0 + bne _081D8784 + movs r0, 0x8 + strh r0, [r4, 0x6] + movs r0, 0x6 + b _081D87C2 +_081D8784: + movs r0, 0x8C + lsls r0, 1 + cmp r1, r0 + bne _081D8794 + movs r0, 0x7 + strh r0, [r4, 0x6] + movs r0, 0x5 + b _081D87C2 +_081D8794: + movs r0, 0x92 + lsls r0, 1 + cmp r1, r0 + bne _081D87A4 + movs r0, 0x6 + strh r0, [r4, 0x6] + movs r0, 0x4 + b _081D87C2 +_081D87A4: + movs r0, 0x98 + lsls r0, 1 + cmp r1, r0 + bne _081D87B4 + movs r0, 0x5 + strh r0, [r4, 0x6] + movs r0, 0x3 + b _081D87C2 +_081D87B4: + movs r0, 0xA0 + lsls r0, 1 + cmp r1, r0 + bne _081D87C4 + movs r0, 0x4 + strh r0, [r4, 0x6] + movs r0, 0x2 +_081D87C2: + strh r0, [r4, 0x8] +_081D87C4: + movs r1, 0x4 + ldrsh r0, [r4, r1] + movs r2, 0x6 + ldrsh r1, [r4, r2] + bl __modsi3 + cmp r0, 0 + bne _081D87EE + ldrh r0, [r5, 0x24] + subs r0, 0x1 + strh r0, [r5, 0x24] + ldr r2, =gSprites + movs r0, 0 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x24] + subs r1, 0x1 + strh r1, [r0, 0x24] +_081D87EE: + movs r1, 0x4 + ldrsh r0, [r4, r1] + movs r2, 0x8 + ldrsh r1, [r4, r2] + bl __modsi3 + cmp r0, 0 + bne _081D8818 + ldrh r0, [r5, 0x26] + adds r0, 0x1 + strh r0, [r5, 0x26] + ldr r2, =gSprites + movs r0, 0 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x26] + adds r1, 0x1 + strh r1, [r0, 0x26] +_081D8818: + ldrh r0, [r4, 0x4] + adds r0, 0x1 + strh r0, [r4, 0x4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D874C + + thumb_func_start sub_81D8828 +sub_81D8828: @ 81D8828 + push {r4,lr} + bl sub_8121DA0 + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_0862AB44 + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + ldr r4, =gUnknown_0203CF60 + ldr r1, [r4] + adds r1, 0x4 + movs r0, 0 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x00000804 + adds r1, r0 + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x00001004 + adds r1, r0 + movs r0, 0x2 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x00001804 + adds r1, r0 + movs r0, 0x3 + bl SetBgTilemapBuffer + bl sub_8121E10 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x3 + bl schedule_bg_copy_tilemap_to_vram + movs r1, 0xC1 + lsls r1, 6 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D8828 + + thumb_func_start sub_81D88D0 +sub_81D88D0: @ 81D88D0 + push {r4,lr} + sub sp, 0x4 + bl reset_temp_tile_data_buffers + ldr r1, =gUnknown_08DA80BC + movs r4, 0 + str r4, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r1, =gUnknown_08DA7EAC + str r4, [sp] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r1, =gUnknown_08DA7C30 + str r4, [sp] + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram +_081D8904: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + bne _081D8904 + ldr r0, =gUnknown_08DA8D6C + ldr r4, =gUnknown_0203CF60 + ldr r1, [r4] + adds r1, 0x4 + bl LZDecompressWram + ldr r0, =gUnknown_08DA8B40 + ldr r1, [r4] + ldr r2, =0x00000804 + adds r1, r2 + bl LZDecompressWram + ldr r0, =gUnknown_08DA7FB4 + ldr r1, [r4] + ldr r2, =0x00001004 + adds r1, r2 + bl LZDecompressWram + ldr r0, =gUnknown_08DA7D6C + ldr r1, [r4] + ldr r2, =0x00001804 + adds r1, r2 + bl LZDecompressWram + ldr r0, =gUnknown_08DA8E84 + movs r1, 0 + movs r2, 0x80 + bl LoadCompressedPalette + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D88D0 + + thumb_func_start sub_81D8980 +sub_81D8980: @ 81D8980 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r5, =gTasks + 0x8 + adds r6, r4, r5 + bl sub_81D8828 + bl sub_81D88D0 + bl sub_81D68C8 + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl BlendPalettes + ldr r0, =sub_81D67EC + bl SetVBlankCallback + movs r0, 0 + strh r0, [r6] + strh r0, [r6, 0x2] + ldr r0, =sub_81D8AD8 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x4] + subs r5, 0x8 + adds r4, r5 + ldr r0, =sub_81D89E0 + str r0, [r4] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D8980 + + thumb_func_start sub_81D89E0 +sub_81D89E0: @ 81D89E0 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + bl sub_81D8BB4 + ldrh r1, [r4, 0x6] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + bne _081D8A16 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bgt _081D8A16 + movs r2, 0x2 + ldrsh r0, [r4, r2] + cmp r0, 0x59 + bgt _081D8A16 + movs r0, 0x67 + bl PlaySE +_081D8A16: + ldrh r0, [r4, 0x6] + adds r0, 0x1 + strh r0, [r4, 0x6] + movs r0, 0 + ldrsh r5, [r4, r0] + cmp r5, 0x1 + beq _081D8A5C + cmp r5, 0x1 + bgt _081D8A34 + cmp r5, 0 + beq _081D8A3E + b _081D8AC6 + .pool +_081D8A34: + cmp r5, 0x2 + beq _081D8A8C + cmp r5, 0x3 + beq _081D8AA8 + b _081D8AC6 +_081D8A3E: + ldrh r1, [r4, 0x2] + movs r2, 0x2 + ldrsh r0, [r4, r2] + cmp r0, 0x8 + bne _081D8AA2 + movs r0, 0x1 + negs r0, r0 + str r5, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade + strh r5, [r4, 0x2] + b _081D8A9A +_081D8A5C: + ldrh r1, [r4, 0x2] + movs r2, 0x2 + ldrsh r0, [r4, r2] + cmp r0, 0x7F + bne _081D8AA2 + movs r0, 0 + strh r0, [r4, 0x2] + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + ldr r2, =gTasks + movs r0, 0x4 + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldr r1, =sub_81D8B2C + b _081D8AC4 + .pool +_081D8A8C: + ldrh r1, [r4, 0x2] + movs r2, 0x2 + ldrsh r0, [r4, r2] + cmp r0, 0xC + bne _081D8AA2 + movs r0, 0 + strh r0, [r4, 0x2] +_081D8A9A: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _081D8AC6 +_081D8AA2: + adds r0, r1, 0x1 + strh r0, [r4, 0x2] + b _081D8AC6 +_081D8AA8: + 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, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81D8BEC +_081D8AC4: + str r1, [r0] +_081D8AC6: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D89E0 + + thumb_func_start sub_81D8AD8 +sub_81D8AD8: @ 81D8AD8 + 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 r5, r1, r0 + ldrh r1, [r5, 0x1E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _081D8B1C + bl Random + movs r4, 0x7 + adds r1, r4, 0 + ands r1, r0 + subs r1, 0x4 + lsls r1, 8 + movs r0, 0x1 + movs r2, 0 + bl ChangeBgX + bl Random + ands r4, r0 + subs r4, 0x4 + lsls r4, 8 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0 + bl ChangeBgY +_081D8B1C: + ldrh r0, [r5, 0x1E] + adds r0, 0x1 + strh r0, [r5, 0x1E] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D8AD8 + + thumb_func_start sub_81D8B2C +sub_81D8B2C: @ 81D8B2C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r4, r1, r0 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081D8B70 + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + movs r0, 0xA + strh r0, [r4, 0x2] + movs r1, 0x1 + negs r1, r1 + adds r0, r1, 0 + b _081D8BAA + .pool +_081D8B70: + cmp r0, 0x1 + bne _081D8BAC + movs r0, 0x2 + ldrsh r1, [r4, r0] + lsls r1, 8 + movs r0, 0x1 + movs r2, 0x2 + bl ChangeBgX + movs r0, 0x2 + ldrsh r1, [r4, r0] + lsls r1, 8 + movs r0, 0x1 + movs r2, 0x1 + bl ChangeBgY + ldrh r0, [r4, 0x4] + ldrh r1, [r4, 0x2] + adds r0, r1 + strh r0, [r4, 0x2] + lsls r0, 16 + asrs r0, 16 + movs r1, 0xA + negs r1, r1 + cmp r0, r1 + bne _081D8BAC + movs r1, 0x4 + ldrsh r0, [r4, r1] + negs r0, r0 +_081D8BAA: + strh r0, [r4, 0x4] +_081D8BAC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81D8B2C + + thumb_func_start sub_81D8BB4 +sub_81D8BB4: @ 81D8BB4 + push {r4,lr} + movs r4, 0x80 + lsls r4, 3 + movs r0, 0x2 + adds r1, r4, 0 + movs r2, 0x2 + bl ChangeBgX + movs r0, 0x2 + adds r1, r4, 0 + movs r2, 0x1 + bl ChangeBgY + movs r4, 0x80 + lsls r4, 4 + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x2 + bl ChangeBgX + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl ChangeBgY + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81D8BB4 + + thumb_func_start sub_81D8BEC +sub_81D8BEC: @ 81D8BEC + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r5, r1, 3 + ldr r6, =gTasks + 0x8 + adds r4, r5, r6 + bl sub_81D8BB4 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081D8C26 + movs r0, 0 + bl SetVBlankCallback + bl sub_81D6904 + ldrb r0, [r4, 0x4] + bl DestroyTask + adds r0, r6, 0 + subs r0, 0x8 + adds r0, r5, r0 + ldr r1, =sub_81D6840 + str r1, [r0] +_081D8C26: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D8BEC + + thumb_func_start sub_81D8C38 +sub_81D8C38: @ 81D8C38 + push {r4,lr} + bl sub_8121DA0 + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_0862AD08 + movs r0, 0x1 + movs r2, 0x3 + bl InitBgsFromTemplates + ldr r4, =gUnknown_0203CF60 + ldr r1, [r4] + adds r1, 0x4 + movs r0, 0 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x00000804 + adds r1, r0 + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x00001004 + adds r1, r0 + movs r0, 0x2 + bl SetBgTilemapBuffer + bl sub_8121E10 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + movs r1, 0xC1 + lsls r1, 6 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D8C38 + + thumb_func_start sub_81D8CC4 +sub_81D8CC4: @ 81D8CC4 + push {r4,lr} + sub sp, 0x4 + bl reset_temp_tile_data_buffers + ldr r1, =gUnknown_08DAAB24 + movs r4, 0 + str r4, [sp] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r1, =gUnknown_08DAA8B4 + str r4, [sp] + movs r0, 0 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram +_081D8CEA: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + bne _081D8CEA + ldr r0, =gUnknown_08DAAE54 + ldr r4, =gUnknown_0203CF60 + ldr r1, [r4] + ldr r2, =0x00000804 + adds r1, r2 + bl LZDecompressWram + ldr r0, =gUnknown_08DAAC1C + ldr r1, [r4] + adds r1, 0x4 + bl LZDecompressWram + ldr r0, =gUnknown_08DAAF98 + ldr r1, [r4] + ldr r2, =0x00001004 + adds r1, r2 + bl LZDecompressWram + ldr r0, =gUnknown_08DAAFEC + movs r1, 0 + movs r2, 0x60 + bl LoadCompressedPalette + ldr r0, =gUnknown_0862AC28 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0862AC30 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0862AC38 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0862AC40 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0862AC48 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0862AC50 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0862AC58 + bl LoadCompressedObjectPalette + ldr r0, =gUnknown_0862AC60 + bl LoadCompressedObjectPalette + ldr r0, =gUnknown_0862AC68 + bl LoadCompressedObjectPalette + ldr r0, =gUnknown_0862AC70 + bl LoadCompressedObjectPalette + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D8CC4 + + thumb_func_start sub_81D8DB4 +sub_81D8DB4: @ 81D8DB4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r5, =gTasks + 0x8 + adds r6, r4, r5 + bl sub_81D8C38 + bl sub_81D8CC4 + bl sub_81D68C8 + movs r1, 0x80 + lsls r1, 3 + movs r0, 0 + bl ClearGpuRegBits + ldr r1, =0x00000241 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x00000e09 + movs r0, 0x52 + bl SetGpuReg + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl BlendPalettes + ldr r0, =sub_81D67EC + bl SetVBlankCallback + movs r0, 0 + strh r0, [r6] + strh r0, [r6, 0x2] + subs r5, 0x8 + adds r4, r5 + ldr r0, =sub_81D8E80 + str r0, [r4] + ldr r0, =sub_81D8FB0 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x4] + movs r0, 0x4 + ldrsh r1, [r6, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + movs r2, 0 + strh r2, [r0, 0x8] + movs r0, 0x4 + ldrsh r1, [r6, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + strh r2, [r0, 0xA] + movs r0, 0x4 + ldrsh r1, [r6, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + strh r2, [r0, 0xC] + movs r0, 0x4 + ldrsh r1, [r6, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + movs r2, 0x1 + strh r2, [r0, 0xE] + movs r0, 0x4 + ldrsh r1, [r6, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + strh r2, [r0, 0x10] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D8DB4 + + thumb_func_start sub_81D8E80 +sub_81D8E80: @ 81D8E80 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r7, r0, 3 + ldr r0, =gTasks + 0x8 + mov r8, r0 + adds r4, r7, r0 + movs r1, 0 + ldrsh r5, [r4, r1] + cmp r5, 0x1 + beq _081D8EDE + cmp r5, 0x1 + bgt _081D8EB0 + cmp r5, 0 + beq _081D8EBA + b _081D8FA0 + .pool +_081D8EB0: + cmp r5, 0x2 + beq _081D8F1E + cmp r5, 0x3 + beq _081D8F84 + b _081D8FA0 +_081D8EBA: + ldrh r1, [r4, 0x2] + movs r2, 0x2 + ldrsh r0, [r4, r2] + cmp r0, 0x8 + bne _081D8F18 + adds r0, r6, 0 + bl sub_81D90A8 + movs r0, 0x1 + negs r0, r0 + str r5, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade + strh r5, [r4, 0x2] + b _081D8F30 +_081D8EDE: + ldr r2, =gSprites + movs r0, 0xA + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =sub_81D97E0 + cmp r1, r0 + bne _081D8FA0 + ldrh r1, [r4, 0x2] + movs r2, 0x2 + ldrsh r0, [r4, r2] + cmp r0, 0x40 + bne _081D8F18 + adds r0, r6, 0 + bl sub_81D94D4 + adds r0, r6, 0 + bl sub_81D93D8 + b _081D8F2C + .pool +_081D8F18: + adds r0, r1, 0x1 + strh r0, [r4, 0x2] + b _081D8FA0 +_081D8F1E: + ldrh r2, [r4, 0x2] + movs r0, 0x2 + ldrsh r1, [r4, r0] + movs r0, 0xE0 + lsls r0, 1 + cmp r1, r0 + bne _081D8F38 +_081D8F2C: + movs r0, 0 + strh r0, [r4, 0x2] +_081D8F30: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _081D8FA0 +_081D8F38: + adds r0, r2, 0x1 + strh r0, [r4, 0x2] + movs r1, 0x2 + ldrsh r0, [r4, r1] + movs r1, 0x90 + bl __modsi3 + lsls r0, 16 + asrs r4, r0, 16 + cmp r4, 0 + bne _081D8FA0 + ldr r0, =0x0000fffe + ldr r1, =0x0000ffff + str r1, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A2C44 + ldr r0, =0xffff0000 + str r4, [sp] + str r4, [sp, 0x4] + movs r1, 0x1 + str r1, [sp, 0x8] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A2C44 + b _081D8FA0 + .pool +_081D8F84: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r1, 0x4 + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + mov r0, r8 + subs r0, 0x8 + adds r0, r7, r0 + ldr r1, =sub_81D9034 + str r1, [r0] +_081D8FA0: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D8E80 + + thumb_func_start sub_81D8FB0 +sub_81D8FB0: @ 81D8FB0 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r4, r1, r0 + ldrh r1, [r4] + movs r0, 0xF + ands r0, r1 + cmp r0, 0 + bne _081D9024 + ldrh r1, [r4, 0x2] + adds r1, 0xE + lsls r1, 8 + movs r2, 0xF8 + lsls r2, 5 + adds r0, r2, 0 + ands r1, r0 + ldrh r0, [r4, 0x4] + adds r0, 0x9 + movs r2, 0xF + ands r0, r2 + orrs r1, r0 + movs r0, 0x52 + bl SetGpuReg + ldrh r1, [r4, 0x2] + ldrh r0, [r4, 0x6] + subs r1, r0 + strh r1, [r4, 0x2] + ldrh r0, [r4, 0x8] + ldrh r2, [r4, 0x4] + adds r0, r2 + strh r0, [r4, 0x4] + lsls r1, 16 + asrs r1, 16 + movs r0, 0x3 + negs r0, r0 + cmp r1, r0 + beq _081D9008 + cmp r1, 0 + bne _081D9010 +_081D9008: + movs r1, 0x6 + ldrsh r0, [r4, r1] + negs r0, r0 + strh r0, [r4, 0x6] +_081D9010: + movs r2, 0x4 + ldrsh r0, [r4, r2] + cmp r0, 0x3 + beq _081D901C + cmp r0, 0 + bne _081D9024 +_081D901C: + movs r1, 0x8 + ldrsh r0, [r4, r1] + negs r0, r0 + strh r0, [r4, 0x8] +_081D9024: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D8FB0 + + thumb_func_start sub_81D9034 +sub_81D9034: @ 81D9034 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r6, r1, 3 + ldr r7, =gTasks + 0x8 + adds r4, r6, r7 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _081D90A0 + bl StopMapMusic + movs r1, 0x2 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081D9078 + movs r0, 0 + bl SetVBlankCallback + bl sub_81D6904 + bl ResetSpriteData + bl FreeAllSpritePalettes + ldrb r0, [r4, 0x4] + bl DestroyTask +_081D9078: + ldrh r1, [r4, 0x2] + movs r2, 0x2 + ldrsh r0, [r4, r2] + cmp r0, 0x20 + bne _081D909C + strh r5, [r4, 0x2] + adds r0, r7, 0 + subs r0, 0x8 + adds r0, r6, r0 + ldr r1, =sub_81D6840 + str r1, [r0] + b _081D90A0 + .pool +_081D909C: + adds r0, r1, 0x1 + strh r0, [r4, 0x2] +_081D90A0: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81D9034 + + thumb_func_start sub_81D90A8 +sub_81D90A8: @ 81D90A8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + ldr r0, =gUnknown_0862AC78 + movs r1, 0x40 + movs r2, 0x78 + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x6] + movs r0, 0x6 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + 0x2E + mov r10, r1 + adds r7, r0, r1 + ldr r0, =gUnknown_0862AC90 + movs r1, 0x10 + movs r2, 0x82 + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7] + movs r2, 0x2E + negs r2, r2 + add r2, r10 + mov r8, r2 + movs r1, 0x6 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r8 + ldrb r2, [r1, 0x5] + movs r6, 0xD + negs r6, r6 + adds r0, r6, 0 + ands r0, r2 + movs r2, 0x4 + mov r9, r2 + mov r2, r9 + orrs r0, r2 + strb r0, [r1, 0x5] + movs r1, 0 + ldrsh r0, [r7, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r8 + ldrb r2, [r1, 0x5] + adds r0, r6, 0 + ands r0, r2 + mov r2, r9 + orrs r0, r2 + strb r0, [r1, 0x5] + ldr r5, =gUnknown_0862ACA8 + adds r0, r5, 0 + movs r1, 0xA0 + movs r2, 0x80 + movs r3, 0x1 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x8] + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + mov r1, r10 + adds r7, r0, r1 + adds r0, r5, 0 + movs r1, 0xC0 + movs r2, 0x80 + movs r3, 0x1 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7] + adds r0, r5, 0 + movs r1, 0xE0 + movs r2, 0x80 + movs r3, 0x1 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7, 0x2] + movs r2, 0x8 + ldrsh r0, [r4, r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r8 + ldrb r2, [r1, 0x5] + adds r0, r6, 0 + ands r0, r2 + mov r2, r9 + orrs r0, r2 + strb r0, [r1, 0x5] + movs r1, 0 + ldrsh r0, [r7, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r8 + ldrb r2, [r1, 0x5] + adds r0, r6, 0 + ands r0, r2 + mov r2, r9 + orrs r0, r2 + strb r0, [r1, 0x5] + movs r1, 0x2 + ldrsh r0, [r7, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r8 + ldrb r2, [r1, 0x5] + adds r0, r6, 0 + ands r0, r2 + mov r2, r9 + orrs r0, r2 + strb r0, [r1, 0x5] + movs r0, 0 + ldrsh r1, [r7, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + movs r1, 0x1 + bl StartSpriteAnim + movs r2, 0x2 + ldrsh r1, [r7, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + movs r1, 0x2 + bl StartSpriteAnim + ldr r0, =gUnknown_0862ACC0 + movs r2, 0x41 + negs r2, r2 + movs r1, 0x78 + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0xA] + movs r0, 0xA + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + mov r1, r10 + adds r7, r0, r1 + ldr r0, =gUnknown_0862ACD8 + movs r2, 0x71 + negs r2, r2 + movs r1, 0x78 + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7] + movs r2, 0xA + ldrsh r0, [r4, r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r8 + ldrb r2, [r1, 0x5] + adds r0, r6, 0 + ands r0, r2 + mov r2, r9 + orrs r0, r2 + strb r0, [r1, 0x5] + movs r0, 0 + ldrsh r1, [r7, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + ldrb r1, [r0, 0x5] + ands r6, r1 + orrs r6, r2 + strb r6, [r0, 0x5] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D90A8 + + thumb_func_start sub_81D9274 +sub_81D9274: @ 81D9274 + push {r4-r6,lr} + mov r6, r8 + push {r6} + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + ldr r0, =gTasks + 0x8 + adds r2, r0 + ldr r3, =gSprites + movs r0, 0x6 + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + movs r1, 0x1C + adds r1, r3 + mov r8, r1 + add r0, r8 + ldr r6, =pokemon_alive_on_battle_side + str r6, [r0] + movs r0, 0x6 + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r4, 0 + strh r4, [r0, 0x36] + movs r0, 0x6 + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x38] + movs r0, 0x6 + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r5, 0x4 + strh r5, [r0, 0x3A] + movs r0, 0x6 + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x3C] + movs r0, 0x8 + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + str r6, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x36] + movs r0, 0x8 + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x38] + movs r0, 0x8 + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r5, [r0, 0x3A] + movs r0, 0x8 + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0x1 + strh r1, [r0, 0x3C] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D9274 + + thumb_func_start pokemon_alive_on_battle_side +pokemon_alive_on_battle_side: @ 81D9338 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x36] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + bne _081D93CC + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081D9370 + ldrh r0, [r4, 0x20] + ldrh r3, [r4, 0x3A] + subs r0, r3 + strh r0, [r4, 0x20] + ldr r2, =gSprites + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x20] + subs r1, r3 + b _081D939E + .pool +_081D9370: + ldrh r2, [r4, 0x3A] + ldrh r1, [r4, 0x20] + adds r0, r2, r1 + strh r0, [r4, 0x20] + ldr r3, =gSprites + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x20] + adds r2, r1 + strh r2, [r0, 0x20] + movs r2, 0x30 + ldrsh r1, [r4, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r4, 0x3A] + ldrh r2, [r0, 0x20] + adds r1, r2 +_081D939E: + strh r1, [r0, 0x20] + ldrh r1, [r4, 0x38] + adds r1, 0x1 + movs r2, 0 + strh r1, [r4, 0x38] + ldrh r0, [r4, 0x3A] + subs r0, r1 + strh r0, [r4, 0x3A] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x3 + bne _081D93CC + strh r2, [r4, 0x36] + strh r2, [r4, 0x38] + strh r2, [r4, 0x3A] + ldr r0, =SpriteCallbackDummy + str r0, [r4, 0x1C] + b _081D93D2 + .pool +_081D93CC: + ldrh r0, [r4, 0x36] + adds r0, 0x1 + strh r0, [r4, 0x36] +_081D93D2: + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemon_alive_on_battle_side + + thumb_func_start sub_81D93D8 +sub_81D93D8: @ 81D93D8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + ldr r0, =gTasks + 0x8 + adds r2, r0 + ldr r3, =gSprites + movs r0, 0x6 + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r3, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_81D9420 + str r1, [r0] + movs r0, 0x6 + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0x1 + bl StartSpriteAnim + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D93D8 + + thumb_func_start sub_81D9420 +sub_81D9420: @ 81D9420 + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x2B + ldrb r0, [r0] + cmp r0, 0x1 + beq _081D9488 + cmp r0, 0x1 + bgt _081D9436 + cmp r0, 0 + beq _081D9440 + b _081D94C4 +_081D9436: + cmp r0, 0x2 + beq _081D9440 + cmp r0, 0x3 + beq _081D9488 + b _081D94C4 +_081D9440: + adds r0, r4, 0 + adds r0, 0x2C + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 26 + movs r1, 0xC + bl __umodsi3 + lsls r0, 24 + ldr r2, =gSprites + cmp r0, 0 + bne _081D9470 + ldrh r0, [r4, 0x20] + subs r0, 0x2 + strh r0, [r4, 0x20] + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x20] + subs r1, 0x2 + strh r1, [r0, 0x20] +_081D9470: + movs r1, 0x2E + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0 + strh r0, [r1, 0x26] + b _081D94C4 + .pool +_081D9488: + ldr r2, =gSprites + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =0x0000fffe + strh r1, [r0, 0x26] + adds r0, r4, 0 + adds r0, 0x2C + ldrb r1, [r0] + lsls r1, 26 + lsrs r1, 26 + movs r0, 0xF + ands r0, r1 + cmp r0, 0 + bne _081D94C4 + ldrh r0, [r4, 0x22] + adds r0, 0x1 + strh r0, [r4, 0x22] + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x22] + adds r1, 0x1 + strh r1, [r0, 0x22] +_081D94C4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D9420 + + thumb_func_start sub_81D94D4 +sub_81D94D4: @ 81D94D4 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r1, r0 + movs r0, 0x8 + ldrsh r1, [r1, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r2, =gSprites + 0x2E + adds r4, r0, r2 + subs r2, 0x12 + adds r0, r2 + ldr r3, =sub_81D9528 + str r3, [r0] + movs r0, 0 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + str r3, [r0] + movs r0, 0x2 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + str r3, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D94D4 + + thumb_func_start sub_81D9528 +sub_81D9528: @ 81D9528 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + ldrh r1, [r7, 0x36] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _081D9550 + ldrh r1, [r7, 0x24] + movs r2, 0x24 + ldrsh r0, [r7, r2] + cmp r0, 0x1 + bne _081D954C + ldr r0, =0x0000ffff + b _081D954E + .pool +_081D954C: + movs r0, 0x1 +_081D954E: + strh r0, [r7, 0x24] +_081D9550: + movs r1, 0x38 + ldrsh r0, [r7, r1] + cmp r0, 0x80 + bne _081D95CE + ldr r2, =gUnknown_0862ACF0 + mov r8, r2 + mov r0, r8 + movs r1, 0x98 + movs r2, 0x84 + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7, 0x3C] + ldr r5, =gSprites + movs r1, 0x3C + ldrsh r0, [r7, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r2, [r1, 0x5] + movs r4, 0xD + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + movs r6, 0x4 + orrs r0, r6 + strb r0, [r1, 0x5] + mov r0, r8 + movs r1, 0xE0 + movs r2, 0x84 + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7, 0x3C] + movs r2, 0x3C + ldrsh r1, [r7, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r1, [r0, 0x5] + ands r4, r1 + orrs r4, r6 + strb r4, [r0, 0x5] + movs r0, 0x3C + ldrsh r1, [r7, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3F + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] + ldrh r0, [r7, 0x38] + adds r0, 0x1 + strh r0, [r7, 0x38] +_081D95CE: + ldrh r1, [r7, 0x38] + movs r2, 0x38 + ldrsh r0, [r7, r2] + cmp r0, 0x7F + ble _081D95F8 + movs r1, 0x26 + ldrsh r0, [r7, r1] + cmp r0, 0x20 + beq _081D95FC + ldrh r0, [r7, 0x3A] + adds r0, 0x1 + strh r0, [r7, 0x3A] + lsls r0, 16 + asrs r0, 20 + strh r0, [r7, 0x26] + b _081D95FC + .pool +_081D95F8: + adds r0, r1, 0x1 + strh r0, [r7, 0x38] +_081D95FC: + ldrh r0, [r7, 0x36] + movs r1, 0x3F + ands r0, r1 + cmp r0, 0 + bne _081D960C + movs r0, 0xA5 + bl PlaySE +_081D960C: + ldrh r0, [r7, 0x36] + adds r0, 0x1 + strh r0, [r7, 0x36] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81D9528 + + thumb_func_start sub_81D961C +sub_81D961C: @ 81D961C + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x3C + ldrsh r1, [r4, r0] + cmp r1, 0x40 + bgt _081D968C + ldrh r0, [r4, 0x26] + adds r0, 0x2 + strh r0, [r4, 0x26] + ldr r5, =gSprites + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrh r1, [r0, 0x26] + adds r1, 0x2 + strh r1, [r0, 0x26] + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0x40 + beq _081D964C + b _081D979E +_081D964C: + movs r3, 0x30 + negs r3, r3 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + bl sub_81D9868 + movs r2, 0x5 + strh r2, [r4, 0x36] + ldr r0, =0x0000ffff + strh r0, [r4, 0x38] + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x3 + strh r1, [r0, 0x36] + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r2, [r0, 0x38] + b _081D979E + .pool +_081D968C: + cmp r1, 0x6F + bgt _081D96BE + adds r0, r4, 0 + bl sub_81D97E0 + movs r1, 0x36 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081D96A4 + movs r0, 0x68 + bl PlaySE +_081D96A4: + movs r0, 0x36 + ldrsh r1, [r4, r0] + movs r0, 0x3 + negs r0, r0 + cmp r1, r0 + bne _081D979E + adds r0, r4, 0 + movs r1, 0x2 + movs r2, 0x30 + movs r3, 0x10 + bl sub_81D9868 + b _081D979E +_081D96BE: + cmp r1, 0x70 + bne _081D96EC + ldr r2, =gSprites + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x7 + strh r1, [r0, 0x36] + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x3 + strh r1, [r0, 0x38] + b _081D96F2 + .pool +_081D96EC: + ldr r0, =0x00000147 + cmp r1, r0 + bgt _081D9700 +_081D96F2: + adds r0, r4, 0 + bl sub_81D97E0 + b _081D979E + .pool +_081D9700: + movs r0, 0xA4 + lsls r0, 1 + cmp r1, r0 + bne _081D974C + adds r0, r4, 0 + bl sub_81D97E0 + adds r0, r4, 0 + movs r1, 0x3 + movs r2, 0x30 + movs r3, 0x10 + bl sub_81D9868 + movs r3, 0x1 + strh r3, [r4, 0x24] + ldr r2, =gSprites + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r3, [r0, 0x24] + movs r0, 0xCB + lsls r0, 1 + movs r1, 0 + bl PlayCry1 + ldr r0, =sub_81D98B4 + movs r1, 0 + bl CreateTask + b _081D979E + .pool +_081D974C: + movs r0, 0xB0 + lsls r0, 1 + cmp r1, r0 + beq _081D9790 + adds r0, 0x18 + cmp r1, r0 + bne _081D979E + movs r3, 0 + strh r3, [r4, 0x24] + ldr r2, =gSprites + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r3, [r0, 0x24] + adds r0, r4, 0 + bl sub_81D97E0 + adds r0, r4, 0 + movs r1, 0x2 + movs r2, 0x30 + movs r3, 0x10 + bl sub_81D9868 + ldr r0, =sub_81D97E0 + str r0, [r4, 0x1C] + b _081D97D2 + .pool +_081D9790: + ldr r0, =sub_81D8E80 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl sub_81D9274 +_081D979E: + ldrh r2, [r4, 0x3C] + movs r0, 0x3C + ldrsh r1, [r4, r0] + movs r0, 0xA4 + lsls r0, 1 + cmp r1, r0 + ble _081D97CC + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + bne _081D97CC + movs r1, 0x24 + ldrsh r2, [r4, r1] + negs r2, r2 + strh r2, [r4, 0x24] + ldr r3, =gSprites + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r2, [r0, 0x24] +_081D97CC: + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] +_081D97D2: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D961C + + thumb_func_start sub_81D97E0 +sub_81D97E0: @ 81D97E0 + push {r4-r7,lr} + adds r3, r0, 0 + movs r0, 0x2E + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, =gSprites + adds r4, r0, r5 + ldrh r1, [r3, 0x3A] + ldrh r0, [r4, 0x36] + ands r0, r1 + cmp r0, 0 + bne _081D985C + ldrh r2, [r3, 0x36] + ldrh r1, [r3, 0x26] + adds r0, r2, r1 + strh r0, [r3, 0x26] + movs r7, 0x2E + ldrsh r1, [r3, r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrh r1, [r0, 0x26] + adds r2, r1 + strh r2, [r0, 0x26] + ldrh r0, [r3, 0x38] + ldrh r2, [r3, 0x36] + adds r0, r2 + strh r0, [r3, 0x36] + lsls r0, 16 + asrs r5, r0, 16 + ldrh r6, [r4, 0x38] + movs r7, 0x38 + ldrsh r2, [r4, r7] + cmp r5, r2 + bge _081D9836 + movs r0, 0x36 + ldrsh r1, [r3, r0] + adds r0, r2, 0 + cmn r1, r0 + bgt _081D985C +_081D9836: + cmp r5, r2 + ble _081D9844 + strh r6, [r3, 0x36] + b _081D9854 + .pool +_081D9844: + movs r0, 0x36 + ldrsh r1, [r3, r0] + movs r2, 0x38 + ldrsh r0, [r4, r2] + cmn r1, r0 + bge _081D9854 + negs r0, r6 + strh r0, [r3, 0x36] +_081D9854: + movs r7, 0x38 + ldrsh r0, [r3, r7] + negs r0, r0 + strh r0, [r3, 0x38] +_081D985C: + ldrh r0, [r3, 0x3A] + adds r0, 0x1 + strh r0, [r3, 0x3A] + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81D97E0 + + thumb_func_start sub_81D9868 +sub_81D9868: @ 81D9868 + push {r4,r5,lr} + adds r5, r1, 0 + lsls r5, 24 + lsrs r5, 24 + movs r4, 0x2E + ldrsh r1, [r0, r4] + lsls r4, r1, 4 + adds r4, r1 + lsls r4, 2 + ldr r1, =gSprites + adds r4, r1 + lsls r2, 16 + asrs r2, 16 + ldrh r1, [r0, 0x20] + adds r2, r1 + strh r2, [r4, 0x20] + lsls r3, 16 + asrs r3, 16 + ldrh r1, [r0, 0x22] + adds r3, r1 + strh r3, [r4, 0x22] + ldrh r1, [r0, 0x24] + strh r1, [r4, 0x24] + ldrh r1, [r0, 0x26] + strh r1, [r4, 0x26] + adds r1, r5, 0 + bl StartSpriteAnim + adds r0, r4, 0 + adds r1, r5, 0 + bl StartSpriteAnim + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D9868 + + thumb_func_start sub_81D98B4 +sub_81D98B4: @ 81D98B4 + push {r4,r5,lr} + sub sp, 0x10 + 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 + movs r0, 0 + ldrsh r1, [r4, r0] + cmp r1, 0x1 + beq _081D990C + cmp r1, 0x1 + bgt _081D98DC + cmp r1, 0 + beq _081D98E2 + b _081D99B4 + .pool +_081D98DC: + cmp r1, 0x2 + beq _081D99A4 + b _081D99B4 +_081D98E2: + movs r2, 0x80 + lsls r2, 7 + movs r0, 0x40 + str r0, [sp] + adds r0, 0xC0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r1, [sp, 0xC] + movs r0, 0x2 + adds r1, r2, 0 + movs r3, 0x78 + bl SetBgAffine + movs r1, 0x80 + lsls r1, 3 + movs r0, 0 + bl SetGpuRegBits + movs r0, 0x10 + strh r0, [r4, 0x8] + b _081D9922 +_081D990C: + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0x8 + bne _081D991A + movs r0, 0x12 + bl PlaySE +_081D991A: + movs r3, 0x4 + ldrsh r0, [r4, r3] + cmp r0, 0x2 + bne _081D992A +_081D9922: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _081D99B4 +_081D992A: + ldrh r5, [r4, 0x8] + ldrh r1, [r4, 0x2] + adds r0, r5, r1 + strh r0, [r4, 0x2] + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + movs r3, 0x6 + ldrsh r0, [r4, r3] + movs r1, 0x3 + bl __modsi3 + lsls r0, 16 + cmp r0, 0 + bne _081D9954 + lsls r0, r5, 16 + asrs r0, 16 + cmp r0, 0x4 + beq _081D9954 + subs r0, r5, 0x2 + strh r0, [r4, 0x8] +_081D9954: + ldrh r0, [r4, 0x6] + adds r0, 0x1 + strh r0, [r4, 0x6] + movs r2, 0x80 + lsls r2, 7 + movs r0, 0x40 + str r0, [sp] + ldrh r0, [r4, 0x2] + movs r3, 0x80 + lsls r3, 1 + adds r1, r3, 0 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + str r0, [sp, 0x4] + ldrh r0, [r4, 0x2] + subs r1, r0 + lsls r1, 16 + asrs r1, 16 + str r1, [sp, 0x8] + movs r5, 0 + str r5, [sp, 0xC] + movs r0, 0x2 + adds r1, r2, 0 + movs r3, 0x78 + bl SetBgAffine + movs r1, 0x2 + ldrsh r0, [r4, r1] + cmp r0, 0xFF + ble _081D99B4 + strh r5, [r4, 0x2] + strh r5, [r4, 0x6] + strh r5, [r4, 0xA] + movs r0, 0x10 + strh r0, [r4, 0x8] + ldrh r0, [r4, 0x4] + adds r0, 0x1 + strh r0, [r4, 0x4] + b _081D99B4 +_081D99A4: + movs r1, 0x80 + lsls r1, 3 + movs r0, 0 + bl ClearGpuRegBits + adds r0, r5, 0 + bl DestroyTask +_081D99B4: + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81D98B4 + + thumb_func_start sub_81D99BC +sub_81D99BC: @ 81D99BC + push {r4,lr} + bl sub_80D2578 + cmp r0, 0 + bne _081D99DC + ldr r4, =gStringVar1 + bl sub_80D2548 + adds r1, r0, 0 + adds r0, r4, 0 + bl StringCopy + movs r0, 0x1 + b _081D99DE + .pool +_081D99DC: + movs r0, 0 +_081D99DE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81D99BC + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_81700F8.s b/asm/reset_save_heap.s similarity index 100% rename from asm/rom_81700F8.s rename to asm/reset_save_heap.s diff --git a/asm/rom_80AEFFC.s b/asm/rom_80AEFFC.s deleted file mode 100644 index 23926a93e..000000000 --- a/asm/rom_80AEFFC.s +++ /dev/null @@ -1,2698 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start palette_bg_faded_fill_white -palette_bg_faded_fill_white: @ 80AEFFC - push {lr} - sub sp, 0x4 - ldr r0, =0x7fff7fff - str r0, [sp] - ldr r1, =gPlttBufferFaded - ldr r2, =0x01000100 - mov r0, sp - bl CpuFastSet - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end palette_bg_faded_fill_white - - thumb_func_start palette_bg_faded_fill_black -palette_bg_faded_fill_black: @ 80AF020 - push {lr} - sub sp, 0x4 - movs r0, 0 - str r0, [sp] - ldr r1, =gPlttBufferFaded - ldr r2, =0x01000100 - mov r0, sp - bl CpuFastSet - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end palette_bg_faded_fill_black - - thumb_func_start pal_fill_for_maplights -pal_fill_for_maplights: @ 80AF040 - push {r4,lr} - bl get_map_light_from_warp0 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sav1_map_get_light_level - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl fade_type_for_given_maplight_pair - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _080AF06A - cmp r0, 0x1 - beq _080AF078 - b _080AF084 -_080AF06A: - bl palette_bg_faded_fill_black - movs r0, 0 - movs r1, 0 - bl fade_screen - b _080AF084 -_080AF078: - bl palette_bg_faded_fill_white - movs r0, 0x2 - movs r1, 0 - bl fade_screen -_080AF084: - pop {r4} - pop {r0} - bx r0 - thumb_func_end pal_fill_for_maplights - - thumb_func_start sub_80AF08C -sub_80AF08C: @ 80AF08C - push {lr} - bl palette_bg_faded_fill_white - movs r0, 0x2 - movs r1, 0x8 - bl fade_screen - pop {r0} - bx r0 - thumb_func_end sub_80AF08C - - thumb_func_start pal_fill_black -pal_fill_black: @ 80AF0A0 - push {lr} - bl palette_bg_faded_fill_black - movs r0, 0 - movs r1, 0 - bl fade_screen - pop {r0} - bx r0 - thumb_func_end pal_fill_black - - thumb_func_start sub_80AF0B4 -sub_80AF0B4: @ 80AF0B4 - push {r4,lr} - bl sav1_map_get_light_level - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl warp1_get_mapheader - ldrb r1, [r0, 0x17] - adds r0, r4, 0 - bl sub_8137360 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _080AF0DA - cmp r0, 0x1 - beq _080AF0E4 - b _080AF0EC -_080AF0DA: - movs r0, 0x1 - movs r1, 0 - bl fade_screen - b _080AF0EC -_080AF0E4: - movs r0, 0x3 - movs r1, 0 - bl fade_screen -_080AF0EC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80AF0B4 - - thumb_func_start sub_80AF0F4 -sub_80AF0F4: @ 80AF0F4 - push {lr} - lsls r0, 24 - movs r1, 0 - cmp r0, 0 - bne _080AF100 - movs r1, 0x1 -_080AF100: - adds r0, r1, 0 - bl sub_808C0A8 - pop {r0} - bx r0 - thumb_func_end sub_80AF0F4 - - thumb_func_start task0A_nop_for_a_while -task0A_nop_for_a_while: @ 80AF10C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80AF71C - cmp r0, 0x1 - bne _080AF120 - adds r0, r4, 0 - bl DestroyTask -_080AF120: - pop {r4} - pop {r0} - bx r0 - thumb_func_end task0A_nop_for_a_while - - thumb_func_start sub_80AF128 -sub_80AF128: @ 80AF128 - push {lr} - bl ScriptContext2_Enable - bl sub_8085784 - bl pal_fill_black - ldr r0, =task0A_nop_for_a_while - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF128 - - thumb_func_start task0A_asap_script_env_2_enable_and_set_ctx_running -task0A_asap_script_env_2_enable_and_set_ctx_running: @ 80AF148 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80AF71C - cmp r0, 0x1 - bne _080AF160 - adds r0, r4, 0 - bl DestroyTask - bl EnableBothScriptContexts -_080AF160: - pop {r4} - pop {r0} - bx r0 - thumb_func_end task0A_asap_script_env_2_enable_and_set_ctx_running - - thumb_func_start sub_80AF168 -sub_80AF168: @ 80AF168 - push {lr} - bl ScriptContext2_Enable - bl sub_8085784 - bl pal_fill_black - ldr r0, =task0A_asap_script_env_2_enable_and_set_ctx_running - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF168 - - thumb_func_start sub_80AF188 -sub_80AF188: @ 80AF188 - push {lr} - bl ScriptContext2_Enable - bl pal_fill_black - ldr r0, =task0A_asap_script_env_2_enable_and_set_ctx_running - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF188 - - thumb_func_start task_mpl_807DD60 -task_mpl_807DD60: @ 80AF1A4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r2, =gTasks - adds r4, r0, r2 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080AF1DE - cmp r0, 0x1 - bgt _080AF1CC - cmp r0, 0 - beq _080AF1D2 - b _080AF20E - .pool -_080AF1CC: - cmp r0, 0x2 - beq _080AF1FC - b _080AF20E -_080AF1D2: - bl sub_80B3050 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0xA] - b _080AF1F4 -_080AF1DE: - movs r1, 0xA - ldrsh r0, [r4, r1] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldrb r0, [r1, 0x4] - cmp r0, 0x1 - beq _080AF20E - bl pal_fill_for_maplights -_080AF1F4: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080AF20E -_080AF1FC: - bl sub_80AF71C - cmp r0, 0x1 - bne _080AF20E - bl ScriptContext2_Disable - adds r0, r5, 0 - bl DestroyTask -_080AF20E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end task_mpl_807DD60 - - thumb_func_start sub_80AF214 -sub_80AF214: @ 80AF214 - push {lr} - bl ScriptContext2_Enable - bl sub_8085784 - bl palette_bg_faded_fill_black - ldr r0, =task_mpl_807DD60 - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF214 - - thumb_func_start sub_80AF234 -sub_80AF234: @ 80AF234 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080AF268 - cmp r0, 0x1 - bgt _080AF25C - cmp r0, 0 - beq _080AF262 - b _080AF2AE - .pool -_080AF25C: - cmp r0, 0x2 - beq _080AF298 - b _080AF2AE -_080AF262: - bl sub_800ADF8 - b _080AF290 -_080AF268: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _080AF28C - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - movs r1, 0xE1 - lsls r1, 19 - cmp r0, r1 - ble _080AF2AE - movs r0, 0xC0 - lsls r0, 7 - bl sub_8011170 - b _080AF2AE -_080AF28C: - bl pal_fill_for_maplights -_080AF290: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080AF2AE -_080AF298: - bl sub_80AF71C - cmp r0, 0x1 - bne _080AF2AE - bl sub_8009F18 - bl ScriptContext2_Disable - adds r0, r5, 0 - bl DestroyTask -_080AF2AE: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80AF234 - - thumb_func_start sub_80AF2B4 -sub_80AF2B4: @ 80AF2B4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080AF2E8 - cmp r0, 0x1 - bgt _080AF2DC - cmp r0, 0 - beq _080AF2E2 - b _080AF30C - .pool -_080AF2DC: - cmp r0, 0x2 - beq _080AF2FA - b _080AF30C -_080AF2E2: - bl sub_800ADF8 - b _080AF2F2 -_080AF2E8: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080AF30C -_080AF2F2: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080AF30C -_080AF2FA: - bl sub_8009F18 - bl sub_8086C2C - bl ScriptContext2_Disable - adds r0, r5, 0 - bl DestroyTask -_080AF30C: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80AF2B4 - - thumb_func_start sub_80AF314 -sub_80AF314: @ 80AF314 - push {lr} - bl ScriptContext2_Enable - bl sub_8085784 - bl palette_bg_faded_fill_black - ldr r0, =sub_80AF234 - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF314 - - thumb_func_start sub_80AF334 -sub_80AF334: @ 80AF334 - push {r4,lr} - sub sp, 0x4 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl PlayerGetDestCoords - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_8088EFC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080AF36C - ldr r1, =sub_80AF438 - b _080AF37E - .pool -_080AF36C: - adds r0, r4, 0 - bl sub_8088F58 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =task_map_chg_seq_0807E2CC - cmp r0, 0x1 - bne _080AF37E - ldr r1, =task_map_chg_seq_0807E20C -_080AF37E: - adds r0, r1, 0 - movs r1, 0xA - bl CreateTask - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF334 - - thumb_func_start mapldr_default -mapldr_default: @ 80AF398 - push {lr} - bl sub_8085784 - bl pal_fill_for_maplights - bl sub_80AF334 - bl ScriptContext2_Enable - pop {r0} - bx r0 - thumb_func_end mapldr_default - - thumb_func_start sub_80AF3B0 -sub_80AF3B0: @ 80AF3B0 - push {lr} - bl sub_8085784 - bl sub_80AF08C - bl sub_80AF334 - bl ScriptContext2_Enable - pop {r0} - bx r0 - thumb_func_end sub_80AF3B0 - - thumb_func_start sub_80AF3C8 -sub_80AF3C8: @ 80AF3C8 - push {lr} - bl sub_81D6534 - cmp r0, 0 - bne _080AF3D6 - bl sub_8085784 -_080AF3D6: - bl pal_fill_black - bl sub_80AF334 - bl ScriptContext2_Enable - pop {r0} - bx r0 - thumb_func_end sub_80AF3C8 - - thumb_func_start sub_80AF3E8 -sub_80AF3E8: @ 80AF3E8 - push {lr} - bl sub_8085784 - bl pal_fill_for_maplights - movs r0, 0x2E - bl PlaySE - ldr r0, =task0A_mpl_807E31C - movs r1, 0xA - bl CreateTask - bl ScriptContext2_Enable - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF3E8 - - thumb_func_start sub_80AF40C -sub_80AF40C: @ 80AF40C - push {lr} - bl sub_8085784 - bl pal_fill_for_maplights - movs r0, 0x2E - bl PlaySE - ldr r0, =task_map_chg_seq_0807E2CC - movs r1, 0xA - bl CreateTask - bl ScriptContext2_Enable - movs r0, 0xE - bl sub_8085540 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF40C - - thumb_func_start sub_80AF438 -sub_80AF438: @ 80AF438 - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks - adds r5, r0, r1 - adds r6, r5, 0 - adds r6, 0xC - adds r7, r5, 0 - adds r7, 0xE - movs r2, 0x8 - ldrsh r0, [r5, r2] - adds r2, r1, 0 - cmp r0, 0x4 - bhi _080AF54A - lsls r0, 2 - ldr r1, =_080AF46C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080AF46C: - .4byte _080AF480 - .4byte _080AF4A4 - .4byte _080AF4DC - .4byte _080AF520 - .4byte _080AF540 -_080AF480: - movs r0, 0 - bl sub_80AF0F4 - bl player_bitmagic - adds r0, r6, 0 - adds r1, r7, 0 - bl PlayerGetDestCoords - movs r1, 0 - ldrsh r0, [r6, r1] - movs r2, 0 - ldrsh r1, [r7, r2] - bl sub_808A854 - movs r0, 0x1 - strh r0, [r5, 0x8] - b _080AF54A -_080AF4A4: - bl sub_80AF71C - cmp r0, 0 - beq _080AF54A - movs r0, 0x1 - bl sub_80AF0F4 - movs r0, 0xFF - movs r1, 0 - movs r2, 0 - bl GetFieldObjectIdByLocalIdAndMap - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gMapObjects - adds r0, r1 - movs r1, 0x8 - bl FieldObjectSetSpecialAnim - movs r0, 0x2 - strh r0, [r5, 0x8] - b _080AF54A - .pool -_080AF4DC: - bl walkrun_is_standing_still - lsls r0, 24 - cmp r0, 0 - beq _080AF54A - movs r1, 0 - ldrsh r0, [r6, r1] - movs r2, 0 - ldrsh r1, [r7, r2] - bl sub_808A8AC - lsls r0, 24 - asrs r0, 24 - strh r0, [r5, 0xA] - movs r0, 0xFF - movs r1, 0 - movs r2, 0 - bl GetFieldObjectIdByLocalIdAndMap - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gMapObjects - adds r0, r1 - bl FieldObjectClearAnimIfSpecialAnimFinished - movs r0, 0x3 - strh r0, [r5, 0x8] - b _080AF54A - .pool -_080AF520: - movs r1, 0xA - ldrsh r0, [r5, r1] - cmp r0, 0 - blt _080AF536 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldrb r0, [r1, 0x4] - cmp r0, 0x1 - beq _080AF54A -_080AF536: - bl sub_809757C - movs r0, 0x4 - strh r0, [r5, 0x8] - b _080AF54A -_080AF540: - bl ScriptContext2_Disable - adds r0, r4, 0 - bl DestroyTask -_080AF54A: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80AF438 - - thumb_func_start task_map_chg_seq_0807E20C -task_map_chg_seq_0807E20C: @ 80AF550 - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks - adds r5, r0, r1 - adds r6, r5, 0 - adds r6, 0xC - adds r7, r5, 0 - adds r7, 0xE - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _080AF5A2 - cmp r0, 0x1 - bgt _080AF580 - cmp r0, 0 - beq _080AF58A - b _080AF60A - .pool -_080AF580: - cmp r0, 0x2 - beq _080AF5EC - cmp r0, 0x3 - beq _080AF600 - b _080AF60A -_080AF58A: - movs r0, 0 - bl sub_80AF0F4 - bl player_bitmagic - adds r0, r6, 0 - adds r1, r7, 0 - bl PlayerGetDestCoords - movs r0, 0x1 - strh r0, [r5, 0x8] - b _080AF60A -_080AF5A2: - bl sub_80AF71C - cmp r0, 0 - beq _080AF60A - movs r0, 0x1 - bl sub_80AF0F4 - movs r0, 0xFF - movs r1, 0 - movs r2, 0 - bl GetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =gMapObjects - adds r4, r0 - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - bl GetGoSpeed0AnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetSpecialAnim - movs r0, 0x2 - strh r0, [r5, 0x8] - b _080AF60A - .pool -_080AF5EC: - bl walkrun_is_standing_still - lsls r0, 24 - cmp r0, 0 - beq _080AF60A - bl sub_809757C - movs r0, 0x3 - strh r0, [r5, 0x8] - b _080AF60A -_080AF600: - bl ScriptContext2_Disable - adds r0, r4, 0 - bl DestroyTask -_080AF60A: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end task_map_chg_seq_0807E20C - - thumb_func_start task_map_chg_seq_0807E2CC -task_map_chg_seq_0807E2CC: @ 80AF610 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _080AF634 - cmp r0, 0x1 - beq _080AF644 - b _080AF65A - .pool -_080AF634: - bl player_bitmagic - bl ScriptContext2_Enable - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080AF65A -_080AF644: - bl sub_80AF71C - cmp r0, 0 - beq _080AF65A - bl sub_809757C - bl ScriptContext2_Disable - adds r0, r5, 0 - bl DestroyTask -_080AF65A: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end task_map_chg_seq_0807E2CC - - thumb_func_start sub_80AF660 -sub_80AF660: @ 80AF660 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80AF71C - cmp r0, 0x1 - bne _080AF67C - adds r0, r4, 0 - bl DestroyTask - ldr r0, =sub_809FA34 - movs r1, 0x50 - bl CreateTask -_080AF67C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF660 - - thumb_func_start sub_80AF688 -sub_80AF688: @ 80AF688 - push {lr} - bl pal_fill_black - ldr r0, =sub_80AF660 - movs r1, 0x50 - bl CreateTask - bl ScriptContext2_Enable - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF688 - - thumb_func_start sub_80AF6A4 -sub_80AF6A4: @ 80AF6A4 - push {lr} - bl sub_809FA18 - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sub_80AF6A4 - - thumb_func_start task_mpl_807E3C8 -task_mpl_807E3C8: @ 80AF6B0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80AF71C - cmp r0, 0x1 - bne _080AF6CC - bl ScriptContext2_Disable - adds r0, r4, 0 - bl DestroyTask - bl sub_80984F4 -_080AF6CC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end task_mpl_807E3C8 - - thumb_func_start sub_80AF6D4 -sub_80AF6D4: @ 80AF6D4 - push {lr} - bl ScriptContext2_Enable - bl pal_fill_black - ldr r0, =task_mpl_807E3C8 - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF6D4 - - thumb_func_start sub_80AF6F0 -sub_80AF6F0: @ 80AF6F0 - push {lr} - bl ScriptContext2_Enable - bl sub_8085784 - bl pal_fill_black - ldr r0, =task_mpl_807E3C8 - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF6F0 - - thumb_func_start sub_80AF710 -sub_80AF710: @ 80AF710 - ldr r0, =gPaletteFade - ldrb r0, [r0, 0x7] - lsrs r0, 7 - bx lr - .pool - thumb_func_end sub_80AF710 - - thumb_func_start sub_80AF71C -sub_80AF71C: @ 80AF71C - push {lr} - bl sub_80ABDFC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080AF72E - movs r0, 0 - b _080AF730 -_080AF72E: - movs r0, 0x1 -_080AF730: - pop {r1} - bx r1 - thumb_func_end sub_80AF71C - - thumb_func_start sub_80AF734 -sub_80AF734: @ 80AF734 - push {lr} - bl ScriptContext2_Enable - bl music_something - bl sub_80AF0B4 - bl play_some_sound - movs r0, 0x9 - bl PlaySE - ldr r0, =gUnknown_03005DAC - ldr r1, =mapldr_default - str r1, [r0] - ldr r0, =sub_80AFA0C - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF734 - - thumb_func_start sp13E_warp_to_last_warp -sp13E_warp_to_last_warp: @ 80AF76C - push {lr} - bl ScriptContext2_Enable - bl music_something - bl sub_80AF0B4 - bl play_some_sound - ldr r0, =gUnknown_03005DAC - ldr r1, =mapldr_default - str r1, [r0] - ldr r0, =sub_80AFA0C - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sp13E_warp_to_last_warp - - thumb_func_start sub_80AF79C -sub_80AF79C: @ 80AF79C - push {lr} - bl ScriptContext2_Enable - bl music_something - movs r0, 0x3 - movs r1, 0x8 - bl fade_screen - bl play_some_sound - ldr r0, =gUnknown_03005DAC - ldr r1, =sub_80AF3B0 - str r1, [r0] - ldr r0, =sub_80AFA0C - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF79C - - thumb_func_start sub_80AF7D0 -sub_80AF7D0: @ 80AF7D0 - push {lr} - bl ScriptContext2_Enable - ldr r0, =gUnknown_03005DAC - ldr r1, =mapldr_default - str r1, [r0] - ldr r0, =sub_80AFA88 - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF7D0 - - thumb_func_start sp13F_fall_to_last_warp -sp13F_fall_to_last_warp: @ 80AF7F4 - push {lr} - bl sp13E_warp_to_last_warp - ldr r1, =gUnknown_03005DAC - ldr r0, =sub_80B6B68 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sp13F_fall_to_last_warp - - thumb_func_start sub_80AF80C -sub_80AF80C: @ 80AF80C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl ScriptContext2_Enable - adds r0, r4, 0 - movs r1, 0xA - bl sub_80B6E4C - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80AF80C - - thumb_func_start sub_80AF828 -sub_80AF828: @ 80AF828 - push {lr} - bl ScriptContext2_Enable - movs r0, 0xA - bl sub_80B75D8 - pop {r0} - bx r0 - thumb_func_end sub_80AF828 - - thumb_func_start sub_80AF838 -sub_80AF838: @ 80AF838 - push {lr} - bl ScriptContext2_Enable - movs r0, 0xA - bl sub_80B7A74 - pop {r0} - bx r0 - thumb_func_end sub_80AF838 - - thumb_func_start sub_80AF848 -sub_80AF848: @ 80AF848 - push {lr} - bl ScriptContext2_Enable - bl music_something - bl sub_80AF0B4 - movs r0, 0x2D - bl PlaySE - ldr r0, =sub_80AFA0C - movs r1, 0xA - bl CreateTask - ldr r1, =gUnknown_03005DAC - ldr r0, =sub_80AF3E8 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF848 - - thumb_func_start sub_80AF87C -sub_80AF87C: @ 80AF87C - push {lr} - movs r0, 0x1 - bl sub_8085540 - bl ScriptContext2_Enable - bl save_serialize_npcs - bl music_something - bl sub_80AF0B4 - movs r0, 0x2D - bl PlaySE - ldr r0, =sub_80AFA0C - movs r1, 0xA - bl CreateTask - ldr r1, =gUnknown_03005DAC - ldr r0, =sub_80AF40C - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF87C - - thumb_func_start sub_80AF8B8 -sub_80AF8B8: @ 80AF8B8 - push {lr} - bl ScriptContext2_Enable - bl sub_80AF0B4 - ldr r0, =sub_80AFA0C - movs r1, 0xA - bl CreateTask - ldr r1, =gUnknown_03005DAC - ldr r0, =sub_80FB768 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF8B8 - - thumb_func_start sub_80AF8E0 -sub_80AF8E0: @ 80AF8E0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080AF914 - cmp r0, 0x1 - bgt _080AF908 - cmp r0, 0 - beq _080AF90E - b _080AF93E - .pool -_080AF908: - cmp r0, 0x2 - beq _080AF92E - b _080AF93E -_080AF90E: - bl ScriptContext2_Enable - b _080AF926 -_080AF914: - bl sub_80AF710 - cmp r0, 0 - bne _080AF93E - bl sub_80859A0 - lsls r0, 24 - cmp r0, 0 - beq _080AF93E -_080AF926: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080AF93E -_080AF92E: - bl warp_in - ldr r0, =sub_8086074 - bl SetMainCallback2 - adds r0, r5, 0 - bl DestroyTask -_080AF93E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF8E0 - - thumb_func_start sub_80AF948 -sub_80AF948: @ 80AF948 - push {lr} - bl ScriptContext2_Enable - bl music_something - bl sub_80AF0B4 - movs r0, 0x9 - bl PlaySE - ldr r0, =sub_80AF8E0 - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF948 - - thumb_func_start sub_80AF96C -sub_80AF96C: @ 80AF96C - 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 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080AF9B2 - cmp r0, 0x1 - bgt _080AF994 - cmp r0, 0 - beq _080AF99A - b _080AF9E8 - .pool -_080AF994: - cmp r0, 0x2 - beq _080AF9D0 - b _080AF9E8 -_080AF99A: - bl sub_8009FAC - movs r0, 0x1 - movs r1, 0 - bl fade_screen - bl music_something - movs r0, 0x9 - bl PlaySE - b _080AF9C8 -_080AF9B2: - bl sub_80AF710 - cmp r0, 0 - bne _080AF9E8 - bl sub_80859A0 - lsls r0, 24 - cmp r0, 0 - beq _080AF9E8 - bl sub_800AC34 -_080AF9C8: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - b _080AF9E8 -_080AF9D0: - ldr r0, =gUnknown_03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _080AF9E8 - bl warp_in - ldr r0, =c2_load_new_map - bl SetMainCallback2 - adds r0, r5, 0 - bl DestroyTask -_080AF9E8: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF96C - - thumb_func_start sub_80AF9F8 -sub_80AF9F8: @ 80AF9F8 - push {lr} - ldr r0, =sub_80AF96C - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF9F8 - - thumb_func_start sub_80AFA0C -sub_80AFA0C: @ 80AFA0C - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r5, [r4, r0] - cmp r5, 0x1 - beq _080AFA44 - cmp r5, 0x1 - bgt _080AFA34 - cmp r5, 0 - beq _080AFA3A - b _080AFA7C - .pool -_080AFA34: - cmp r5, 0x2 - beq _080AFA6C - b _080AFA7C -_080AFA3A: - bl player_bitmagic - bl ScriptContext2_Enable - b _080AFA64 -_080AFA44: - bl sub_80AF710 - cmp r0, 0 - bne _080AFA7C - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080AFA5A - bl sub_81BE72C - strh r5, [r4, 0xA] -_080AFA5A: - bl sub_80859A0 - lsls r0, 24 - cmp r0, 0 - beq _080AFA7C -_080AFA64: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080AFA7C -_080AFA6C: - bl warp_in - ldr r0, =c2_load_new_map - bl SetMainCallback2 - adds r0, r6, 0 - bl DestroyTask -_080AFA7C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AFA0C - - thumb_func_start sub_80AFA88 -sub_80AFA88: @ 80AFA88 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks - adds r5, r1, r0 - adds r4, r5, 0 - adds r4, 0xC - adds r6, r5, 0 - adds r6, 0xE - movs r2, 0x8 - ldrsh r1, [r5, r2] - adds r2, r0, 0 - cmp r1, 0x4 - bls _080AFAAC - b _080AFBE8 -_080AFAAC: - lsls r0, r1, 2 - ldr r1, =_080AFAC0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080AFAC0: - .4byte _080AFAD4 - .4byte _080AFB10 - .4byte _080AFB6C - .4byte _080AFBB8 - .4byte _080AFBD4 -_080AFAD4: - bl player_bitmagic - adds r0, r4, 0 - adds r1, r6, 0 - bl PlayerGetDestCoords - movs r1, 0 - ldrsh r0, [r4, r1] - movs r2, 0 - ldrsh r1, [r6, r2] - subs r1, 0x1 - bl cur_mapdata_get_door_sound_at - lsls r0, 16 - lsrs r0, 16 - bl PlaySE - movs r1, 0 - ldrsh r0, [r4, r1] - movs r2, 0 - ldrsh r1, [r6, r2] - subs r1, 0x1 - bl task_overworld_door_add_if_role_69_for_opening_door_at - lsls r0, 24 - asrs r0, 24 - strh r0, [r5, 0xA] - movs r0, 0x1 - strh r0, [r5, 0x8] - b _080AFBE8 -_080AFB10: - movs r1, 0xA - ldrsh r0, [r5, r1] - cmp r0, 0 - blt _080AFB26 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldrb r0, [r1, 0x4] - cmp r0, 0x1 - beq _080AFBE8 -_080AFB26: - movs r0, 0xFF - movs r1, 0 - movs r2, 0 - bl GetFieldObjectIdByLocalIdAndMap - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r4, =gMapObjects - adds r0, r4 - bl FieldObjectClearAnimIfSpecialAnimActive - movs r0, 0xFF - movs r1, 0 - movs r2, 0 - bl GetFieldObjectIdByLocalIdAndMap - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x9 - bl FieldObjectSetSpecialAnim - movs r0, 0x2 - strh r0, [r5, 0x8] - b _080AFBE8 - .pool -_080AFB6C: - bl walkrun_is_standing_still - lsls r0, 24 - cmp r0, 0 - beq _080AFBE8 - movs r2, 0 - ldrsh r0, [r4, r2] - movs r2, 0 - ldrsh r1, [r6, r2] - subs r1, 0x1 - bl sub_808A8AC - lsls r0, 24 - asrs r0, 24 - strh r0, [r5, 0xA] - movs r0, 0xFF - movs r1, 0 - movs r2, 0 - bl GetFieldObjectIdByLocalIdAndMap - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gMapObjects - adds r0, r1 - bl FieldObjectClearAnimIfSpecialAnimFinished - movs r0, 0 - bl sub_80AF0F4 - movs r0, 0x3 - strh r0, [r5, 0x8] - b _080AFBE8 - .pool -_080AFBB8: - movs r1, 0xA - ldrsh r0, [r5, r1] - cmp r0, 0 - blt _080AFBCE - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldrb r0, [r1, 0x4] - cmp r0, 0x1 - beq _080AFBE8 -_080AFBCE: - movs r0, 0x4 - strh r0, [r5, 0x8] - b _080AFBE8 -_080AFBD4: - bl music_something - bl sub_80AF0B4 - bl play_some_sound - movs r0, 0 - strh r0, [r5, 0x8] - ldr r0, =sub_80AFA0C - str r0, [r5] -_080AFBE8: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AFA88 - - thumb_func_start task0A_fade_n_map_maybe -task0A_fade_n_map_maybe: @ 80AFBF4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080AFC2C - cmp r0, 0x1 - bgt _080AFC1C - cmp r0, 0 - beq _080AFC22 - b _080AFC56 - .pool -_080AFC1C: - cmp r0, 0x2 - beq _080AFC46 - b _080AFC56 -_080AFC22: - bl player_bitmagic - bl ScriptContext2_Enable - b _080AFC3E -_080AFC2C: - bl sub_80AF710 - cmp r0, 0 - bne _080AFC56 - bl sub_80859A0 - lsls r0, 24 - cmp r0, 0 - beq _080AFC56 -_080AFC3E: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080AFC56 -_080AFC46: - bl warp_in - ldr r0, =sub_8086024 - bl SetMainCallback2 - adds r0, r5, 0 - bl DestroyTask -_080AFC56: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end task0A_fade_n_map_maybe - - thumb_func_start sub_80AFC60 -sub_80AFC60: @ 80AFC60 - push {lr} - bl ScriptContext2_Enable - bl music_something - bl sub_80AF0B4 - bl play_some_sound - movs r0, 0x9 - bl PlaySE - ldr r0, =gUnknown_03005DAC - ldr r1, =sub_80AF3C8 - str r1, [r0] - ldr r0, =task0A_fade_n_map_maybe - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AFC60 - - thumb_func_start sub_80AFC98 -sub_80AFC98: @ 80AFC98 - push {lr} - cmp r1, 0xA0 - bhi _080AFCC0 - cmp r2, 0 - bge _080AFCA4 - movs r2, 0 -_080AFCA4: - cmp r2, 0xFF - ble _080AFCAA - movs r2, 0xFF -_080AFCAA: - cmp r3, 0 - bge _080AFCB0 - movs r3, 0 -_080AFCB0: - cmp r3, 0xFF - ble _080AFCB6 - movs r3, 0xFF -_080AFCB6: - lsls r1, 1 - adds r1, r0 - lsls r0, r2, 8 - orrs r0, r3 - strh r0, [r1] -_080AFCC0: - pop {r0} - bx r0 - thumb_func_end sub_80AFC98 - - thumb_func_start sub_80AFCC4 -sub_80AFCC4: @ 80AFCC4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - str r0, [sp] - mov r10, r1 - mov r9, r2 - adds r6, r3, 0 - mov r8, r6 - movs r7, 0 - cmp r6, 0 - blt _080AFD40 -_080AFCE0: - mov r0, r9 - subs r1, r0, r7 - mov r0, r10 - subs r4, r0, r6 - adds r5, r0, r6 - ldr r0, [sp] - adds r2, r4, 0 - adds r3, r5, 0 - bl sub_80AFC98 - mov r0, r9 - adds r1, r0, r7 - ldr r0, [sp] - adds r2, r4, 0 - adds r3, r5, 0 - bl sub_80AFC98 - mov r0, r9 - subs r1, r0, r6 - mov r0, r10 - subs r4, r0, r7 - adds r5, r0, r7 - ldr r0, [sp] - adds r2, r4, 0 - adds r3, r5, 0 - bl sub_80AFC98 - mov r0, r9 - adds r1, r0, r6 - ldr r0, [sp] - adds r2, r4, 0 - adds r3, r5, 0 - bl sub_80AFC98 - mov r1, r8 - adds r1, 0x1 - lsls r0, r7, 1 - subs r1, r0 - mov r8, r1 - adds r7, 0x1 - cmp r1, 0 - bge _080AFD3C - subs r1, r6, 0x1 - lsls r0, r1, 1 - add r8, r0 - adds r6, r1, 0 -_080AFD3C: - cmp r6, r7 - bge _080AFCE0 -_080AFD40: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80AFCC4 - - thumb_func_start sub_80AFD50 -sub_80AFD50: @ 80AFD50 - push {lr} - cmp r1, 0xA0 - bhi _080AFD78 - cmp r2, 0 - bge _080AFD5C - movs r2, 0 -_080AFD5C: - cmp r2, 0xF0 - ble _080AFD62 - movs r2, 0xF0 -_080AFD62: - cmp r3, 0 - bge _080AFD68 - movs r3, 0 -_080AFD68: - cmp r3, 0xF0 - ble _080AFD6E - movs r3, 0xF0 -_080AFD6E: - lsls r1, 1 - adds r1, r0 - lsls r0, r2, 8 - orrs r0, r3 - strh r0, [r1] -_080AFD78: - pop {r0} - bx r0 - thumb_func_end sub_80AFD50 - - thumb_func_start sub_80AFD7C -sub_80AFD7C: @ 80AFD7C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - str r0, [sp] - mov r10, r1 - mov r9, r2 - adds r6, r3, 0 - mov r8, r6 - movs r7, 0 - cmp r6, 0 - blt _080AFDF8 -_080AFD98: - mov r0, r9 - subs r1, r0, r7 - mov r0, r10 - subs r4, r0, r6 - adds r5, r0, r6 - ldr r0, [sp] - adds r2, r4, 0 - adds r3, r5, 0 - bl sub_80AFD50 - mov r0, r9 - adds r1, r0, r7 - ldr r0, [sp] - adds r2, r4, 0 - adds r3, r5, 0 - bl sub_80AFD50 - mov r0, r9 - subs r1, r0, r6 - mov r0, r10 - subs r4, r0, r7 - adds r5, r0, r7 - ldr r0, [sp] - adds r2, r4, 0 - adds r3, r5, 0 - bl sub_80AFD50 - mov r0, r9 - adds r1, r0, r6 - ldr r0, [sp] - adds r2, r4, 0 - adds r3, r5, 0 - bl sub_80AFD50 - mov r1, r8 - adds r1, 0x1 - lsls r0, r7, 1 - subs r1, r0 - mov r8, r1 - adds r7, 0x1 - cmp r1, 0 - bge _080AFDF4 - subs r1, r6, 0x1 - lsls r0, r1, 1 - add r8, r0 - adds r6, r1, 0 -_080AFDF4: - cmp r6, r7 - bge _080AFD98 -_080AFDF8: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80AFD7C - - thumb_func_start sub_80AFE08 -sub_80AFE08: @ 80AFE08 - push {r4-r6,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 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080AFE64 - cmp r0, 0x1 - bgt _080AFE30 - cmp r0, 0 - beq _080AFE36 - b _080AFEC6 - .pool -_080AFE30: - cmp r0, 0x2 - beq _080AFEBC - b _080AFEC6 -_080AFE36: - ldr r0, =gUnknown_02039B28 - ldrb r1, [r0, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - ldr r1, =gUnknown_02038C28 - adds r0, r1 - movs r2, 0x2 - ldrsh r1, [r4, r2] - movs r3, 0x4 - ldrsh r2, [r4, r3] - movs r5, 0x6 - ldrsh r3, [r4, r5] - bl sub_80AFCC4 - movs r0, 0x1 - strh r0, [r4] - b _080AFEC6 - .pool -_080AFE64: - ldr r0, =gUnknown_02039B28 - ldrb r1, [r0, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - ldr r1, =gUnknown_02038C28 - adds r0, r1 - movs r6, 0x2 - ldrsh r1, [r4, r6] - movs r3, 0x4 - ldrsh r2, [r4, r3] - movs r6, 0x6 - ldrsh r3, [r4, r6] - bl sub_80AFCC4 - movs r0, 0 - strh r0, [r4] - ldrh r0, [r4, 0xA] - ldrh r1, [r4, 0x6] - adds r0, r1 - strh r0, [r4, 0x6] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x8 - ldrsh r1, [r4, r2] - cmp r0, r1 - ble _080AFEC6 - movs r3, 0xC - ldrsh r0, [r4, r3] - cmp r0, 0x1 - bne _080AFEB4 - bl remove_some_task - movs r0, 0x2 - strh r0, [r4] - b _080AFEC6 - .pool -_080AFEB4: - adds r0, r5, 0 - bl DestroyTask - b _080AFEC6 -_080AFEBC: - bl dp12_8087EA4 - adds r0, r5, 0 - bl DestroyTask -_080AFEC6: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80AFE08 - - thumb_func_start sub_80AFECC -sub_80AFECC: @ 80AFECC - push {r4-r6,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 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080AFF28 - cmp r0, 0x1 - bgt _080AFEF4 - cmp r0, 0 - beq _080AFEFA - b _080AFF8A - .pool -_080AFEF4: - cmp r0, 0x2 - beq _080AFF80 - b _080AFF8A -_080AFEFA: - ldr r0, =gUnknown_02039B28 - ldrb r1, [r0, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - ldr r1, =gUnknown_02038C28 - adds r0, r1 - movs r2, 0x2 - ldrsh r1, [r4, r2] - movs r3, 0x4 - ldrsh r2, [r4, r3] - movs r5, 0x6 - ldrsh r3, [r4, r5] - bl sub_80AFD7C - movs r0, 0x1 - strh r0, [r4] - b _080AFF8A - .pool -_080AFF28: - ldr r0, =gUnknown_02039B28 - ldrb r1, [r0, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - ldr r1, =gUnknown_02038C28 - adds r0, r1 - movs r6, 0x2 - ldrsh r1, [r4, r6] - movs r3, 0x4 - ldrsh r2, [r4, r3] - movs r6, 0x6 - ldrsh r3, [r4, r6] - bl sub_80AFD7C - movs r0, 0 - strh r0, [r4] - ldrh r0, [r4, 0xA] - ldrh r1, [r4, 0x6] - adds r0, r1 - strh r0, [r4, 0x6] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x8 - ldrsh r1, [r4, r2] - cmp r0, r1 - ble _080AFF8A - movs r3, 0xC - ldrsh r0, [r4, r3] - cmp r0, 0x1 - bne _080AFF78 - bl remove_some_task - movs r0, 0x2 - strh r0, [r4] - b _080AFF8A - .pool -_080AFF78: - adds r0, r5, 0 - bl DestroyTask - b _080AFF8A -_080AFF80: - bl dp12_8087EA4 - adds r0, r5, 0 - bl DestroyTask -_080AFF8A: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80AFECC - - thumb_func_start sub_80AFF90 -sub_80AFF90: @ 80AFF90 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =sub_80AFE08 - bl FuncIsActiveTask - lsls r0, 24 - cmp r0, 0 - bne _080AFFAC - bl EnableBothScriptContexts - adds r0, r4, 0 - bl DestroyTask -_080AFFAC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AFF90 - - thumb_func_start sub_80AFFB8 -sub_80AFFB8: @ 80AFFB8 - push {r4,lr} - ldr r4, =sub_80AFF90 - adds r0, r4, 0 - bl FuncIsActiveTask - lsls r0, 24 - cmp r0, 0 - bne _080AFFD0 - adds r0, r4, 0 - movs r1, 0x50 - bl CreateTask -_080AFFD0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AFFB8 - - thumb_func_start sub_80AFFDC -sub_80AFFDC: @ 80AFFDC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - mov r8, r0 - mov r9, r1 - adds r5, r2, 0 - adds r4, r3, 0 - ldr r6, [sp, 0x1C] - ldr r0, [sp, 0x20] - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =sub_80AFE08 - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r1, r0, r1 - strh r5, [r1, 0x6] - strh r4, [r1, 0x8] - mov r0, r8 - strh r0, [r1, 0x2] - mov r0, r9 - strh r0, [r1, 0x4] - strh r6, [r1, 0xC] - cmp r5, r4 - bge _080B0028 - strh r7, [r1, 0xA] - b _080B002C - .pool -_080B0028: - negs r0, r7 - strh r0, [r1, 0xA] -_080B002C: - adds r0, r2, 0 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80AFFDC - - thumb_func_start sub_80B003C -sub_80B003C: @ 80B003C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - mov r8, r0 - mov r9, r1 - adds r5, r2, 0 - adds r4, r3, 0 - ldr r6, [sp, 0x1C] - ldr r0, [sp, 0x20] - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =sub_80AFECC - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r1, r0, r1 - strh r5, [r1, 0x6] - strh r4, [r1, 0x8] - mov r0, r8 - strh r0, [r1, 0x2] - mov r0, r9 - strh r0, [r1, 0x4] - strh r6, [r1, 0xC] - cmp r5, r4 - bge _080B0088 - strh r7, [r1, 0xA] - b _080B008C - .pool -_080B0088: - negs r0, r7 - strh r0, [r1, 0xA] -_080B008C: - adds r0, r2, 0 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80B003C - - thumb_func_start sub_80B009C -sub_80B009C: @ 80B009C - push {r4,r5,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - bl sav1_get_flash_used_on_map - lsls r0, 24 - lsrs r0, 24 - movs r5, 0 - cmp r4, 0 - bne _080B00B6 - movs r5, 0x1 -_080B00B6: - ldr r1, =gUnknown_0854FE64 - lsls r0, 1 - adds r0, r1 - ldrh r2, [r0] - lsls r0, r4, 1 - adds r0, r1 - ldrh r3, [r0] - str r5, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r0, 0x78 - movs r1, 0x50 - bl sub_80AFFDC - bl sub_80AFFB8 - bl ScriptContext2_Enable - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B009C - - thumb_func_start sub_80B00E8 -sub_80B00E8: @ 80B00E8 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _080B0116 - ldr r4, =gUnknown_02038C28 - ldr r1, =gUnknown_0854FE64 - lsls r0, 1 - adds r0, r1 - ldrh r3, [r0] - adds r0, r4, 0 - movs r1, 0x78 - movs r2, 0x50 - bl sub_80AFCC4 - movs r0, 0xF0 - lsls r0, 3 - adds r1, r4, r0 - movs r2, 0xF0 - lsls r2, 1 - adds r0, r4, 0 - bl CpuFastSet -_080B0116: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B00E8 - - thumb_func_start door_upload_tiles -door_upload_tiles: @ 80B0124 - push {r4,lr} - ldr r4, =gUnknown_02038C28 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000e68 - adds r0, r1 - ldrb r3, [r0] - adds r0, r4, 0 - movs r1, 0x78 - movs r2, 0x50 - bl sub_80AFCC4 - movs r0, 0xF0 - lsls r0, 3 - adds r1, r4, r0 - movs r2, 0xF0 - lsls r2, 1 - adds r0, r4, 0 - bl CpuFastSet - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end door_upload_tiles - - thumb_func_start task0A_mpl_807E31C -task0A_mpl_807E31C: @ 80B0160 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _080B0184 - cmp r0, 0x1 - beq _080B0198 - b _080B01B6 - .pool -_080B0184: - bl player_bitmagic - bl ScriptContext2_Enable - bl sub_808D194 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080B01B6 -_080B0198: - bl sub_80AF71C - cmp r0, 0 - beq _080B01B6 - bl sub_808D1B4 - cmp r0, 0x1 - beq _080B01B6 - bl sub_809757C - bl ScriptContext2_Disable - adds r0, r5, 0 - bl DestroyTask -_080B01B6: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end task0A_mpl_807E31C - - thumb_func_start sub_80B01BC -sub_80B01BC: @ 80B01BC - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080B0202 - cmp r0, 0x1 - bgt _080B01E4 - cmp r0, 0 - beq _080B01EE - b _080B023A - .pool -_080B01E4: - cmp r0, 0x2 - beq _080B0210 - cmp r0, 0x3 - beq _080B022A - b _080B023A -_080B01EE: - bl player_bitmagic - bl ScriptContext2_Enable - movs r0, 0x2D - bl PlaySE - bl sub_808D1C8 - b _080B0222 -_080B0202: - bl sub_808D1E8 - cmp r0, 0 - bne _080B023A - bl sub_80AF0B4 - b _080B0222 -_080B0210: - bl sub_80AF710 - cmp r0, 0 - bne _080B023A - bl sub_80859A0 - lsls r0, 24 - cmp r0, 0 - beq _080B023A -_080B0222: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080B023A -_080B022A: - bl warp_in - ldr r0, =c2_load_new_map - bl SetMainCallback2 - adds r0, r5, 0 - bl DestroyTask -_080B023A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B01BC - - thumb_func_start sub_80B0244 -sub_80B0244: @ 80B0244 - push {lr} - bl ScriptContext2_Enable - ldr r0, =sub_80AFA0C - movs r1, 0xA - bl CreateTask - ldr r1, =gUnknown_03005DAC - ldr r0, =sub_80AF3E8 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B0244 - - thumb_func_start sub_80B0268 -sub_80B0268: @ 80B0268 - push {lr} - bl ScriptContext2_Enable - ldr r0, =gUnknown_03005DAC - ldr r1, =mapldr_default - str r1, [r0] - ldr r0, =sub_80B01BC - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B0268 - - thumb_func_start sub_80B028C -sub_80B028C: @ 80B028C - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - cmp r0, 0 - bne _080B029A - movs r1, 0x1F - b _080B02A0 -_080B029A: - movs r0, 0xF8 - lsls r0, 7 - adds r1, r0, 0 -_080B02A0: - mov r0, sp - strh r1, [r0] - movs r5, 0 - movs r4, 0xF0 - lsls r4, 16 -_080B02AA: - lsrs r1, r4, 16 - mov r0, sp - movs r2, 0x2 - bl LoadPalette - movs r0, 0x80 - lsls r0, 9 - adds r4, r0 - adds r5, 0x1 - cmp r5, 0xF - ble _080B02AA - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80B028C - - thumb_func_start sub_80B02C8 -sub_80B02C8: @ 80B02C8 - push {r4,r5,lr} - lsls r0, 16 - ldr r2, =0x04000052 - ldrh r1, [r2] - lsls r1, 24 - lsrs r5, r1, 24 - ldrh r1, [r2] - lsrs r4, r1, 8 - cmp r0, 0 - beq _080B02EC - cmp r5, 0 - beq _080B02F6 - subs r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - b _080B02F6 - .pool -_080B02EC: - cmp r4, 0xF - bhi _080B02F6 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_080B02F6: - lsls r1, r4, 8 - orrs r1, r5 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - cmp r5, 0 - bne _080B0310 - cmp r4, 0x10 - bne _080B0310 - movs r0, 0x1 - b _080B0312 -_080B0310: - movs r0, 0 -_080B0312: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80B02C8 - - thumb_func_start sub_80B0318 -sub_80B0318: @ 80B0318 - push {r4,r5,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r5, r0, r1 - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0x7 - bls _080B0334 - b _080B052C -_080B0334: - lsls r0, 2 - ldr r1, =_080B0348 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080B0348: - .4byte _080B0368 - .4byte _080B0424 - .4byte _080B0450 - .4byte _080B046C - .4byte _080B0482 - .4byte _080B04F2 - .4byte _080B04AC - .4byte _080B04BA -_080B0368: - movs r0, 0x80 - lsls r0, 19 - ldrh r0, [r0] - strh r0, [r5, 0xC] - ldr r0, =0x04000050 - ldrh r0, [r0] - strh r0, [r5, 0xE] - ldr r0, =0x04000052 - ldrh r0, [r0] - strh r0, [r5, 0x10] - ldr r0, =0x04000048 - ldrh r0, [r0] - strh r0, [r5, 0x12] - ldr r0, =0x0400004a - ldrh r0, [r0] - strh r0, [r5, 0x14] - movs r1, 0x80 - lsls r1, 7 - movs r0, 0 - bl ClearGpuRegBits - ldr r0, =gUnknown_82EC7CC - ldrh r1, [r0] - movs r0, 0x50 - bl SetGpuRegBits - ldr r1, =0x0000070c - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0x3F - bl SetGpuReg - movs r0, 0x4A - movs r1, 0x1E - bl SetGpuReg - movs r0, 0x14 - str r0, [sp] - movs r0, 0xF - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0x1E - bl sub_8199C30 - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldr r4, =gUnknown_02038C28 - movs r2, 0x4 - ldrsh r1, [r5, r2] - movs r0, 0x6 - ldrsh r2, [r5, r0] - adds r0, r4, 0 - movs r3, 0x1 - bl sub_80AFD7C - movs r2, 0xF0 - lsls r2, 3 - adds r1, r4, r2 - movs r2, 0xF0 - lsls r2, 1 - adds r0, r4, 0 - bl CpuFastSet - ldr r2, =gUnknown_0854FE7C - ldr r0, [r2] - ldr r1, [r2, 0x4] - ldr r2, [r2, 0x8] - bl sub_80BA038 - movs r0, 0x1 - strh r0, [r5] - b _080B052C - .pool -_080B0424: - movs r0, 0 - movs r1, 0x11 - movs r2, 0 - movs r3, 0x1 - bl sub_8199DF0 - ldrb r0, [r5, 0x2] - bl sub_80B028C - movs r1, 0x4 - ldrsh r0, [r5, r1] - movs r2, 0x6 - ldrsh r1, [r5, r2] - movs r2, 0x1 - str r2, [sp] - movs r4, 0x2 - str r4, [sp, 0x4] - movs r3, 0xA0 - bl sub_80B003C - strh r4, [r5] - b _080B052C -_080B0450: - ldr r0, =sub_80AFECC - bl FuncIsActiveTask - lsls r0, 24 - cmp r0, 0 - bne _080B052C - bl EnableBothScriptContexts - movs r0, 0x3 - strh r0, [r5] - b _080B052C - .pool -_080B046C: - bl InstallCameraPanAheadCallback - movs r0, 0 - bl SetCameraPanningCallback - movs r0, 0 - strh r0, [r5, 0xA] - movs r0, 0x4 - strh r0, [r5, 0x8] - strh r0, [r5] - b _080B052C -_080B0482: - ldrh r0, [r5, 0x8] - subs r0, 0x1 - strh r0, [r5, 0x8] - lsls r0, 16 - cmp r0, 0 - bne _080B052C - movs r0, 0x4 - strh r0, [r5, 0x8] - ldrh r0, [r5, 0xA] - movs r1, 0x1 - eors r0, r1 - strh r0, [r5, 0xA] - movs r1, 0x4 - negs r1, r1 - cmp r0, 0 - beq _080B04A4 - movs r1, 0x4 -_080B04A4: - movs r0, 0 - bl SetCameraPanning - b _080B052C -_080B04AC: - bl InstallCameraPanAheadCallback - movs r0, 0x8 - strh r0, [r5, 0x8] - movs r0, 0x7 - strh r0, [r5] - b _080B052C -_080B04BA: - ldrh r0, [r5, 0x8] - subs r0, 0x1 - strh r0, [r5, 0x8] - lsls r0, 16 - cmp r0, 0 - bne _080B052C - movs r0, 0x8 - strh r0, [r5, 0x8] - ldrh r0, [r5, 0xA] - movs r1, 0x1 - eors r0, r1 - strh r0, [r5, 0xA] - ldrh r0, [r5, 0xA] - bl sub_80B02C8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B052C - movs r0, 0x5 - strh r0, [r5] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_8199DF0 - b _080B052C -_080B04F2: - movs r0, 0x40 - movs r1, 0xFF - bl SetGpuReg - ldrh r1, [r5, 0xC] - movs r0, 0 - bl SetGpuReg - ldrh r1, [r5, 0xE] - movs r0, 0x50 - bl SetGpuReg - ldrh r1, [r5, 0x10] - movs r0, 0x52 - bl SetGpuReg - ldrh r1, [r5, 0x12] - movs r0, 0x48 - bl SetGpuReg - ldrh r1, [r5, 0x14] - movs r0, 0x4A - bl SetGpuReg - bl EnableBothScriptContexts - adds r0, r4, 0 - bl DestroyTask -_080B052C: - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80B0318 - - thumb_func_start sub_80B0534 -sub_80B0534: @ 80B0534 - push {lr} - ldr r0, =sub_80B0318 - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r1, r0 - ldr r0, =gScriptResult - ldrh r0, [r0] - cmp r0, 0 - bne _080B0568 - strh r0, [r1, 0x2] - movs r0, 0x68 - b _080B0580 - .pool -_080B0568: - cmp r0, 0x1 - bne _080B0572 - strh r0, [r1, 0x2] - movs r0, 0x88 - b _080B0580 -_080B0572: - cmp r0, 0x2 - bne _080B057A - movs r0, 0 - b _080B057C -_080B057A: - movs r0, 0x1 -_080B057C: - strh r0, [r1, 0x2] - movs r0, 0x78 -_080B0580: - strh r0, [r1, 0x4] - movs r0, 0x50 - strh r0, [r1, 0x6] - pop {r0} - bx r0 - thumb_func_end sub_80B0534 - - thumb_func_start sub_80B058C -sub_80B058C: @ 80B058C - push {lr} - ldr r0, =sub_80B0318 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0x6 - strh r0, [r1, 0x8] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B058C - - thumb_func_start sub_80B05B4 -sub_80B05B4: @ 80B05B4 - push {lr} - bl sub_80859B0 - ldr r0, =task50_0807F0C8 - movs r1, 0x50 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B05B4 - - thumb_func_start task50_0807F0C8 -task50_0807F0C8: @ 80B05CC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80859A0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B05E8 - adds r0, r4, 0 - bl DestroyTask - bl EnableBothScriptContexts -_080B05E8: - pop {r4} - pop {r0} - bx r0 - thumb_func_end task50_0807F0C8 - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_813C5BC.s b/asm/rom_813C5BC.s deleted file mode 100644 index eeb6c57fe..000000000 --- a/asm/rom_813C5BC.s +++ /dev/null @@ -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. diff --git a/asm/rom_818E9AC.s b/asm/rom_818E9AC.s deleted file mode 100644 index 58a942aa0..000000000 --- a/asm/rom_818E9AC.s +++ /dev/null @@ -1,83686 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start sub_818E9AC -sub_818E9AC: @ 818E9AC - push {lr} - ldr r1, =gUnknown_0860D090 - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E9AC - - thumb_func_start sub_818E9CC -sub_818E9CC: @ 818E9CC - push {r4-r7,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r5, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r7, r0, 16 - ldr r0, [r4] - ldr r2, =0x00000ca8 - adds r0, r2 - movs r6, 0 - strb r6, [r0] - ldr r1, [r4] - adds r2, 0xA - adds r0, r1, r2 - strh r6, [r0] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r4] - ldr r2, =0x00000ca9 - adds r1, r2 - ldrb r2, [r1] - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r4, [r4] - ldr r0, =0x00000cdc - adds r3, r4, r0 - ldr r2, =gUnknown_0860D0EC - lsls r1, r5, 2 - lsls r0, r7, 3 - adds r1, r0 - adds r1, r2 - ldr r0, [r3] - ldr r1, [r1] - ands r0, r1 - cmp r0, 0 - bne _0818EA3E - lsls r0, r5, 1 - lsls r1, r7, 2 - adds r0, r1 - ldr r2, =0x00000d0c - adds r1, r4, r2 - adds r1, r0 - strh r6, [r1] -_0818EA3E: - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0x4 - ldrsb r1, [r0, r1] - movs r2, 0x5 - ldrsb r2, [r0, r2] - movs r3, 0x1 - negs r3, r3 - movs r0, 0 - bl saved_warp2_set - ldr r0, =gTrainerBattleOpponent_A - strh r6, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E9CC - - thumb_func_start sub_818EA84 -sub_818EA84: @ 818EA84 - push {r4-r6,lr} - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r5, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x9 - bls _0818EAA8 - b _0818ED10 -_0818EAA8: - lsls r0, 2 - ldr r1, =_0818EAC8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0818EAC8: - .4byte _0818EAF0 - .4byte _0818EB14 - .4byte _0818EB48 - .4byte _0818EB64 - .4byte _0818EB80 - .4byte _0818EB98 - .4byte _0818EBB4 - .4byte _0818EC40 - .4byte _0818ECD0 - .4byte _0818ECF4 -_0818EAF0: - ldr r3, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r5, 1 - lsls r2, r6, 2 - adds r1, r2 - ldr r2, =0x00000d0c - adds r0, r2 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r3] - b _0818ED10 - .pool -_0818EB14: - ldr r4, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r3, =0x00000cdc - adds r2, r3 - ldr r3, =gUnknown_0860D0EC - lsls r0, r5, 2 - lsls r1, r6, 3 - adds r0, r1 - adds r0, r3 - ldr r1, [r2] - ldr r0, [r0] - ands r1, r0 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - strh r0, [r4] - b _0818ED10 - .pool -_0818EB48: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000d08 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 31 - b _0818ECBE - .pool -_0818EB64: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r3, =0x00000d08 - adds r0, r3 - ldrb r0, [r0] - lsls r0, 30 - b _0818ECBE - .pool -_0818EB80: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000d08 - adds r0, r2 - b _0818ECBA - .pool -_0818EB98: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r3, =0x00000d08 - adds r0, r3 - ldrb r0, [r0] - lsls r0, 28 - b _0818ECBE - .pool -_0818EBB4: - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bne _0818EC04 - cmp r5, 0 - beq _0818EBE8 - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000d08 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 26 - b _0818ECBE - .pool -_0818EBE8: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r3, =0x00000d08 - adds r0, r3 - ldrb r0, [r0] - lsls r0, 27 - b _0818ECBE - .pool -_0818EC04: - cmp r5, 0 - beq _0818EC24 - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000d08 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 30 - b _0818ECBE - .pool -_0818EC24: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r3, =0x00000d08 - adds r0, r3 - ldrb r0, [r0] - lsls r0, 31 - b _0818ECBE - .pool -_0818EC40: - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bne _0818EC90 - cmp r5, 0 - beq _0818EC74 - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000d08 - adds r0, r2 - ldrb r0, [r0] - lsrs r0, 7 - strh r0, [r1] - b _0818ED10 - .pool -_0818EC74: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r3, =0x00000d08 - adds r0, r3 - ldrb r0, [r0] - lsls r0, 25 - b _0818ECBE - .pool -_0818EC90: - cmp r5, 0 - beq _0818ECB0 - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000d08 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 28 - b _0818ECBE - .pool -_0818ECB0: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r3, =0x00000d08 - adds r0, r3 -_0818ECBA: - ldrb r0, [r0] - lsls r0, 29 -_0818ECBE: - lsrs r0, 31 - strh r0, [r1] - b _0818ED10 - .pool -_0818ECD0: - bl sub_81B8558 - ldr r2, =gUnknown_0203CEF8 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - movs r1, 0xCB - lsls r1, 4 - adds r0, r1 - ldrh r1, [r0] - strb r1, [r2] - ldrh r0, [r0] - lsrs r0, 8 - strb r0, [r2, 0x1] - b _0818ED10 - .pool -_0818ECF4: - ldr r2, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r3, =0x00000d0a - adds r0, r1, r3 - ldrb r0, [r0] - lsls r0, 1 - adds r3, 0x1 - adds r1, r3 - ldr r3, =0x0000fffd - adds r0, r3 - ldrb r1, [r1] - adds r0, r1 - strh r0, [r2] -_0818ED10: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818EA84 - - thumb_func_start sub_818ED28 -sub_818ED28: @ 818ED28 - push {r4,r5,lr} - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r4, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x8 - bls _0818ED4C - b _0818F01E -_0818ED4C: - lsls r0, 2 - ldr r1, =_0818ED6C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0818ED6C: - .4byte _0818ED90 - .4byte _0818EDB4 - .4byte _0818EE10 - .4byte _0818EE34 - .4byte _0818EE5C - .4byte _0818EE78 - .4byte _0818EEA0 - .4byte _0818EF50 - .4byte _0818F008 -_0818ED90: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - lsls r0, r4, 1 - lsls r1, r5, 2 - adds r0, r1 - ldr r1, =0x00000d0c - adds r2, r1 - adds r2, r0 - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - strh r0, [r2] - b _0818F01E - .pool -_0818EDB4: - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - cmp r0, 0 - beq _0818EDE8 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r0, =0x00000cdc - adds r2, r0 - ldr r3, =gUnknown_0860D0EC - lsls r1, r4, 2 - lsls r0, r5, 3 - adds r1, r0 - adds r1, r3 - ldr r0, [r2] - ldr r1, [r1] - orrs r0, r1 - str r0, [r2] - b _0818F01E - .pool -_0818EDE8: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r1, =0x00000cdc - adds r2, r1 - ldr r3, =gUnknown_0860D0FC - lsls r1, r4, 2 - lsls r0, r5, 3 - adds r1, r0 - adds r1, r3 - ldr r0, [r2] - ldr r1, [r1] - ands r0, r1 - str r0, [r2] - b _0818F01E - .pool -_0818EE10: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r1, =0x00000d08 - adds r2, r1 - movs r1, 0x1 - ands r1, r0 - ldrb r3, [r2] - movs r0, 0x2 - negs r0, r0 - b _0818EF74 - .pool -_0818EE34: - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r2, =0x00000d08 - adds r3, r2 - movs r1, 0x1 - ands r1, r0 - lsls r1, 1 - ldrb r2, [r3] - movs r0, 0x3 - negs r0, r0 - b _0818EFF4 - .pool -_0818EE5C: - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r1, =0x00000d08 - adds r3, r1 - b _0818EFE8 - .pool -_0818EE78: - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r2, =0x00000d08 - adds r3, r2 - movs r1, 0x1 - ands r1, r0 - lsls r1, 3 - ldrb r2, [r3] - movs r0, 0x9 - negs r0, r0 - b _0818EFF4 - .pool -_0818EEA0: - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x1 - bne _0818EF00 - cmp r4, 0 - beq _0818EEDC - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r2, =0x00000d08 - adds r3, r2 - ands r1, r0 - lsls r1, 5 - ldrb r2, [r3] - movs r0, 0x21 - negs r0, r0 - b _0818EFF4 - .pool -_0818EEDC: - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r2, =0x00000d08 - adds r3, r2 - ands r1, r0 - lsls r1, 4 - ldrb r2, [r3] - movs r0, 0x11 - negs r0, r0 - b _0818EFF4 - .pool -_0818EF00: - cmp r4, 0 - beq _0818EF2C - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r1, =0x00000d08 - adds r3, r1 - movs r1, 0x1 - ands r1, r0 - lsls r1, 1 - ldrb r2, [r3] - movs r0, 0x3 - negs r0, r0 - b _0818EFF4 - .pool -_0818EF2C: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r1, =0x00000d08 - adds r2, r1 - movs r1, 0x1 - ands r1, r0 - ldrb r3, [r2] - movs r0, 0x2 - negs r0, r0 - b _0818EF74 - .pool -_0818EF50: - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x1 - bne _0818EFB0 - cmp r4, 0 - beq _0818EF8C - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r1, [r0] - ldr r0, =0x00000d08 - adds r2, r0 - lsls r1, 7 - ldrb r3, [r2] - movs r0, 0x7F -_0818EF74: - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - b _0818F01E - .pool -_0818EF8C: - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r2, =0x00000d08 - adds r3, r2 - ands r1, r0 - lsls r1, 6 - ldrb r2, [r3] - movs r0, 0x41 - negs r0, r0 - b _0818EFF4 - .pool -_0818EFB0: - cmp r4, 0 - beq _0818EFDC - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r1, =0x00000d08 - adds r3, r1 - movs r1, 0x1 - ands r1, r0 - lsls r1, 3 - ldrb r2, [r3] - movs r0, 0x9 - negs r0, r0 - b _0818EFF4 - .pool -_0818EFDC: - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r2, =0x00000d08 - adds r3, r2 -_0818EFE8: - movs r1, 0x1 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r3] - movs r0, 0x5 - negs r0, r0 -_0818EFF4: - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - b _0818F01E - .pool -_0818F008: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r0, =gUnknown_0203CEF8 - ldrb r1, [r0] - ldrb r0, [r0, 0x1] - lsls r0, 8 - orrs r1, r0 - movs r0, 0xCB - lsls r0, 4 - adds r2, r0 - strh r1, [r2] -_0818F01E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818ED28 - - thumb_func_start sub_818F02C -sub_818F02C: @ 818F02C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x3C - movs r0, 0 - str r0, [sp, 0x8] - str r0, [sp, 0xC] - str r0, [sp, 0x10] - movs r0, 0x20 - bl AllocZeroed - str r0, [sp, 0x18] - movs r0, 0x18 - bl AllocZeroed - str r0, [sp, 0x1C] - ldr r4, =gSaveBlock2Ptr - ldr r1, [r4] - ldr r2, =0x00000ca9 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - adds r0, 0x1 - ldr r3, =0x00000d0a - adds r1, r3 - strb r0, [r1] - ldr r0, =0x000040ce - bl VarGet - ldr r1, [r4] - adds r0, 0x1 - ldr r5, =0x00000d0b - adds r1, r5 - strb r0, [r1] - ldr r2, [r4] - ldr r7, =0x00000d24 - adds r3, r2, r7 - ldrh r0, [r3] - ldr r5, =0x000003ff - adds r1, r5, 0 - orrs r0, r1 - strh r0, [r3] - ldr r3, =0x00000d25 - adds r2, r3 - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldr r1, [r4] - adds r1, r3 - ldrb r2, [r1] - movs r0, 0x19 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r4] - adds r1, r3 - ldrb r2, [r1] - movs r0, 0x1F - ands r0, r2 - strb r0, [r1] - movs r7, 0 - mov r10, r7 - mov r8, r4 - ldr r0, =gBattleScripting + 0x14 - mov r9, r0 - movs r4, 0 -_0818F0BA: - mov r1, r8 - ldr r0, [r1] - ldr r2, =0x00000caa - adds r0, r2 - adds r0, r4 - ldrh r0, [r0] - movs r3, 0x64 - muls r0, r3 - add r0, r9 - movs r1, 0xB - movs r2, 0 - bl GetMonData - mov r5, r8 - ldr r1, [r5] - ldr r7, =0x00000d64 - adds r1, r7 - adds r1, r4 - strh r0, [r1] - movs r5, 0 - mov r0, r10 - lsls r7, r0, 4 - adds r6, r7, 0 -_0818F0E8: - mov r1, r8 - ldr r0, [r1] - ldr r2, =0x00000caa - adds r0, r2 - adds r0, r4 - ldrh r0, [r0] - movs r3, 0x64 - muls r0, r3 - add r0, r9 - adds r1, r5, 0 - adds r1, 0xD - movs r2, 0 - bl GetMonData - mov r2, r8 - ldr r1, [r2] - ldr r3, =0x00000efc - adds r1, r3 - adds r1, r6 - strh r0, [r1] - adds r6, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _0818F0E8 - movs r5, 0 - ldr r6, =gSaveBlock2Ptr -_0818F11C: - ldr r0, [r6] - ldr r1, =0x00000caa - adds r0, r1 - adds r0, r4 - ldrh r0, [r0] - movs r2, 0x64 - muls r0, r2 - add r0, r9 - adds r1, r5, 0 - adds r1, 0x1A - movs r2, 0 - bl GetMonData - ldr r1, [r6] - adds r2, r5, r7 - ldr r3, =0x00000f04 - adds r1, r3 - adds r1, r2 - strb r0, [r1] - adds r5, 0x1 - cmp r5, 0x5 - ble _0818F11C - mov r5, r8 - ldr r0, [r5] - ldr r1, =0x00000caa - adds r0, r1 - adds r0, r4 - ldrh r0, [r0] - movs r2, 0x64 - muls r0, r2 - add r0, r9 - bl GetNature - ldr r1, [r5] - adds r1, r7 - ldr r3, =0x00000f0a - adds r1, r3 - strb r0, [r1] - adds r4, 0x2 - movs r5, 0x1 - add r10, r5 - mov r7, r10 - cmp r7, 0x2 - ble _0818F0BA - mov r10, r5 - movs r0, 0x4 - str r0, [sp, 0x34] - movs r1, 0x6 - str r1, [sp, 0x38] -_0818F17E: - mov r2, r10 - cmp r2, 0x5 - ble _0818F22C -_0818F184: - bl sub_81A39C4 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl sub_8162548 - lsls r0, 16 - lsrs r4, r0, 16 - movs r5, 0x1 - cmp r5, r10 - bge _0818F1CA - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - ldr r7, =0x00000d28 - adds r0, r7 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - adds r2, r3, 0 - cmp r0, r4 - beq _0818F1CA - ldr r3, =0x00000d24 -_0818F1B2: - adds r5, 0x1 - cmp r5, r10 - bge _0818F1CA - ldr r0, [r2] - lsls r1, r5, 2 - adds r0, r1 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - cmp r0, r4 - bne _0818F1B2 -_0818F1CA: - cmp r5, r10 - bne _0818F184 - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r1, [sp, 0x34] - adds r3, r1 - ldr r2, =0x00000d24 - adds r3, r2 - ldr r5, =0x000003ff - adds r0, r5, 0 - adds r2, r4, 0 - ands r2, r0 - ldrh r0, [r3] - ldr r7, =0xfffffc00 - adds r1, r7, 0 - b _0818F292 - .pool -_0818F22C: - bl sub_81A39C4 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl sub_8162548 - lsls r0, 16 - lsrs r4, r0, 16 - movs r5, 0x1 - cmp r5, r10 - bge _0818F274 - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r2, =0x00000d28 - adds r0, r2 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - adds r2, r1, 0 - cmp r0, r4 - beq _0818F274 - ldr r3, =0x00000d24 -_0818F25C: - adds r5, 0x1 - cmp r5, r10 - bge _0818F274 - ldr r0, [r2] - lsls r1, r5, 2 - adds r0, r1 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - cmp r0, r4 - bne _0818F25C -_0818F274: - cmp r5, r10 - bne _0818F22C - ldr r5, =gSaveBlock2Ptr - ldr r3, [r5] - ldr r7, [sp, 0x34] - adds r3, r7 - ldr r0, =0x00000d24 - adds r3, r0 - ldr r1, =0x000003ff - adds r0, r1, 0 - adds r2, r4, 0 - ands r2, r0 - ldrh r0, [r3] - ldr r5, =0xfffffc00 - adds r1, r5, 0 -_0818F292: - ands r0, r1 - orrs r0, r2 - strh r0, [r3] - movs r5, 0 - lsls r4, 16 - str r4, [sp, 0x2C] - ldr r7, [sp, 0x38] - str r7, [sp, 0x20] -_0818F2A2: - lsls r0, r5, 1 - mov r9, r0 - adds r1, r5, 0x1 - str r1, [sp, 0x24] - lsls r2, r5, 2 - str r2, [sp, 0x28] -_0818F2AE: - ldr r3, [sp, 0x2C] - lsrs r0, r3, 16 - bl sub_8163524 - lsls r0, 16 - lsrs r6, r0, 16 - movs r7, 0 - cmp r7, r5 - bge _0818F300 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, [sp, 0x8] - mov r8, r1 - ldr r2, [sp, 0xC] - mov r12, r2 - ldr r3, =0x00000d64 - adds r0, r3 - ldr r1, [sp, 0x20] - adds r4, r1, r0 -_0818F2D4: - ldrh r3, [r4] - cmp r3, r6 - beq _0818F300 - ldr r2, =gUnknown_0203BC8C - ldr r1, [r2] - lsls r0, r6, 4 - adds r2, r0, r1 - ldrh r0, [r2] - cmp r8, r0 - beq _0818F300 - cmp r12, r0 - beq _0818F300 - lsls r0, r3, 4 - adds r0, r1 - ldrb r0, [r0, 0xA] - ldrb r2, [r2, 0xA] - cmp r0, r2 - beq _0818F300 - adds r4, 0x2 - adds r7, 0x1 - cmp r7, r5 - blt _0818F2D4 -_0818F300: - cmp r7, r5 - bne _0818F2AE - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - ldr r1, [sp, 0x38] - add r1, r9 - ldr r5, =0x00000d64 - adds r0, r5 - adds r0, r1 - strh r6, [r0] - ldr r2, [sp, 0x28] - add r2, sp - adds r2, 0x8 - ldr r0, =gUnknown_0203BC8C - ldr r1, [r0] - lsls r0, r6, 4 - adds r0, r1 - ldrh r0, [r0] - str r0, [r2] - ldr r5, [sp, 0x24] - cmp r5, 0x2 - ble _0818F2A2 - ldr r2, [r3] - ldr r7, [sp, 0x34] - adds r2, r7 - ldr r0, =0x00000d25 - adds r2, r0 - ldrb r0, [r2] - movs r3, 0x5 - negs r3, r3 - adds r1, r3, 0 - ands r0, r1 - strb r0, [r2] - ldr r5, =gSaveBlock2Ptr - ldr r2, [r5] - adds r2, r7 - ldr r7, =0x00000d25 - adds r2, r7 - ldrb r0, [r2] - subs r3, 0x14 - adds r1, r3, 0 - ands r0, r1 - strb r0, [r2] - ldr r1, [r5] - ldr r5, [sp, 0x34] - adds r1, r5 - adds r1, r7 - ldrb r2, [r1] - movs r0, 0x1F - ands r0, r2 - strb r0, [r1] - adds r5, 0x4 - str r5, [sp, 0x34] - ldr r7, [sp, 0x38] - adds r7, 0x6 - str r7, [sp, 0x38] - movs r0, 0x1 - add r10, r0 - mov r1, r10 - cmp r1, 0xF - bgt _0818F37C - b _0818F17E -_0818F37C: - movs r7, 0 - ldr r2, [sp, 0x18] - strh r7, [r2] - movs r3, 0 - mov r10, r3 - ldr r6, =gBitTable - ldr r5, =gBaseStats -_0818F38A: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - mov r2, r10 - lsls r1, r2, 1 - ldr r3, =0x00000caa - adds r0, r3 - adds r0, r1 - ldrh r0, [r0] - subs r4, r0, 0x1 - movs r0, 0x64 - muls r4, r0 - ldr r0, =gPlayerParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x3B - movs r2, 0 - bl GetMonData - ldr r2, [sp, 0x18] - ldrh r1, [r2] - adds r1, r0 - strh r1, [r2] - adds r0, r4, 0 - movs r1, 0x3C - movs r2, 0 - bl GetMonData - ldr r3, [sp, 0x18] - ldrh r1, [r3] - adds r1, r0 - strh r1, [r3] - adds r0, r4, 0 - movs r1, 0x3E - movs r2, 0 - bl GetMonData - ldr r2, [sp, 0x18] - ldrh r1, [r2] - adds r1, r0 - strh r1, [r2] - adds r0, r4, 0 - movs r1, 0x3F - movs r2, 0 - bl GetMonData - ldr r3, [sp, 0x18] - ldrh r1, [r3] - adds r1, r0 - strh r1, [r3] - adds r0, r4, 0 - movs r1, 0x3D - movs r2, 0 - bl GetMonData - ldr r2, [sp, 0x18] - ldrh r1, [r2] - adds r1, r0 - strh r1, [r2] - adds r0, r4, 0 - movs r1, 0x3A - movs r2, 0 - bl GetMonData - ldr r3, [sp, 0x18] - ldrh r1, [r3] - adds r1, r0 - strh r1, [r3] - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r0, [r1, 0x6] - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - orrs r7, r0 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r0, [r1, 0x7] - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - orrs r7, r0 - movs r0, 0x1 - add r10, r0 - mov r1, r10 - cmp r1, 0x2 - ble _0818F38A - movs r4, 0 - movs r1, 0x1 - movs r5, 0x1F -_0818F458: - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0 - beq _0818F462 - adds r4, 0x1 -_0818F462: - asrs r7, 1 - subs r5, 0x1 - cmp r5, 0 - bge _0818F458 - bl sub_8165C40 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x14] - adds r2, r0, 0 - adds r0, r4, 0 - muls r0, r2 - movs r1, 0x14 - bl __divsi3 - ldr r3, [sp, 0x18] - ldrh r1, [r3] - adds r1, r0 - strh r1, [r3] - movs r5, 0x1 - mov r10, r5 - adds r6, r3, 0 - adds r6, 0x2 - movs r7, 0x2 - str r7, [sp, 0x30] -_0818F494: - movs r7, 0 - strh r7, [r6] - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - mov r2, r10 - lsls r1, r2, 2 - adds r0, r1 - ldr r3, =0x00000d24 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - bl sub_8190168 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r5, 0 - ldr r0, [sp, 0x30] - mov r9, r0 -_0818F4BC: - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - mov r4, r9 - add r4, r10 - adds r4, r5 - lsls r4, 1 - ldr r2, =0x00000d64 - adds r0, r2 - adds r0, r4 - ldrh r1, [r0] - ldr r3, =gUnknown_0203BC8C - ldr r0, [r3] - lsls r1, 4 - adds r1, r0 - ldrh r0, [r1] - ldrb r3, [r1, 0xB] - ldrb r1, [r1, 0xC] - str r1, [sp] - ldr r1, [sp, 0x1C] - str r1, [sp, 0x4] - ldr r1, [sp, 0x14] - mov r2, r8 - bl sub_818F720 - ldr r2, [sp, 0x1C] - ldr r1, [r2, 0x4] - ldrh r0, [r6] - adds r0, r1 - ldr r1, [r2, 0x8] - adds r0, r1 - ldr r1, [r2, 0x10] - adds r0, r1 - ldr r1, [r2, 0x14] - adds r0, r1 - ldr r1, [r2, 0xC] - adds r0, r1 - ldr r1, [r2] - adds r0, r1 - strh r0, [r6] - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - ldr r1, =0x00000d64 - adds r0, r1 - adds r0, r4 - ldrh r0, [r0] - ldr r2, =gUnknown_0203BC8C - ldr r1, [r2] - lsls r0, 4 - adds r0, r1 - ldrh r0, [r0] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - ldr r3, =gBaseStats - adds r1, r3 - ldrb r0, [r1, 0x6] - lsls r0, 2 - ldr r2, =gBitTable - adds r0, r2 - ldr r0, [r0] - orrs r7, r0 - ldrb r0, [r1, 0x7] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - orrs r7, r0 - adds r5, 0x1 - cmp r5, 0x2 - ble _0818F4BC - movs r4, 0 - movs r1, 0x1 - movs r5, 0x1F -_0818F54C: - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0 - beq _0818F556 - adds r4, 0x1 -_0818F556: - asrs r7, 1 - subs r5, 0x1 - cmp r5, 0 - bge _0818F54C - ldr r3, [sp, 0x14] - adds r0, r4, 0 - muls r0, r3 - movs r1, 0x14 - bl __divsi3 - ldrh r1, [r6] - adds r1, r0 - strh r1, [r6] - adds r6, 0x2 - ldr r5, [sp, 0x30] - adds r5, 0x2 - str r5, [sp, 0x30] - movs r7, 0x1 - add r10, r7 - mov r0, r10 - cmp r0, 0xF - ble _0818F494 - movs r1, 0 - mov r10, r1 - ldr r2, =0x000003ff - mov r8, r2 -_0818F58A: - mov r5, r10 - adds r5, 0x1 - adds r7, r5, 0 - cmp r5, 0xF - bgt _0818F626 - mov r3, r10 - lsls r0, r3, 1 - ldr r1, [sp, 0x18] - adds r6, r0, r1 - lsls r0, r5, 1 - adds r4, r0, r1 -_0818F5A0: - ldrh r1, [r6] - ldrh r0, [r4] - cmp r1, r0 - bcc _0818F5C2 - cmp r1, r0 - bne _0818F61E - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - lsls r0, r5, 2 - adds r0, r1, r0 - ldr r2, =0x00000d24 - adds r0, r2 - ldrh r0, [r0] - lsls r2, r0, 22 - lsrs r0, r2, 22 - cmp r0, r8 - bne _0818F602 -_0818F5C2: - mov r0, r10 - adds r1, r5, 0 - ldr r2, [sp, 0x18] - bl sub_818F904 - b _0818F600 - .pool -_0818F600: - b _0818F61E -_0818F602: - mov r3, r10 - lsls r0, r3, 2 - adds r0, r1, r0 - ldr r1, =0x00000d24 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 22 - cmp r0, r2 - bls _0818F61E - mov r0, r10 - adds r1, r5, 0 - ldr r2, [sp, 0x18] - bl sub_818F904 -_0818F61E: - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0xF - ble _0818F5A0 -_0818F626: - mov r10, r7 - mov r2, r10 - cmp r2, 0xE - ble _0818F58A - bl sub_81A3610 - lsls r0, 24 - cmp r0, 0 - beq _0818F6EE - movs r3, 0 - mov r10, r3 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r4, =0x00000d24 - adds r1, r4 - ldrh r1, [r1] - lsls r1, 22 - lsrs r1, 22 - ldr r3, =0x000003ff - adds r2, r0, 0 - ldr r6, =gUnknown_0860D3F1 - cmp r1, r3 - beq _0818F674 - adds r5, r2, 0 -_0818F656: - movs r7, 0x1 - add r10, r7 - mov r0, r10 - cmp r0, 0xF - bgt _0818F674 - ldr r0, [r5] - mov r7, r10 - lsls r1, r7, 2 - adds r0, r1 - adds r0, r4 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - cmp r0, r3 - bne _0818F656 -_0818F674: - mov r1, r10 - lsls r0, r1, 1 - adds r0, r6 - ldrb r0, [r0] - cmp r0, 0 - beq _0818F6AC - movs r5, 0 - ldr r2, [r2] - ldr r3, =0x00000d24 - adds r2, r3 - ldrh r1, [r2] - ldr r0, =0xfffffc00 - ands r0, r1 - ldr r7, =0x000003fe - adds r1, r7, 0 - b _0818F6BE - .pool -_0818F6AC: - movs r5, 0x1 - ldr r2, [r2] - ldr r0, =0x00000d28 - adds r2, r0 - ldrh r1, [r2] - ldr r0, =0xfffffc00 - ands r0, r1 - ldr r3, =0x000003fe - adds r1, r3, 0 -_0818F6BE: - orrs r0, r1 - strh r0, [r2] - movs r7, 0 - mov r10, r7 - lsls r0, r5, 1 - adds r0, r5 - lsls r4, r0, 1 -_0818F6CC: - mov r1, r10 - lsls r0, r1, 24 - lsrs r0, 24 - bl sub_81A4FF0 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - ldr r2, =0x00000d64 - adds r1, r2 - adds r1, r4 - strh r0, [r1] - adds r4, 0x2 - movs r3, 0x1 - add r10, r3 - mov r5, r10 - cmp r5, 0x2 - ble _0818F6CC -_0818F6EE: - ldr r0, [sp, 0x18] - bl Free - ldr r0, [sp, 0x1C] - bl Free - add sp, 0x3C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818F02C - - thumb_func_start sub_818F720 -sub_818F720: @ 818F720 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - adds r7, r1, 0 - mov r9, r2 - ldr r1, [sp, 0x3C] - ldr r2, [sp, 0x40] - mov r8, r2 - lsls r0, 16 - lsrs r6, r0, 16 - lsls r3, 24 - lsrs r5, r3, 24 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x18] - movs r1, 0 - adds r4, r5, 0 - movs r3, 0x1 - movs r2, 0x5 -_0818F74C: - adds r0, r4, 0 - ands r0, r3 - cmp r0, 0 - beq _0818F756 - adds r1, 0x1 -_0818F756: - lsrs r4, 1 - subs r2, 0x1 - cmp r2, 0 - bge _0818F74C - movs r0, 0xFF - lsls r0, 1 - bl __divsi3 - lsls r0, 16 - lsrs r3, r0, 16 - lsls r0, r6, 3 - mov r10, r0 - movs r1, 0 - mov r12, r1 - mov r1, sp - movs r2, 0x5 -_0818F776: - mov r0, r12 - str r0, [r1] - adds r0, r5, 0 - ands r0, r4 - cmp r0, 0 - beq _0818F784 - str r3, [r1] -_0818F784: - lsls r0, r4, 25 - lsrs r4, r0, 24 - adds r1, 0x4 - subs r2, 0x1 - cmp r2, 0 - bge _0818F776 - ldr r0, =0x0000012f - cmp r6, r0 - bne _0818F7A0 - movs r0, 0x1 - b _0818F7CA - .pool -_0818F7A0: - mov r2, r10 - subs r0, r2, r6 - lsls r0, 2 - ldr r1, =gBaseStats - adds r0, r1 - ldrb r0, [r0] - lsls r0, 1 - mov r2, r9 - adds r1, r0, r2 - ldr r0, [sp] - cmp r0, 0 - bge _0818F7BA - adds r0, 0x3 -_0818F7BA: - asrs r0, 2 - adds r0, r1, r0 - muls r0, r7 - movs r1, 0x64 - bl __divsi3 - adds r0, r7 - adds r0, 0xA -_0818F7CA: - mov r1, r8 - str r0, [r1] - mov r2, r10 - subs r0, r2, r6 - lsls r0, 2 - ldr r1, =gBaseStats - adds r4, r0, r1 - ldrb r0, [r4, 0x1] - lsls r0, 1 - mov r2, r9 - adds r1, r0, r2 - ldr r0, [sp, 0x4] - cmp r0, 0 - bge _0818F7E8 - adds r0, 0x3 -_0818F7E8: - asrs r0, 2 - adds r0, r1, r0 - muls r0, r7 - movs r1, 0x64 - bl __divsi3 - adds r1, r0, 0 - adds r1, 0x5 - mov r0, r8 - str r1, [r0, 0x4] - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0x18] - movs r2, 0x1 - bl nature_stat_mod - lsls r0, 24 - lsrs r0, 24 - mov r1, r8 - str r0, [r1, 0x4] - ldrb r0, [r4, 0x2] - lsls r0, 1 - mov r2, r9 - adds r1, r0, r2 - ldr r0, [sp, 0x8] - cmp r0, 0 - bge _0818F820 - adds r0, 0x3 -_0818F820: - asrs r0, 2 - adds r0, r1, r0 - muls r0, r7 - movs r1, 0x64 - bl __divsi3 - adds r1, r0, 0 - adds r1, 0x5 - mov r0, r8 - str r1, [r0, 0x8] - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0x18] - movs r2, 0x2 - bl nature_stat_mod - lsls r0, 24 - lsrs r0, 24 - mov r1, r8 - str r0, [r1, 0x8] - ldrb r0, [r4, 0x3] - lsls r0, 1 - mov r2, r9 - adds r1, r0, r2 - ldr r0, [sp, 0xC] - cmp r0, 0 - bge _0818F858 - adds r0, 0x3 -_0818F858: - asrs r0, 2 - adds r0, r1, r0 - muls r0, r7 - movs r1, 0x64 - bl __divsi3 - adds r1, r0, 0 - adds r1, 0x5 - mov r0, r8 - str r1, [r0, 0xC] - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0x18] - movs r2, 0x3 - bl nature_stat_mod - lsls r0, 24 - lsrs r0, 24 - mov r1, r8 - str r0, [r1, 0xC] - ldrb r0, [r4, 0x4] - lsls r0, 1 - mov r2, r9 - adds r1, r0, r2 - ldr r0, [sp, 0x10] - cmp r0, 0 - bge _0818F890 - adds r0, 0x3 -_0818F890: - asrs r0, 2 - adds r0, r1, r0 - muls r0, r7 - movs r1, 0x64 - bl __divsi3 - adds r1, r0, 0 - adds r1, 0x5 - mov r0, r8 - str r1, [r0, 0x10] - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0x18] - movs r2, 0x4 - bl nature_stat_mod - lsls r0, 24 - lsrs r0, 24 - mov r1, r8 - str r0, [r1, 0x10] - ldrb r0, [r4, 0x5] - lsls r0, 1 - mov r1, r9 - adds r2, r0, r1 - ldr r0, [sp, 0x14] - cmp r0, 0 - bge _0818F8C8 - adds r0, 0x3 -_0818F8C8: - asrs r0, 2 - adds r0, r2, r0 - muls r0, r7 - movs r1, 0x64 - bl __divsi3 - adds r1, r0, 0 - adds r1, 0x5 - mov r2, r8 - str r1, [r2, 0x14] - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0x18] - movs r2, 0x5 - bl nature_stat_mod - lsls r0, 24 - lsrs r0, 24 - mov r1, r8 - str r0, [r1, 0x14] - 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_818F720 - - thumb_func_start sub_818F904 -sub_818F904: @ 818F904 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r3, r0, 1 - mov r12, r3 - adds r4, r3, r2 - ldrh r5, [r4] - lsls r7, r1, 1 - mov r9, r7 - add r2, r9 - ldrh r3, [r2] - strh r3, [r4] - strh r5, [r2] - ldr r2, =gSaveBlock2Ptr - ldr r5, [r2] - lsls r6, r0, 2 - adds r6, r5, r6 - ldr r3, =0x00000d24 - adds r6, r3 - ldrh r7, [r6] - mov r10, r7 - mov r2, r10 - lsls r2, 22 - mov r8, r2 - lsls r2, r1, 2 - adds r5, r2 - adds r5, r3 - ldrh r4, [r5] - lsls r4, 22 - lsrs r4, 22 - ldr r3, =0xfffffc00 - adds r2, r3, 0 - mov r7, r10 - ands r2, r7 - orrs r2, r4 - strh r2, [r6] - mov r2, r8 - lsrs r2, 22 - mov r8, r2 - ldrh r2, [r5] - ands r3, r2 - mov r7, r8 - orrs r3, r7 - strh r3, [r5] - ldr r2, =gSaveBlock2Ptr - mov r8, r2 - add r12, r0 - add r9, r1 - mov r3, r9 - lsls r4, r3, 1 - mov r7, r12 - lsls r3, r7, 1 - ldr r7, =0x00000d64 - movs r6, 0x2 -_0818F974: - mov r1, r8 - ldr r0, [r1] - adds r0, r7 - adds r2, r0, r3 - ldrh r5, [r2] - adds r0, r4 - ldrh r1, [r0] - strh r1, [r2] - strh r5, [r0] - adds r4, 0x2 - adds r3, 0x2 - subs r6, 0x1 - cmp r6, 0 - bge _0818F974 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818F904 - - thumb_func_start sub_818F9B0 -sub_818F9B0: @ 818F9B0 - push {lr} - ldr r0, =gStringVar1 - ldr r2, =gUnknown_085CCD20 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - ldr r3, =0x00000cb2 - adds r1, r3 - ldrh r1, [r1] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl StringCopy - pop {r0} - bx r0 - .pool - thumb_func_end sub_818F9B0 - - thumb_func_start sub_818F9E0 -sub_818F9E0: @ 818F9E0 - push {lr} - ldr r0, =gStringVar1 - ldr r2, =gUnknown_085CCD20 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - ldr r3, =0x00000cb2 - adds r1, r3 - ldrh r1, [r1] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl StringCopy - ldr r0, =gStringVar2 - ldr r1, =gTrainerBattleOpponent_A - ldrh r1, [r1] - bl sub_8195898 - pop {r0} - bx r0 - .pool - thumb_func_end sub_818F9E0 - - thumb_func_start sub_818FA20 -sub_818FA20: @ 818FA20 - push {r4,r5,lr} - ldr r1, =gUnknown_0203CD70 - movs r0, 0 - str r0, [r1] - ldr r4, =gPlayerParty - adds r0, r4, 0 - movs r1, 0x3A - movs r2, 0 - bl GetMonData - ldr r5, =gUnknown_0203CD74 - str r0, [r5] - adds r4, 0x64 - adds r0, r4, 0 - movs r1, 0x3A - movs r2, 0 - bl GetMonData - ldr r1, [r5] - adds r1, r0 - str r1, [r5] - bl CalculatePlayerPartyCount - ldr r0, =gTrainerBattleOpponent_A - ldrh r0, [r0] - bl sub_8195358 - lsls r0, 16 - lsrs r0, 16 - bl sub_818FBDC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818FA20 - - thumb_func_start sub_818FA74 -sub_818FA74: @ 818FA74 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x30 - adds r5, r2, 0 - str r3, [sp, 0x14] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x10] - lsls r1, 16 - lsrs r1, 16 - str r1, [sp, 0x28] - lsls r5, 24 - lsrs r5, 24 - add r0, sp, 0xC - movs r1, 0x1 - negs r1, r1 - strb r1, [r0] - ldr r0, [sp, 0x28] - bl sub_8190168 - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - str r6, [sp, 0x2C] - bl sub_8165C40 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x64 - ldr r4, [sp, 0x10] - adds r3, r4, 0 - muls r3, r0 - str r3, [sp, 0x18] - ldr r6, =gEnemyParty - adds r0, r3, r6 - ldr r7, =gSaveBlock2Ptr - ldr r4, [r7] - lsls r5, 1 - ldr r3, [sp, 0x28] - lsls r1, r3, 1 - adds r1, r3 - lsls r1, 1 - adds r1, r5, r1 - ldr r6, =0x00000d64 - adds r4, r6 - adds r4, r1 - ldrh r3, [r4] - ldr r7, =gUnknown_0203BC8C - ldr r7, [r7] - mov r8, r7 - lsls r3, 4 - add r3, r8 - ldrh r1, [r3] - ldrb r3, [r3, 0xC] - ldr r6, [sp, 0x2C] - str r6, [sp] - ldrh r4, [r4] - lsls r4, 4 - add r4, r8 - ldrb r4, [r4, 0xB] - str r4, [sp, 0x4] - ldr r7, [sp, 0x14] - str r7, [sp, 0x8] - bl sub_8068634 - add r0, sp, 0xC - movs r1, 0x1 - negs r1, r1 - strb r1, [r0] - movs r6, 0 - ldr r2, [sp, 0x18] - str r2, [sp, 0x1C] - mov r10, r5 - ldr r3, =0x00000d64 - mov r9, r3 - ldr r3, =gUnknown_0203BC8C - mov r4, r10 - str r4, [sp, 0x20] -_0818FB18: - ldr r7, =gSaveBlock2Ptr - ldr r1, [r7] - ldr r2, [sp, 0x28] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 1 - mov r8, r0 - mov r5, r10 - add r5, r8 - add r1, r9 - adds r1, r5 - ldrh r0, [r1] - ldr r1, [r3] - lsls r0, 4 - adds r0, r1 - lsls r4, r6, 1 - adds r0, 0x2 - adds r0, r4 - ldrh r1, [r0] - lsls r2, r6, 24 - lsrs r2, 24 - mov r12, r2 - ldr r7, [sp, 0x1C] - ldr r2, =gEnemyParty - adds r0, r7, r2 - mov r2, r12 - str r3, [sp, 0x24] - bl SetMonMoveSlot - ldr r7, =gSaveBlock2Ptr - ldr r0, [r7] - add r0, r9 - adds r0, r5 - ldrh r0, [r0] - ldr r3, [sp, 0x24] - ldr r1, [r3] - lsls r0, 4 - adds r0, r1 - adds r0, 0x2 - adds r0, r4 - ldrh r0, [r0] - cmp r0, 0xDA - bne _0818FB74 - movs r1, 0 - add r0, sp, 0xC - strb r1, [r0] -_0818FB74: - adds r6, 0x1 - cmp r6, 0x3 - ble _0818FB18 - movs r0, 0x64 - ldr r1, [sp, 0x10] - adds r4, r1, 0 - muls r4, r0 - ldr r0, =gEnemyParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x20 - add r2, sp, 0xC - bl SetMonData - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, [sp, 0x20] - add r1, r8 - ldr r2, =0x00000d64 - adds r0, r2 - adds r0, r1 - ldrh r0, [r0] - ldr r1, =gUnknown_0203BC8C - ldr r1, [r1] - lsls r0, 4 - adds r0, r1 - ldrb r2, [r0, 0xA] - lsls r2, 1 - ldr r0, =gBattleFrontierHeldItems - adds r2, r0 - adds r0, r4, 0 - movs r1, 0xC - bl SetMonData - add sp, 0x30 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818FA74 - - thumb_func_start sub_818FBDC -sub_818FBDC: @ 818FBDC - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - movs r6, 0 - bl ZeroEnemyPartyMons - mov r0, r8 - bl sub_818FC78 - adds r5, r0, 0 - bl Random - adds r4, r0, 0 - bl Random - lsls r4, 16 - lsrs r7, r4, 16 - lsls r0, 16 - orrs r7, r0 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x5 - bls _0818FC46 - movs r4, 0 -_0818FC20: - movs r0, 0x1 - ands r0, r5 - cmp r0, 0 - beq _0818FC3C - lsls r2, r4, 24 - lsrs r2, 24 - adds r0, r6, 0 - mov r1, r8 - adds r3, r7, 0 - bl sub_818FA74 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_0818FC3C: - asrs r5, 1 - adds r4, 0x1 - cmp r4, 0x2 - ble _0818FC20 - b _0818FC6C -_0818FC46: - movs r4, 0x2 -_0818FC48: - movs r0, 0x4 - ands r0, r5 - cmp r0, 0 - beq _0818FC64 - lsls r2, r4, 24 - lsrs r2, 24 - adds r0, r6, 0 - mov r1, r8 - adds r3, r7, 0 - bl sub_818FA74 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_0818FC64: - lsls r5, 1 - subs r4, 0x1 - cmp r4, 0 - bge _0818FC48 -_0818FC6C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_818FBDC - - thumb_func_start sub_818FC78 -sub_818FC78: @ 818FC78 - push {r4,r5,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r5, r4, 0 - bl Random - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _0818FCA2 - adds r0, r4, 0 - movs r1, 0 - bl sub_818FCBC - cmp r0, 0 - bne _0818FCB6 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_818FDB8 - b _0818FCB6 -_0818FCA2: - adds r0, r5, 0 - movs r1, 0 - bl sub_818FDB8 - cmp r0, 0 - bne _0818FCB6 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_818FCBC -_0818FCB6: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_818FC78 - - thumb_func_start sub_818FCBC -sub_818FCBC: @ 818FCBC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0xC] - movs r0, 0 - mov r9, r0 - mov r1, r8 - lsls r1, 2 - str r1, [sp, 0x18] -_0818FCDE: - mov r2, r9 - lsls r0, r2, 2 - mov r2, sp - adds r1, r2, r0 - movs r0, 0 - str r0, [r1] - movs r7, 0 - mov r0, r9 - adds r0, 0x1 - str r0, [sp, 0x14] - adds r5, r1, 0 - mov r1, r9 - lsls r1, 1 - str r1, [sp, 0x10] -_0818FCFA: - movs r6, 0 - adds r2, r7, 0x1 - mov r10, r2 -_0818FD00: - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r2, [sp, 0x18] - adds r0, r1, r2 - ldr r2, =0x00000d24 - adds r0, r2 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - ldr r2, =0x000003fe - cmp r0, r2 - bne _0818FD3C - mov r1, r9 - lsls r0, r1, 24 - lsls r1, r7, 24 - lsrs r0, 24 - lsrs r1, 24 - bl sub_81A5060 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - b _0818FD60 - .pool -_0818FD3C: - mov r2, r8 - lsls r0, r2, 1 - add r0, r8 - lsls r0, 1 - ldr r2, [sp, 0x10] - adds r0, r2, r0 - ldr r2, =0x00000d64 - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - ldr r1, =gUnknown_0203BC8C - ldr r1, [r1] - lsls r0, 4 - adds r0, r1 - lsls r1, r7, 1 - adds r0, 0x2 - adds r0, r1 - ldrh r4, [r0] -_0818FD60: - movs r0, 0x64 - muls r0, r6 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl GetMonData - adds r1, r0, 0 - adds r0, r4, 0 - movs r2, 0 - bl sub_818FFC0 - ldr r1, [r5] - adds r1, r0 - str r1, [r5] - adds r6, 0x1 - cmp r6, 0x2 - ble _0818FD00 - mov r7, r10 - cmp r7, 0x3 - ble _0818FCFA - ldr r0, [sp, 0x14] - mov r9, r0 - cmp r0, 0x2 - ble _0818FCDE - mov r0, sp - ldr r1, [sp, 0xC] - bl sub_818FEB4 - add sp, 0x1C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_818FCBC - - thumb_func_start sub_818FDB8 -sub_818FDB8: @ 818FDB8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0xC] - movs r0, 0 - mov r9, r0 - mov r1, r8 - lsls r1, 2 - str r1, [sp, 0x18] -_0818FDDA: - mov r2, r9 - lsls r0, r2, 2 - mov r2, sp - adds r1, r2, r0 - movs r0, 0 - str r0, [r1] - movs r7, 0 - mov r0, r9 - adds r0, 0x1 - str r0, [sp, 0x14] - adds r5, r1, 0 - mov r1, r9 - lsls r1, 1 - str r1, [sp, 0x10] -_0818FDF6: - movs r6, 0 - adds r2, r7, 0x1 - mov r10, r2 -_0818FDFC: - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r2, [sp, 0x18] - adds r0, r1, r2 - ldr r2, =0x00000d24 - adds r0, r2 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - ldr r2, =0x000003fe - cmp r0, r2 - bne _0818FE38 - mov r1, r9 - lsls r0, r1, 24 - lsls r1, r7, 24 - lsrs r0, 24 - lsrs r1, 24 - bl sub_81A5060 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - b _0818FE5C - .pool -_0818FE38: - mov r2, r8 - lsls r0, r2, 1 - add r0, r8 - lsls r0, 1 - ldr r2, [sp, 0x10] - adds r0, r2, r0 - ldr r2, =0x00000d64 - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - ldr r1, =gUnknown_0203BC8C - ldr r1, [r1] - lsls r0, 4 - adds r0, r1 - lsls r1, r7, 1 - adds r0, 0x2 - adds r0, r1 - ldrh r4, [r0] -_0818FE5C: - movs r0, 0x64 - muls r0, r6 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl GetMonData - adds r1, r0, 0 - adds r0, r4, 0 - movs r2, 0x1 - bl sub_818FFC0 - ldr r1, [r5] - adds r1, r0 - str r1, [r5] - adds r6, 0x1 - cmp r6, 0x2 - ble _0818FDFC - mov r7, r10 - cmp r7, 0x3 - ble _0818FDF6 - ldr r0, [sp, 0x14] - mov r9, r0 - cmp r0, 0x2 - ble _0818FDDA - mov r0, sp - ldr r1, [sp, 0xC] - bl sub_818FEB4 - add sp, 0x1C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_818FDB8 - - thumb_func_start sub_818FEB4 -sub_818FEB4: @ 818FEB4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - mov r10, r0 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0 - str r0, [sp, 0xC] - movs r3, 0x2 - add r0, sp, 0x8 -_0818FECE: - str r3, [r0] - subs r0, 0x4 - subs r3, 0x1 - cmp r3, 0 - bge _0818FECE - mov r3, r10 - ldr r2, [r3] - ldr r0, [r3, 0x4] - cmp r2, r0 - bne _0818FF20 - ldr r0, [r3, 0x8] - cmp r2, r0 - bne _0818FF20 - cmp r1, 0 - beq _0818FFAA - movs r3, 0 - ldr r4, =gBitTable -_0818FEF0: - str r3, [sp, 0x14] - bl Random - movs r1, 0x3 - ands r1, r0 - ldr r3, [sp, 0x14] - cmp r1, 0x3 - beq _0818FF16 - lsls r0, r1, 2 - adds r0, r4 - ldr r1, [r0] - ldr r0, [sp, 0xC] - ands r0, r1 - cmp r0, 0 - bne _0818FF16 - ldr r0, [sp, 0xC] - orrs r0, r1 - str r0, [sp, 0xC] - adds r3, 0x1 -_0818FF16: - cmp r3, 0x2 - bne _0818FEF0 - b _0818FFAA - .pool -_0818FF20: - movs r3, 0 - mov r9, sp - mov r8, r10 -_0818FF26: - adds r2, r3, 0x1 - cmp r2, 0x2 - bgt _0818FF84 - mov r6, r8 - mov r7, r9 - lsls r0, r2, 2 - mov r1, sp - adds r5, r0, r1 - mov r1, r10 - adds r4, r0, r1 -_0818FF3A: - ldr r0, [r6] - ldr r1, [r4] - cmp r0, r1 - bge _0818FF4E - str r1, [r6] - str r0, [r4] - ldr r1, [r7] - ldr r0, [r5] - str r0, [r7] - str r1, [r5] -_0818FF4E: - ldr r1, [r6] - ldr r0, [r4] - cmp r1, r0 - bne _0818FF7A - str r2, [sp, 0x10] - str r3, [sp, 0x14] - bl Random - movs r1, 0x1 - ands r1, r0 - ldr r2, [sp, 0x10] - ldr r3, [sp, 0x14] - cmp r1, 0 - beq _0818FF7A - ldr r1, [r6] - ldr r0, [r4] - str r0, [r6] - str r1, [r4] - ldr r1, [r7] - ldr r0, [r5] - str r0, [r7] - str r1, [r5] -_0818FF7A: - adds r5, 0x4 - adds r4, 0x4 - adds r2, 0x1 - cmp r2, 0x2 - ble _0818FF3A -_0818FF84: - movs r4, 0x4 - add r9, r4 - add r8, r4 - adds r3, 0x1 - cmp r3, 0x1 - ble _0818FF26 - ldr r2, =gBitTable - mov r1, sp - movs r3, 0x1 -_0818FF96: - ldm r1!, {r0} - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ldr r4, [sp, 0xC] - orrs r4, r0 - str r4, [sp, 0xC] - subs r3, 0x1 - cmp r3, 0 - bge _0818FF96 -_0818FFAA: - ldr r0, [sp, 0xC] - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_818FEB4 - - thumb_func_start sub_818FFC0 -sub_818FFC0: @ 818FFC0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - adds r3, r0, 0 - adds r4, r1, 0 - str r2, [sp] - movs r6, 0 - movs r2, 0x14 - cmp r3, 0 - beq _0818FFF0 - ldr r0, =0x0000ffff - cmp r3, r0 - beq _0818FFF0 - ldr r0, =gBattleMoves - lsls r1, r3, 1 - adds r1, r3 - lsls r1, 2 - adds r3, r1, r0 - ldrb r0, [r3, 0x1] - cmp r0, 0 - bne _0818FFFC -_0818FFF0: - movs r0, 0 - b _08190156 - .pool -_0818FFFC: - ldr r1, =gBaseStats - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x6] - mov r10, r1 - ldrb r1, [r0, 0x7] - mov r9, r1 - ldrb r0, [r0, 0x16] - mov r8, r0 - ldrb r3, [r3, 0x2] - str r3, [sp, 0x4] - cmp r0, 0x1A - bne _0819002C - cmp r3, 0x4 - bne _0819002C - ldr r0, [sp] - cmp r0, 0x1 - bne _081900AA - movs r2, 0x8 - b _081900A4 - .pool -_0819002C: - ldr r0, =gUnknown_0831ACE8 - adds r1, r6, r0 - ldrb r0, [r1] - ldr r7, =gUnknown_0831ACE8 - cmp r0, 0xFF - beq _081900A4 - adds r4, r1, 0 -_0819003A: - ldrb r0, [r4] - cmp r0, 0xFE - beq _08190096 - ldrb r0, [r4] - ldr r1, [sp, 0x4] - cmp r0, r1 - bne _08190096 - ldrb r0, [r4, 0x1] - adds r5, r6, 0x1 - cmp r0, r10 - bne _0819006C - adds r1, r6, 0x2 - mov r0, r8 - cmp r0, 0x19 - bne _0819005E - ldrb r0, [r4, 0x2] - cmp r0, 0x28 - bne _0819006C -_0819005E: - adds r0, r1, r7 - ldrb r0, [r0] - muls r0, r2 - movs r1, 0xA - bl __divsi3 - adds r2, r0, 0 -_0819006C: - adds r0, r5, r7 - ldrb r0, [r0] - cmp r0, r9 - bne _08190096 - cmp r10, r9 - beq _08190096 - adds r1, r6, 0x2 - mov r0, r8 - cmp r0, 0x19 - bne _08190088 - adds r0, r1, r7 - ldrb r0, [r0] - cmp r0, 0x28 - bne _08190096 -_08190088: - adds r0, r1, r7 - ldrb r0, [r0] - muls r0, r2 - movs r1, 0xA - bl __divsi3 - adds r2, r0, 0 -_08190096: - adds r4, 0x3 - adds r6, 0x3 - ldr r1, =gUnknown_0831ACE8 - adds r0, r6, r1 - ldrb r0, [r0] - cmp r0, 0xFF - bne _0819003A -_081900A4: - ldr r0, [sp] - cmp r0, 0x1 - beq _081900E0 -_081900AA: - ldr r1, [sp] - cmp r1, 0x1 - bgt _081900BC - cmp r1, 0 - beq _081900C4 - b _08190154 - .pool -_081900BC: - ldr r0, [sp] - cmp r0, 0x2 - beq _08190114 - b _08190154 -_081900C4: - cmp r2, 0xA - beq _08190146 - cmp r2, 0xA - ble _08190146 - cmp r2, 0x28 - beq _0819014A - cmp r2, 0x28 - bgt _081900DA - cmp r2, 0x14 - beq _08190104 - b _08190146 -_081900DA: - cmp r2, 0x50 - bne _08190146 - b _08190100 -_081900E0: - cmp r2, 0xA - beq _08190104 - cmp r2, 0xA - bgt _081900F2 - cmp r2, 0 - beq _08190100 - cmp r2, 0x5 - beq _0819014A - b _08190146 -_081900F2: - cmp r2, 0x28 - beq _08190108 - cmp r2, 0x28 - ble _08190146 - cmp r2, 0x50 - beq _0819010E - b _08190146 -_08190100: - movs r2, 0x8 - b _08190154 -_08190104: - movs r2, 0x2 - b _08190154 -_08190108: - movs r2, 0x2 - negs r2, r2 - b _08190154 -_0819010E: - movs r2, 0x4 - negs r2, r2 - b _08190154 -_08190114: - cmp r2, 0xA - beq _08190146 - cmp r2, 0xA - bgt _08190126 - cmp r2, 0 - beq _0819013A - cmp r2, 0x5 - beq _08190140 - b _08190146 -_08190126: - cmp r2, 0x28 - beq _0819014E - cmp r2, 0x28 - bgt _08190134 - cmp r2, 0x14 - beq _0819014A - b _08190146 -_08190134: - cmp r2, 0x50 - beq _08190152 - b _08190146 -_0819013A: - movs r2, 0x10 - negs r2, r2 - b _08190154 -_08190140: - movs r2, 0x8 - negs r2, r2 - b _08190154 -_08190146: - movs r2, 0 - b _08190154 -_0819014A: - movs r2, 0x4 - b _08190154 -_0819014E: - movs r2, 0xC - b _08190154 -_08190152: - movs r2, 0x14 -_08190154: - adds r0, r2, 0 -_08190156: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_818FFC0 - - thumb_func_start sub_8190168 -sub_8190168: @ 8190168 - push {lr} - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - cmp r0, 0x63 - bls _0819019A - movs r1, 0x6 - cmp r0, 0x77 - bls _0819019A - movs r1, 0x9 - cmp r0, 0x8B - bls _0819019A - movs r1, 0xC - cmp r0, 0x9F - bls _0819019A - movs r1, 0xF - cmp r0, 0xB3 - bls _0819019A - movs r1, 0x12 - cmp r0, 0xC7 - bls _0819019A - movs r1, 0x1F - cmp r0, 0xDB - bhi _0819019A - movs r1, 0x15 -_0819019A: - adds r0, r1, 0 - pop {r1} - bx r1 - thumb_func_end sub_8190168 - - thumb_func_start sub_81901A0 -sub_81901A0: @ 81901A0 - push {r4-r7,lr} - adds r3, r0, 0 - adds r2, r1, 0 - movs r5, 0 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r4, =0x00000d24 - adds r1, r4 - ldrh r1, [r1] - lsls r1, 22 - lsrs r1, 22 - mov r12, r0 - ldr r6, =gUnknown_0860D10C - cmp r1, r2 - beq _081901D8 - mov r7, r12 -_081901C0: - adds r5, 0x1 - cmp r5, 0xF - bgt _081901D8 - ldr r0, [r7] - lsls r1, r5, 2 - adds r0, r1 - adds r0, r4 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - cmp r0, r2 - bne _081901C0 -_081901D8: - cmp r3, 0 - beq _0819026C - cmp r3, 0x3 - bne _081901FC - lsls r0, r5, 2 - adds r1, r0, 0x3 - adds r1, r6 - ldrb r1, [r1] - adds r4, r1, 0 - adds r4, 0x8 - b _08190206 - .pool -_081901FC: - lsls r0, r5, 2 - adds r1, r3, r0 - adds r1, r6 - ldrb r1, [r1] - adds r4, r1, 0x4 -_08190206: - adds r0, r3, r0 - adds r0, r6 - ldrb r2, [r0] - cmp r2, r4 - bge _08190256 - ldr r1, =gUnknown_0860D14C - adds r0, r2, r1 - ldrb r3, [r0] - adds r6, r1, 0 - cmp r3, r5 - beq _08190234 - mov r1, r12 - ldr r0, [r1] - lsls r1, r3, 2 - adds r0, r1 - ldr r3, =0x00000d25 - adds r0, r3 - b _0819024E - .pool -_08190234: - adds r2, 0x1 - cmp r2, r4 - bge _08190256 - adds r0, r2, r6 - ldrb r1, [r0] - cmp r1, r5 - beq _08190234 - mov r3, r12 - ldr r0, [r3] - lsls r1, 2 - adds r0, r1 - ldr r1, =0x00000d25 - adds r0, r1 -_0819024E: - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _08190234 -_08190256: - cmp r2, r4 - beq _08190286 - ldr r0, =gUnknown_0860D14C - adds r0, r2, r0 - ldrb r0, [r0] - b _08190292 - .pool -_0819026C: - mov r3, r12 - ldr r1, [r3] - lsls r0, r5, 2 - adds r0, r6 - ldrb r2, [r0] - lsls r0, r2, 2 - adds r1, r0 - ldr r0, =0x00000d25 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 29 - cmp r0, 0 - bge _08190290 -_08190286: - movs r0, 0xFF - b _08190292 - .pool -_08190290: - adds r0, r2, 0 -_08190292: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81901A0 - - thumb_func_start sub_8190298 -sub_8190298: @ 8190298 - push {lr} - bl sub_81902AC - ldr r1, =gTrainerBattleOpponent_A - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8190298 - - thumb_func_start sub_81902AC -sub_81902AC: @ 81902AC - push {r4,lr} - ldr r0, =gSaveBlock2Ptr - ldr r4, [r0] - ldr r1, =0x00000cb2 - adds r0, r4, r1 - ldrh r0, [r0] - ldr r1, =0x000003ff - bl sub_81901A0 - lsls r0, 2 - adds r4, r0 - ldr r0, =0x00000d24 - adds r4, r0 - ldrh r0, [r4] - lsls r0, 22 - lsrs r0, 22 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81902AC - - thumb_func_start sub_81902E4 -sub_81902E4: @ 81902E4 - push {lr} - ldr r0, =gTrainerBattleOpponent_A - ldrh r0, [r0] - movs r1, 0 - bl sub_8162614 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81902E4 - - thumb_func_start sub_81902F8 -sub_81902F8: @ 81902F8 - push {r4,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - strb r1, [r0] - movs r0, 0x80 - lsls r0, 7 - movs r1, 0 - bl VarSet - ldr r1, [r4] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - bl sub_81A4C30 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81902F8 - - thumb_func_start sub_819033C -sub_819033C: @ 819033C - push {r4,r5,lr} - ldr r5, =gSaveBlock2Ptr - ldr r0, [r5] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r4, [r0] - lsls r4, 30 - lsrs r4, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 24 - ldr r1, [r5] - lsls r4, 1 - lsrs r0, 22 - adds r4, r0 - ldr r3, =0x00000d0c - adds r1, r3 - adds r1, r4 - ldrh r0, [r1] - ldr r2, =0x000003e6 - cmp r0, r2 - bhi _0819036E - adds r0, 0x1 - strh r0, [r1] -_0819036E: - ldr r0, [r5] - ldr r1, =0x00000d1c - adds r0, r1 - adds r1, r0, r4 - ldrh r0, [r1] - cmp r0, r2 - bhi _08190380 - adds r0, 0x1 - strh r0, [r1] -_08190380: - ldr r0, [r5] - adds r1, r0, r3 - adds r1, r4 - ldr r2, =0x00000d14 - adds r0, r2 - adds r0, r4 - ldrh r1, [r1] - ldrh r2, [r0] - cmp r1, r2 - bls _08190396 - strh r1, [r0] -_08190396: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819033C - - thumb_func_start sub_81903B8 -sub_81903B8: @ 81903B8 - push {r4,r5,lr} - ldr r0, =sub_8190400 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gTasks - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r4, r1 - movs r5, 0 - strh r5, [r4, 0x8] - bl sub_81902AC - lsls r0, 16 - lsrs r0, 16 - bl sub_8195358 - strh r0, [r4, 0xA] - strh r5, [r4, 0xC] - strh r5, [r4, 0xE] - ldr r0, =sub_8194B54 - bl SetMainCallback2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81903B8 - - thumb_func_start sub_8190400 -sub_8190400: @ 8190400 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldr r1, =gTasks - lsls r0, 2 - add r0, r10 - lsls r0, 3 - adds r6, r0, r1 - movs r0, 0xA - ldrsh r5, [r6, r0] - movs r2, 0xC - ldrsh r1, [r6, r2] - mov r9, r1 - movs r0, 0xE - ldrsh r7, [r6, r0] - movs r1, 0x8 - ldrsh r4, [r6, r1] - cmp r4, 0x1 - beq _08190508 - cmp r4, 0x1 - bgt _08190440 - cmp r4, 0 - beq _0819044E - b _08190772 - .pool -_08190440: - cmp r4, 0x2 - bne _08190446 - b _08190570 -_08190446: - cmp r4, 0x3 - bne _0819044C - b _08190634 -_0819044C: - b _08190772 -_0819044E: - movs r0, 0 - bl SetHBlankCallback - movs r0, 0 - bl SetVBlankCallback - movs r0, 0x1 - bl EnableInterrupts - str r4, [sp, 0x4] - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x05006000 - add r0, sp, 0x4 - bl CpuSet - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0860CE84 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - ldr r0, =gUnknown_0860CEB4 - bl InitWindows - bl DeactivateAllTextPrinters - ldr r0, =gUnknown_02022E14 - strh r4, [r0] - ldr r0, =gUnknown_02022E16 - strh r4, [r0] - ldr r0, =gUnknown_02022E18 - strh r4, [r0] - ldr r0, =gUnknown_02022E1A - strh r4, [r0] - ldr r0, =gUnknown_02022E20 - strh r4, [r0] - ldr r0, =gUnknown_02022E22 - strh r4, [r0] - mov r2, r9 - cmp r2, 0x2 - bne _081904DC - ldr r0, =gUnknown_02022E1C - strh r4, [r0] - ldr r0, =gUnknown_02022E1E - strh r4, [r0] - b _081904E6 - .pool -_081904DC: - ldr r0, =gUnknown_02022E1C - strh r4, [r0] - ldr r1, =gUnknown_02022E1E - movs r0, 0xA0 - strh r0, [r1] -_081904E6: - 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] - b _08190772 - .pool -_08190508: - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4C - movs r1, 0 - bl SetGpuReg - movs r0, 0x40 - movs r1, 0 - bl SetGpuReg - movs r0, 0x44 - movs r1, 0 - bl SetGpuReg - movs r0, 0x42 - movs r1, 0 - bl SetGpuReg - movs r0, 0x46 - movs r1, 0 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4A - movs r1, 0x3F - bl SetGpuReg - bl ResetPaletteFade - bl ResetSpriteData - bl FreeAllSpritePalettes - ldr r1, =gReservedSpritePaletteCount - movs r0, 0x4 - strb r0, [r1] - b _08190602 - .pool -_08190570: - ldr r1, =gUnknown_08D83D50 - movs r5, 0x80 - lsls r5, 6 - movs r7, 0 - str r7, [sp] - movs r0, 0x2 - adds r2, r5, 0 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - ldr r1, =gUnknown_08D84970 - movs r4, 0x1 - str r4, [sp] - movs r0, 0x2 - adds r2, r5, 0 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - ldr r1, =gUnknown_08D84F00 - movs r2, 0x80 - lsls r2, 4 - str r4, [sp] - movs r0, 0x3 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - ldr r0, =gUnknown_0860CF50 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_08D85358 - movs r4, 0x80 - lsls r4, 2 - movs r1, 0 - adds r2, r4, 0 - bl LoadCompressedPalette - ldr r0, =gUnknown_08D85444 - movs r1, 0x80 - lsls r1, 1 - adds r2, r4, 0 - bl LoadCompressedPalette - ldr r0, =gUnknown_08D85600 - movs r1, 0xF0 - movs r2, 0x20 - bl LoadCompressedPalette - mov r0, r9 - cmp r0, 0x2 - bne _081905DE - ldr r0, =gUnknown_08D854C8 - movs r1, 0x50 - movs r2, 0x20 - bl LoadCompressedPalette -_081905DE: - str r7, [sp, 0x8] - add r0, sp, 0x8 - ldr r1, =gPlttBufferFaded - ldr r2, =0x05000100 - bl CpuSet - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg -_08190602: - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] - b _08190772 - .pool -_08190634: - ldr r0, =sub_8194B70 - bl SetVBlankCallback - ldr r4, =gUnknown_0203CD78 - movs r0, 0x14 - bl AllocZeroed - str r0, [r4] - movs r6, 0 - lsls r5, 24 - movs r2, 0xFF -_0819064A: - ldr r1, [r4] - adds r1, r6 - ldrb r0, [r1] - orrs r0, r2 - strb r0, [r1] - adds r6, 0x1 - cmp r6, 0xF - ble _0819064A - bl sub_80D2F04 - ldr r0, =sub_8190CD4 - movs r1, 0 - bl CreateTask - 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, 0 - strh r1, [r0, 0x8] - strh r1, [r0, 0xC] - mov r1, r9 - strh r1, [r0, 0xE] - strh r7, [r0, 0x10] - mov r2, r9 - cmp r2, 0x2 - bne _081906A8 - lsrs r1, r5, 24 - movs r0, 0 - bl sub_819314C - ldr r0, =gUnknown_0203CD78 - ldr r1, [r0] - movs r0, 0x1 - strb r0, [r1, 0x10] - b _081906B0 - .pool -_081906A8: - lsrs r1, r5, 24 - movs r0, 0 - bl sub_81924E0 -_081906B0: - movs r1, 0xFA - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - mov r0, r9 - cmp r0, 0 - beq _0819076C - ldr r5, =gUnknown_0860D068 - adds r0, r5, 0 - movs r1, 0x78 - movs r2, 0x4 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r7, r0, 24 - lsls r4, r7, 4 - adds r4, r7 - lsls r4, 2 - ldr r1, =gSprites - mov r8, r1 - add r4, r8 - adds r0, r4, 0 - movs r1, 0 - bl StartSpriteAnim - strh r6, [r4, 0x2E] - adds r0, r5, 0 - movs r1, 0x78 - movs r2, 0x9C - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r7, r0, 24 - lsls r4, r7, 4 - adds r4, r7 - lsls r4, 2 - add r4, r8 - adds r0, r4, 0 - movs r1, 0x1 - bl StartSpriteAnim - strh r6, [r4, 0x2E] - ldr r5, =gUnknown_0860D050 - adds r0, r5, 0 - movs r1, 0x6 - movs r2, 0x50 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - mov r2, r8 - adds r4, r0, r2 - adds r0, r4, 0 - movs r1, 0 - bl StartSpriteAnim - strh r6, [r4, 0x2E] - movs r0, 0 - strh r0, [r4, 0x30] - mov r1, r9 - cmp r1, 0x1 - bne _08190746 - adds r0, r4, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_08190746: - adds r0, r5, 0 - movs r1, 0xEA - movs r2, 0x50 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r7, r0, 24 - lsls r4, r7, 4 - adds r4, r7 - lsls r4, 2 - add r4, r8 - adds r0, r4, 0 - movs r1, 0x1 - bl StartSpriteAnim - strh r6, [r4, 0x2E] - movs r0, 0x1 - strh r0, [r4, 0x30] -_0819076C: - mov r0, r10 - bl DestroyTask -_08190772: - 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_8190400 - - thumb_func_start sub_8190790 -sub_8190790: @ 8190790 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x22] - adds r1, r0, 0x4 - strh r1, [r2, 0x22] - movs r3, 0x2E - ldrsh r0, [r2, r3] - cmp r0, 0 - beq _081907D4 - lsls r0, r1, 16 - asrs r0, 16 - movs r1, 0x20 - negs r1, r1 - cmp r0, r1 - blt _081907BC - adds r3, r2, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r3] -_081907BC: - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x28 - bne _081907F0 - ldr r0, =SpriteCallbackDummy - str r0, [r2, 0x1C] - b _081907F0 - .pool -_081907D4: - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0xBF - ble _081907F0 - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - movs r3, 0x32 - ldrsh r1, [r2, r3] - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldrh r0, [r2, 0x34] - bl sub_818D8F0 -_081907F0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8190790 - - thumb_func_start sub_81907F8 -sub_81907F8: @ 81907F8 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x22] - subs r1, r0, 0x4 - strh r1, [r2, 0x22] - movs r3, 0x2E - ldrsh r0, [r2, r3] - cmp r0, 0 - beq _08190838 - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0xC0 - bgt _08190820 - adds r3, r2, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r3] -_08190820: - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x28 - bne _08190858 - ldr r0, =SpriteCallbackDummy - str r0, [r2, 0x1C] - b _08190858 - .pool -_08190838: - lsls r0, r1, 16 - asrs r0, 16 - movs r1, 0x20 - negs r1, r1 - cmp r0, r1 - bgt _08190858 - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - movs r3, 0x32 - ldrsh r1, [r2, r3] - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldrh r0, [r2, 0x34] - bl sub_818D8F0 -_08190858: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81907F8 - - thumb_func_start sub_8190860 -sub_8190860: @ 8190860 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x20] - adds r1, r0, 0x4 - strh r1, [r2, 0x20] - movs r3, 0x2E - ldrsh r0, [r2, r3] - cmp r0, 0 - beq _081908A4 - lsls r0, r1, 16 - asrs r0, 16 - movs r1, 0x20 - negs r1, r1 - cmp r0, r1 - blt _0819088C - adds r3, r2, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r3] -_0819088C: - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x40 - bne _081908C0 - ldr r0, =SpriteCallbackDummy - str r0, [r2, 0x1C] - b _081908C0 - .pool -_081908A4: - lsls r1, 16 - ldr r0, =0x010f0000 - cmp r1, r0 - ble _081908C0 - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - movs r3, 0x32 - ldrsh r1, [r2, r3] - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldrh r0, [r2, 0x34] - bl sub_818D8F0 -_081908C0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8190860 - - thumb_func_start sub_81908CC -sub_81908CC: @ 81908CC - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x20] - subs r1, r0, 0x4 - strh r1, [r2, 0x20] - movs r3, 0x2E - ldrsh r0, [r2, r3] - cmp r0, 0 - beq _08190910 - lsls r1, 16 - movs r0, 0x88 - lsls r0, 17 - cmp r1, r0 - bgt _081908F6 - adds r3, r2, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r3] -_081908F6: - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x40 - bne _08190930 - ldr r0, =SpriteCallbackDummy - str r0, [r2, 0x1C] - b _08190930 - .pool -_08190910: - lsls r0, r1, 16 - asrs r0, 16 - movs r1, 0x20 - negs r1, r1 - cmp r0, r1 - bgt _08190930 - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - movs r3, 0x32 - ldrsh r1, [r2, r3] - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldrh r0, [r2, 0x34] - bl sub_818D8F0 -_08190930: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81908CC - - thumb_func_start sub_8190938 -sub_8190938: @ 8190938 - push {lr} - adds r1, r0, 0 - movs r2, 0x34 - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _0819094A - adds r0, r1, 0 - bl sub_80D30DC -_0819094A: - pop {r0} - bx r0 - thumb_func_end sub_8190938 - - thumb_func_start sub_8190950 -sub_8190950: @ 8190950 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08190962 - adds r0, r4, 0 - bl sub_80D30DC -_08190962: - ldrh r0, [r4, 0x22] - adds r1, r0, 0x4 - strh r1, [r4, 0x22] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _081909A4 - lsls r0, r1, 16 - asrs r0, 16 - movs r1, 0x10 - negs r1, r1 - cmp r0, r1 - blt _0819098A - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_0819098A: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x28 - bne _081909C0 - ldr r0, =sub_8190938 - str r0, [r4, 0x1C] - b _081909C0 - .pool -_081909A4: - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0xAF - ble _081909C0 - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - movs r2, 0x32 - ldrsh r1, [r4, r2] - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - adds r0, r4, 0 - bl sub_80D2EF8 -_081909C0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8190950 - - thumb_func_start sub_81909CC -sub_81909CC: @ 81909CC - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081909DE - adds r0, r4, 0 - bl sub_80D30DC -_081909DE: - ldrh r0, [r4, 0x22] - subs r1, r0, 0x4 - strh r1, [r4, 0x22] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _08190A1C - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0xB0 - bgt _08190A02 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_08190A02: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x28 - bne _08190A3C - ldr r0, =sub_8190938 - str r0, [r4, 0x1C] - b _08190A3C - .pool -_08190A1C: - lsls r0, r1, 16 - asrs r0, 16 - movs r1, 0x10 - negs r1, r1 - cmp r0, r1 - bgt _08190A3C - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - movs r2, 0x32 - ldrsh r1, [r4, r2] - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - adds r0, r4, 0 - bl sub_80D2EF8 -_08190A3C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81909CC - - thumb_func_start sub_8190A48 -sub_8190A48: @ 8190A48 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08190A5A - adds r0, r4, 0 - bl sub_80D30DC -_08190A5A: - ldrh r0, [r4, 0x20] - adds r1, r0, 0x4 - strh r1, [r4, 0x20] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _08190A9C - lsls r0, r1, 16 - asrs r0, 16 - movs r1, 0x10 - negs r1, r1 - cmp r0, r1 - blt _08190A82 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_08190A82: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x40 - bne _08190AB8 - ldr r0, =sub_8190938 - str r0, [r4, 0x1C] - b _08190AB8 - .pool -_08190A9C: - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0xFF - ble _08190AB8 - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - movs r2, 0x32 - ldrsh r1, [r4, r2] - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - adds r0, r4, 0 - bl sub_80D2EF8 -_08190AB8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8190A48 - - thumb_func_start sub_8190AC4 -sub_8190AC4: @ 8190AC4 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08190AD6 - adds r0, r4, 0 - bl sub_80D30DC -_08190AD6: - ldrh r0, [r4, 0x20] - subs r1, r0, 0x4 - strh r1, [r4, 0x20] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _08190B14 - lsls r1, 16 - movs r0, 0x80 - lsls r0, 17 - cmp r1, r0 - bgt _08190AFC - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_08190AFC: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x40 - bne _08190B34 - ldr r0, =sub_8190938 - str r0, [r4, 0x1C] - b _08190B34 - .pool -_08190B14: - lsls r0, r1, 16 - asrs r0, 16 - movs r1, 0x10 - negs r1, r1 - cmp r0, r1 - bgt _08190B34 - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - movs r2, 0x32 - ldrsh r1, [r4, r2] - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - adds r0, r4, 0 - bl sub_80D2EF8 -_08190B34: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8190AC4 - - thumb_func_start sub_8190B40 -sub_8190B40: @ 8190B40 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r3, r0, 0 - movs r0, 0x2E - ldrsh r6, [r3, r0] - ldr r2, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r4, r0, r2 - movs r7, 0x10 - ldrsh r1, [r4, r7] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r1, 0xA - ldrsh r0, [r0, r1] - ldr r1, =gUnknown_0860D080 - adds r0, r1 - ldrb r0, [r0] - mov r10, r0 - ldr r1, =gSaveBlock2Ptr - ldr r5, [r1] - ldr r7, =0x00000cb2 - adds r0, r5, r7 - ldrh r0, [r0] - mov r12, r0 - movs r7, 0xE - ldrsh r0, [r4, r7] - mov r9, r2 - mov r8, r1 - cmp r0, 0x1 - bne _08190C0C - movs r1, 0x30 - ldrsh r0, [r3, r1] - cmp r0, 0 - beq _08190BFC - mov r2, r10 - lsls r0, r2, 2 - adds r1, r5, r0 - ldr r7, =0x00000d25 - adds r1, r7 - ldrb r2, [r1] - lsls r1, r2, 29 - adds r4, r0, 0 - cmp r1, 0 - bge _08190BB6 - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r1, [r0, 0x10] - subs r1, 0x1 - lsls r0, r2, 27 - lsrs r0, 30 - cmp r1, r0 - blt _08190C32 -_08190BB6: - mov r1, r8 - ldr r0, [r1] - adds r0, r4 - ldr r2, =0x00000d25 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _08190BD4 - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - subs r0, 0x1 - cmp r0, r12 - blt _08190C32 -_08190BD4: - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - add r0, r9 - movs r7, 0x8 - ldrsh r0, [r0, r7] - b _08190C4C - .pool -_08190BFC: - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0 - bne _08190C32 - b _08190C48 - .pool -_08190C0C: - movs r2, 0x30 - ldrsh r0, [r3, r2] - cmp r0, 0 - beq _08190C28 - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0x1 - bls _08190C32 - movs r7, 0x8 - ldrsh r0, [r4, r7] - b _08190C4C - .pool -_08190C28: - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0 - beq _08190C48 -_08190C32: - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - b _08190C5C - .pool -_08190C48: - movs r1, 0x8 - ldrsh r0, [r4, r1] -_08190C4C: - cmp r0, 0x2 - bne _08190C5C - adds r0, r3, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_08190C5C: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8190B40 - - thumb_func_start sub_8190C6C -sub_8190C6C: @ 8190C6C - push {lr} - adds r3, r0, 0 - movs r0, 0x2E - ldrsh r1, [r3, r0] - ldr r2, =gTasks - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r1, r0, r2 - movs r2, 0xE - ldrsh r0, [r1, r2] - cmp r0, 0x1 - bne _08190C9C - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0 - bne _08190CA6 - b _08190CC0 - .pool -_08190C9C: - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0x1 - beq _08190CC0 -_08190CA6: - movs r2, 0x8 - ldrsh r0, [r1, r2] - cmp r0, 0x2 - bne _08190CCE - adds r0, r3, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - b _08190CCE - .pool -_08190CC0: - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_08190CCE: - pop {r0} - bx r0 - thumb_func_end sub_8190C6C - - thumb_func_start sub_8190CD4 -sub_8190CD4: @ 8190CD4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r1, =gTasks - lsls r0, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r3, 0xE - ldrsh r2, [r0, r3] - mov r9, r2 - movs r4, 0x10 - ldrsh r7, [r0, r4] - movs r5, 0x8 - ldrsh r0, [r0, r5] - cmp r0, 0x8 - bls _08190D06 - bl _08192202 -_08190D06: - lsls r0, 2 - ldr r1, =_08190D18 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08190D18: - .4byte _08190D3C - .4byte _08190D7C - .4byte _08190DA8 - .4byte _08190E48 - .4byte _08191FF8 - .4byte _08192038 - .4byte _08192078 - .4byte _081920BC - .4byte _08192106 -_08190D3C: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _08190D50 - bl _08192202 -_08190D50: - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - ldr r1, =gTasks - mov r6, r8 - lsls r0, r6, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r1, 0x1 - strh r1, [r0, 0x8] - bl _08192202 - .pool -_08190D7C: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08190D8C - bl _08192202 -_08190D8C: - mov r1, r8 - lsls r0, r1, 2 - add r0, r8 - lsls r0, 3 - ldr r2, =gTasks - adds r0, r2 - movs r1, 0x2 - strh r1, [r0, 0x8] - bl _08192202 - .pool -_08190DA8: - mov r0, r8 - bl sub_819221C - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x8 - bgt _08190DBE - cmp r6, 0x1 - bge _08190DF0 - bl _08192202 -_08190DBE: - cmp r6, 0x9 - beq _08190DC6 - bl _08192202 -_08190DC6: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r1, =gTasks - mov r3, r8 - lsls r0, r3, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r1, 0x8 - strh r1, [r0, 0x8] - bl _08192202 - .pool -_08190DF0: - ldr r1, =gTasks - mov r4, r8 - lsls r2, r4, 2 - adds r0, r2, r4 - lsls r0, 3 - adds r0, r1 - strh r6, [r0, 0x12] - movs r5, 0xC - ldrsh r0, [r0, r5] - movs r1, 0 - mov r9, r2 - cmp r0, 0 - beq _08190E0C - movs r1, 0x9 -_08190E0C: - adds r6, r1, 0 - adds r0, r6, 0 - adds r0, 0x9 - cmp r6, r0 - bge _08190E32 - adds r5, r0, 0 -_08190E18: - lsls r4, r6, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0x2 - bl CopyWindowToVram - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r6, 0x1 - cmp r6, r5 - blt _08190E18 -_08190E32: - ldr r0, =gTasks - mov r1, r9 - add r1, r8 - lsls r1, 3 - adds r1, r0 - movs r0, 0x3 - strh r0, [r1, 0x8] - bl _08192202 - .pool -_08190E48: - mov r6, r8 - lsls r1, r6, 2 - adds r0, r1, r6 - lsls r0, 3 - ldr r2, =gTasks - adds r0, r2 - movs r3, 0x12 - ldrsh r6, [r0, r3] - subs r0, r6, 0x1 - mov r9, r1 - cmp r0, 0x7 - bls _08190E64 - bl _08192202 -_08190E64: - lsls r0, 2 - ldr r1, =_08190E78 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08190E78: - .4byte _08190E98 - .4byte _08191234 - .4byte _081915CC - .4byte _08191B08 - .4byte _08190E98 - .4byte _08191234 - .4byte _0819187C - .4byte _08191D68 -_08190E98: - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r4, =gTasks - adds r0, r4 - movs r5, 0xC - ldrsh r2, [r0, r5] - cmp r2, 0 - beq _08190ED4 - ldr r0, =gUnknown_02022E14 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E16 - strh r1, [r0] - ldr r0, =gUnknown_02022E18 - strh r1, [r0] - ldr r1, =gUnknown_02022E1A - movs r0, 0xA0 - strh r0, [r1] - b _08190EE6 - .pool -_08190ED4: - ldr r0, =gUnknown_02022E14 - strh r2, [r0] - ldr r1, =gUnknown_02022E16 - movs r0, 0xA0 - strh r0, [r1] - ldr r0, =gUnknown_02022E18 - strh r2, [r0] - ldr r0, =gUnknown_02022E1A - strh r2, [r0] -_08190EE6: - cmp r6, 0x1 - bne _08190F9C - ldr r5, =gUnknown_0203CD78 - ldr r0, [r5] - ldrb r1, [r0, 0x10] - cmp r1, 0 - bne _08190F50 - ldr r0, =gUnknown_02022E1C - strh r1, [r0] - ldr r1, =gUnknown_02022E1E - movs r6, 0xA0 - lsls r6, 1 - adds r0, r6, 0 - strh r0, [r1] - ldr r3, =gUnknown_0860D080 - ldr r2, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r2 - movs r4, 0xA - ldrsh r1, [r0, r4] - adds r1, r3 - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r2 - ldrb r2, [r0, 0xC] - movs r0, 0x10 - orrs r0, r2 - ldrb r1, [r1] - bl sub_81924E0 - b _08191084 - .pool -_08190F50: - ldr r1, =gUnknown_02022E1C - movs r6, 0x80 - lsls r6, 1 - adds r0, r6, 0 - strh r0, [r1] - ldr r0, =gUnknown_02022E1E - movs r4, 0 - strh r4, [r0] - ldr r3, =gUnknown_0860D080 - ldr r2, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r2 - movs r6, 0xA - ldrsh r1, [r0, r6] - adds r1, r3 - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r2 - ldrb r2, [r0, 0xC] - movs r0, 0x10 - orrs r0, r2 - ldrb r1, [r1] - bl sub_81924E0 - ldr r0, [r5] - strb r4, [r0, 0x10] - b _08191084 - .pool -_08190F9C: - ldr r6, =gUnknown_0203CD78 - ldr r1, [r6] - ldrb r5, [r1, 0x10] - cmp r5, 0 - bne _08190FF8 - ldr r4, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r4 - movs r2, 0xA - ldrsh r0, [r0, r2] - adds r2, r0, 0 - subs r2, 0x10 - lsls r0, r2, 24 - lsrs r0, 24 - adds r1, 0x11 - bl sub_8192F08 - ldr r0, =gUnknown_02022E1C - strh r5, [r0] - ldr r1, =gUnknown_02022E1E - movs r3, 0xA0 - lsls r3, 1 - adds r0, r3, 0 - strh r0, [r1] - ldr r2, [r6] - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r4 - ldrb r1, [r0, 0xC] - movs r0, 0x10 - orrs r0, r1 - ldrb r1, [r2, 0x11] - bl sub_81924E0 - b _08191084 - .pool -_08190FF8: - cmp r5, 0x2 - bne _0819104C - ldr r4, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r4 - movs r5, 0xA - ldrsh r0, [r0, r5] - adds r2, r0, 0 - subs r2, 0x10 - lsls r0, r2, 24 - lsrs r0, 24 - adds r1, 0x11 - bl sub_8192F08 - ldr r1, =gUnknown_02022E1C - movs r0, 0 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - movs r2, 0xA0 - lsls r2, 1 - adds r0, r2, 0 - strh r0, [r1] - ldr r2, [r6] - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r4 - ldrb r1, [r0, 0xC] - movs r0, 0x10 - orrs r0, r1 - ldrb r1, [r2, 0x12] - bl sub_81924E0 - b _08191084 - .pool -_0819104C: - ldr r1, =gUnknown_02022E1C - movs r3, 0x80 - lsls r3, 1 - adds r0, r3, 0 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - movs r0, 0xA0 - strh r0, [r1] - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - movs r4, 0xA - ldrsh r0, [r0, r4] - adds r2, r0, 0 - subs r2, 0x10 - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0xC] - movs r0, 0x10 - orrs r0, r1 - lsls r1, r2, 24 - lsrs r1, 24 - bl sub_819314C -_08191084: - movs r6, 0 - ldr r5, =gUnknown_0203CD78 - mov r10, r5 - ldr r3, =gSprites - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r1, =gTasks - adds r5, r0, r1 - mov r12, r6 - adds r4, r3, 0 - adds r4, 0x1C - movs r7, 0x1 -_0819109E: - cmp r6, 0x1 - bgt _0819110C - mov r2, r10 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191150 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_8190790 - str r1, [r0] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r0, [r5, 0xC] - eors r0, r7 - strh r0, [r1, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - mov r1, r12 - strh r1, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r1, [r0, 0x34] - b _08191150 - .pool -_0819110C: - mov r2, r10 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191150 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_8190950 - str r1, [r0] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r0, [r5, 0xC] - eors r0, r7 - strh r0, [r1, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - mov r1, r12 - strh r1, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] -_08191150: - adds r6, 0x1 - cmp r6, 0x7 - ble _0819109E - movs r6, 0x8 - ldr r2, =gUnknown_0203CD78 - mov r12, r2 - ldr r3, =gSprites - ldr r1, =gTasks - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r5, r0, r1 - movs r4, 0 - adds r7, r3, 0 - adds r7, 0x1C -_0819116E: - cmp r6, 0x9 - bgt _081911D4 - mov r1, r12 - ldr r0, [r1] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191214 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_8190790 - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r5, 0xC] - strh r1, [r0, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r1, [r0, 0x34] - b _08191214 - .pool -_081911D4: - mov r2, r12 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191214 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_8190950 - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r5, 0xC] - strh r1, [r0, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] -_08191214: - adds r6, 0x1 - cmp r6, 0xF - ble _0819116E - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r3, =gTasks - adds r0, r3 - movs r2, 0 - movs r1, 0x4 - bl _08191FE8 - .pool -_08191234: - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r4, =gTasks - adds r0, r4 - movs r5, 0xC - ldrsh r2, [r0, r5] - cmp r2, 0 - beq _08191278 - ldr r0, =gUnknown_02022E14 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E16 - strh r1, [r0] - ldr r0, =gUnknown_02022E18 - strh r1, [r0] - ldr r1, =gUnknown_02022E1A - ldr r2, =0x0000ff60 - adds r0, r2, 0 - strh r0, [r1] - b _0819128C - .pool -_08191278: - ldr r0, =gUnknown_02022E14 - strh r2, [r0] - ldr r1, =gUnknown_02022E16 - ldr r3, =0x0000ff60 - adds r0, r3, 0 - strh r0, [r1] - ldr r0, =gUnknown_02022E18 - strh r2, [r0] - ldr r0, =gUnknown_02022E1A - strh r2, [r0] -_0819128C: - cmp r6, 0x2 - bne _0819133C - ldr r5, =gUnknown_0203CD78 - ldr r0, [r5] - ldrb r1, [r0, 0x10] - cmp r1, 0 - bne _081912F4 - ldr r0, =gUnknown_02022E1C - strh r1, [r0] - ldr r1, =gUnknown_02022E1E - movs r0, 0xA0 - strh r0, [r1] - ldr r3, =gUnknown_0860D080 - ldr r2, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r2 - movs r4, 0xA - ldrsh r1, [r0, r4] - adds r1, r3 - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r2 - ldrb r2, [r0, 0xC] - movs r0, 0x4 - orrs r0, r2 - ldrb r1, [r1] - bl sub_81924E0 - b _0819141C - .pool -_081912F4: - ldr r0, =gUnknown_02022E1C - movs r4, 0 - strh r4, [r0] - ldr r0, =gUnknown_02022E1E - strh r4, [r0] - ldr r3, =gUnknown_0860D080 - ldr r2, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r2 - movs r6, 0xA - ldrsh r1, [r0, r6] - adds r1, r3 - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r2 - ldrb r2, [r0, 0xC] - movs r0, 0x4 - orrs r0, r2 - ldrb r1, [r1] - bl sub_81924E0 - ldr r0, [r5] - strb r4, [r0, 0x10] - b _0819141C - .pool -_0819133C: - ldr r6, =gUnknown_0203CD78 - ldr r1, [r6] - ldrb r5, [r1, 0x10] - cmp r5, 0 - bne _08191394 - ldr r4, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r4 - movs r2, 0xA - ldrsh r0, [r0, r2] - adds r2, r0, 0 - subs r2, 0x10 - lsls r0, r2, 24 - lsrs r0, 24 - adds r1, 0x11 - bl sub_8192F08 - ldr r0, =gUnknown_02022E1C - strh r5, [r0] - ldr r1, =gUnknown_02022E1E - movs r0, 0xA0 - strh r0, [r1] - ldr r2, [r6] - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r4 - ldrb r1, [r0, 0xC] - movs r0, 0x4 - orrs r0, r1 - ldrb r1, [r2, 0x11] - bl sub_81924E0 - b _0819141C - .pool -_08191394: - cmp r5, 0x2 - bne _081913E4 - ldr r4, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r4 - movs r3, 0xA - ldrsh r0, [r0, r3] - adds r2, r0, 0 - subs r2, 0x10 - lsls r0, r2, 24 - lsrs r0, 24 - adds r1, 0x11 - bl sub_8192F08 - ldr r1, =gUnknown_02022E1C - movs r0, 0 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - movs r0, 0xA0 - strh r0, [r1] - ldr r2, [r6] - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r4 - ldrb r1, [r0, 0xC] - movs r0, 0x4 - orrs r0, r1 - ldrb r1, [r2, 0x12] - bl sub_81924E0 - b _0819141C - .pool -_081913E4: - ldr r1, =gUnknown_02022E1C - movs r4, 0x80 - lsls r4, 1 - adds r0, r4, 0 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - movs r0, 0 - strh r0, [r1] - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - movs r5, 0xA - ldrsh r0, [r0, r5] - adds r2, r0, 0 - subs r2, 0x10 - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0xC] - movs r0, 0x4 - orrs r0, r1 - lsls r1, r2, 24 - lsrs r1, 24 - bl sub_819314C -_0819141C: - movs r6, 0 - ldr r0, =gUnknown_0203CD78 - mov r10, r0 - ldr r3, =gSprites - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r1, =gTasks - adds r5, r0, r1 - mov r12, r6 - adds r4, r3, 0 - adds r4, 0x1C - movs r7, 0x1 -_08191436: - cmp r6, 0x1 - bgt _081914A4 - mov r2, r10 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _081914E8 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_81907F8 - str r1, [r0] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r0, [r5, 0xC] - eors r0, r7 - strh r0, [r1, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - mov r1, r12 - strh r1, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r1, [r0, 0x34] - b _081914E8 - .pool -_081914A4: - mov r2, r10 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _081914E8 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_81909CC - str r1, [r0] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r0, [r5, 0xC] - eors r0, r7 - strh r0, [r1, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - mov r1, r12 - strh r1, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] -_081914E8: - adds r6, 0x1 - cmp r6, 0x7 - ble _08191436 - movs r6, 0x8 - ldr r2, =gUnknown_0203CD78 - mov r12, r2 - ldr r3, =gSprites - ldr r1, =gTasks - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r5, r0, r1 - movs r4, 0 - adds r7, r3, 0 - adds r7, 0x1C -_08191506: - cmp r6, 0x9 - bgt _0819156C - mov r1, r12 - ldr r0, [r1] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _081915AC - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_81907F8 - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r5, 0xC] - strh r1, [r0, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r1, [r0, 0x34] - b _081915AC - .pool -_0819156C: - mov r2, r12 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _081915AC - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_81909CC - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r5, 0xC] - strh r1, [r0, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] -_081915AC: - adds r6, 0x1 - cmp r6, 0xF - ble _08191506 - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r3, =gTasks - adds r0, r3 - movs r2, 0 - movs r1, 0x5 - bl _08191FE8 - .pool -_081915CC: - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r4, =gTasks - adds r0, r4 - movs r5, 0xC - ldrsh r2, [r0, r5] - cmp r2, 0 - beq _0819160C - ldr r0, =gUnknown_02022E14 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E16 - strh r1, [r0] - ldr r2, =gUnknown_02022E18 - movs r6, 0x80 - lsls r6, 1 - adds r0, r6, 0 - strh r0, [r2] - ldr r0, =gUnknown_02022E1A - strh r1, [r0] - b _08191622 - .pool -_0819160C: - ldr r1, =gUnknown_02022E14 - movs r3, 0x80 - lsls r3, 1 - adds r0, r3, 0 - strh r0, [r1] - ldr r0, =gUnknown_02022E16 - strh r2, [r0] - ldr r0, =gUnknown_02022E18 - strh r2, [r0] - ldr r0, =gUnknown_02022E1A - strh r2, [r0] -_08191622: - ldr r0, =gUnknown_0203CD78 - ldr r4, [r0] - ldrb r0, [r4, 0x10] - cmp r0, 0 - bne _08191688 - ldr r1, =gUnknown_02022E1C - movs r4, 0x80 - lsls r4, 1 - adds r0, r4, 0 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - movs r0, 0xA0 - strh r0, [r1] - ldr r3, =gUnknown_0860D080 - ldr r2, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r2 - movs r5, 0xA - ldrsh r1, [r0, r5] - adds r1, r3 - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r2 - ldrb r2, [r0, 0xC] - movs r0, 0x8 - orrs r0, r2 - ldrb r1, [r1] - bl sub_81924E0 - b _081916C6 - .pool -_08191688: - ldr r1, =gUnknown_02022E1C - movs r6, 0x80 - lsls r6, 1 - adds r0, r6, 0 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - movs r0, 0 - strh r0, [r1] - ldr r3, =gUnknown_0860D15C - ldr r2, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r2 - movs r5, 0xA - ldrsh r1, [r0, r5] - lsls r1, 2 - subs r1, 0x1 - ldrb r4, [r4, 0x10] - adds r1, r4 - adds r1, r3 - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r2 - ldrb r2, [r0, 0xC] - movs r0, 0x8 - orrs r0, r2 - ldrb r1, [r1] - bl sub_819314C -_081916C6: - movs r6, 0 - ldr r0, =gUnknown_0203CD78 - mov r10, r0 - ldr r3, =gSprites - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r1, =gTasks - adds r5, r0, r1 - mov r12, r6 - adds r4, r3, 0 - adds r4, 0x1C - movs r7, 0x1 -_081916E0: - cmp r6, 0x1 - bgt _08191754 - mov r2, r10 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191798 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_8190860 - str r1, [r0] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r0, [r5, 0xC] - eors r0, r7 - strh r0, [r1, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - mov r1, r12 - strh r1, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r1, [r0, 0x34] - b _08191798 - .pool -_08191754: - mov r2, r10 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191798 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_8190A48 - str r1, [r0] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r0, [r5, 0xC] - eors r0, r7 - strh r0, [r1, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - mov r1, r12 - strh r1, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] -_08191798: - adds r6, 0x1 - cmp r6, 0x7 - ble _081916E0 - movs r6, 0x8 - ldr r2, =gUnknown_0203CD78 - mov r12, r2 - ldr r3, =gSprites - ldr r1, =gTasks - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r5, r0, r1 - movs r4, 0 - adds r7, r3, 0 - adds r7, 0x1C -_081917B6: - cmp r6, 0x9 - bgt _0819181C - mov r1, r12 - ldr r0, [r1] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _0819185C - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_8190860 - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r5, 0xC] - strh r1, [r0, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r1, [r0, 0x34] - b _0819185C - .pool -_0819181C: - mov r2, r12 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _0819185C - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_8190A48 - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r5, 0xC] - strh r1, [r0, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] -_0819185C: - adds r6, 0x1 - cmp r6, 0xF - ble _081917B6 - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r3, =gTasks - adds r0, r3 - movs r2, 0 - movs r1, 0x6 - b _08191FE8 - .pool -_0819187C: - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r4, =gTasks - adds r0, r4 - movs r5, 0xC - ldrsh r2, [r0, r5] - cmp r2, 0 - beq _081918BC - ldr r0, =gUnknown_02022E14 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E16 - strh r1, [r0] - ldr r2, =gUnknown_02022E18 - movs r6, 0x80 - lsls r6, 1 - adds r0, r6, 0 - strh r0, [r2] - ldr r0, =gUnknown_02022E1A - strh r1, [r0] - b _081918D2 - .pool -_081918BC: - ldr r1, =gUnknown_02022E14 - movs r3, 0x80 - lsls r3, 1 - adds r0, r3, 0 - strh r0, [r1] - ldr r0, =gUnknown_02022E16 - strh r2, [r0] - ldr r0, =gUnknown_02022E18 - strh r2, [r0] - ldr r0, =gUnknown_02022E1A - strh r2, [r0] -_081918D2: - ldr r0, =gUnknown_0203CD78 - ldr r2, [r0] - ldrb r0, [r2, 0x10] - cmp r0, 0 - bne _08191924 - ldr r1, =gUnknown_02022E1C - movs r4, 0x80 - lsls r4, 1 - adds r0, r4, 0 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - movs r0, 0xA0 - strh r0, [r1] - ldr r1, =gTasks - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0xC] - movs r0, 0x8 - orrs r0, r1 - ldrb r1, [r2, 0x11] - bl sub_81924E0 - b _08191958 - .pool -_08191924: - ldr r1, =gUnknown_02022E1C - movs r0, 0 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - movs r0, 0xA0 - strh r0, [r1] - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - movs r5, 0xA - ldrsh r0, [r0, r5] - adds r2, r0, 0 - subs r2, 0x10 - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0xC] - movs r0, 0x8 - orrs r0, r1 - lsls r1, r2, 24 - lsrs r1, 24 - bl sub_819314C -_08191958: - movs r6, 0 - ldr r0, =gUnknown_0203CD78 - mov r10, r0 - ldr r3, =gSprites - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r1, =gTasks - adds r5, r0, r1 - mov r12, r6 - adds r4, r3, 0 - adds r4, 0x1C - movs r7, 0x1 -_08191972: - cmp r6, 0x1 - bgt _081919E0 - mov r2, r10 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191A24 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_8190860 - str r1, [r0] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r0, [r5, 0xC] - eors r0, r7 - strh r0, [r1, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - mov r1, r12 - strh r1, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r1, [r0, 0x34] - b _08191A24 - .pool -_081919E0: - mov r2, r10 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191A24 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_8190A48 - str r1, [r0] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r0, [r5, 0xC] - eors r0, r7 - strh r0, [r1, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - mov r1, r12 - strh r1, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] -_08191A24: - adds r6, 0x1 - cmp r6, 0x7 - ble _08191972 - movs r6, 0x8 - ldr r2, =gUnknown_0203CD78 - mov r12, r2 - ldr r3, =gSprites - ldr r1, =gTasks - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r5, r0, r1 - movs r4, 0 - adds r7, r3, 0 - adds r7, 0x1C -_08191A42: - cmp r6, 0x9 - bgt _08191AA8 - mov r1, r12 - ldr r0, [r1] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191AE8 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_8190860 - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r5, 0xC] - strh r1, [r0, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r1, [r0, 0x34] - b _08191AE8 - .pool -_08191AA8: - mov r2, r12 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191AE8 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_8190A48 - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r5, 0xC] - strh r1, [r0, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] -_08191AE8: - adds r6, 0x1 - cmp r6, 0xF - ble _08191A42 - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r3, =gTasks - adds r0, r3 - movs r2, 0 - movs r1, 0x6 - b _08191FE8 - .pool -_08191B08: - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r4, =gTasks - adds r0, r4 - movs r5, 0xC - ldrsh r2, [r0, r5] - cmp r2, 0 - beq _08191B48 - ldr r0, =gUnknown_02022E14 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E16 - strh r1, [r0] - ldr r2, =gUnknown_02022E18 - movs r6, 0xFF - lsls r6, 8 - adds r0, r6, 0 - strh r0, [r2] - ldr r0, =gUnknown_02022E1A - strh r1, [r0] - b _08191B5E - .pool -_08191B48: - ldr r1, =gUnknown_02022E14 - movs r3, 0xFF - lsls r3, 8 - adds r0, r3, 0 - strh r0, [r1] - ldr r0, =gUnknown_02022E16 - strh r2, [r0] - ldr r0, =gUnknown_02022E18 - strh r2, [r0] - ldr r0, =gUnknown_02022E1A - strh r2, [r0] -_08191B5E: - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0x1 - bne _08191B94 - ldr r1, =gUnknown_02022E1C - movs r0, 0 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - movs r0, 0xA0 - strh r0, [r1] - b _08191B9E - .pool -_08191B94: - ldr r0, =gUnknown_02022E1C - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E1E - strh r1, [r0] -_08191B9E: - ldr r4, =gUnknown_0860D15C - ldr r5, =gUnknown_0203CD78 - ldr r3, [r5] - ldr r2, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r2 - movs r6, 0xA - ldrsh r1, [r0, r6] - lsls r1, 2 - subs r1, 0x1 - ldrb r3, [r3, 0x10] - adds r1, r3 - adds r1, r4 - mov r4, r9 - add r4, r8 - lsls r4, 3 - adds r4, r2 - ldrb r2, [r4, 0xC] - movs r0, 0x2 - orrs r0, r2 - ldrb r1, [r1] - bl sub_819314C - movs r6, 0 - ldr r7, =gSprites - mov r12, r6 - mov r10, r5 - adds r5, r7, 0 - adds r5, 0x1C -_08191BDC: - cmp r6, 0x1 - bgt _08191C50 - mov r1, r10 - ldr r0, [r1] - adds r3, r0, r6 - ldrb r0, [r3] - cmp r0, 0xFF - beq _08191C96 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =sub_81908CC - str r1, [r0] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r4, 0xC] - movs r2, 0x1 - eors r1, r2 - strh r1, [r0, 0x2E] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - mov r2, r12 - strh r2, [r0, 0x30] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r6, [r0, 0x32] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r1, [r0, 0x34] - b _08191C96 - .pool -_08191C50: - mov r3, r10 - ldr r0, [r3] - adds r3, r0, r6 - ldrb r0, [r3] - cmp r0, 0xFF - beq _08191C96 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =sub_8190AC4 - str r1, [r0] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r4, 0xC] - movs r2, 0x1 - eors r1, r2 - strh r1, [r0, 0x2E] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - mov r1, r12 - strh r1, [r0, 0x30] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r6, [r0, 0x32] -_08191C96: - adds r6, 0x1 - cmp r6, 0x7 - ble _08191BDC - movs r6, 0x8 - ldr r2, =gUnknown_0203CD78 - mov r12, r2 - ldr r3, =gSprites - ldr r1, =gTasks - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r5, r0, r1 - movs r4, 0 - adds r7, r3, 0 - adds r7, 0x1C -_08191CB4: - cmp r6, 0x9 - bgt _08191D1C - mov r1, r12 - ldr r0, [r1] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191D5C - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_81908CC - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r5, 0xC] - strh r1, [r0, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r1, [r0, 0x34] - b _08191D5C - .pool -_08191D1C: - mov r2, r12 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191D5C - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_8190AC4 - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r5, 0xC] - strh r1, [r0, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] -_08191D5C: - adds r6, 0x1 - cmp r6, 0xF - ble _08191CB4 - b _08191FDA - .pool -_08191D68: - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r4, =gTasks - adds r0, r4 - movs r5, 0xC - ldrsh r2, [r0, r5] - cmp r2, 0 - beq _08191DA8 - ldr r0, =gUnknown_02022E14 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E16 - strh r1, [r0] - ldr r2, =gUnknown_02022E18 - movs r6, 0xFF - lsls r6, 8 - adds r0, r6, 0 - strh r0, [r2] - ldr r0, =gUnknown_02022E1A - strh r1, [r0] - b _08191DBE - .pool -_08191DA8: - ldr r1, =gUnknown_02022E14 - movs r3, 0xFF - lsls r3, 8 - adds r0, r3, 0 - strh r0, [r1] - ldr r0, =gUnknown_02022E16 - strh r2, [r0] - ldr r0, =gUnknown_02022E18 - strh r2, [r0] - ldr r0, =gUnknown_02022E1A - strh r2, [r0] -_08191DBE: - ldr r0, =gUnknown_0203CD78 - ldr r2, [r0] - ldrb r0, [r2, 0x10] - cmp r0, 0x2 - bne _08191E10 - ldr r1, =gUnknown_02022E1C - movs r4, 0x80 - lsls r4, 1 - adds r0, r4, 0 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - movs r0, 0xA0 - strh r0, [r1] - ldr r1, =gTasks - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0xC] - movs r0, 0x2 - orrs r0, r1 - ldrb r1, [r2, 0x12] - bl sub_81924E0 - b _08191E44 - .pool -_08191E10: - ldr r1, =gUnknown_02022E1C - movs r0, 0 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - movs r0, 0xA0 - strh r0, [r1] - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - movs r5, 0xA - ldrsh r0, [r0, r5] - adds r2, r0, 0 - subs r2, 0x10 - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0xC] - movs r0, 0x2 - orrs r0, r1 - lsls r1, r2, 24 - lsrs r1, 24 - bl sub_819314C -_08191E44: - movs r6, 0 - ldr r0, =gUnknown_0203CD78 - mov r10, r0 - ldr r3, =gSprites - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r1, =gTasks - adds r5, r0, r1 - mov r12, r6 - adds r4, r3, 0 - adds r4, 0x1C - movs r7, 0x1 -_08191E5E: - cmp r6, 0x1 - bgt _08191ECC - mov r2, r10 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191F10 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_81908CC - str r1, [r0] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r0, [r5, 0xC] - eors r0, r7 - strh r0, [r1, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - mov r1, r12 - strh r1, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r1, [r0, 0x34] - b _08191F10 - .pool -_08191ECC: - mov r2, r10 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191F10 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_8190AC4 - str r1, [r0] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r0, [r5, 0xC] - eors r0, r7 - strh r0, [r1, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - mov r1, r12 - strh r1, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] -_08191F10: - adds r6, 0x1 - cmp r6, 0x7 - ble _08191E5E - movs r6, 0x8 - ldr r2, =gUnknown_0203CD78 - mov r12, r2 - ldr r3, =gSprites - ldr r1, =gTasks - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r5, r0, r1 - movs r4, 0 - adds r7, r3, 0 - adds r7, 0x1C -_08191F2E: - cmp r6, 0x9 - bgt _08191F94 - mov r1, r12 - ldr r0, [r1] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191FD4 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_81908CC - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r5, 0xC] - strh r1, [r0, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r1, [r0, 0x34] - b _08191FD4 - .pool -_08191F94: - mov r2, r12 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191FD4 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_8190AC4 - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r5, 0xC] - strh r1, [r0, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] -_08191FD4: - adds r6, 0x1 - cmp r6, 0xF - ble _08191F2E -_08191FDA: - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r3, =gTasks - adds r0, r3 - movs r2, 0 - movs r1, 0x7 -_08191FE8: - strh r1, [r0, 0x8] - strh r2, [r0, 0x12] - b _08192202 - .pool -_08191FF8: - mov r4, r8 - lsls r0, r4, 2 - add r0, r8 - lsls r0, 3 - ldr r5, =gTasks - adds r1, r0, r5 - ldrh r0, [r1, 0x12] - adds r0, 0x1 - strh r0, [r1, 0x12] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x29 - beq _08192100 - ldr r1, =gUnknown_02022E16 - ldrh r0, [r1] - subs r0, 0x4 - strh r0, [r1] - ldr r1, =gUnknown_02022E1A - ldrh r0, [r1] - subs r0, 0x4 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - b _081920A4 - .pool -_08192038: - mov r6, r8 - lsls r0, r6, 2 - add r0, r8 - lsls r0, 3 - ldr r2, =gTasks - adds r1, r0, r2 - ldrh r0, [r1, 0x12] - adds r0, 0x1 - strh r0, [r1, 0x12] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x29 - beq _08192100 - ldr r1, =gUnknown_02022E16 - ldrh r0, [r1] - adds r0, 0x4 - strh r0, [r1] - ldr r1, =gUnknown_02022E1A - ldrh r0, [r1] - adds r0, 0x4 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - b _081920E8 - .pool -_08192078: - mov r3, r8 - lsls r0, r3, 2 - add r0, r8 - lsls r0, 3 - ldr r4, =gTasks - adds r1, r0, r4 - ldrh r0, [r1, 0x12] - adds r0, 0x1 - strh r0, [r1, 0x12] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x41 - beq _08192100 - ldr r1, =gUnknown_02022E14 - ldrh r0, [r1] - subs r0, 0x4 - strh r0, [r1] - ldr r1, =gUnknown_02022E18 - ldrh r0, [r1] - subs r0, 0x4 - strh r0, [r1] - ldr r1, =gUnknown_02022E1C -_081920A4: - ldrh r0, [r1] - subs r0, 0x4 - strh r0, [r1] - b _08192202 - .pool -_081920BC: - mov r5, r8 - lsls r0, r5, 2 - add r0, r8 - lsls r0, 3 - ldr r6, =gTasks - adds r1, r0, r6 - ldrh r0, [r1, 0x12] - adds r0, 0x1 - strh r0, [r1, 0x12] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x41 - beq _08192100 - ldr r1, =gUnknown_02022E14 - ldrh r0, [r1] - adds r0, 0x4 - strh r0, [r1] - ldr r1, =gUnknown_02022E18 - ldrh r0, [r1] - adds r0, 0x4 - strh r0, [r1] - ldr r1, =gUnknown_02022E1C -_081920E8: - ldrh r0, [r1] - adds r0, 0x4 - strh r0, [r1] - b _08192202 - .pool -_08192100: - movs r0, 0x2 - strh r0, [r1, 0x8] - b _08192202 -_08192106: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08192202 - movs r6, 0 - ldr r4, =gUnknown_0203CD78 -_08192116: - cmp r6, 0x1 - bgt _08192134 - ldr r0, [r4] - adds r1, r0, r6 - ldrb r0, [r1] - cmp r0, 0xFF - beq _0819214E - bl sub_818D8F0 - b _0819214E - .pool -_08192134: - ldr r0, [r4] - adds r1, r0, r6 - ldrb r0, [r1] - cmp r0, 0xFF - beq _0819214E - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl sub_80D2EF8 -_0819214E: - adds r6, 0x1 - cmp r6, 0x7 - ble _08192116 - movs r6, 0x8 - ldr r4, =gUnknown_0203CD78 -_08192158: - cmp r6, 0x9 - bgt _08192174 - ldr r0, [r4] - adds r1, r0, r6 - ldrb r0, [r1] - cmp r0, 0xFF - beq _0819218E - bl sub_818D8F0 - b _0819218E - .pool -_08192174: - ldr r0, [r4] - adds r1, r0, r6 - ldrb r0, [r1] - cmp r0, 0xFF - beq _0819218E - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl sub_80D2EF8 -_0819218E: - adds r6, 0x1 - cmp r6, 0xF - ble _08192158 - bl sub_80D2F9C - ldr r4, =gUnknown_0203CD78 - ldr r0, [r4] - bl Free - movs r5, 0 - str r5, [r4] - bl FreeAllWindowBuffers - mov r0, r9 - cmp r0, 0 - bne _081921C4 - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 - b _081921FC - .pool -_081921C4: - ldr r0, =sub_8194220 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r6, r0, 24 - ldr r2, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r2 - strh r5, [r1, 0x8] - strh r5, [r1, 0xA] - movs r0, 0x3 - strh r0, [r1, 0xC] - mov r3, r8 - lsls r0, r3, 2 - add r0, r8 - lsls r0, 3 - adds r0, r2 - ldrh r0, [r0, 0x10] - strh r0, [r1, 0xE] - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r2 - ldrh r0, [r0, 0x14] - strh r0, [r1, 0x10] -_081921FC: - mov r0, r8 - bl DestroyTask -_08192202: - 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_8190CD4 - - thumb_func_start sub_819221C -sub_819221C: @ 819221C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - movs r7, 0 - ldr r2, =gTasks - lsls r0, 2 - add r0, r9 - lsls r0, 3 - adds r0, r2 - mov r12, r0 - movs r1, 0x10 - ldrsh r6, [r0, r1] - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r2 - movs r3, 0xA - ldrsh r5, [r0, r3] - ldr r0, =gUnknown_0860D080 - adds r0, r5, r0 - ldrb r0, [r0] - mov r10, r0 - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - mov r8, r0 - ldr r1, =gMain - ldrh r4, [r1, 0x2E] - movs r0, 0x3 - ands r0, r4 - adds r2, r1, 0 - cmp r0, 0 - beq _0819226E - movs r7, 0x9 -_0819226E: - mov r3, r12 - movs r1, 0xE - ldrsh r0, [r3, r1] - cmp r0, 0 - bne _0819227A - b _081924CC -_0819227A: - cmp r0, 0x1 - beq _08192280 - b _081923B0 -_08192280: - movs r0, 0x40 - ands r0, r4 - cmp r0, 0 - beq _081922BA - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0 - bne _081922BA - cmp r5, 0 - bne _081922B4 - movs r5, 0xF - b _081922B6 - .pool -_081922B4: - subs r5, 0x1 -_081922B6: - movs r7, 0x1 - b _08192360 -_081922BA: - ldrh r1, [r2, 0x2E] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081922E2 - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0 - bne _081922E2 - cmp r5, 0xF - bne _081922DC - movs r5, 0 - b _081922DE - .pool -_081922DC: - adds r5, 0x1 -_081922DE: - movs r7, 0x2 - b _08192360 -_081922E2: - ldrh r1, [r2, 0x2E] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08192304 - ldr r0, =gUnknown_0203CD78 - ldr r1, [r0] - ldrb r0, [r1, 0x10] - cmp r0, 0 - beq _08192304 - subs r0, 0x1 - strb r0, [r1, 0x10] - movs r7, 0x3 - b _08192360 - .pool -_08192304: - ldrh r1, [r2, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08192360 - ldr r2, =gSaveBlock2Ptr - ldr r0, [r2] - mov r3, r10 - lsls r1, r3, 2 - adds r0, r1 - ldr r2, =0x00000d25 - adds r0, r2 - ldrb r3, [r0] - lsls r0, r3, 29 - mov r12, r1 - cmp r0, 0 - bge _0819233C - ldr r0, =gUnknown_0203CD78 - ldr r2, [r0] - ldrb r4, [r2, 0x10] - subs r1, r4, 0x1 - lsls r0, r3, 27 - lsrs r0, 30 - cmp r1, r0 - bge _0819233C - adds r0, r4, 0x1 - strb r0, [r2, 0x10] - movs r7, 0x4 -_0819233C: - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - add r0, r12 - ldr r1, =0x00000d25 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _08192360 - ldr r0, =gUnknown_0203CD78 - ldr r3, [r0] - ldrb r1, [r3, 0x10] - subs r0, r1, 0x1 - cmp r0, r8 - bge _08192360 - adds r0, r1, 0x1 - strb r0, [r3, 0x10] - movs r7, 0x4 -_08192360: - cmp r7, 0x9 - beq _08192366 - b _081924A0 -_08192366: - ldr r0, =gUnknown_0203CD78 - ldr r3, [r0] - ldrb r0, [r3, 0x10] - cmp r0, 0 - beq _081923A0 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - ldr r2, =gTasks - adds r1, r2 - ldr r2, =gUnknown_0860D1A0 - lsrs r0, r5, 31 - adds r0, r5, r0 - asrs r0, 1 - lsls r0, 2 - subs r0, 0x1 - ldrb r3, [r3, 0x10] - adds r0, r3 - b _08192482 - .pool -_081923A0: - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r3, =gTasks - adds r0, r3 - b _0819249E - .pool -_081923B0: - movs r0, 0x40 - ands r0, r4 - cmp r0, 0 - beq _081923DE - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0x1 - bne _081923DE - cmp r5, 0x10 - bne _081923D8 - ldr r0, =gUnknown_0860D19C - add r0, r8 - ldrb r5, [r0] - b _081923DA - .pool -_081923D8: - subs r5, 0x1 -_081923DA: - movs r7, 0x5 - b _08192446 -_081923DE: - ldrh r1, [r2, 0x2E] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0819240E - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0x1 - bne _0819240E - ldr r0, =gUnknown_0860D19C - add r0, r8 - ldrb r0, [r0] - cmp r5, r0 - bne _08192408 - movs r5, 0x10 - b _0819240A - .pool -_08192408: - adds r5, 0x1 -_0819240A: - movs r7, 0x6 - b _08192446 -_0819240E: - ldrh r1, [r2, 0x2E] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0819242C - ldr r0, =gUnknown_0203CD78 - ldr r1, [r0] - ldrb r0, [r1, 0x10] - cmp r0, 0 - beq _0819242C - movs r7, 0x7 - subs r0, 0x1 - b _08192444 - .pool -_0819242C: - ldrh r1, [r2, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08192446 - ldr r0, =gUnknown_0203CD78 - ldr r1, [r0] - ldrb r0, [r1, 0x10] - cmp r0, 0x1 - bhi _08192446 - movs r7, 0x8 - adds r0, 0x1 -_08192444: - strb r0, [r1, 0x10] -_08192446: - cmp r7, 0x9 - bne _081924A0 - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r1, [r0, 0x10] - cmp r1, 0 - bne _08192470 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - ldr r2, =gTasks - adds r1, r2 - ldr r2, =gUnknown_0860D1C0 - ldrb r0, [r0, 0x11] - b _08192482 - .pool -_08192470: - cmp r1, 0x2 - bne _08192494 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - ldr r3, =gTasks - adds r1, r3 - ldr r2, =gUnknown_0860D1C0 - ldrb r0, [r0, 0x12] -_08192482: - adds r0, r2 - ldrb r0, [r0] - strh r0, [r1, 0xA] - b _081924A0 - .pool -_08192494: - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks - adds r0, r1 -_0819249E: - strh r5, [r0, 0xA] -_081924A0: - cmp r7, 0 - beq _081924CC - cmp r7, 0x9 - beq _081924CC - movs r0, 0x5 - bl PlaySE - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - strh r5, [r0, 0xA] - mov r2, r9 - lsls r0, r2, 2 - add r0, r9 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0xC] - movs r2, 0x1 - eors r1, r2 - strh r1, [r0, 0xC] -_081924CC: - adds r0, r7, 0 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_819221C - - thumb_func_start sub_81924E0 -sub_81924E0: @ 81924E0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x58 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x1C] - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x20] - movs r5, 0 - movs r0, 0 - str r0, [sp, 0x28] - movs r1, 0 - str r1, [sp, 0x2C] - movs r2, 0 - str r2, [sp, 0x30] - movs r4, 0 - movs r0, 0x24 - bl AllocZeroed - mov r8, r0 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r3, [sp, 0x20] - lsls r0, r3, 2 - adds r0, r1, r0 - ldr r2, =0x00000d24 - adds r0, r2 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - str r0, [sp, 0x24] - movs r0, 0x1 - ldr r3, [sp, 0x1C] - ands r0, r3 - cmp r0, 0 - beq _08192538 - movs r5, 0x8 - movs r4, 0x9 - str r4, [sp, 0x28] - movs r4, 0x2 -_08192538: - movs r0, 0x2 - ldr r2, [sp, 0x1C] - ands r0, r2 - cmp r0, 0 - beq _08192548 - movs r3, 0x80 - lsls r3, 1 - str r3, [sp, 0x2C] -_08192548: - movs r0, 0x4 - ldr r2, [sp, 0x1C] - ands r0, r2 - cmp r0, 0 - beq _08192556 - movs r3, 0xA0 - str r3, [sp, 0x30] -_08192556: - movs r0, 0x8 - ldr r2, [sp, 0x1C] - ands r0, r2 - cmp r0, 0 - beq _08192564 - ldr r3, =0xffffff00 - str r3, [sp, 0x2C] -_08192564: - movs r0, 0x10 - ldr r2, [sp, 0x1C] - ands r0, r2 - cmp r0, 0 - beq _08192574 - movs r3, 0xA0 - negs r3, r3 - str r3, [sp, 0x30] -_08192574: - ldr r0, =0x000003ff - ldr r2, [sp, 0x24] - cmp r2, r0 - bne _08192598 - ldrb r0, [r1, 0x8] - bl sub_806F000 - lsls r0, 16 - lsrs r0, 16 - b _081925B6 - .pool -_08192598: - ldr r0, =0x000003fe - ldr r3, [sp, 0x24] - cmp r3, r0 - bne _081925AC - bl sub_8195910 - b _081925B2 - .pool -_081925AC: - ldr r0, [sp, 0x24] - bl sub_8162AA0 -_081925B2: - lsls r0, 24 - lsrs r0, 24 -_081925B6: - ldr r2, [sp, 0x2C] - adds r2, 0x30 - ldr r3, [sp, 0x30] - adds r3, 0x40 - adds r1, r4, 0 - adds r1, 0xC - str r1, [sp] - ldr r1, =0x0000ffff - str r1, [sp, 0x4] - movs r1, 0x1 - bl sub_818D8AC - ldr r1, =gUnknown_0203CD78 - ldr r1, [r1] - adds r1, r5 - strb r0, [r1] - movs r0, 0x1E - ldr r4, [sp, 0x1C] - ands r0, r4 - cmp r0, 0 - beq _081925FC - ldr r2, =gSprites - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_081925FC: - movs r7, 0 - ldr r0, [sp, 0x20] - lsls r0, 1 - str r0, [sp, 0x3C] - adds r1, r5, 0x2 - ldr r2, [sp, 0x28] - lsls r2, 24 - str r2, [sp, 0x44] - ldr r3, [sp, 0x28] - adds r3, 0x4 - str r3, [sp, 0x40] - ldr r4, [sp, 0x20] - adds r0, r4 - ldr r6, =gUnknown_0203CD78 - ldr r2, =gSprites - mov r10, r2 - adds r4, r1, 0 - lsls r5, r0, 1 - movs r3, 0 - mov r9, r3 -_08192624: - ldr r0, =0x000003ff - ldr r1, [sp, 0x24] - cmp r1, r0 - bne _08192660 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000d64 - adds r0, r2 - adds r0, r5 - ldrh r0, [r0] - ldr r1, =gUnknown_0860D340 - adds r1, r7, r1 - ldrb r2, [r1] - ldr r3, [sp, 0x2C] - orrs r2, r3 - b _081926B0 - .pool -_08192660: - ldr r0, =0x000003fe - ldr r3, [sp, 0x24] - cmp r3, r0 - bne _08192690 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000d64 - adds r0, r1 - adds r0, r5 - ldrh r0, [r0] - ldr r1, =gUnknown_0860D340 - adds r1, r7, r1 - ldrb r2, [r1] - ldr r3, [sp, 0x2C] - orrs r2, r3 - b _081926B0 - .pool -_08192690: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r3, =0x00000d64 - adds r0, r3 - adds r0, r5 - ldrh r1, [r0] - ldr r0, =gUnknown_0203BC8C - ldr r0, [r0] - lsls r1, 4 - adds r1, r0 - ldrh r0, [r1] - ldr r1, =gUnknown_0860D340 - adds r1, r7, r1 - ldrb r2, [r1] - ldr r1, [sp, 0x2C] - orrs r2, r1 -_081926B0: - ldr r1, =gUnknown_0860D343 - adds r1, r7, r1 - ldrb r3, [r1] - ldr r1, [sp, 0x30] - adds r3, r1 - mov r1, r9 - str r1, [sp] - str r1, [sp, 0x4] - movs r1, 0x1 - str r1, [sp, 0x8] - ldr r1, =sub_8190938 - bl sub_80D2CC4 - ldr r1, [r6] - adds r1, r4 - strb r0, [r1] - ldr r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r10 - ldrb r1, [r0, 0x5] - movs r2, 0xD - negs r2, r2 - ands r1, r2 - strb r1, [r0, 0x5] - movs r0, 0x1E - ldr r3, [sp, 0x1C] - ands r0, r3 - cmp r0, 0 - beq _0819270A - ldr r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r10 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_0819270A: - adds r4, 0x1 - adds r5, 0x2 - adds r7, 0x1 - cmp r7, 0x2 - ble _08192624 - add r0, sp, 0xC - movs r2, 0 - movs r3, 0x2 - strb r3, [r0, 0x5] - strb r2, [r0, 0x6] - strb r2, [r0, 0x7] - adds r1, r0, 0 - adds r0, r2, 0 - strb r0, [r1, 0x8] - adds r0, r1, 0 - ldrb r0, [r0, 0x7] - strb r0, [r1, 0x9] - adds r0, r1, 0 - strb r3, [r0, 0xA] - strb r2, [r0, 0xB] - adds r3, r0, 0 - ldrb r2, [r3, 0xC] - movs r1, 0x10 - negs r1, r1 - adds r0, r1, 0 - ands r0, r2 - strb r0, [r3, 0xC] - adds r2, r3, 0 - movs r0, 0xE0 - strb r0, [r2, 0xC] - ldrb r0, [r2, 0xD] - ands r1, r0 - strb r1, [r2, 0xD] - adds r1, r2, 0 - movs r0, 0xD0 - strb r0, [r1, 0xD] - movs r7, 0 - ldr r0, =0x000003ff - ldr r4, [sp, 0x24] - cmp r4, r0 - bne _08192784 - ldr r0, =gTrainerClassToNameIndex - adds r0, 0x3C - ldrb r5, [r0] - b _081927A2 - .pool -_08192784: - ldr r0, =0x000003fe - ldr r1, [sp, 0x24] - cmp r1, r0 - bne _08192798 - bl sub_8195924 - b _0819279E - .pool -_08192798: - ldr r0, [sp, 0x24] - bl GetFrontierOpponentClass -_0819279E: - lsls r0, 24 - lsrs r5, r0, 24 -_081927A2: - ldr r2, =gTrainerClassNames - movs r0, 0xD - adds r1, r5, 0 - muls r1, r0 - adds r0, r7, r1 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0xFF - beq _081927CA - ldr r3, =gStringVar1 - adds r0, r1, r2 - adds r2, r7, r0 -_081927BA: - adds r0, r7, r3 - ldrb r1, [r2] - strb r1, [r0] - adds r2, 0x1 - adds r7, 0x1 - ldrb r0, [r2] - cmp r0, 0xFF - bne _081927BA -_081927CA: - ldr r5, =gStringVar1 - adds r1, r7, r5 - movs r0, 0 - strb r0, [r1] - adds r0, r7, 0x1 - adds r0, r5 - movs r1, 0xFF - strb r1, [r0] - ldr r0, =0x000003ff - ldr r2, [sp, 0x24] - cmp r2, r0 - bne _08192800 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - adds r0, r5, 0 - bl StringAppend - b _08192836 - .pool -_08192800: - ldr r0, =0x000003fe - ldr r3, [sp, 0x24] - cmp r3, r0 - bne _08192824 - ldr r4, =gStringVar2 - adds r0, r4, 0 - bl sub_8195938 - adds r0, r5, 0 - adds r1, r4, 0 - bl StringAppend - b _08192836 - .pool -_08192824: - ldr r4, =gStringVar2 - ldr r1, [sp, 0x24] - adds r0, r4, 0 - bl sub_8195898 - adds r0, r5, 0 - adds r1, r4, 0 - bl StringAppend -_08192836: - add r0, sp, 0xC - ldrb r0, [r0, 0x5] - ldr r4, =gStringVar1 - add r1, sp, 0xC - ldrb r3, [r1, 0xA] - adds r1, r4, 0 - movs r2, 0xD0 - bl GetStringCenterAlignXOffsetWithLetterSpacing - add r1, sp, 0xC - movs r5, 0 - strb r0, [r1, 0x8] - str r4, [sp, 0xC] - adds r0, r1, 0 - add r4, sp, 0x28 - ldrb r4, [r4] - strb r4, [r0, 0x4] - ldr r0, [sp, 0x44] - lsrs r4, r0, 24 - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - add r0, sp, 0xC - movs r1, 0 - movs r2, 0 - bl AddTextPrinter - add r0, sp, 0xC - strb r5, [r0, 0xA] - movs r7, 0 - adds r6, r0, 0 - ldr r1, [sp, 0x3C] - ldr r2, [sp, 0x20] - adds r0, r1, r2 - lsls r0, 1 - mov r9, r0 - movs r3, 0xB - mov r10, r3 -_0819288A: - ldr r0, =gUnknown_0860D346 - adds r0, r7, r0 - ldrb r0, [r0] - strb r0, [r6, 0x9] - ldr r0, =0x000003ff - ldr r4, [sp, 0x24] - cmp r4, r0 - bne _081928C0 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - lsls r0, r7, 1 - add r0, r9 - ldr r2, =0x00000d64 - adds r1, r2 - b _081928FA - .pool -_081928C0: - ldr r0, =0x000003fe - ldr r4, [sp, 0x24] - cmp r4, r0 - bne _081928E4 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - lsls r0, r7, 1 - add r0, r9 - ldr r2, =0x00000d64 - adds r1, r2 - b _081928FA - .pool -_081928E4: - ldr r4, =gSaveBlock2Ptr - ldr r1, [r4] - lsls r0, r7, 1 - add r0, r9 - ldr r2, =0x00000d64 - adds r1, r2 - adds r1, r0 - ldrh r1, [r1] - ldr r0, =gUnknown_0203BC8C - ldr r0, [r0] - lsls r1, 4 -_081928FA: - adds r1, r0 - ldrh r0, [r1] - mov r3, r10 - muls r3, r0 - adds r0, r3, 0 - ldr r1, =gSpeciesNames - adds r0, r1 - str r0, [sp, 0xC] - adds r0, r7, 0x1 - ldr r4, [sp, 0x28] - adds r0, r4 - movs r1, 0 - strb r0, [r6, 0x4] - cmp r7, 0x1 - bne _08192930 - movs r0, 0x7 - strb r0, [r6, 0x8] - b _08192932 - .pool -_08192930: - strb r1, [r6, 0x8] -_08192932: - adds r5, r7, 0x1 - ldr r0, [sp, 0x28] - adds r4, r5, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - add r0, sp, 0xC - movs r1, 0 - movs r2, 0 - bl AddTextPrinter - adds r7, r5, 0 - cmp r7, 0x2 - ble _0819288A - ldr r4, [sp, 0x40] - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - ldr r0, =0x000003fe - ldr r1, [sp, 0x24] - cmp r1, r0 - bne _08192980 - ldr r0, =gUnknown_0860D1D0 - ldr r0, [r0, 0x40] - b _0819298A - .pool -_08192980: - ldr r0, =gUnknown_0860D1D0 - ldr r2, [sp, 0x20] - lsls r1, r2, 2 - adds r1, r0 - ldr r0, [r1] -_0819298A: - str r0, [sp, 0xC] - add r1, sp, 0xC - movs r2, 0 - movs r0, 0x1 - strb r0, [r1, 0x5] - adds r0, r1, 0 - add r3, sp, 0x40 - ldrb r3, [r3] - strb r3, [r0, 0x4] - strb r2, [r0, 0x8] - movs r1, 0x4 - strb r1, [r0, 0x7] - strb r1, [r0, 0x9] - movs r1, 0 - bl AddTextPrinter - movs r7, 0 - ldr r3, =gUnknown_0860B358 -_081929AE: - movs r5, 0 - adds r4, r7, 0x1 - str r4, [sp, 0x38] - lsls r0, r7, 1 - str r0, [sp, 0x34] - lsls r2, r7, 4 -_081929BA: - movs r6, 0 - lsls r1, r5, 1 - mov r10, r1 - mov r4, r8 - mov r9, r2 -_081929C4: - ldr r0, =0x000003fe - ldr r1, [sp, 0x24] - cmp r1, r0 - bne _08192A00 - lsls r0, r7, 24 - lsls r1, r5, 24 - lsrs r0, 24 - lsrs r1, 24 - str r2, [sp, 0x48] - str r3, [sp, 0x4C] - bl sub_81A5060 - lsls r0, 16 - lsrs r0, 12 - adds r0, r6, r0 - ldr r3, [sp, 0x4C] - adds r0, r3 - ldrh r1, [r4] - ldrb r0, [r0] - adds r1, r0 - strh r1, [r4] - ldr r2, [sp, 0x48] - b _08192A58 - .pool -_08192A00: - ldr r0, =0x000003ff - ldr r1, [sp, 0x24] - cmp r1, r0 - bne _08192A20 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000efc - adds r0, r1 - add r0, r9 - b _08192A48 - .pool -_08192A20: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - mov r12, r0 - ldr r0, [sp, 0x3C] - ldr r1, [sp, 0x20] - adds r0, r1 - str r0, [sp, 0x50] - lsls r0, 1 - ldr r1, [sp, 0x34] - adds r0, r1, r0 - ldr r1, =0x00000d64 - add r1, r12 - adds r1, r0 - ldrh r0, [r1] - ldr r1, =gUnknown_0203BC8C - ldr r1, [r1] - lsls r0, 4 - adds r0, r1 - adds r0, 0x2 - add r0, r10 -_08192A48: - ldrh r0, [r0] - lsls r0, 4 - adds r0, r6, r0 - adds r0, r3 - ldrh r1, [r4] - ldrb r0, [r0] - adds r1, r0 - strh r1, [r4] -_08192A58: - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0xF - ble _081929C4 - adds r2, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _081929BA - ldr r7, [sp, 0x38] - cmp r7, 0x2 - ble _081929AE - movs r7, 0 - ldr r2, =gUnknown_0860D214 - mov r9, r2 - ldr r3, =gUnknown_0860C988 - mov r10, r3 -_08192A78: - movs r4, 0 - movs r6, 0 - movs r5, 0 - mov r3, r8 - lsls r0, r7, 4 - mov r1, r10 - adds r2, r0, r1 -_08192A86: - ldrb r0, [r2] - cmp r0, 0 - beq _08192A9E - adds r4, 0x1 - movs r1, 0 - ldrsh r0, [r3, r1] - cmp r0, 0 - beq _08192A9E - ldrb r1, [r2] - cmp r0, r1 - blt _08192A9E - adds r6, 0x1 -_08192A9E: - adds r3, 0x2 - adds r2, 0x1 - adds r5, 0x1 - cmp r5, 0xF - ble _08192A86 - cmp r4, r6 - beq _08192AB2 - adds r7, 0x1 - cmp r7, 0x1E - bls _08192A78 -_08192AB2: - lsls r0, r7, 2 - add r0, r9 - ldr r0, [r0] - str r0, [sp, 0xC] - add r0, sp, 0xC - movs r1, 0x14 - strb r1, [r0, 0x7] - strb r1, [r0, 0x9] - movs r1, 0 - movs r2, 0 - bl AddTextPrinter - movs r1, 0 - mov r0, r8 - adds r0, 0x22 -_08192AD0: - strh r1, [r0] - subs r0, 0x2 - cmp r0, r8 - bge _08192AD0 - ldr r2, [sp, 0x24] - ldr r3, =0xfffffc02 - adds r0, r2, r3 - cmp r0, 0x1 - bls _08192AE4 - b _08192C24 -_08192AE4: - movs r7, 0 - movs r4, 0 - mov r9, r4 -_08192AEA: - movs r5, 0 - mov r4, r8 - mov r6, r9 -_08192AF0: - ldr r0, =0x000003fe - ldr r1, [sp, 0x24] - cmp r1, r0 - bne _08192B24 - lsls r1, r5, 24 - lsrs r1, 24 - lsrs r0, r6, 24 - bl sub_81A50F0 - lsls r0, 24 - lsrs r0, 24 - b _08192B34 - .pool -_08192B24: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r7, 4 - adds r1, r5, r1 - ldr r2, =0x00000f04 - adds r0, r2 - adds r0, r1 - ldrb r0, [r0] -_08192B34: - strh r0, [r4] - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x5 - ble _08192AF0 - mov r3, r8 - ldrh r0, [r3] - ldrh r4, [r3, 0xC] - adds r0, r4 - strh r0, [r3, 0xC] - movs r5, 0 - mov r4, r8 -_08192B4C: - ldr r0, =0x000003fe - ldr r1, [sp, 0x24] - cmp r1, r0 - bne _08192B70 - mov r2, r9 - lsrs r0, r2, 24 - bl sub_81A50B0 - lsls r0, 24 - lsrs r2, r0, 24 - b _08192B7E - .pool -_08192B70: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r7, 4 - adds r0, r1 - ldr r3, =0x00000f0a - adds r0, r3 - ldrb r2, [r0] -_08192B7E: - ldr r1, =gNatureStatTable - lsls r0, r2, 2 - adds r0, r2 - adds r0, r5, r0 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - ble _08192BB4 - movs r0, 0x2 - ldrsh r1, [r4, r0] - movs r0, 0x6E - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - ldrh r1, [r4, 0xE] - adds r1, r0 - strh r1, [r4, 0xE] - b _08192BDC - .pool -_08192BB4: - cmp r0, 0 - bge _08192BD4 - movs r2, 0x2 - ldrsh r1, [r4, r2] - movs r0, 0x5A - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - ldrh r1, [r4, 0xE] - adds r1, r0 - strh r1, [r4, 0xE] - ldrh r0, [r4, 0x1A] - adds r0, 0x1 - strh r0, [r4, 0x1A] - b _08192BDC -_08192BD4: - ldrh r0, [r4, 0x2] - ldrh r3, [r4, 0xE] - adds r0, r3 - strh r0, [r4, 0xE] -_08192BDC: - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x4 - ble _08192B4C - movs r4, 0x80 - lsls r4, 17 - add r9, r4 - adds r7, 0x1 - cmp r7, 0x2 - bgt _08192BF2 - b _08192AEA -_08192BF2: - movs r5, 0 - mov r1, r8 - movs r7, 0x5 -_08192BF8: - movs r2, 0xC - ldrsh r0, [r1, r2] - adds r5, r0 - adds r1, 0x2 - subs r7, 0x1 - cmp r7, 0 - bge _08192BF8 - movs r6, 0x64 - mov r4, r8 - movs r7, 0x5 -_08192C0C: - movs r3, 0xC - ldrsh r0, [r4, r3] - muls r0, r6 - adds r1, r5, 0 - bl __divsi3 - strh r0, [r4] - adds r4, 0x2 - subs r7, 0x1 - cmp r7, 0 - bge _08192C0C - b _08192D70 -_08192C24: - ldr r4, =gUnknown_0203BC8C - mov r10, r4 - ldr r1, [sp, 0x3C] - ldr r2, [sp, 0x20] - adds r0, r1, r2 - lsls r0, 1 - mov r9, r0 - movs r7, 0x2 -_08192C34: - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - ldr r4, =0x00000d64 - adds r0, r4 - add r0, r9 - ldrh r0, [r0] - mov r2, r10 - ldr r1, [r2] - lsls r0, 4 - adds r0, r1 - ldrb r2, [r0, 0xB] - movs r6, 0 - movs r4, 0 - movs r3, 0x1 - mov r1, r8 - movs r5, 0x5 -_08192C54: - strh r4, [r1] - adds r0, r2, 0 - ands r0, r3 - cmp r0, 0 - beq _08192C60 - adds r6, 0x1 -_08192C60: - asrs r2, 1 - adds r1, 0x2 - subs r5, 0x1 - cmp r5, 0 - bge _08192C54 - movs r0, 0xFF - lsls r0, 1 - adds r1, r6, 0 - bl __divsi3 - adds r6, r0, 0 - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - ldr r4, =0x00000d64 - adds r0, r4 - add r0, r9 - ldrh r0, [r0] - mov r2, r10 - ldr r1, [r2] - lsls r0, 4 - adds r0, r1 - ldrb r2, [r0, 0xB] - movs r3, 0x1 - mov r1, r8 - movs r5, 0x5 -_08192C92: - adds r0, r2, 0 - ands r0, r3 - cmp r0, 0 - beq _08192C9C - strh r6, [r1] -_08192C9C: - asrs r2, 1 - adds r1, 0x2 - subs r5, 0x1 - cmp r5, 0 - bge _08192C92 - mov r3, r8 - ldrh r0, [r3] - ldrh r4, [r3, 0xC] - adds r0, r4 - strh r0, [r3, 0xC] - movs r5, 0 - mov r4, r8 -_08192CB4: - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r2, =0x00000d64 - adds r0, r2 - add r0, r9 - ldrh r0, [r0] - mov r3, r10 - ldr r1, [r3] - lsls r0, 4 - adds r0, r1 - ldrb r2, [r0, 0xC] - lsls r0, r2, 2 - adds r0, r2 - adds r0, r5, r0 - ldr r1, =gNatureStatTable - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - ble _08192D04 - movs r2, 0x2 - ldrsh r1, [r4, r2] - movs r0, 0x6E - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - ldrh r1, [r4, 0xE] - adds r1, r0 - strh r1, [r4, 0xE] - b _08192D2C - .pool -_08192D04: - cmp r0, 0 - bge _08192D24 - movs r3, 0x2 - ldrsh r1, [r4, r3] - movs r0, 0x5A - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - ldrh r1, [r4, 0xE] - adds r1, r0 - strh r1, [r4, 0xE] - ldrh r0, [r4, 0x1A] - adds r0, 0x1 - strh r0, [r4, 0x1A] - b _08192D2C -_08192D24: - ldrh r0, [r4, 0x2] - ldrh r1, [r4, 0xE] - adds r0, r1 - strh r0, [r4, 0xE] -_08192D2C: - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x4 - ble _08192CB4 - movs r2, 0x2 - add r9, r2 - subs r7, 0x1 - cmp r7, 0 - blt _08192D40 - b _08192C34 -_08192D40: - movs r5, 0 - mov r1, r8 - movs r7, 0x5 -_08192D46: - movs r3, 0xC - ldrsh r0, [r1, r3] - adds r5, r0 - adds r1, 0x2 - subs r7, 0x1 - cmp r7, 0 - bge _08192D46 - movs r6, 0x64 - mov r4, r8 - movs r7, 0x5 -_08192D5A: - movs r1, 0xC - ldrsh r0, [r4, r1] - muls r0, r6 - adds r1, r5, 0 - bl __divsi3 - strh r0, [r4] - adds r4, 0x2 - subs r7, 0x1 - cmp r7, 0 - bge _08192D5A -_08192D70: - movs r7, 0 - movs r5, 0 - movs r6, 0 - mov r4, r8 - mov r10, r8 - mov r9, r8 -_08192D7C: - movs r2, 0 - ldrsh r1, [r4, r2] - cmp r1, 0x1D - ble _08192DDE - cmp r7, 0x2 - bne _08192DD4 - mov r3, r8 - movs r0, 0xC - ldrsh r3, [r3, r0] - mov r12, r3 - cmp r12, r1 - bge _08192DC6 - mov r2, r8 - ldrh r2, [r2, 0xE] - add r3, sp, 0x54 - strh r2, [r3] - mov r2, r8 - movs r3, 0xE - ldrsh r0, [r2, r3] - cmp r0, r1 - bge _08192DBA - cmp r12, r0 - bge _08192DB4 - add r0, sp, 0x54 - ldrh r0, [r0] - strh r0, [r2, 0xC] - strh r6, [r2, 0xE] - b _08192DDE -_08192DB4: - mov r1, r8 - strh r6, [r1, 0xE] - b _08192DDE -_08192DBA: - add r2, sp, 0x54 - ldrh r3, [r2] - mov r2, r8 - strh r3, [r2, 0xC] - strh r6, [r2, 0xE] - b _08192DDE -_08192DC6: - mov r3, r8 - movs r2, 0xE - ldrsh r0, [r3, r2] - cmp r0, r1 - bge _08192DDE - strh r6, [r3, 0xE] - b _08192DDE -_08192DD4: - mov r3, r9 - strh r6, [r3, 0xC] - movs r0, 0x2 - add r9, r0 - adds r7, 0x1 -_08192DDE: - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08192E64 - cmp r5, 0x2 - bne _08192E5A - movs r2, 0x18 - ldrsh r0, [r4, r2] - cmp r0, 0x1 - bgt _08192E18 - cmp r0, 0x1 - bne _08192E64 - mov r3, r8 - movs r1, 0x10 - ldrsh r0, [r3, r1] - lsls r0, 1 - add r0, r8 - movs r2, 0x18 - ldrsh r0, [r0, r2] - cmp r0, 0 - bne _08192E22 - movs r1, 0x12 - ldrsh r0, [r3, r1] - lsls r0, 1 - add r0, r8 - movs r2, 0x18 - ldrsh r0, [r0, r2] - cmp r0, 0 - bne _08192E22 -_08192E18: - mov r3, r8 - ldrh r0, [r3, 0x12] - strh r0, [r3, 0x10] - strh r6, [r3, 0x12] - b _08192E64 -_08192E22: - movs r1, 0x18 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - bne _08192E64 - mov r2, r8 - movs r3, 0x10 - ldrsh r0, [r2, r3] - lsls r0, 1 - add r0, r8 - movs r1, 0x18 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08192E44 - ldrh r0, [r2, 0x12] - strh r0, [r2, 0x10] - strh r6, [r2, 0x12] - b _08192E64 -_08192E44: - mov r2, r8 - movs r3, 0x12 - ldrsh r0, [r2, r3] - lsls r0, 1 - add r0, r8 - movs r1, 0x18 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08192E64 - strh r6, [r2, 0x12] - b _08192E64 -_08192E5A: - mov r2, r10 - strh r6, [r2, 0x10] - movs r3, 0x2 - add r10, r3 - adds r5, 0x1 -_08192E64: - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x5 - ble _08192D7C - cmp r7, 0x2 - bne _08192E8C - ldr r0, =gUnknown_0860D349 - mov r4, r8 - movs r1, 0xC - ldrsh r2, [r4, r1] - adds r0, r2, r0 - movs r3, 0xE - ldrsh r1, [r4, r3] - subs r1, 0x1 - subs r1, r2 - ldrb r0, [r0] - adds r7, r1, r0 - b _08192ED2 - .pool -_08192E8C: - cmp r7, 0x1 - bne _08192E9C - mov r4, r8 - movs r1, 0xC - ldrsh r0, [r4, r1] - adds r7, r0, 0 - adds r7, 0xF - b _08192ED2 -_08192E9C: - cmp r5, 0x2 - bne _08192EC0 - ldr r0, =gUnknown_0860D349 - mov r3, r8 - movs r4, 0x10 - ldrsh r2, [r3, r4] - adds r0, r2, r0 - movs r4, 0x12 - ldrsh r1, [r3, r4] - subs r1, 0x1 - subs r1, r2 - ldrb r0, [r0] - adds r1, r0 - adds r7, r1, 0 - adds r7, 0x15 - b _08192ED2 - .pool -_08192EC0: - cmp r5, 0x1 - bne _08192ED0 - mov r1, r8 - movs r2, 0x10 - ldrsh r0, [r1, r2] - adds r7, r0, 0 - adds r7, 0x24 - b _08192ED2 -_08192ED0: - movs r7, 0x2A -_08192ED2: - lsls r0, r7, 2 - ldr r3, =gUnknown_0860D294 - adds r0, r3 - ldr r0, [r0] - str r0, [sp, 0xC] - add r0, sp, 0xC - movs r1, 0x24 - strb r1, [r0, 0x7] - strb r1, [r0, 0x9] - movs r1, 0 - movs r2, 0 - bl AddTextPrinter - mov r0, r8 - bl Free - add sp, 0x58 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81924E0 - - thumb_func_start sub_8192F08 -sub_8192F08: @ 8192F08 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - str r1, [sp] - lsls r0, 24 - lsrs r7, r0, 24 - movs r0, 0 - str r0, [sp, 0x4] - mov r8, r0 - ldr r2, =gUnknown_0860D3C4 - lsls r0, r7, 1 - adds r0, r7 - adds r1, r0, r2 - ldrb r6, [r1] - adds r1, r2, 0x1 - adds r0, r1 - ldrb r0, [r0] - adds r0, r6, r0 - adds r3, r2, 0 - cmp r6, r0 - bge _08192FD4 - ldr r5, =gSaveBlock2Ptr - ldr r1, =0x000003ff - mov r10, r1 - ldr r2, =0x000003fe - mov r9, r2 -_08192F42: - ldr r0, =gUnknown_0860D3B4 - adds r0, r6, r0 - ldrb r4, [r0] - ldr r0, [r5] - lsls r1, r4, 2 - adds r0, r1 - ldr r2, =0x00000d25 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _08192FBE - ldr r0, [sp] - add r0, r8 - strb r4, [r0] - ldr r2, [r5] - adds r0, r2, r1 - ldr r1, =0x00000d24 - adds r0, r1 - ldrh r0, [r0] - lsls r1, r0, 22 - lsrs r0, r1, 22 - cmp r0, r10 - bne _08192F9C - ldr r0, =gStringVar1 - adds r1, r2, 0 - bl StringCopy - b _08192FB8 - .pool -_08192F9C: - lsrs r0, r1, 22 - cmp r0, r9 - bne _08192FB0 - ldr r0, =gStringVar1 - bl sub_8195938 - b _08192FB8 - .pool -_08192FB0: - lsrs r1, 22 - ldr r0, =gStringVar1 - bl sub_8195898 -_08192FB8: - movs r2, 0x1 - add r8, r2 - ldr r3, =gUnknown_0860D3C4 -_08192FBE: - adds r6, 0x1 - lsls r1, r7, 1 - adds r1, r7 - adds r0, r1, r3 - ldrb r2, [r0] - adds r0, r3, 0x1 - adds r1, r0 - ldrb r0, [r1] - adds r2, r0 - cmp r6, r2 - blt _08192F42 -_08192FD4: - mov r5, r8 - cmp r5, 0x2 - bne _08192FE8 - movs r0, 0 - b _0819313C - .pool -_08192FE8: - mov r12, r3 - lsls r3, r7, 1 - adds r0, r3, r7 - mov r2, r12 - adds r1, r0, r2 - ldrb r6, [r1] - mov r1, r12 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - adds r0, r6, r0 - str r3, [sp, 0x8] - cmp r6, r0 - blt _08193006 - b _08193126 -_08193006: - ldr r5, =gSaveBlock2Ptr - mov r10, r5 - ldr r0, =0x00000d25 - mov r9, r0 -_0819300E: - ldr r0, =gUnknown_0860D3B4 - adds r0, r6, r0 - ldrb r4, [r0] - mov r1, r10 - ldr r0, [r1] - lsls r2, r4, 2 - str r2, [sp, 0xC] - adds r0, r2 - add r0, r9 - ldrb r2, [r0] - lsls r0, r2, 29 - cmp r0, 0 - bge _08193100 - lsls r2, 27 - adds r1, r3, r7 - mov r0, r12 - adds r0, 0x2 - adds r1, r0 - lsrs r2, 30 - ldrb r1, [r1] - cmp r2, r1 - bcc _08193100 - ldr r0, [sp] - add r0, r8 - strb r4, [r0] - movs r5, 0x1 - add r8, r5 - mov r0, r10 - ldr r3, [r0] - ldr r5, [sp, 0xC] - adds r2, r3, r5 - adds r0, r2, 0 - add r0, r9 - ldrb r5, [r0] - mov r12, r5 - mov r0, r12 - lsls r0, 27 - lsrs r0, 30 - cmp r0, r1 - bne _081930BC - lsls r4, 1 - movs r1, 0xEC - lsls r1, 4 - adds r0, r3, r1 - adds r0, r4 - ldrh r1, [r0] - movs r0, 0xD - muls r1, r0 - ldr r0, =gMoveNames - adds r1, r0 - ldr r0, =gStringVar2 - bl StringCopy - mov r2, r10 - ldr r1, [r2] - ldr r5, [sp, 0xC] - adds r0, r1, r5 - add r0, r9 - ldrb r0, [r0] - lsls r2, r0, 24 - lsrs r0, r2, 29 - lsls r0, 1 - str r0, [sp, 0x4] - movs r0, 0xEC - lsls r0, 4 - adds r1, r0 - adds r1, r4 - ldrh r0, [r1] - cmp r0, 0 - bne _08193100 - lsrs r0, r2, 29 - cmp r0, 0 - bne _08193100 - movs r1, 0x4 - str r1, [sp, 0x4] - b _08193100 - .pool -_081930BC: - ldr r5, =0x00000d24 - adds r0, r2, r5 - ldrh r0, [r0] - lsls r1, r0, 22 - ldr r0, =0xffc00000 - cmp r1, r0 - bne _081930E0 - ldr r0, =gStringVar1 - adds r1, r3, 0 - bl StringCopy - b _08193100 - .pool -_081930E0: - ldr r0, =0xff800000 - cmp r1, r0 - bne _081930F8 - ldr r0, =gStringVar1 - bl sub_8195938 - b _08193100 - .pool -_081930F8: - lsrs r1, 22 - ldr r0, =gStringVar1 - bl sub_8195898 -_08193100: - mov r0, r8 - cmp r0, 0x2 - beq _08193126 - adds r6, 0x1 - ldr r1, =gUnknown_0860D3C4 - mov r12, r1 - ldr r3, [sp, 0x8] - adds r1, r3, r7 - mov r2, r12 - adds r0, r1, r2 - ldrb r2, [r0] - mov r0, r12 - adds r0, 0x1 - adds r1, r0 - ldrb r0, [r1] - adds r2, r0 - cmp r6, r2 - bge _08193126 - b _0819300E -_08193126: - cmp r7, 0xE - beq _08193138 - ldr r0, [sp, 0x4] - adds r0, 0x1 - b _0819313C - .pool -_08193138: - ldr r0, [sp, 0x4] - adds r0, 0x2 -_0819313C: - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8192F08 - - thumb_func_start sub_819314C -sub_819314C: @ 819314C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x80 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x34] - lsls r1, 24 - lsrs r6, r1, 24 - movs r0, 0 - str r0, [sp, 0x3C] - movs r7, 0 - movs r1, 0 - str r1, [sp, 0x40] - movs r2, 0 - str r2, [sp, 0x44] - mov r9, r2 - movs r0, 0x1 - ldr r3, [sp, 0x34] - ands r0, r3 - cmp r0, 0 - beq _08193186 - movs r7, 0x8 - str r7, [sp, 0x3C] - movs r7, 0x9 - movs r0, 0x2 - mov r9, r0 -_08193186: - movs r0, 0x2 - ldr r1, [sp, 0x34] - ands r0, r1 - cmp r0, 0 - beq _08193196 - movs r2, 0x80 - lsls r2, 1 - str r2, [sp, 0x40] -_08193196: - movs r0, 0x4 - ldr r3, [sp, 0x34] - ands r0, r3 - cmp r0, 0 - beq _081931A4 - movs r0, 0xA0 - str r0, [sp, 0x44] -_081931A4: - movs r0, 0x8 - ldr r1, [sp, 0x34] - ands r0, r1 - cmp r0, 0 - beq _081931B2 - ldr r2, =0xffffff00 - str r2, [sp, 0x40] -_081931B2: - movs r0, 0x10 - ldr r3, [sp, 0x34] - ands r0, r3 - cmp r0, 0 - beq _081931C2 - movs r0, 0xA0 - negs r0, r0 - str r0, [sp, 0x44] -_081931C2: - ldr r4, =gUnknown_0203CD78 - ldr r1, [r4] - adds r1, 0x11 - adds r0, r6, 0 - bl sub_8192F08 - str r0, [sp, 0x38] - movs r5, 0 - mov r1, sp - adds r1, 0x1C - str r1, [sp, 0x48] - mov r2, sp - adds r2, 0x24 - str r2, [sp, 0x4C] - lsls r1, r6, 1 - mov r3, sp - adds r3, 0x2C - str r3, [sp, 0x50] - ldr r0, [sp, 0x40] - adds r0, 0x30 - mov r8, r0 - ldr r2, [sp, 0x44] - adds r2, 0x58 - str r2, [sp, 0x78] - movs r3, 0xC - add r3, r9 - mov r10, r3 - ldr r0, [sp, 0x40] - adds r0, 0xC0 - str r0, [sp, 0x7C] - mov r2, r9 - adds r2, 0xD - str r2, [sp, 0x74] - ldr r3, [sp, 0x3C] - adds r3, 0x1 - mov r9, r3 - ldr r0, [sp, 0x3C] - adds r0, 0x2 - str r0, [sp, 0x54] - ldr r2, [sp, 0x3C] - adds r2, 0x5 - str r2, [sp, 0x5C] - adds r3, r7, 0 - adds r3, 0x8 - str r3, [sp, 0x6C] - adds r0, r7, 0x6 - str r0, [sp, 0x64] - adds r2, r7, 0x7 - str r2, [sp, 0x68] - lsls r3, r6, 2 - str r3, [sp, 0x58] - adds r0, r7, 0x5 - str r0, [sp, 0x60] - ldr r0, [r4] - adds r0, 0x11 - mov r12, r0 - ldr r0, =gSaveBlock2Ptr - ldr r4, [r0] - ldr r0, =gUnknown_0860D3C6 - movs r3, 0 - adds r1, r6 - adds r1, r0 - ldrb r6, [r1] -_08193240: - ldr r1, [sp, 0x48] - adds r2, r3, r1 - mov r7, r12 - adds r0, r7, r5 - ldrb r0, [r0] - str r0, [r2] - ldr r7, [sp, 0x4C] - adds r1, r3, r7 - lsls r0, 2 - adds r0, r4, r0 - ldr r7, =0x00000d24 - adds r0, r7 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - str r0, [r1] - ldr r0, [r2] - lsls r0, 2 - adds r0, r4, r0 - ldr r1, =0x00000d25 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 27 - lsrs r0, 30 - cmp r0, r6 - bhi _0819329C - lsls r0, r1, 29 - cmp r0, 0 - bge _0819329C - ldr r2, [sp, 0x50] - adds r1, r3, r2 - movs r0, 0x1 - b _081932A2 - .pool -_0819329C: - ldr r7, [sp, 0x50] - adds r1, r3, r7 - movs r0, 0 -_081932A2: - str r0, [r1] - adds r3, 0x4 - adds r5, 0x1 - cmp r5, 0x1 - ble _08193240 - ldr r1, [sp, 0x24] - ldr r0, =0x000003ff - cmp r1, r0 - bne _081932D4 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrb r0, [r0, 0x8] - bl sub_806F000 - lsls r0, 16 - lsrs r0, 16 - mov r2, r8 - ldr r3, [sp, 0x78] - mov r1, r10 - str r1, [sp] - b _081932F8 - .pool -_081932D4: - ldr r0, =0x000003fe - cmp r1, r0 - bne _081932E4 - bl sub_8195910 - b _081932EC - .pool -_081932E4: - lsls r0, r1, 16 - lsrs r0, 16 - bl sub_8162AA0 -_081932EC: - lsls r0, 24 - lsrs r0, 24 - mov r2, r8 - ldr r3, [sp, 0x78] - mov r7, r10 - str r7, [sp] -_081932F8: - ldr r1, =0x0000ffff - str r1, [sp, 0x4] - movs r1, 0x1 - bl sub_818D8AC - ldr r1, =gUnknown_0203CD78 - ldr r1, [r1] - ldr r2, [sp, 0x3C] - adds r1, r2 - strb r0, [r1] - movs r0, 0x1E - ldr r3, [sp, 0x34] - ands r0, r3 - cmp r0, 0 - beq _08193334 - ldr r2, =gSprites - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldr r7, [sp, 0x3C] - adds r0, r7 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_08193334: - ldr r0, [sp, 0x2C] - cmp r0, 0 - beq _0819335A - ldr r2, =gSprites - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldr r1, [sp, 0x3C] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r2, [r0, 0x5] - movs r1, 0xF - ands r1, r2 - movs r2, 0x30 - orrs r1, r2 - strb r1, [r0, 0x5] -_0819335A: - ldr r2, [sp, 0x4C] - ldr r1, [r2, 0x4] - ldr r0, =0x000003ff - cmp r1, r0 - bne _08193388 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrb r0, [r0, 0x8] - bl sub_806F000 - lsls r0, 16 - lsrs r0, 16 - b _081933B0 - .pool -_08193388: - ldr r0, =0x000003fe - cmp r1, r0 - bne _081933A4 - bl sub_8195910 - lsls r0, 24 - lsrs r0, 24 - ldr r2, [sp, 0x7C] - ldr r3, [sp, 0x78] - ldr r1, [sp, 0x74] - str r1, [sp] - b _081933B8 - .pool -_081933A4: - lsls r0, r1, 16 - lsrs r0, 16 - bl sub_8162AA0 - lsls r0, 24 - lsrs r0, 24 -_081933B0: - ldr r2, [sp, 0x7C] - ldr r3, [sp, 0x78] - ldr r7, [sp, 0x74] - str r7, [sp] -_081933B8: - ldr r1, =0x0000ffff - str r1, [sp, 0x4] - movs r1, 0x1 - bl sub_818D8AC - ldr r1, =gUnknown_0203CD78 - ldr r1, [r1] - add r1, r9 - strb r0, [r1] - movs r0, 0x1E - ldr r1, [sp, 0x34] - ands r0, r1 - cmp r0, 0 - beq _081933F0 - ldr r2, =gSprites - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - add r0, r9 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_081933F0: - ldr r2, [sp, 0x50] - ldr r0, [r2, 0x4] - cmp r0, 0 - beq _08193416 - ldr r2, =gSprites - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - add r0, r9 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r2, [r0, 0x5] - movs r1, 0xF - ands r1, r2 - movs r2, 0x30 - orrs r1, r2 - strb r1, [r0, 0x5] -_08193416: - movs r5, 0 - ldr r3, [sp, 0x38] - lsls r3, 2 - str r3, [sp, 0x70] - mov r8, r5 - ldr r6, =gUnknown_0203CD78 - ldr r7, =gSprites - ldr r4, [sp, 0x54] - mov r9, r5 - movs r0, 0x1 - mov r10, r0 -_0819342C: - ldr r1, [sp, 0x24] - ldr r0, =0x000003ff - cmp r1, r0 - bne _08193464 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r1, [sp, 0x1C] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 1 - add r0, r9 - ldr r1, =0x00000d64 - adds r2, r1 - adds r2, r0 - ldrh r0, [r2] - b _081934B0 - .pool -_08193464: - ldr r0, =0x000003fe - cmp r1, r0 - bne _08193490 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r1, [sp, 0x1C] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 1 - add r0, r9 - ldr r1, =0x00000d64 - adds r2, r1 - adds r2, r0 - ldrh r0, [r2] - b _081934B0 - .pool -_08193490: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r1, [sp, 0x1C] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 1 - add r0, r9 - ldr r1, =0x00000d64 - adds r2, r1 - adds r2, r0 - ldrh r1, [r2] - ldr r0, =gUnknown_0203BC8C - ldr r0, [r0] - lsls r1, 4 - adds r1, r0 - ldrh r0, [r1] -_081934B0: - ldr r1, =gUnknown_0860D3A8 - adds r1, r5, r1 - ldrb r2, [r1] - ldr r3, [sp, 0x40] - orrs r2, r3 - ldr r1, =gUnknown_0860D3AB - adds r1, r5, r1 - ldrb r3, [r1] - ldr r1, [sp, 0x44] - adds r3, r1 - mov r1, r8 - str r1, [sp] - str r1, [sp, 0x4] - mov r1, r10 - str r1, [sp, 0x8] - ldr r1, =sub_8190938 - bl sub_80D2CC4 - ldr r1, [r6] - adds r1, r4 - strb r0, [r1] - ldr r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrb r1, [r0, 0x5] - movs r3, 0xD - negs r3, r3 - adds r2, r3, 0 - ands r1, r2 - strb r1, [r0, 0x5] - movs r0, 0x1E - ldr r1, [sp, 0x34] - ands r0, r1 - cmp r0, 0 - beq _08193516 - ldr r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_08193516: - ldr r0, [sp, 0x2C] - cmp r0, 0 - beq _08193548 - ldr r0, [r6] - adds r0, r4 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r7 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - movs r2, 0x30 - orrs r0, r2 - strb r0, [r1, 0x5] - ldr r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - mov r2, r10 - strh r2, [r0, 0x34] -_08193548: - adds r4, 0x1 - movs r3, 0x2 - add r9, r3 - adds r5, 0x1 - cmp r5, 0x2 - bgt _08193556 - b _0819342C -_08193556: - movs r5, 0 - ldr r6, =gUnknown_0203CD78 - ldr r7, =gSprites - mov r8, r7 - ldr r4, [sp, 0x5C] - mov r9, r5 - movs r7, 0 -_08193564: - ldr r0, [sp, 0x4C] - ldr r1, [r0, 0x4] - ldr r0, =0x000003ff - cmp r1, r0 - bne _081935AC - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r3, [sp, 0x48] - ldr r1, [r3, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 1 - add r0, r9 - ldr r1, =0x00000d64 - adds r2, r1 - adds r2, r0 - ldrh r0, [r2] - b _081935FA - .pool -_081935AC: - ldr r0, =0x000003fe - cmp r1, r0 - bne _081935D8 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r0, [sp, 0x48] - ldr r1, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 1 - add r0, r9 - ldr r1, =0x00000d64 - adds r2, r1 - adds r2, r0 - ldrh r0, [r2] - b _081935FA - .pool -_081935D8: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r0, [sp, 0x48] - ldr r1, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 1 - add r0, r9 - ldr r1, =0x00000d64 - adds r2, r1 - adds r2, r0 - ldrh r1, [r2] - ldr r0, =gUnknown_0203BC8C - ldr r0, [r0] - lsls r1, 4 - adds r1, r0 - ldrh r0, [r1] -_081935FA: - ldr r1, =gUnknown_0860D3AE - adds r1, r5, r1 - ldrb r2, [r1] - ldr r3, [sp, 0x40] - orrs r2, r3 - ldr r1, =gUnknown_0860D3B1 - adds r1, r5, r1 - ldrb r3, [r1] - ldr r1, [sp, 0x44] - adds r3, r1 - str r7, [sp] - str r7, [sp, 0x4] - movs r1, 0x1 - str r1, [sp, 0x8] - ldr r1, =sub_8190938 - bl sub_80D2CC4 - ldr r1, [r6] - adds r1, r4 - strb r0, [r1] - ldr r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - ldrb r1, [r0, 0x5] - movs r3, 0xD - negs r3, r3 - adds r2, r3, 0 - ands r1, r2 - strb r1, [r0, 0x5] - movs r0, 0x1E - ldr r1, [sp, 0x34] - ands r0, r1 - cmp r0, 0 - beq _0819365E - ldr r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_0819365E: - ldr r2, [sp, 0x50] - ldr r0, [r2, 0x4] - cmp r0, 0 - beq _08193692 - ldr r0, [r6] - adds r0, r4 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r8 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - movs r2, 0x30 - orrs r0, r2 - strb r0, [r1, 0x5] - ldr r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - movs r1, 0x1 - strh r1, [r0, 0x34] -_08193692: - adds r4, 0x1 - movs r3, 0x2 - add r9, r3 - adds r5, 0x1 - cmp r5, 0x2 - bgt _081936A0 - b _08193564 -_081936A0: - add r0, sp, 0xC - movs r5, 0 - strb r5, [r0, 0x6] - adds r1, r0, 0 - movs r0, 0x2 - strb r0, [r1, 0x7] - adds r0, r1, 0 - ldrb r0, [r0, 0x6] - strb r0, [r1, 0x8] - adds r0, r1, 0 - ldrb r0, [r0, 0x7] - strb r0, [r1, 0x9] - adds r0, r1, 0 - strb r5, [r0, 0xA] - strb r5, [r0, 0xB] - adds r3, r0, 0 - ldrb r2, [r3, 0xC] - movs r1, 0x10 - negs r1, r1 - adds r0, r1, 0 - ands r0, r2 - strb r0, [r3, 0xC] - adds r2, r3, 0 - movs r0, 0xE0 - strb r0, [r2, 0xC] - ldrb r0, [r2, 0xD] - ands r1, r0 - strb r1, [r2, 0xD] - adds r1, r2, 0 - movs r0, 0xD0 - strb r0, [r1, 0xD] - ldr r4, =gStringVar4 - ldr r0, =gUnknown_0860D38C - ldr r7, [sp, 0x70] - adds r0, r7, r0 - ldr r1, [r0] - adds r0, r4, 0 - bl StringExpandPlaceholders - str r4, [sp, 0xC] - add r0, sp, 0xC - add r1, sp, 0x6C - ldrb r1, [r1] - strb r1, [r0, 0x4] - adds r1, r0, 0 - movs r0, 0x1 - strb r0, [r1, 0x5] - ldr r4, [sp, 0x6C] - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - add r0, sp, 0xC - strb r5, [r0, 0x8] - adds r1, r0, 0 - strb r5, [r0, 0x7] - strb r5, [r1, 0x9] - movs r1, 0 - movs r2, 0 - bl AddTextPrinter - ldr r1, [sp, 0x24] - ldr r0, =0x000003ff - cmp r1, r0 - bne _0819375C - ldr r0, =gStringVar1 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - bl StringCopy - b _0819377E - .pool -_0819375C: - ldr r0, =0x000003fe - cmp r1, r0 - bne _08193774 - ldr r0, =gStringVar1 - bl sub_8195938 - b _0819377E - .pool -_08193774: - ldr r0, =gStringVar1 - lsls r1, 16 - lsrs r1, 16 - bl sub_8195898 -_0819377E: - add r0, sp, 0xC - movs r4, 0x2 - strb r4, [r0, 0x5] - strb r4, [r0, 0xA] - ldr r5, =gStringVar1 - str r5, [sp, 0xC] - add r2, sp, 0x64 - ldrb r2, [r2] - strb r2, [r0, 0x4] - ldrb r0, [r0, 0x5] - ldr r1, [sp, 0xC] - add r2, sp, 0xC - ldrb r3, [r2, 0xA] - movs r2, 0x40 - bl GetStringCenterAlignXOffsetWithLetterSpacing - add r1, sp, 0xC - strb r0, [r1, 0x8] - adds r0, r1, 0 - strb r4, [r0, 0x7] - strb r4, [r1, 0x9] - ldr r4, [sp, 0x64] - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - add r0, sp, 0xC - movs r1, 0 - movs r2, 0 - bl AddTextPrinter - ldr r3, [sp, 0x4C] - ldr r1, [r3, 0x4] - ldr r0, =0x000003ff - cmp r1, r0 - bne _081937E4 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - adds r0, r5, 0 - bl StringCopy - b _08193802 - .pool -_081937E4: - ldr r0, =0x000003fe - cmp r1, r0 - bne _081937F8 - adds r0, r5, 0 - bl sub_8195938 - b _08193802 - .pool -_081937F8: - lsls r1, 16 - lsrs r1, 16 - adds r0, r5, 0 - bl sub_8195898 -_08193802: - ldr r0, =gStringVar1 - str r0, [sp, 0xC] - add r0, sp, 0xC - movs r6, 0 - add r7, sp, 0x68 - ldrb r7, [r7] - strb r7, [r0, 0x4] - ldrb r0, [r0, 0x5] - ldr r1, [sp, 0xC] - add r2, sp, 0xC - ldrb r3, [r2, 0xA] - movs r2, 0x40 - bl GetStringCenterAlignXOffsetWithLetterSpacing - add r1, sp, 0xC - strb r0, [r1, 0x8] - adds r0, r1, 0 - movs r5, 0x2 - strb r5, [r0, 0x7] - strb r5, [r1, 0x9] - ldr r4, [sp, 0x68] - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - add r0, sp, 0xC - movs r1, 0 - movs r2, 0 - bl AddTextPrinter - add r0, sp, 0xC - strb r6, [r0, 0xA] - ldr r0, =gUnknown_0860D350 - ldr r1, [sp, 0x58] - adds r0, r1, r0 - ldr r0, [r0] - str r0, [sp, 0xC] - add r0, sp, 0xC - add r2, sp, 0x60 - ldrb r2, [r2] - strb r2, [r0, 0x4] - ldrb r0, [r0, 0x5] - ldr r1, [sp, 0xC] - add r2, sp, 0xC - ldrb r3, [r2, 0xA] - movs r2, 0xA0 - bl GetStringCenterAlignXOffsetWithLetterSpacing - add r1, sp, 0xC - strb r0, [r1, 0x8] - adds r0, r1, 0 - strb r5, [r0, 0x7] - strb r5, [r1, 0x9] - ldr r4, [sp, 0x60] - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - add r0, sp, 0xC - movs r1, 0 - movs r2, 0 - bl AddTextPrinter - add sp, 0x80 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819314C - - thumb_func_start sub_81938A4 -sub_81938A4: @ 81938A4 - push {lr} - ldr r0, =sub_8194220 - movs r1, 0 - 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 r2, 0 - strh r2, [r1, 0x8] - strh r2, [r1, 0xA] - movs r0, 0x2 - strh r0, [r1, 0xC] - strh r2, [r1, 0x10] - ldr r0, =sub_8194B54 - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81938A4 - - thumb_func_start sub_81938E0 -sub_81938E0: @ 81938E0 - push {r4,lr} - bl sub_8194D48 - ldr r4, =gSaveBlock2Ptr - ldr r2, [r4] - ldr r1, =0x00000d0a - adds r0, r2, r1 - ldrb r1, [r0] - subs r1, 0x1 - ldr r0, =0x00000ca9 - adds r2, r0 - movs r0, 0x3 - ands r1, r0 - ldrb r3, [r2] - movs r0, 0x4 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - ldr r0, [r4] - ldr r1, =0x00000cb2 - adds r0, r1 - movs r4, 0 - movs r1, 0x3 - strh r1, [r0] - ldr r0, =sub_8194220 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x8] - strh r4, [r1, 0xA] - movs r0, 0x2 - strh r0, [r1, 0xC] - movs r0, 0x1 - strh r0, [r1, 0x10] - ldr r0, =sub_8194B54 - bl SetMainCallback2 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81938E0 - - thumb_func_start sub_819395C -sub_819395C: @ 819395C - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r2, 0xA - ldrsh r7, [r0, r2] - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r2, r1, 0 - cmp r0, 0x7 - bls _0819397E - b _08193BC2 -_0819397E: - lsls r0, 2 - ldr r1, =_08193990 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08193990: - .4byte _081939B0 - .4byte _08193A00 - .4byte _08193A20 - .4byte _08193AA8 - .4byte _08193BC2 - .4byte _08193B20 - .4byte _08193BC2 - .4byte _08193B84 -_081939B0: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _081939C2 - b _08193BC2 -_081939C2: - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0x1 - strh r1, [r0, 0x8] - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - movs r1, 0x1 - bl StartSpriteAnim - b _08193BC2 - .pool -_08193A00: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08193A0E - b _08193BC2 -_08193A0E: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r2 - movs r1, 0x2 - strh r1, [r0, 0x8] - b _08193BC2 - .pool -_08193A20: - adds r0, r5, 0 - bl sub_8193BDC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08193A30 - b _08193BC2 -_08193A30: - cmp r0, 0x1 - ble _08193A3C - cmp r0, 0x2 - beq _08193A60 - cmp r0, 0x3 - beq _08193A84 -_08193A3C: - 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, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0x7 - strh r1, [r0, 0x8] - b _08193BC2 - .pool -_08193A60: - 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, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0x3 - strh r1, [r0, 0x8] - b _08193BC2 - .pool -_08193A84: - 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, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0x5 - strh r1, [r0, 0x8] - b _08193BC2 - .pool -_08193AA8: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - beq _08193ABA - b _08193BC2 -_08193ABA: - bl FreeAllWindowBuffers - bl remove_some_task - ldr r4, =gUnknown_0203CD7C - ldr r0, [r4] - bl Free - str r6, [r4] - ldr r0, =sub_8190400 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r3, r0, 24 - ldr r2, =gTasks - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 3 - adds r1, r2 - movs r3, 0 - strh r6, [r1, 0x8] - ldr r0, =gUnknown_0860D080 - adds r0, r7, r0 - ldrb r0, [r0] - strh r0, [r1, 0xA] - movs r0, 0x1 - strh r0, [r1, 0xC] - strh r5, [r1, 0xE] - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r2 - movs r1, 0x4 - strh r1, [r0, 0x8] - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - strb r3, [r0, 0x10] - b _08193BC2 - .pool -_08193B20: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - bne _08193BC2 - bl FreeAllWindowBuffers - bl remove_some_task - ldr r4, =gUnknown_0203CD7C - ldr r0, [r4] - bl Free - str r6, [r4] - ldr r0, =sub_8190400 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r3, r0, 24 - ldr r2, =gTasks - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 3 - adds r0, r2 - strh r6, [r0, 0x8] - adds r1, r7, 0 - subs r1, 0x10 - strh r1, [r0, 0xA] - movs r1, 0x2 - strh r1, [r0, 0xC] - strh r5, [r0, 0xE] - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r2 - movs r1, 0x6 - strh r1, [r0, 0x8] - b _08193BC2 - .pool -_08193B84: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - bne _08193BC2 - bl FreeAllWindowBuffers - bl remove_some_task - ldr r4, =gUnknown_0203CD7C - ldr r0, [r4] - bl Free - str r6, [r4] - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldrb r0, [r0, 0x16] - bl DestroyTask - adds r0, r5, 0 - bl DestroyTask -_08193BC2: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819395C - - thumb_func_start sub_8193BDC -sub_8193BDC: @ 8193BDC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r7, r0, 24 - movs r0, 0x1 - mov r9, r0 - movs r1, 0x4 - mov r8, r1 - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - movs r1, 0xA - ldrsh r5, [r0, r1] - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r6, [r0] - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - adds r2, r1, 0 - adds r3, r0, 0 - cmp r2, 0x2 - beq _08193C20 - mov r0, r9 - ands r0, r1 - cmp r0, 0 - beq _08193C58 - cmp r5, 0x1F - bne _08193C3C -_08193C20: - movs r0, 0x5 - bl PlaySE - movs r0, 0 - mov r9, r0 - b _08193CDE - .pool -_08193C3C: - cmp r5, 0xF - bgt _08193C4C - movs r0, 0x5 - bl PlaySE - movs r1, 0x2 - mov r9, r1 - b _08193CDE -_08193C4C: - movs r0, 0x5 - bl PlaySE - movs r0, 0x3 - mov r9, r0 - b _08193CDE -_08193C58: - cmp r2, 0x40 - bne _08193C78 - ldr r0, =gUnknown_0860CBF1 - lsls r1, r5, 2 - adds r1, r5 - adds r1, r6 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0xFF - beq _08193C78 - movs r1, 0 - mov r8, r1 - b _08193CDE - .pool -_08193C78: - ldrh r0, [r3, 0x2E] - cmp r0, 0x80 - bne _08193C9C - ldr r0, =gUnknown_0860CBF1 - lsls r1, r5, 2 - adds r1, r5 - adds r1, r6 - lsls r1, 2 - adds r0, 0x1 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0xFF - beq _08193C9C - movs r0, 0x1 - b _08193CDC - .pool -_08193C9C: - ldrh r0, [r3, 0x2E] - cmp r0, 0x20 - bne _08193CC0 - ldr r0, =gUnknown_0860CBF1 - lsls r1, r5, 2 - adds r1, r5 - adds r1, r6 - lsls r1, 2 - adds r0, 0x2 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0xFF - beq _08193CC0 - movs r1, 0x2 - mov r8, r1 - b _08193CDE - .pool -_08193CC0: - ldrh r0, [r3, 0x2E] - cmp r0, 0x10 - bne _08193CDE - ldr r0, =gUnknown_0860CBF1 - lsls r1, r5, 2 - adds r1, r5 - adds r1, r6 - lsls r1, 2 - adds r0, 0x3 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0xFF - beq _08193CDE - movs r0, 0x3 -_08193CDC: - mov r8, r0 -_08193CDE: - mov r1, r8 - cmp r1, 0x4 - beq _08193D26 - movs r0, 0x5 - bl PlaySE - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - ldr r4, =gSprites - adds r0, r4 - movs r1, 0 - bl StartSpriteAnim - ldr r2, =gUnknown_0860CBF1 - lsls r1, r6, 2 - add r1, r8 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 2 - adds r1, r0 - adds r1, r2 - ldrb r5, [r1] - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - adds r0, r4 - movs r1, 0x1 - bl StartSpriteAnim - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - strh r5, [r0, 0xA] -_08193D26: - mov r0, r9 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8193BDC - - thumb_func_start sub_8193D40 -sub_8193D40: @ 8193D40 - push {lr} - ldr r0, =sub_8194220 - movs r1, 0 - 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 r2, 0 - strh r2, [r1, 0x8] - movs r0, 0x1 - strh r0, [r1, 0xA] - movs r0, 0x2 - strh r0, [r1, 0xC] - strh r2, [r1, 0x10] - ldr r0, =sub_8194B54 - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8193D40 - - thumb_func_start sub_8193D7C -sub_8193D7C: @ 8193D7C - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r7, =gSpecialVar_0x8005 - ldrh r0, [r7] - cmp r0, 0x1 - bne _08193E10 - ldr r5, =gTrainerBattleOpponent_A - ldrh r0, [r5] - bl sub_8195358 - ldr r4, =gSaveBlock2Ptr - ldr r2, [r4] - lsls r0, 2 - adds r2, r0 - ldr r6, =0x00000d25 - adds r2, r6 - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldrh r0, [r5] - bl sub_8195358 - ldr r1, [r4] - lsls r0, 2 - adds r0, r1, r0 - ldr r2, =0x00000cb2 - mov r8, r2 - add r1, r8 - adds r0, r6 - movs r3, 0x3 - ldrb r2, [r1] - ands r2, r3 - lsls r2, 3 - ldrb r3, [r0] - movs r1, 0x19 - negs r1, r1 - ands r1, r3 - orrs r1, r2 - strb r1, [r0] - ldrh r0, [r5] - bl sub_8195358 - ldr r2, [r4] - lsls r0, 1 - movs r3, 0xEC - lsls r3, 4 - adds r1, r2, r3 - adds r1, r0 - ldr r0, =gBattleResults - ldrh r0, [r0, 0x22] - strh r0, [r1] - add r2, r8 - ldrh r0, [r2] - cmp r0, 0x2 - bhi _08193EAE - lsls r0, 24 - lsrs r0, 24 - bl sub_8195438 - b _08193EAE - .pool -_08193E10: - ldr r5, =0x000003ff - adds r0, r5, 0 - bl sub_8195358 - ldr r4, =gSaveBlock2Ptr - ldr r2, [r4] - lsls r0, 2 - adds r2, r0 - ldr r6, =0x00000d25 - adds r2, r6 - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - adds r0, r5, 0 - bl sub_8195358 - ldr r1, [r4] - lsls r0, 2 - adds r0, r1, r0 - ldr r2, =0x00000cb2 - adds r1, r2 - adds r0, r6 - movs r3, 0x3 - ldrb r2, [r1] - ands r2, r3 - lsls r2, 3 - ldrb r3, [r0] - movs r1, 0x19 - negs r1, r1 - ands r1, r3 - orrs r1, r2 - strb r1, [r0] - adds r0, r5, 0 - bl sub_8195358 - ldr r1, [r4] - lsls r0, 1 - movs r3, 0xEC - lsls r3, 4 - adds r1, r3 - adds r1, r0 - ldr r0, =gBattleResults - ldrh r0, [r0, 0x24] - strh r0, [r1] - ldr r0, =gBattleOutcome - ldrb r0, [r0] - cmp r0, 0x9 - beq _08193E78 - ldrh r0, [r7] - cmp r0, 0x9 - bne _08193E92 -_08193E78: - adds r0, r5, 0 - bl sub_8195358 - ldr r2, [r4] - lsls r0, 2 - adds r2, r0 - adds r2, r6 - ldrb r1, [r2] - movs r0, 0x1F - ands r0, r1 - movs r1, 0x20 - orrs r0, r1 - strb r0, [r2] -_08193E92: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r4, [r0] - cmp r4, 0x3 - bgt _08193EAE -_08193EA0: - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_8195438 - adds r4, 0x1 - cmp r4, 0x3 - ble _08193EA0 -_08193EAE: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8193D7C - - thumb_func_start sub_8193ED0 -sub_8193ED0: @ 8193ED0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x84 - str r0, [sp, 0x48] - str r1, [sp, 0x4C] - lsls r4, r2, 24 - lsrs r4, 24 - movs r0, 0 - str r0, [sp, 0x54] - movs r1, 0 - str r1, [sp, 0x58] - bl sub_8165C40 - movs r2, 0 - str r2, [sp, 0x50] - add r3, sp, 0x30 - mov r10, r3 - ldr r5, [sp, 0x4C] - lsls r5, 1 - str r5, [sp, 0x70] - subs r4, 0x1 - str r4, [sp, 0x78] -_08193F02: - movs r0, 0 - mov r9, r0 - ldr r1, [sp, 0x50] - lsls r1, 2 - str r1, [sp, 0x74] - ldr r2, [sp, 0x48] - lsls r2, 2 - str r2, [sp, 0x6C] - ldr r3, [sp, 0x50] - adds r3, 0x1 - str r3, [sp, 0x60] -_08193F18: - ldr r4, [sp, 0x74] - add r4, r9 - lsls r0, r4, 2 - mov r5, sp - adds r1, r5, r0 - movs r0, 0 - str r0, [r1] - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r1, [sp, 0x6C] - adds r0, r3, r1 - ldr r2, =0x00000d24 - adds r0, r2 - ldrh r0, [r0] - lsls r0, 22 - ldr r1, =0xff800000 - cmp r0, r1 - bne _08193F60 - ldr r3, [sp, 0x50] - lsls r0, r3, 24 - mov r5, r9 - lsls r1, r5, 24 - lsrs r1, 24 - lsrs r0, 24 - bl sub_81A5060 - lsls r1, r4, 1 - add r1, r10 - strh r0, [r1] - b _08193F8C - .pool -_08193F60: - lsls r2, r4, 1 - add r2, r10 - ldr r1, [sp, 0x48] - lsls r0, r1, 1 - adds r0, r1 - ldr r4, [sp, 0x50] - adds r0, r4 - lsls r0, 1 - ldr r5, =0x00000d64 - adds r1, r3, r5 - adds r1, r0 - ldrh r0, [r1] - ldr r1, =gUnknown_0203BC8C - ldr r1, [r1] - lsls r0, 4 - adds r0, r1 - mov r3, r9 - lsls r1, r3, 1 - adds r0, 0x2 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r2] -_08193F8C: - ldr r0, =gBattleMoves - ldr r1, [sp, 0x74] - add r1, r9 - lsls r1, 1 - add r1, r10 - ldrh r2, [r1] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r6, [r1, 0x1] - cmp r6, 0 - bne _08193FB8 - movs r6, 0x28 - b _08193FD0 - .pool -_08193FB8: - cmp r6, 0x1 - bne _08193FC0 - movs r6, 0x3C - b _08193FD0 -_08193FC0: - adds r1, r2, 0 - cmp r1, 0x78 - beq _08193FCA - cmp r1, 0x99 - bne _08193FD0 -_08193FCA: - lsrs r0, r6, 31 - adds r0, r6, r0 - asrs r6, r0, 1 -_08193FD0: - movs r1, 0 - mov r4, r9 - adds r4, 0x1 - str r4, [sp, 0x64] - ldr r5, [sp, 0x70] - ldr r2, [sp, 0x4C] - adds r0, r5, r2 - lsls r0, 1 - str r0, [sp, 0x5C] -_08193FE2: - lsls r7, r1, 1 - adds r1, 0x1 - str r1, [sp, 0x68] - ldr r3, [sp, 0x5C] - adds r3, r7 - mov r8, r3 -_08193FEE: - bl Random - adds r4, r0, 0 - bl Random - lsls r4, 16 - lsrs r5, r4, 16 - lsls r0, 16 - orrs r5, r0 - ldr r2, =gSaveBlock2Ptr - ldr r0, [r2] - ldr r4, =0x00000d64 - adds r0, r4 - add r0, r8 - ldrh r4, [r0] - ldr r3, =gUnknown_0203BC8C - ldr r0, [r3] - lsls r4, 4 - adds r4, r0 - adds r0, r5, 0 - str r2, [sp, 0x7C] - str r3, [sp, 0x80] - bl GetNatureFromPersonality - ldrb r1, [r4, 0xC] - lsls r0, 24 - lsrs r0, 24 - ldr r2, [sp, 0x7C] - ldr r3, [sp, 0x80] - cmp r1, r0 - bne _08193FEE - ldr r0, [r2] - ldr r2, [sp, 0x5C] - adds r1, r7, r2 - ldr r4, =0x00000d64 - adds r0, r4 - adds r0, r1 - ldrh r0, [r0] - ldr r1, [r3] - lsls r0, 4 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x1 - ands r5, r0 - cmp r5, 0 - beq _08194068 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - ldr r5, =gBaseStats - adds r0, r5 - ldrb r2, [r0, 0x17] - b _08194074 - .pool -_08194068: - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - ldr r2, =gBaseStats - adds r0, r2 - ldrb r2, [r0, 0x16] -_08194074: - ldr r4, [sp, 0x74] - add r4, r9 - lsls r0, r4, 1 - add r0, r10 - ldrh r0, [r0] - bl ai_rate_move - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0x6 - ands r0, r5 - cmp r0, 0x6 - bne _0819409C - lsls r0, r4, 2 - mov r3, sp - adds r1, r3, r0 - b _081940D8 - .pool -_0819409C: - movs r0, 0x29 - ands r0, r5 - cmp r0, 0 - bne _081940DE - movs r0, 0x2 - ands r0, r5 - cmp r0, 0 - beq _081940B6 - lsls r0, r4, 2 - mov r5, sp - adds r2, r5, r0 - lsls r1, r6, 1 - b _081940CA -_081940B6: - movs r0, 0x4 - ands r5, r0 - cmp r5, 0 - beq _081940D2 - lsls r0, r4, 2 - mov r1, sp - adds r2, r1, r0 - lsrs r1, r6, 31 - adds r1, r6, r1 - asrs r1, 1 -_081940CA: - ldr r0, [r2] - adds r0, r1 - str r0, [r2] - b _081940DE -_081940D2: - lsls r0, r4, 2 - mov r2, sp - adds r1, r2, r0 -_081940D8: - ldr r0, [r1] - adds r0, r6 - str r0, [r1] -_081940DE: - ldr r1, [sp, 0x68] - cmp r1, 0x2 - bgt _081940E6 - b _08193FE2 -_081940E6: - ldr r2, [sp, 0x74] - add r2, r9 - lsls r0, r2, 2 - add r0, sp - ldr r1, [r0] - ldr r3, [sp, 0x54] - cmp r3, r1 - bge _08194104 - lsls r0, r2, 16 - lsrs r0, 16 - str r0, [sp, 0x58] - lsls r0, r1, 16 - lsrs r0, 16 - str r0, [sp, 0x54] - b _08194122 -_08194104: - ldr r4, [sp, 0x54] - cmp r4, r1 - bne _08194122 - ldr r5, [sp, 0x58] - lsls r0, r5, 1 - add r0, r10 - lsls r1, r2, 1 - add r1, r10 - ldrh r0, [r0] - ldrh r1, [r1] - cmp r0, r1 - bcs _08194122 - lsls r0, r2, 16 - lsrs r0, 16 - str r0, [sp, 0x58] -_08194122: - ldr r0, [sp, 0x64] - mov r9, r0 - cmp r0, 0x3 - bgt _0819412C - b _08193F18 -_0819412C: - ldr r1, [sp, 0x60] - str r1, [sp, 0x50] - cmp r1, 0x2 - bgt _08194136 - b _08193F02 -_08194136: - ldr r2, [sp, 0x58] - mov r9, r2 - b _08194182 -_0819413C: - movs r3, 0 - mov r9, r3 - movs r1, 0 - mov r4, r10 - mov r3, r10 - mov r2, sp -_08194148: - ldr r0, [r2] - ldr r5, [sp, 0x54] - cmp r5, r0 - bge _0819415A - mov r9, r1 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x54] - b _08194170 -_0819415A: - ldr r5, [sp, 0x54] - cmp r5, r0 - bne _08194170 - mov r5, r9 - lsls r0, r5, 1 - adds r0, r4, r0 - ldrh r0, [r0] - ldrh r5, [r3] - cmp r0, r5 - bcs _08194170 - mov r9, r1 -_08194170: - adds r3, 0x2 - adds r2, 0x4 - adds r1, 0x1 - cmp r1, 0xB - ble _08194148 - ldr r0, [sp, 0x50] - ldr r1, [sp, 0x78] - cmp r0, r1 - beq _081941F4 -_08194182: - movs r2, 0 - str r2, [sp, 0x50] - mov r3, r9 - lsls r7, r3, 2 - ldr r4, [sp, 0x78] - cmp r2, r4 - bge _081941CA - lsls r0, r3, 1 - mov r5, r10 - adds r6, r5, r0 - ldr r0, [sp, 0x48] - lsls r5, r0, 24 -_0819419A: - ldr r0, =gSaveBlock2Ptr - ldr r4, [r0] - ldr r2, [sp, 0x50] - lsls r1, r2, 24 - lsrs r1, 24 - lsrs r0, r5, 24 - bl sub_81953E8 - lsls r0, 24 - lsrs r0, 23 - movs r3, 0xEC - lsls r3, 4 - adds r4, r3 - adds r4, r0 - ldrh r0, [r4] - ldrh r4, [r6] - cmp r0, r4 - beq _081941CA - ldr r0, [sp, 0x50] - adds r0, 0x1 - str r0, [sp, 0x50] - ldr r1, [sp, 0x78] - cmp r0, r1 - blt _0819419A -_081941CA: - ldr r2, [sp, 0x50] - ldr r3, [sp, 0x78] - cmp r2, r3 - beq _081941F4 - mov r4, sp - adds r1, r4, r7 - movs r0, 0 - str r0, [r1] - movs r5, 0 - str r5, [sp, 0x54] - mov r9, r5 - mov r2, sp - movs r1, 0xB -_081941E4: - ldm r2!, {r0} - add r9, r0 - subs r1, 0x1 - cmp r1, 0 - bge _081941E4 - mov r0, r9 - cmp r0, 0 - bne _0819413C -_081941F4: - mov r1, r9 - lsls r0, r1, 2 - add r0, sp - ldr r0, [r0] - cmp r0, 0 - bne _08194204 - ldr r2, [sp, 0x58] - mov r9, r2 -_08194204: - mov r3, r9 - lsls r0, r3, 1 - add r0, r10 - ldrh r0, [r0] - add sp, 0x84 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8193ED0 - - thumb_func_start sub_8194220 -sub_8194220: @ 8194220 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x28 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r1, =gTasks - lsls r0, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r2, 0xA - ldrsh r1, [r0, r2] - mov r10, r1 - movs r3, 0xC - ldrsh r4, [r0, r3] - movs r1, 0x8 - ldrsh r0, [r0, r1] - cmp r0, 0x5 - bls _08194250 - b _081948C2 -_08194250: - lsls r0, 2 - ldr r1, =_08194264 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08194264: - .4byte _0819427C - .4byte _0819431C - .4byte _0819438C - .4byte _0819447C - .4byte _081944FC - .4byte _081947C8 -_0819427C: - movs r0, 0 - bl SetHBlankCallback - movs r0, 0 - bl SetVBlankCallback - movs r0, 0x3 - bl EnableInterrupts - movs r4, 0 - str r4, [sp, 0x14] - add r0, sp, 0x14 - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x05006000 - bl CpuSet - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0860CE74 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - ldr r0, =gUnknown_0860CE94 - bl InitWindows - bl DeactivateAllTextPrinters - ldr r0, =gUnknown_02022E14 - strh r4, [r0] - ldr r0, =gUnknown_02022E16 - strh r4, [r0] - ldr r0, =gUnknown_02022E18 - strh r4, [r0] - ldr r0, =gUnknown_02022E1A - strh r4, [r0] - 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 r1, 0xB0 - lsls r1, 4 - movs r0, 0x3 - movs r2, 0 - bl ChangeBgY - ldr r1, =gTasks - mov r2, r8 - lsls r0, r2, 2 - b _0819443C - .pool -_0819431C: - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4C - movs r1, 0 - bl SetGpuReg - ldr r1, =0x00005860 - movs r0, 0x40 - bl SetGpuReg - movs r0, 0x44 - movs r1, 0x9F - bl SetGpuReg - ldr r1, =0x00009098 - movs r0, 0x42 - bl SetGpuReg - movs r0, 0x46 - movs r1, 0x9F - bl SetGpuReg - movs r0, 0x48 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4A - movs r1, 0x3F - bl SetGpuReg - bl ResetPaletteFade - bl ResetSpriteData - bl FreeAllSpritePalettes - ldr r1, =gTasks - mov r3, r8 - lsls r0, r3, 2 - b _0819443C - .pool -_0819438C: - ldr r4, =gUnknown_0203CD7C - movs r0, 0x80 - lsls r0, 4 - bl AllocZeroed - adds r1, r0, 0 - str r1, [r4] - ldr r0, =gUnknown_08D83900 - bl LZDecompressWram - ldr r1, [r4] - movs r0, 0x1 - bl SetBgTilemapBuffer - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - ldr r1, =gUnknown_08D82F10 - movs r5, 0x80 - lsls r5, 6 - movs r6, 0 - str r6, [sp] - movs r0, 0x1 - adds r2, r5, 0 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - ldr r1, =gUnknown_08D834FC - str r6, [sp] - movs r0, 0x2 - adds r2, r5, 0 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - ldr r1, =gUnknown_08D83B2C - movs r4, 0x1 - str r4, [sp] - movs r0, 0x2 - adds r2, r5, 0 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - ldr r1, =gUnknown_08D83C3C - str r4, [sp] - movs r0, 0x3 - adds r2, r5, 0 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - ldr r0, =gUnknown_08D85358 - movs r4, 0x80 - lsls r4, 2 - movs r1, 0 - adds r2, r4, 0 - bl LoadCompressedPalette - ldr r0, =gUnknown_08D85444 - movs r1, 0x80 - lsls r1, 1 - adds r2, r4, 0 - bl LoadCompressedPalette - ldr r0, =gUnknown_08D85600 - movs r1, 0xF0 - movs r2, 0x20 - bl LoadCompressedPalette - str r6, [sp, 0x18] - add r0, sp, 0x18 - ldr r1, =gPlttBufferFaded - ldr r2, =0x05000100 - bl CpuSet - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - ldr r1, =gTasks - mov r4, r8 - lsls r0, r4, 2 -_0819443C: - add r0, r8 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x8] - adds r1, 0x1 - strh r1, [r0, 0x8] - b _081948C2 - .pool -_0819447C: - ldr r0, =gUnknown_0860CF50 - bl LoadCompressedObjectPic - mov r0, r8 - lsls r0, 2 - str r0, [sp, 0x1C] - mov r1, r10 - cmp r1, 0 - bne _081944E8 - movs r5, 0 - ldr r4, =gUnknown_0860D411 -_08194492: - ldrb r1, [r4] - ldrb r2, [r4, 0x1] - ldr r0, =gUnknown_0860CFA8 - movs r3, 0 - bl CreateSprite - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x1E - bls _08194492 - ldr r0, =gTasks - ldr r1, [sp, 0x1C] - add r1, r8 - lsls r1, 3 - adds r1, r0 - movs r2, 0x10 - ldrsh r0, [r1, r2] - cmp r0, 0 - beq _081944DC - ldr r0, =gUnknown_0860D008 - movs r1, 0xDA - movs r2, 0xC - movs r3, 0 - bl CreateSprite - b _081944E8 - .pool -_081944DC: - ldr r0, =gUnknown_0860CFD8 - movs r1, 0xDA - movs r2, 0xC - movs r3, 0 - bl CreateSprite -_081944E8: - ldr r1, =0x00007f40 - movs r0, 0 - bl SetGpuReg - b _081947A6 - .pool -_081944FC: - add r0, sp, 0x4 - movs r2, 0 - movs r1, 0x2 - strb r1, [r0, 0x5] - ldr r0, =gUnknown_085CCCEE - str r0, [sp, 0x4] - add r0, sp, 0x4 - strb r1, [r0, 0x4] - strb r2, [r0, 0x6] - strb r2, [r0, 0x7] - strb r1, [r0, 0xA] - strb r2, [r0, 0xB] - ldrb r0, [r0, 0x5] - ldr r1, [sp, 0x4] - add r2, sp, 0x4 - ldrb r3, [r2, 0xA] - movs r2, 0x70 - bl GetStringCenterAlignXOffsetWithLetterSpacing - add r1, sp, 0x4 - strb r0, [r1, 0x8] - movs r0, 0x1 - strb r0, [r1, 0x9] - adds r3, r1, 0 - ldrb r2, [r3, 0xC] - movs r1, 0x10 - negs r1, r1 - adds r0, r1, 0 - ands r0, r2 - strb r0, [r3, 0xC] - adds r2, r3, 0 - movs r0, 0xE0 - strb r0, [r2, 0xC] - ldrb r0, [r2, 0xD] - ands r1, r0 - strb r1, [r2, 0xD] - adds r1, r2, 0 - movs r0, 0xD0 - strb r0, [r1, 0xD] - adds r0, r1, 0 - movs r1, 0 - movs r2, 0 - bl AddTextPrinter - mov r3, r8 - lsls r3, 2 - str r3, [sp, 0x1C] - add r4, sp, 0x4 - movs r0, 0xF - mov r9, r0 - movs r1, 0 - str r1, [sp, 0x20] - movs r2, 0 - str r2, [sp, 0x24] - movs r7, 0 - movs r5, 0xF -_0819456C: - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - adds r0, r7 - ldr r1, =0x00000d24 - adds r0, r1 - ldrh r1, [r0] - lsls r1, 22 - lsrs r1, 22 - ldr r0, =gDisplayedStringBattle - bl sub_8195898 - mov r2, r10 - cmp r2, 0x1 - bne _081945C4 - ldr r3, =gSaveBlock2Ptr - ldr r2, [r3] - adds r0, r2, r7 - ldr r1, =0x00000d25 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 29 - cmp r0, 0 - blt _081945DC - ldr r3, =0x00000cb2 - adds r0, r2, r3 - ldrh r1, [r0] - cmp r1, 0x1 - beq _08194634 - ldr r2, [sp, 0x24] - lsrs r0, r2, 24 - subs r1, 0x2 - b _081945EA - .pool -_081945C4: - mov r3, r10 - cmp r3, 0 - bne _08194634 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - adds r0, r2, r7 - ldr r1, =0x00000d25 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 29 - cmp r0, 0 - bge _081945FC -_081945DC: - lsls r1, 27 - lsrs r0, r1, 30 - cmp r0, 0 - beq _08194634 - subs r1, r0, 0x1 - ldr r2, [sp, 0x24] - lsrs r0, r2, 24 -_081945EA: - lsls r1, 24 - lsrs r1, 24 - bl sub_81948EC - b _08194634 - .pool -_081945FC: - ldr r3, =0x00000cb2 - adds r1, r2, r3 - ldrh r0, [r1] - cmp r0, 0 - beq _08194634 - ldr r0, [sp, 0x1C] - add r0, r8 - lsls r0, 3 - ldr r2, =gTasks - adds r0, r2 - movs r3, 0x10 - ldrsh r0, [r0, r3] - cmp r0, 0 - beq _08194624 - ldrh r1, [r1] - b _08194628 - .pool -_08194624: - ldrh r0, [r1] - subs r1, r0, 0x1 -_08194628: - ldr r2, [sp, 0x24] - lsrs r0, r2, 24 - lsls r1, 24 - lsrs r1, 24 - bl sub_81948EC -_08194634: - ldr r0, [sp, 0x1C] - add r0, r8 - lsls r0, 3 - ldr r3, =gTasks - adds r0, r3 - movs r1, 0x10 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _08194660 - ldr r2, =gSaveBlock2Ptr - ldr r0, [r2] - ldr r3, =0x00000cb2 - adds r0, r3 - ldrh r3, [r0] - adds r6, r2, 0 - b _0819466E - .pool -_08194660: - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r2, =0x00000cb2 - adds r0, r2 - ldrh r0, [r0] - subs r3, r0, 0x1 - adds r6, r1, 0 -_0819466E: - mov r0, r10 - cmp r0, 0x1 - bne _0819468E - ldr r2, [r6] - adds r0, r2, r7 - ldr r1, =0x00000d25 - adds r0, r1 - ldrb r1, [r0] - lsls r1, 27 - lsrs r1, 30 - ldr r0, =0x00000cb2 - adds r2, r0 - ldrh r0, [r2] - subs r0, 0x1 - cmp r1, r0 - blt _081946A6 -_0819468E: - mov r1, r10 - cmp r1, 0 - bne _081946FA - ldr r0, [r6] - adds r0, r7 - ldr r2, =0x00000d25 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 27 - lsrs r0, 30 - cmp r0, r3 - bgt _081946FA -_081946A6: - ldr r0, [r6] - adds r1, r0, r7 - ldr r3, =0x00000d25 - adds r0, r1, r3 - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - bge _081946FA - ldr r2, =0x00000d24 - adds r0, r1, r2 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - ldr r3, =0x000003ff - cmp r0, r3 - bne _081946F0 - ldrb r1, [r4, 0xC] - mov r0, r9 - ands r0, r1 - movs r1, 0x30 - orrs r0, r1 - strb r0, [r4, 0xC] - ldrb r1, [r4, 0xD] - mov r0, r9 - ands r0, r1 - movs r1, 0x40 - b _08194740 - .pool -_081946F0: - ldrb r1, [r4, 0xC] - mov r0, r9 - ands r0, r1 - movs r1, 0xB0 - b _08194734 -_081946FA: - ldr r0, [r6] - adds r0, r7 - ldr r1, =0x00000d24 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - ldr r2, =0x000003ff - cmp r0, r2 - bne _0819472C - ldrb r1, [r4, 0xC] - mov r0, r9 - ands r0, r1 - movs r1, 0x30 - orrs r0, r1 - strb r0, [r4, 0xC] - ldrb r1, [r4, 0xD] - mov r0, r9 - ands r0, r1 - movs r1, 0x40 - b _08194740 - .pool -_0819472C: - ldrb r1, [r4, 0xC] - mov r0, r9 - ands r0, r1 - movs r1, 0xE0 -_08194734: - orrs r0, r1 - strb r0, [r4, 0xC] - ldrb r1, [r4, 0xD] - mov r0, r9 - ands r0, r1 - movs r1, 0xD0 -_08194740: - orrs r0, r1 - strb r0, [r4, 0xD] - ldr r0, =gUnknown_0860D3F1 - ldr r3, [sp, 0x20] - adds r0, r3, r0 - ldrb r0, [r0] - cmp r0, 0 - bne _08194768 - ldrb r0, [r4, 0x5] - ldrb r3, [r4, 0xA] - ldr r1, =gDisplayedStringBattle - movs r2, 0x3D - bl GetStringWidthDifference - b _0819476A - .pool -_08194768: - movs r0, 0x3 -_0819476A: - strb r0, [r4, 0x8] - ldr r0, =gDisplayedStringBattle - str r0, [sp, 0x4] - ldr r0, =gUnknown_0860D3F1 - ldr r1, [sp, 0x20] - adds r0, r1, r0 - ldrb r0, [r0] - strb r0, [r4, 0x4] - ldr r2, =gUnknown_0860D3F2 - adds r0, r1, r2 - ldrb r0, [r0] - strb r0, [r4, 0x9] - add r0, sp, 0x4 - movs r1, 0 - movs r2, 0 - bl AddTextPrinter - ldr r3, [sp, 0x20] - adds r3, 0x2 - str r3, [sp, 0x20] - ldr r0, [sp, 0x24] - movs r1, 0x80 - lsls r1, 17 - adds r0, r1 - str r0, [sp, 0x24] - adds r7, 0x4 - subs r5, 0x1 - cmp r5, 0 - blt _081947A6 - b _0819456C -_081947A6: - ldr r0, =gTasks - ldr r1, [sp, 0x1C] - add r1, r8 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _081948C2 - .pool -_081947C8: - movs r0, 0 - bl PutWindowTilemap - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0x2 - bl PutWindowTilemap - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - movs r0, 0x1 - movs r1, 0x3 - bl CopyWindowToVram - movs r0, 0x2 - movs r1, 0x3 - bl CopyWindowToVram - ldr r0, =sub_8194BEC - bl SetHBlankCallback - ldr r0, =sub_8194CE4 - bl SetVBlankCallback - cmp r4, 0x2 - bne _0819485C - mov r2, r10 - cmp r2, 0 - bne _08194844 - ldr r0, =sub_819395C - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r5, r0, 24 - ldr r2, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r2 - mov r3, r10 - strh r3, [r1, 0x8] - strh r3, [r1, 0xA] - mov r4, r8 - lsls r0, r4, 2 - add r0, r8 - lsls r0, 3 - adds r0, r2 - ldrh r0, [r0, 0x10] - strh r0, [r1, 0x14] - b _08194878 - .pool -_08194844: - ldr r0, =sub_8194950 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - b _0819486C - .pool -_0819485C: - ldr r1, =gTasks - mov r2, r8 - lsls r0, r2, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r3, 0xE - ldrsh r5, [r0, r3] -_0819486C: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x8] -_08194878: - bl dp12_8087EA4 - ldr r0, =gUnknown_02038C28 - ldr r2, =0x00001f0a - movs r4, 0xF0 - lsls r4, 3 - adds r1, r0, r4 - movs r5, 0x5A -_08194888: - strh r2, [r0] - strh r2, [r1] - adds r1, 0x2 - adds r0, 0x2 - subs r5, 0x1 - cmp r5, 0 - bge _08194888 - movs r5, 0x5B - ldr r3, =gUnknown_0860CF44 - ldr r0, =gUnknown_02038C28 - ldr r2, =0x00001f09 - ldr r4, =0x00000836 - adds r1, r0, r4 - adds r0, 0xB6 -_081948A4: - strh r2, [r0] - strh r2, [r1] - adds r1, 0x2 - adds r0, 0x2 - adds r5, 0x1 - cmp r5, 0x9F - ble _081948A4 - ldr r0, [r3] - ldr r1, [r3, 0x4] - ldr r2, [r3, 0x8] - bl sub_80BA038 - mov r0, r8 - bl DestroyTask -_081948C2: - add sp, 0x28 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8194220 - - thumb_func_start sub_81948EC -sub_81948EC: @ 81948EC - push {r4-r7,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r4, =gUnknown_0860DD10 - lsls r2, r1, 2 - lsls r3, r0, 4 - adds r2, r3 - adds r2, r4 - ldr r3, [r2] - ldr r2, =gUnknown_0860DE10 - lsls r0, 2 - adds r1, r0 - adds r1, r2 - ldrb r0, [r1] - cmp r0, 0 - beq _08194938 - movs r7, 0x1 - adds r4, r3, 0 - adds r5, r4, 0x2 - adds r6, r0, 0 -_0819491A: - ldrb r2, [r4] - ldrb r3, [r4, 0x1] - str r7, [sp] - str r7, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - adds r1, r5, 0 - bl CopyToBgTilemapBufferRect_ChangePalette - adds r4, 0x4 - adds r5, 0x4 - subs r6, 0x1 - cmp r6, 0 - bne _0819491A -_08194938: - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81948EC - - thumb_func_start sub_8194950 -sub_8194950: @ 8194950 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x14 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r2, r1, 0 - cmp r0, 0x4 - bls _08194974 - b _08194B3C -_08194974: - lsls r0, 2 - ldr r1, =_08194988 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08194988: - .4byte _0819499C - .4byte _081949C0 - .4byte _08194AD4 - .4byte _08194AEE - .4byte _08194B24 -_0819499C: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0x1 - strh r1, [r0, 0x8] - b _08194B3C - .pool -_081949C0: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081949CE - b _08194B3C -_081949CE: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r2 - movs r2, 0 - movs r3, 0x2 - movs r1, 0x2 - strh r1, [r0, 0x8] - movs r1, 0x40 - strh r1, [r0, 0xE] - add r0, sp, 0x4 - strb r3, [r0, 0x5] - strb r2, [r0, 0x6] - strb r2, [r0, 0x7] - strb r3, [r0, 0xA] - strb r2, [r0, 0xB] - adds r3, r0, 0 - ldrb r2, [r3, 0xC] - subs r1, 0x50 - adds r0, r1, 0 - ands r0, r2 - strb r0, [r3, 0xC] - adds r2, r3, 0 - movs r0, 0xB0 - strb r0, [r2, 0xC] - ldrb r0, [r2, 0xD] - ands r1, r0 - strb r1, [r2, 0xD] - adds r1, r2, 0 - movs r0, 0xD0 - strb r0, [r1, 0xD] - movs r7, 0 - ldr r0, =gDisplayedStringBattle - mov r9, r0 - ldr r1, =gSaveBlock2Ptr - mov r8, r1 - adds r4, r2, 0 - ldr r6, =gUnknown_0860D3F1 - movs r5, 0 -_08194A1C: - mov r2, r8 - ldr r0, [r2] - adds r0, r5 - ldr r1, =0x00000d24 - adds r0, r1 - ldrh r1, [r0] - lsls r1, 22 - lsrs r1, 22 - mov r0, r9 - bl sub_8195898 - mov r0, r8 - ldr r2, [r0] - adds r0, r2, r5 - ldr r1, =0x00000d25 - adds r0, r1 - ldrb r3, [r0] - lsls r1, r3, 27 - lsrs r1, 30 - ldr r0, =0x00000cb2 - adds r2, r0 - ldrh r0, [r2] - subs r0, 0x1 - cmp r1, r0 - bne _08194A9E - lsls r0, r3, 29 - cmp r0, 0 - bge _08194A9E - ldrb r0, [r6] - cmp r0, 0 - bne _08194A84 - ldrb r0, [r4, 0x5] - ldrb r3, [r4, 0xA] - mov r1, r9 - movs r2, 0x3D - bl GetStringWidthDifference - b _08194A86 - .pool -_08194A84: - movs r0, 0x3 -_08194A86: - strb r0, [r4, 0x8] - mov r1, r9 - str r1, [sp, 0x4] - ldrb r0, [r6] - strb r0, [r4, 0x4] - ldrb r0, [r6, 0x1] - strb r0, [r4, 0x9] - add r0, sp, 0x4 - movs r1, 0 - movs r2, 0 - bl AddTextPrinter -_08194A9E: - mov r2, r8 - ldr r1, [r2] - adds r0, r1, r5 - ldr r2, =0x00000d25 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _08194AC4 - subs r2, 0x73 - adds r0, r1, r2 - ldrh r1, [r0] - subs r1, 0x1 - lsls r0, r7, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - bl sub_81948EC -_08194AC4: - adds r6, 0x2 - adds r5, 0x4 - adds r7, 0x1 - cmp r7, 0xF - ble _08194A1C - b _08194B3C - .pool -_08194AD4: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r2 - ldrh r0, [r1, 0xE] - subs r0, 0x1 - strh r0, [r1, 0xE] - lsls r0, 16 - cmp r0, 0 - bne _08194B3C - movs r0, 0x3 - strh r0, [r1, 0x8] - b _08194B3C -_08194AEE: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _08194B3C - 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 - movs r1, 0x4 - strh r1, [r0, 0x8] - b _08194B3C - .pool -_08194B24: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08194B3C - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 - adds r0, r4, 0 - bl DestroyTask -_08194B3C: - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8194950 - - thumb_func_start sub_8194B54 -sub_8194B54: @ 8194B54 - push {lr} - bl AnimateSprites - bl BuildOamBuffer - bl RunTextPrinters - bl UpdatePaletteFade - bl RunTasks - pop {r0} - bx r0 - thumb_func_end sub_8194B54 - - thumb_func_start sub_8194B70 -sub_8194B70: @ 8194B70 - push {lr} - movs r0, 0x3 - movs r1, 0x80 - movs r2, 0x1 - bl ChangeBgX - movs r0, 0x3 - movs r1, 0x80 - movs r2, 0x2 - bl ChangeBgY - ldr r0, =gUnknown_02022E14 - ldrh r1, [r0] - movs r0, 0x10 - bl SetGpuReg - ldr r0, =gUnknown_02022E16 - ldrh r1, [r0] - movs r0, 0x12 - bl SetGpuReg - ldr r0, =gUnknown_02022E18 - ldrh r1, [r0] - movs r0, 0x14 - bl SetGpuReg - ldr r0, =gUnknown_02022E1A - ldrh r1, [r0] - movs r0, 0x16 - bl SetGpuReg - ldr r0, =gUnknown_02022E1C - ldrh r1, [r0] - movs r0, 0x18 - bl SetGpuReg - ldr r0, =gUnknown_02022E1E - ldrh r1, [r0] - movs r0, 0x1A - bl SetGpuReg - bl LoadOam - bl ProcessSpriteCopyRequests - bl TransferPlttBuffer - pop {r0} - bx r0 - .pool - thumb_func_end sub_8194B70 - - thumb_func_start sub_8194BEC -sub_8194BEC: @ 8194BEC - push {lr} - ldr r0, =0x04000006 - ldrh r0, [r0] - adds r1, r0, 0 - cmp r0, 0x29 - bls _08194CC8 - cmp r0, 0x31 - bhi _08194C1C - ldr r1, =0x04000048 - ldr r2, =0x00003b3b - adds r0, r2, 0 - strh r0, [r1] - subs r1, 0x8 - ldr r0, =0x989b5558 - b _08194CD4 - .pool -_08194C1C: - cmp r0, 0x39 - bls _08194CC8 - cmp r0, 0x4A - bhi _08194C40 - ldr r1, =0x04000048 - ldr r2, =0x00003b3b - adds r0, r2, 0 - strh r0, [r1] - subs r1, 0x8 - ldr r0, =0x90985860 - b _08194CD4 - .pool -_08194C40: - cmp r0, 0x51 - bhi _08194C60 - ldr r1, =0x04000048 - ldr r2, =0x00003b3b - adds r0, r2, 0 - strh r0, [r1] - subs r1, 0x8 - ldr r0, =0x989b5558 - b _08194CD4 - .pool -_08194C60: - cmp r0, 0x5E - bls _08194CC8 - cmp r0, 0x66 - bhi _08194C84 - ldr r1, =0x04000048 - ldr r2, =0x00003737 - adds r0, r2, 0 - strh r0, [r1] - subs r1, 0x8 - ldr r0, =0x989b5558 - b _08194CD4 - .pool -_08194C84: - cmp r0, 0x76 - bhi _08194CA4 - ldr r1, =0x04000048 - ldr r2, =0x00003737 - adds r0, r2, 0 - strh r0, [r1] - subs r1, 0x8 - ldr r0, =0x90985860 - b _08194CD4 - .pool -_08194CA4: - cmp r0, 0x7E - bls _08194CC8 - cmp r1, 0x86 - bhi _08194CC8 - ldr r1, =0x04000048 - ldr r2, =0x00003737 - adds r0, r2, 0 - strh r0, [r1] - subs r1, 0x8 - ldr r0, =0x989b5558 - b _08194CD4 - .pool -_08194CC8: - ldr r1, =0x04000048 - ldr r2, =0x00003f3f - adds r0, r2, 0 - strh r0, [r1] - subs r1, 0x8 - movs r0, 0 -_08194CD4: - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8194BEC - - thumb_func_start sub_8194CE4 -sub_8194CE4: @ 8194CE4 - push {lr} - ldr r0, =gUnknown_02022E14 - ldrh r1, [r0] - movs r0, 0x10 - bl SetGpuReg - ldr r0, =gUnknown_02022E16 - ldrh r1, [r0] - movs r0, 0x12 - bl SetGpuReg - ldr r0, =gUnknown_02022E18 - ldrh r1, [r0] - movs r0, 0x14 - bl SetGpuReg - ldr r0, =gUnknown_02022E1A - ldrh r1, [r0] - movs r0, 0x16 - bl SetGpuReg - movs r0, 0x2 - movs r1, 0x80 - movs r2, 0x2 - bl ChangeBgY - movs r0, 0x3 - movs r1, 0x80 - movs r2, 0x1 - bl ChangeBgY - bl LoadOam - bl ProcessSpriteCopyRequests - bl TransferPlttBuffer - bl sub_80BA0A8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8194CE4 - - thumb_func_start sub_8194D48 -sub_8194D48: @ 8194D48 - ldr r1, =gUnknown_0203BC8C - ldr r0, =gBattleFrontierMons - str r0, [r1] - ldr r1, =gUnknown_0203BC88 - ldr r0, =gBattleFrontierTrainers - str r0, [r1] - bx lr - .pool - thumb_func_end sub_8194D48 - - thumb_func_start sub_8194D68 -sub_8194D68: @ 8194D68 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - movs r3, 0 -_08194D76: - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r0, =gUnknown_0203CEF8 - adds r0, r3, r0 - ldrb r0, [r0] - subs r0, 0x1 - lsls r0, 1 - ldr r2, =0x00000caa - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - subs r0, 0x1 - mov r10, r0 - movs r6, 0 - adds r0, r3, 0x1 - str r0, [sp] - movs r1, 0x64 - mov r0, r10 - muls r0, r1 - movs r2, 0x8E - lsls r2, 2 - adds r2, r0 - mov r9, r2 - adds r7, r3, 0 - muls r7, r1 -_08194DA8: - movs r5, 0 - adds r0, r6, 0x1 - mov r8, r0 - b _08194DBE - .pool -_08194DBC: - adds r5, 0x1 -_08194DBE: - cmp r5, 0x3 - bgt _08194DEA - ldr r1, =gSaveBlock1Ptr - ldr r0, [r1] - add r0, r9 - adds r1, r5, 0 - adds r1, 0xD - movs r2, 0 - str r3, [sp, 0x4] - bl GetMonData - adds r4, r0, 0 - adds r1, r6, 0 - adds r1, 0xD - ldr r2, =gPlayerParty - adds r0, r7, r2 - movs r2, 0 - bl GetMonData - ldr r3, [sp, 0x4] - cmp r4, r0 - bne _08194DBC -_08194DEA: - cmp r5, 0x4 - bne _08194E00 - lsls r2, r6, 24 - lsrs r2, 24 - ldr r1, =gPlayerParty - adds r0, r7, r1 - movs r1, 0xA6 - str r3, [sp, 0x4] - bl SetMonMoveSlot - ldr r3, [sp, 0x4] -_08194E00: - mov r6, r8 - cmp r6, 0x3 - ble _08194DA8 - ldr r2, =gSaveBlock1Ptr - ldr r0, [r2] - movs r2, 0x64 - mov r1, r10 - muls r1, r2 - adds r0, r1 - movs r1, 0x8E - lsls r1, 2 - adds r0, r1 - adds r1, r3, 0 - muls r1, r2 - ldr r2, =gPlayerParty - adds r1, r2 - movs r2, 0x64 - bl memcpy - ldr r3, [sp] - cmp r3, 0x1 - ble _08194D76 - 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_8194D68 - - thumb_func_start sub_8194E44 -sub_8194E44: @ 8194E44 - push {r4-r7,lr} - sub sp, 0x4 - movs r4, 0 - ldr r7, =gSaveBlock1Ptr - movs r6, 0x64 - movs r5, 0 -_08194E50: - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r0, =gUnknown_0203CEF8 - adds r0, r4, r0 - ldrb r0, [r0] - subs r0, 0x1 - lsls r0, 1 - ldr r2, =0x00000caa - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - subs r0, 0x1 - adds r1, r0, 0 - muls r1, r6 - movs r0, 0x8E - lsls r0, 2 - adds r1, r0 - ldr r0, [r7] - adds r0, r1 - movs r1, 0xC - movs r2, 0 - bl GetMonData - mov r1, sp - strh r0, [r1] - ldr r0, =gPlayerParty - adds r0, r5, r0 - movs r1, 0xC - mov r2, sp - bl SetMonData - adds r5, 0x64 - adds r4, 0x1 - cmp r4, 0x1 - ble _08194E50 - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8194E44 - - thumb_func_start sub_8194EB4 -sub_8194EB4: @ 8194EB4 - push {lr} - bl sub_80F94E8 - pop {r0} - bx r0 - thumb_func_end sub_8194EB4 - - thumb_func_start sub_8194EC0 -sub_8194EC0: @ 8194EC0 - push {r4,lr} - ldr r0, =gTrainerBattleOpponent_A - ldrh r0, [r0] - bl sub_8195358 - adds r4, r0, 0 - ldr r0, =0x000003ff - bl sub_8195358 - cmp r4, r0 - ble _08194EE8 - ldr r1, =gScriptResult - movs r0, 0x1 - b _08194EEC - .pool -_08194EE8: - ldr r1, =gScriptResult - movs r0, 0x2 -_08194EEC: - strh r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8194EC0 - - thumb_func_start sub_8194EF8 -sub_8194EF8: @ 8194EF8 - push {r4,lr} - bl sub_8194D48 - movs r2, 0 - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - ldr r1, =0x00000d25 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - bge _08194F2A - adds r4, r3, 0 - adds r3, r1, 0 -_08194F14: - adds r2, 0x1 - cmp r2, 0xF - bgt _08194F2A - ldr r0, [r4] - lsls r1, r2, 2 - adds r0, r1 - adds r0, r3 - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _08194F14 -_08194F2A: - ldr r0, =gStringVar1 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - lsls r2, 2 - adds r1, r2 - ldr r2, =0x00000d24 - adds r1, r2 - ldrh r1, [r1] - lsls r1, 22 - lsrs r1, 22 - bl sub_8195898 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8194EF8 - - thumb_func_start sub_8194F58 -sub_8194F58: @ 8194F58 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x40 - movs r0, 0 - str r0, [sp, 0x8] - str r0, [sp, 0xC] - str r0, [sp, 0x10] - ldr r4, =gSaveBlock2Ptr - ldr r2, [r4] - ldr r5, =0x00000d0a - adds r0, r2, r5 - ldrb r1, [r0] - ldr r6, =0x00000d0b - adds r0, r2, r6 - ldrb r0, [r0] - cmn r1, r0 - beq _08194F8C - ldr r1, =0x00000ca8 - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _08194F8C - b _0819533E -_08194F8C: - movs r0, 0x20 - bl AllocZeroed - str r0, [sp, 0x18] - movs r0, 0x18 - bl AllocZeroed - str r0, [sp, 0x1C] - ldr r1, [r4] - ldr r2, =0x00000ca9 - adds r1, r2 - ldrb r2, [r1] - lsls r0, r2, 30 - lsrs r0, 30 - str r0, [sp, 0x14] - movs r0, 0x4 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r0, [r4] - movs r1, 0x1 - adds r0, r5 - strb r1, [r0] - ldr r0, [r4] - adds r0, r6 - strb r1, [r0] - movs r3, 0 - mov r10, r3 - movs r4, 0 - str r4, [sp, 0x38] - movs r5, 0 - str r5, [sp, 0x3C] -_08194FCC: - mov r0, r10 - cmp r0, 0x4 - bgt _08194FFC - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 16 - lsrs r4, r0, 16 - b _08195030 - .pool -_08194FFC: - mov r1, r10 - cmp r1, 0xE - bgt _0819501A - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x14 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - adds r4, r0, 0 - adds r4, 0xA - b _08195030 -_0819501A: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - adds r4, r0, 0 - adds r4, 0x1E -_08195030: - movs r6, 0 - cmp r6, r10 - bge _08195064 - ldr r2, =gSaveBlock2Ptr - ldr r0, [r2] - ldr r3, =0x00000d24 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - cmp r0, r4 - beq _08195064 - adds r3, r2, 0 - ldr r2, =0x00000d24 -_0819504C: - adds r6, 0x1 - cmp r6, r10 - bge _08195064 - ldr r0, [r3] - lsls r1, r6, 2 - adds r0, r1 - adds r0, r2 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - cmp r0, r4 - bne _0819504C -_08195064: - cmp r6, r10 - bne _08194FCC - ldr r5, =gSaveBlock2Ptr - ldr r3, [r5] - ldr r0, [sp, 0x38] - adds r3, r0 - ldr r1, =0x00000d24 - adds r3, r1 - ldr r2, =0x000003ff - adds r0, r2, 0 - adds r2, r4, 0 - ands r2, r0 - ldrh r0, [r3] - ldr r5, =0xfffffc00 - adds r1, r5, 0 - ands r0, r1 - orrs r0, r2 - strh r0, [r3] - movs r6, 0 - lsls r4, 16 - str r4, [sp, 0x30] - ldr r0, [sp, 0x3C] - str r0, [sp, 0x20] -_08195092: - adds r1, r6, 0x1 - str r1, [sp, 0x24] - lsls r2, r6, 2 - str r2, [sp, 0x2C] - lsls r3, r6, 1 - str r3, [sp, 0x28] -_0819509E: - ldr r4, [sp, 0x30] - lsrs r0, r4, 16 - bl sub_8163524 - lsls r0, 16 - lsrs r5, r0, 16 - movs r7, 0 - cmp r7, r6 - bge _081950F4 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =gUnknown_0203BC8C - mov r9, r1 - ldr r2, [sp, 0x8] - mov r8, r2 - ldr r3, [sp, 0xC] - mov r12, r3 - ldr r4, =0x00000d64 - adds r0, r4 - ldr r1, [sp, 0x20] - adds r4, r1, r0 -_081950C8: - ldrh r3, [r4] - cmp r3, r5 - beq _081950F4 - mov r2, r9 - ldr r1, [r2] - lsls r0, r5, 4 - adds r2, r0, r1 - ldrh r0, [r2] - cmp r8, r0 - beq _081950F4 - cmp r12, r0 - beq _081950F4 - lsls r0, r3, 4 - adds r0, r1 - ldrb r0, [r0, 0xA] - ldrb r2, [r2, 0xA] - cmp r0, r2 - beq _081950F4 - adds r4, 0x2 - adds r7, 0x1 - cmp r7, r6 - blt _081950C8 -_081950F4: - cmp r7, r6 - bne _0819509E - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - ldr r4, [sp, 0x28] - ldr r2, [sp, 0x3C] - adds r1, r4, r2 - ldr r3, =0x00000d64 - adds r0, r3 - adds r0, r1 - strh r5, [r0] - ldr r2, [sp, 0x2C] - add r2, sp - adds r2, 0x8 - ldr r3, =gUnknown_0203BC8C - ldr r1, [r3] - lsls r0, r5, 4 - adds r0, r1 - ldrh r0, [r0] - str r0, [r2] - ldr r6, [sp, 0x24] - cmp r6, 0x2 - ble _08195092 - ldr r4, =gSaveBlock2Ptr - ldr r2, [r4] - ldr r5, [sp, 0x38] - adds r2, r5 - ldr r0, =0x00000d25 - adds r2, r0 - ldrb r0, [r2] - movs r4, 0x5 - negs r4, r4 - adds r1, r4, 0 - ands r0, r1 - strb r0, [r2] - ldr r5, =gSaveBlock2Ptr - ldr r2, [r5] - ldr r0, [sp, 0x38] - adds r2, r0 - ldr r1, =0x00000d25 - adds r2, r1 - ldrb r0, [r2] - subs r4, 0x14 - adds r1, r4, 0 - ands r0, r1 - strb r0, [r2] - ldr r1, [r5] - ldr r5, [sp, 0x38] - adds r1, r5 - ldr r0, =0x00000d25 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x1F - ands r0, r2 - strb r0, [r1] - adds r5, 0x4 - str r5, [sp, 0x38] - ldr r1, [sp, 0x3C] - adds r1, 0x6 - str r1, [sp, 0x3C] - movs r2, 0x1 - add r10, r2 - mov r4, r10 - cmp r4, 0xF - bgt _08195178 - b _08194FCC -_08195178: - movs r5, 0 - mov r10, r5 - ldr r5, [sp, 0x18] - movs r0, 0 - str r0, [sp, 0x34] -_08195182: - movs r7, 0 - strh r7, [r5] - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - mov r2, r10 - lsls r1, r2, 2 - adds r0, r1 - ldr r3, =0x00000d24 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - bl sub_8190168 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r6, 0 - ldr r4, [sp, 0x34] - mov r9, r4 -_081951AA: - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - mov r4, r9 - add r4, r10 - adds r4, r6 - lsls r4, 1 - ldr r2, =0x00000d64 - adds r0, r2 - adds r0, r4 - ldrh r1, [r0] - ldr r3, =gUnknown_0203BC8C - ldr r0, [r3] - lsls r1, 4 - adds r1, r0 - ldrh r0, [r1] - ldrb r3, [r1, 0xB] - ldrb r1, [r1, 0xC] - str r1, [sp] - ldr r1, [sp, 0x1C] - str r1, [sp, 0x4] - movs r1, 0x32 - mov r2, r8 - bl sub_818F720 - ldr r2, [sp, 0x1C] - ldr r1, [r2, 0x4] - ldrh r0, [r5] - adds r0, r1 - ldr r1, [r2, 0x8] - adds r0, r1 - ldr r1, [r2, 0x10] - adds r0, r1 - ldr r1, [r2, 0x14] - adds r0, r1 - ldr r1, [r2, 0xC] - adds r0, r1 - ldr r1, [r2] - adds r0, r1 - strh r0, [r5] - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - ldr r1, =0x00000d64 - adds r0, r1 - adds r0, r4 - ldrh r0, [r0] - ldr r2, =gUnknown_0203BC8C - ldr r1, [r2] - lsls r0, 4 - adds r0, r1 - ldrh r0, [r0] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - ldr r3, =gBaseStats - adds r1, r3 - ldrb r0, [r1, 0x6] - lsls r0, 2 - ldr r4, =gBitTable - adds r0, r4 - ldr r0, [r0] - orrs r7, r0 - ldrb r0, [r1, 0x7] - lsls r0, 2 - adds r0, r4 - ldr r0, [r0] - orrs r7, r0 - adds r6, 0x1 - cmp r6, 0x2 - ble _081951AA - movs r4, 0 - movs r1, 0x1 - movs r6, 0x1F -_0819523A: - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0 - beq _08195244 - adds r4, 0x1 -_08195244: - asrs r7, 1 - subs r6, 0x1 - cmp r6, 0 - bge _0819523A - movs r1, 0x32 - adds r0, r4, 0 - muls r0, r1 - movs r1, 0x14 - bl __divsi3 - ldrh r1, [r5] - adds r1, r0 - strh r1, [r5] - adds r5, 0x2 - ldr r2, [sp, 0x34] - adds r2, 0x2 - str r2, [sp, 0x34] - movs r3, 0x1 - add r10, r3 - mov r4, r10 - cmp r4, 0xF - ble _08195182 - movs r5, 0 - mov r10, r5 - ldr r7, [sp, 0x18] -_08195276: - mov r6, r10 - adds r6, 0x1 - cmp r6, 0xF - bgt _081952F8 - mov r8, r7 - ldr r5, =0x00000d24 - lsls r0, r6, 1 - ldr r1, [sp, 0x18] - adds r4, r0, r1 -_08195288: - mov r2, r8 - ldrh r1, [r2] - ldrh r0, [r4] - cmp r1, r0 - bcs _081952C4 - mov r0, r10 - adds r1, r6, 0 - ldr r2, [sp, 0x18] - bl sub_818F904 - b _081952F0 - .pool -_081952C4: - cmp r1, r0 - bne _081952F0 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - mov r3, r10 - lsls r0, r3, 2 - adds r0, r1, r0 - adds r0, r5 - ldrh r2, [r0] - lsls r2, 22 - lsls r0, r6, 2 - adds r1, r0 - adds r1, r5 - ldrh r0, [r1] - lsls r0, 22 - cmp r2, r0 - bls _081952F0 - mov r0, r10 - adds r1, r6, 0 - ldr r2, [sp, 0x18] - bl sub_818F904 -_081952F0: - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0xF - ble _08195288 -_081952F8: - adds r7, 0x2 - movs r4, 0x1 - add r10, r4 - mov r5, r10 - cmp r5, 0xE - ble _08195276 - ldr r0, [sp, 0x18] - bl Free - ldr r0, [sp, 0x1C] - bl Free - movs r0, 0 - mov r10, r0 -_08195314: - mov r1, r10 - lsls r0, r1, 24 - lsrs r0, 24 - bl sub_8195438 - movs r2, 0x1 - add r10, r2 - mov r3, r10 - cmp r3, 0x3 - ble _08195314 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r4, =0x00000ca9 - adds r1, r4 - ldrb r2, [r1] - movs r0, 0x4 - negs r0, r0 - ands r0, r2 - ldr r5, [sp, 0x14] - orrs r0, r5 - strb r0, [r1] -_0819533E: - add sp, 0x40 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8194F58 - - thumb_func_start sub_8195358 -sub_8195358: @ 8195358 - push {r4,r5,lr} - lsls r0, 16 - lsrs r3, r0, 16 - movs r2, 0 - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000d24 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - cmp r0, r3 - beq _0819538E - adds r5, r4, 0 - adds r4, r1, 0 -_08195376: - adds r2, 0x1 - cmp r2, 0xF - bgt _0819538E - ldr r0, [r5] - lsls r1, r2, 2 - adds r0, r1 - adds r0, r4 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - cmp r0, r3 - bne _08195376 -_0819538E: - adds r0, r2, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8195358 - - thumb_func_start sub_81953A0 -sub_81953A0: @ 81953A0 - push {r4,r5,lr} - lsls r0, 16 - lsrs r3, r0, 16 - movs r2, 0 - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000d24 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - cmp r0, r3 - beq _081953D6 - adds r5, r4, 0 - adds r4, r1, 0 -_081953BE: - adds r2, 0x1 - cmp r2, 0xF - bgt _081953D6 - ldr r0, [r5] - lsls r1, r2, 2 - adds r0, r1 - adds r0, r4 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - cmp r0, r3 - bne _081953BE -_081953D6: - adds r0, r2, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81953A0 - - thumb_func_start sub_81953E8 -sub_81953E8: @ 81953E8 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_0860D1A0 - ldr r0, =gUnknown_0860D1C0 - adds r0, r4, r0 - ldrb r0, [r0] - lsrs r0, 1 - lsls r0, 2 - adds r1, r0 - adds r1, r2 - ldrb r0, [r1] - subs r0, 0x10 - lsls r0, 24 - lsrs r0, 24 - mov r1, sp - bl sub_8192F08 - mov r0, sp - ldrb r0, [r0] - cmp r4, r0 - beq _0819542C - mov r0, sp - ldrb r0, [r0] - b _08195430 - .pool -_0819542C: - mov r0, sp - ldrb r0, [r0, 0x1] -_08195430: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81953E8 - - thumb_func_start sub_8195438 -sub_8195438: @ 8195438 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x40 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0xC] - movs r1, 0 - str r1, [sp, 0x10] - movs r5, 0 - movs r1, 0x3 - ldr r0, [sp] - ands r0, r1 - lsls r0, 3 - str r0, [sp, 0x14] -_0819545E: - ldr r2, =gSaveBlock2Ptr - ldr r0, [r2] - lsls r4, r5, 2 - adds r1, r0, r4 - ldr r3, =0x00000d25 - adds r0, r1, r3 - ldrb r0, [r0] - lsls r0, 29 - adds r2, r5, 0x1 - str r2, [sp, 0x24] - cmp r0, 0 - bge _08195478 - b _08195876 -_08195478: - subs r3, 0x1 - adds r0, r1, r3 - ldrh r0, [r0] - lsls r1, r0, 22 - ldr r0, =0xffc00000 - cmp r1, r0 - bne _08195488 - b _08195876 -_08195488: - str r5, [sp, 0x4] - lsrs r1, 22 - ldr r0, [sp] - bl sub_81901A0 - str r0, [sp, 0x8] - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - adds r0, r3, r4 - ldr r1, =0x00000d24 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 22 - ldr r1, =0xff800000 - cmp r0, r1 - bne _08195504 - ldr r2, [sp, 0x8] - cmp r2, 0xFF - beq _08195504 - lsls r2, 2 - adds r1, r3, r2 - ldr r3, =0x00000d25 - adds r1, r3 - ldrb r0, [r1] - movs r3, 0x4 - orrs r0, r3 - strb r0, [r1] - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - adds r1, r2 - ldr r2, =0x00000d25 - adds r1, r2 - ldrb r0, [r1] - subs r3, 0x1D - ands r0, r3 - ldr r2, [sp, 0x14] - orrs r0, r2 - strb r0, [r1] - adds r0, r5, 0 - ldr r1, [sp, 0x8] - ldr r2, [sp] - bl sub_8193ED0 - ldr r3, =gSaveBlock2Ptr - ldr r1, [r3] - ldr r5, [sp, 0x8] - lsls r2, r5, 1 - movs r3, 0xEC - lsls r3, 4 - adds r1, r3 - adds r1, r2 - b _08195874 - .pool -_08195504: - ldr r4, =gSaveBlock2Ptr - ldr r3, [r4] - ldr r0, [sp, 0x8] - lsls r2, r0, 2 - adds r0, r3, r2 - ldr r1, =0x00000d24 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 22 - ldr r1, =0xff800000 - str r2, [sp, 0x30] - cmp r0, r1 - bne _0819557C - ldr r2, [sp, 0x4] - cmp r2, 0xFF - beq _0819557C - lsls r2, 2 - adds r1, r3, r2 - ldr r3, =0x00000d25 - adds r1, r3 - ldrb r0, [r1] - movs r3, 0x4 - orrs r0, r3 - strb r0, [r1] - ldr r1, [r4] - adds r1, r2 - ldr r0, =0x00000d25 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x19 - negs r2, r2 - ands r0, r2 - ldr r3, [sp, 0x14] - orrs r0, r3 - strb r0, [r1] - ldr r0, [sp, 0x8] - ldr r1, [sp, 0x4] - ldr r2, [sp] - bl sub_8193ED0 - ldr r1, [r4] - ldr r3, [sp, 0x4] - lsls r2, r3, 1 - movs r3, 0xEC - lsls r3, 4 - adds r1, r3 - adds r1, r2 - strh r0, [r1] - adds r5, 0x1 - str r5, [sp, 0x24] - b _08195876 - .pool -_0819557C: - adds r5, 0x1 - str r5, [sp, 0x24] - ldr r5, [sp, 0x8] - cmp r5, 0xFF - bne _08195588 - b _08195876 -_08195588: - movs r0, 0 - mov r10, r0 - lsls r1, r5, 1 - str r1, [sp, 0x2C] - ldr r2, [sp, 0x4] - lsls r2, 1 - str r2, [sp, 0x28] - ldr r3, [sp, 0x4] - adds r0, r2, r3 - lsls r0, 1 - mov r9, r0 - adds r0, r1, r5 - lsls r0, 1 - str r0, [sp, 0x18] -_081955A4: - movs r5, 0 - mov r0, r9 - str r0, [sp, 0x38] -_081955AA: - movs r6, 0 - lsls r7, r5, 1 - ldr r4, [sp, 0x18] -_081955B0: - ldr r2, =gSaveBlock2Ptr - ldr r1, [r2] - ldr r3, =0x00000d64 - adds r1, r3 - ldr r2, [sp, 0x38] - adds r0, r1, r2 - ldrh r0, [r0] - ldr r3, =gUnknown_0203BC8C - mov r8, r3 - ldr r2, [r3] - lsls r0, 4 - adds r0, r2 - adds r0, 0x2 - adds r0, r7 - ldrh r0, [r0] - adds r1, r4 - ldrh r1, [r1] - lsls r1, 4 - adds r1, r2 - ldrh r1, [r1] - movs r2, 0x2 - bl sub_818FFC0 - ldr r1, [sp, 0xC] - adds r1, r0 - str r1, [sp, 0xC] - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x2 - ble _081955B0 - adds r5, 0x1 - cmp r5, 0x3 - ble _081955AA - ldr r2, =gSaveBlock2Ptr - ldr r0, [r2] - ldr r3, =0x00000d64 - adds r0, r3 - add r0, r9 - ldrh r0, [r0] - mov r5, r8 - ldr r1, [r5] - lsls r0, 4 - adds r0, r1 - ldrh r2, [r0] - ldr r0, =gBaseStats - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1] - ldrb r2, [r1, 0x1] - adds r0, r2 - ldrb r2, [r1, 0x2] - adds r0, r2 - ldrb r2, [r1, 0x3] - adds r0, r2 - ldrb r3, [r1, 0x4] - adds r0, r3 - ldrb r1, [r1, 0x5] - adds r0, r1 - movs r1, 0xA - bl __divsi3 - ldr r5, [sp, 0xC] - adds r5, r0 - str r5, [sp, 0xC] - movs r0, 0x2 - add r9, r0 - movs r1, 0x1 - add r10, r1 - mov r2, r10 - cmp r2, 0x2 - ble _081955A4 - bl Random - movs r1, 0x1F - ands r1, r0 - adds r5, r1 - ldr r3, [sp, 0x4] - adds r5, r3 - str r5, [sp, 0xC] - movs r5, 0 - mov r10, r5 - ldr r1, [sp, 0x2C] - ldr r2, [sp, 0x8] - adds r0, r1, r2 - lsls r0, 1 - str r0, [sp, 0x1C] - ldr r5, [sp, 0x28] - adds r0, r5, r3 - lsls r0, 1 - str r0, [sp, 0x20] -_08195668: - movs r5, 0 - mov r0, r10 - lsls r3, r0, 1 - movs r1, 0x1 - add r10, r1 - ldr r2, [sp, 0x1C] - adds r2, r3 - mov r8, r2 -_08195678: - movs r6, 0 - lsls r7, r5, 1 - adds r5, 0x1 - str r5, [sp, 0x3C] - ldr r4, [sp, 0x20] -_08195682: - ldr r5, =gSaveBlock2Ptr - ldr r1, [r5] - ldr r0, =0x00000d64 - adds r1, r0 - mov r2, r8 - adds r0, r1, r2 - ldrh r0, [r0] - ldr r5, =gUnknown_0203BC8C - mov r9, r5 - ldr r2, [r5] - lsls r0, 4 - adds r0, r2 - adds r0, 0x2 - adds r0, r7 - ldrh r0, [r0] - adds r1, r4 - ldrh r1, [r1] - lsls r1, 4 - adds r1, r2 - ldrh r1, [r1] - movs r2, 0x2 - str r3, [sp, 0x34] - bl sub_818FFC0 - ldr r1, [sp, 0x10] - adds r1, r0 - str r1, [sp, 0x10] - adds r4, 0x2 - adds r6, 0x1 - ldr r3, [sp, 0x34] - cmp r6, 0x2 - ble _08195682 - ldr r5, [sp, 0x3C] - cmp r5, 0x3 - ble _08195678 - ldr r2, =gSaveBlock2Ptr - ldr r0, [r2] - ldr r5, [sp, 0x1C] - adds r1, r3, r5 - ldr r2, =0x00000d64 - adds r0, r2 - adds r0, r1 - ldrh r0, [r0] - mov r3, r9 - ldr r1, [r3] - lsls r0, 4 - adds r0, r1 - ldrh r2, [r0] - ldr r0, =gBaseStats - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1] - ldrb r2, [r1, 0x1] - adds r0, r2 - ldrb r5, [r1, 0x2] - adds r0, r5 - ldrb r2, [r1, 0x3] - adds r0, r2 - ldrb r2, [r1, 0x4] - adds r0, r2 - ldrb r1, [r1, 0x5] - adds r0, r1 - movs r1, 0xA - bl __divsi3 - ldr r3, [sp, 0x10] - adds r3, r0 - str r3, [sp, 0x10] - mov r5, r10 - cmp r5, 0x2 - ble _08195668 - bl Random - movs r1, 0x1F - ands r1, r0 - ldr r0, [sp, 0x10] - adds r0, r1 - ldr r1, [sp, 0x8] - adds r0, r1 - str r0, [sp, 0x10] - ldr r2, [sp, 0xC] - cmp r2, r0 - ble _08195784 - ldr r3, =gSaveBlock2Ptr - ldr r1, [r3] - ldr r5, [sp, 0x30] - adds r1, r5 - ldr r0, =0x00000d25 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - ldr r1, [r3] - adds r1, r5 - ldr r3, =0x00000d25 - adds r1, r3 - ldrb r0, [r1] - movs r5, 0x19 - negs r5, r5 - ands r0, r5 - ldr r2, [sp, 0x14] - orrs r0, r2 - strb r0, [r1] - ldr r0, [sp, 0x4] - ldr r1, [sp, 0x8] - ldr r2, [sp] - bl sub_8193ED0 - ldr r3, =gSaveBlock2Ptr - ldr r1, [r3] - movs r5, 0xEC - lsls r5, 4 - adds r1, r5 - ldr r2, [sp, 0x2C] - adds r1, r2 - b _08195874 - .pool -_08195784: - ldr r3, [sp, 0xC] - ldr r5, [sp, 0x10] - cmp r3, r5 - bge _081957DC - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r3, [sp, 0x4] - lsls r2, r3, 2 - adds r1, r2 - ldr r5, =0x00000d25 - adds r1, r5 - ldrb r0, [r1] - movs r3, 0x4 - orrs r0, r3 - strb r0, [r1] - ldr r5, =gSaveBlock2Ptr - ldr r1, [r5] - adds r1, r2 - ldr r0, =0x00000d25 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x19 - negs r2, r2 - ands r0, r2 - ldr r3, [sp, 0x14] - orrs r0, r3 - strb r0, [r1] - ldr r0, [sp, 0x8] - ldr r1, [sp, 0x4] - ldr r2, [sp] - bl sub_8193ED0 - ldr r1, [r5] - movs r5, 0xEC - lsls r5, 4 - adds r1, r5 - ldr r2, [sp, 0x28] - adds r1, r2 - b _08195874 - .pool -_081957DC: - ldr r3, [sp, 0x4] - ldr r5, [sp, 0x8] - cmp r3, r5 - ble _08195830 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r2, [sp, 0x30] - adds r1, r2 - ldr r3, =0x00000d25 - adds r1, r3 - ldrb r0, [r1] - movs r5, 0x4 - orrs r0, r5 - strb r0, [r1] - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - adds r1, r2 - adds r1, r3 - ldrb r0, [r1] - movs r2, 0x19 - negs r2, r2 - ands r0, r2 - ldr r3, [sp, 0x14] - orrs r0, r3 - strb r0, [r1] - ldr r0, [sp, 0x4] - ldr r1, [sp, 0x8] - ldr r2, [sp] - bl sub_8193ED0 - ldr r5, =gSaveBlock2Ptr - ldr r1, [r5] - movs r2, 0xEC - lsls r2, 4 - adds r1, r2 - ldr r3, [sp, 0x2C] - b _08195872 - .pool -_08195830: - ldr r5, =gSaveBlock2Ptr - ldr r1, [r5] - ldr r0, [sp, 0x4] - lsls r2, r0, 2 - adds r1, r2 - ldr r3, =0x00000d25 - adds r1, r3 - ldrb r0, [r1] - movs r5, 0x4 - orrs r0, r5 - strb r0, [r1] - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - adds r1, r2 - adds r1, r3 - ldrb r0, [r1] - movs r2, 0x19 - negs r2, r2 - ands r0, r2 - ldr r3, [sp, 0x14] - orrs r0, r3 - strb r0, [r1] - ldr r0, [sp, 0x8] - ldr r1, [sp, 0x4] - ldr r2, [sp] - bl sub_8193ED0 - ldr r5, =gSaveBlock2Ptr - ldr r1, [r5] - movs r2, 0xEC - lsls r2, 4 - adds r1, r2 - ldr r3, [sp, 0x28] -_08195872: - adds r1, r3 -_08195874: - strh r0, [r1] -_08195876: - ldr r5, [sp, 0x24] - cmp r5, 0xF - bgt _0819587E - b _0819545E -_0819587E: - add sp, 0x40 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195438 - - thumb_func_start sub_8195898 -sub_8195898: @ 8195898 - push {r4-r6,lr} - adds r6, r0, 0 - lsls r1, 16 - lsrs r5, r1, 16 - movs r4, 0 - bl sub_8165C40 - ldr r0, =0x000003fe - cmp r5, r0 - bne _081958B8 - adds r0, r6, 0 - bl sub_8195938 - b _08195902 - .pool -_081958B8: - ldr r0, =0x000003ff - cmp r5, r0 - bne _081958DC - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] -_081958C2: - adds r0, r6, r4 - adds r1, r2, r4 - ldrb r1, [r1] - strb r1, [r0] - adds r4, 0x1 - cmp r4, 0x6 - ble _081958C2 - b _081958FC - .pool -_081958DC: - ldr r0, =0x0000012b - cmp r5, r0 - bhi _081958FC - ldr r0, =gUnknown_0203BC88 - ldr r1, [r0] - movs r0, 0x34 - muls r0, r5 - adds r0, r1 - adds r2, r0, 0x4 -_081958EE: - adds r0, r6, r4 - adds r1, r2, r4 - ldrb r1, [r1] - strb r1, [r0] - adds r4, 0x1 - cmp r4, 0x6 - ble _081958EE -_081958FC: - adds r1, r6, r4 - movs r0, 0xFF - strb r0, [r1] -_08195902: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195898 - - thumb_func_start sub_8195910 -sub_8195910: @ 8195910 - ldr r0, =gTrainers - ldr r1, =0x00007df3 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_8195910 - - thumb_func_start sub_8195924 -sub_8195924: @ 8195924 - ldr r0, =gTrainers - ldr r1, =0x00007df1 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_8195924 - - thumb_func_start sub_8195938 -sub_8195938: @ 8195938 - push {r4,lr} - adds r3, r0, 0 - movs r2, 0 - ldr r4, =gTrainers + TRAINER_TUCKER * 0x28 + 0x4 @ Tucker's name -_08195940: - adds r0, r3, r2 - adds r1, r2, r4 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x6 - ble _08195940 - adds r1, r3, r2 - movs r0, 0xFF - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195938 - - thumb_func_start sub_8195960 -sub_8195960: @ 8195960 - push {lr} - ldr r1, =gUnknown_0860DE50 - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195960 - - thumb_func_start sub_8195980 -sub_8195980: @ 8195980 - push {r4-r7,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r5, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r7, r0, 16 - ldr r0, [r4] - ldr r2, =0x00000ca8 - adds r0, r2 - movs r6, 0 - strb r6, [r0] - ldr r1, [r4] - adds r2, 0xA - adds r0, r1, r2 - strh r6, [r0] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r4] - ldr r2, =0x00000ca9 - adds r1, r2 - ldrb r2, [r1] - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r4, [r4] - ldr r0, =0x00000cdc - adds r3, r4, r0 - ldr r2, =gUnknown_0860DE98 - lsls r1, r5, 2 - lsls r0, r7, 3 - adds r1, r0 - adds r1, r2 - ldr r0, [r3] - ldr r1, [r1] - ands r0, r1 - cmp r0, 0 - bne _081959F2 - lsls r0, r5, 1 - lsls r1, r7, 2 - adds r0, r1 - ldr r2, =0x00000dc8 - adds r1, r4, r2 - adds r1, r0 - strh r6, [r1] -_081959F2: - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0x4 - ldrsb r1, [r0, r1] - movs r2, 0x5 - ldrsb r2, [r0, r2] - movs r3, 0x1 - negs r3, r3 - movs r0, 0 - bl saved_warp2_set - ldr r0, =gTrainerBattleOpponent_A - strh r6, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195980 - - thumb_func_start sub_8195A38 -sub_8195A38: @ 8195A38 - push {r4-r7,lr} - ldr r5, =gSaveBlock2Ptr - ldr r0, [r5] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r7, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x1 - beq _08195A90 - cmp r0, 0x1 - bgt _08195A74 - cmp r0, 0 - beq _08195A7A - b _08195AD0 - .pool -_08195A74: - cmp r0, 0x2 - beq _08195AB0 - b _08195AD0 -_08195A7A: - ldr r0, =gScriptResult - ldr r1, [r5] - ldr r2, =0x00000dc6 - adds r1, r2 - ldrh r1, [r1] - strh r1, [r0] - b _08195AD0 - .pool -_08195A90: - ldr r3, =gScriptResult - ldr r0, [r5] - lsls r1, r7, 1 - lsls r2, r6, 2 - adds r1, r2 - ldr r2, =0x00000dc8 - adds r0, r2 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r3] - b _08195AD0 - .pool -_08195AB0: - ldr r4, =gScriptResult - ldr r2, [r5] - ldr r0, =0x00000cdc - adds r2, r0 - ldr r3, =gUnknown_0860DE98 - lsls r0, r7, 2 - lsls r1, r6, 3 - adds r0, r1 - adds r0, r3 - ldr r1, [r2] - ldr r0, [r0] - ands r1, r0 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - strh r0, [r4] -_08195AD0: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195A38 - - thumb_func_start sub_8195AE4 -sub_8195AE4: @ 8195AE4 - push {r4-r6,lr} - ldr r6, =gSaveBlock2Ptr - ldr r0, [r6] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r5, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x1 - beq _08195B3C - cmp r0, 0x1 - bgt _08195B20 - cmp r0, 0 - beq _08195B26 - b _08195BA0 - .pool -_08195B20: - cmp r0, 0x2 - beq _08195B5C - b _08195BA0 -_08195B26: - ldr r0, [r6] - ldr r1, =gSpecialVar_0x8006 - ldrh r1, [r1] - ldr r2, =0x00000dc6 - adds r0, r2 - strh r1, [r0] - b _08195BA0 - .pool -_08195B3C: - ldr r2, [r6] - lsls r0, r5, 1 - lsls r1, r4, 2 - adds r0, r1 - ldr r1, =0x00000dc8 - adds r2, r1 - adds r2, r0 - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - strh r0, [r2] - b _08195BA0 - .pool -_08195B5C: - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - cmp r0, 0 - beq _08195B88 - ldr r2, [r6] - ldr r0, =0x00000cdc - adds r2, r0 - ldr r3, =gUnknown_0860DE98 - lsls r1, r5, 2 - lsls r0, r4, 3 - adds r1, r0 - adds r1, r3 - ldr r0, [r2] - ldr r1, [r1] - orrs r0, r1 - b _08195B9E - .pool -_08195B88: - ldr r2, [r6] - ldr r1, =0x00000cdc - adds r2, r1 - ldr r3, =gUnknown_0860DEA8 - lsls r1, r5, 2 - lsls r0, r4, 3 - adds r1, r0 - adds r1, r3 - ldr r0, [r2] - ldr r1, [r1] - ands r0, r1 -_08195B9E: - str r0, [r2] -_08195BA0: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195AE4 - - thumb_func_start sub_8195BB0 -sub_8195BB0: @ 8195BB0 - push {r4,lr} - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - ldr r1, =gSaveBlock2Ptr - ldr r2, [r1] - ldr r3, =0x00000ca9 - adds r1, r2, r3 - ldrb r1, [r1] - lsls r1, 30 - lsrs r1, 29 - lsrs r0, 14 - adds r1, r0 - ldr r0, =0x00000dc8 - adds r2, r0 - adds r2, r1 - ldrh r0, [r2] - cmp r0, 0x31 - bhi _08195C00 - ldr r4, =gScriptResult - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - strh r0, [r4] - b _08195C16 - .pool -_08195C00: - cmp r0, 0x62 - bhi _08195C10 - ldr r1, =gScriptResult - movs r0, 0x3 - b _08195C14 - .pool -_08195C10: - ldr r1, =gScriptResult - movs r0, 0x4 -_08195C14: - strh r0, [r1] -_08195C16: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195BB0 - - thumb_func_start sub_8195C20 -sub_8195C20: @ 8195C20 - push {r4,lr} - ldr r4, =gTrainerBattleOpponent_A - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xFF - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - lsls r1, r0, 2 - adds r1, r0 - lsrs r1, 6 - strh r1, [r4] - ldrh r0, [r4] - movs r1, 0 - bl sub_8162614 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195C20 - - thumb_func_start sub_8195C50 -sub_8195C50: @ 8195C50 - push {lr} - ldr r3, =gTrainerBattleOpponent_A - ldrh r1, [r3] - ldr r0, =0x0000012b - cmp r1, r0 - bhi _08195C6C - ldr r2, =gUnknown_0203BC88 - movs r0, 0x34 - muls r1, r0 - ldr r0, [r2] - adds r0, r1 - adds r0, 0xC - bl ConvertBattleFrontierTrainerSpeechToString -_08195C6C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195C50 - - thumb_func_start sub_8195C7C -sub_8195C7C: @ 8195C7C - push {r4-r7,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r7, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 24 - ldr r4, [r4] - lsls r1, r7, 1 - lsrs r5, r0, 22 - adds r1, r5 - ldr r3, =0x00000dc8 - adds r6, r4, r3 - adds r3, r6, r1 - ldrh r2, [r3] - ldr r0, =0x0000270e - cmp r2, r0 - bhi _08195CCA - adds r2, 0x1 - strh r2, [r3] - movs r3, 0xDD - lsls r3, 4 - adds r0, r4, r3 - adds r1, r0, r1 - adds r0, r5, 0 - ldrh r3, [r1] - cmp r7, r3 - bls _08195CC0 - adds r0, 0x2 -_08195CC0: - adds r0, r6, r0 - ldrh r0, [r0] - cmp r0, 0 - beq _08195CCA - strh r2, [r1] -_08195CCA: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195C7C - - thumb_func_start sub_8195CE4 -sub_8195CE4: @ 8195CE4 - push {r4,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - strb r1, [r0] - movs r0, 0x80 - lsls r0, 7 - movs r1, 0 - bl VarSet - ldr r1, [r4] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - bl sub_81A4C30 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195CE4 - - thumb_func_start sub_8195D28 -sub_8195D28: @ 8195D28 - push {r4,r5,lr} - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - ldr r4, =gSaveBlock2Ptr - ldr r2, [r4] - ldr r3, =0x00000ca9 - adds r1, r2, r3 - ldrb r1, [r1] - lsls r1, 30 - lsrs r1, 29 - lsrs r0, 14 - adds r1, r0 - ldr r0, =0x00000dc8 - adds r2, r0 - adds r2, r1 - ldrh r0, [r2] - cmp r0, 0x29 - bls _08195D88 - bl Random - ldr r4, [r4] - ldr r5, =gUnknown_0860DE84 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x9 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 15 - adds r0, r5 - ldrh r0, [r0] - ldr r1, =0x00000dc6 - adds r4, r1 - b _08195DA6 - .pool -_08195D88: - bl Random - ldr r4, [r4] - ldr r5, =gUnknown_0860DE78 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x6 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 15 - adds r0, r5 - ldrh r0, [r0] - ldr r3, =0x00000dc6 - adds r4, r3 -_08195DA6: - strh r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195D28 - - thumb_func_start sub_8195DB8 -sub_8195DB8: @ 8195DB8 - push {r4,r5,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000dc6 - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x1 - bl AddBagItem - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bne _08195E00 - ldr r0, [r4] - ldr r1, =0x00000dc6 - adds r0, r1 - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r0, [r4] - ldr r1, =0x00000dc6 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - ldr r0, =gScriptResult - strh r5, [r0] - b _08195E06 - .pool -_08195E00: - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] -_08195E06: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195DB8 - - thumb_func_start sub_8195E10 -sub_8195E10: @ 8195E10 - push {lr} - bl RtcCalcLocalTime - ldr r0, =gLocalTime - bl sub_8195E34 - ldr r1, =gUnknown_0203CD80 - adds r0, 0xA - str r0, [r1] - movs r0, 0 - strb r0, [r1, 0x6] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195E10 - - thumb_func_start sub_8195E34 -sub_8195E34: @ 8195E34 - adds r3, r0, 0 - movs r1, 0 - ldrsh r0, [r3, r1] - lsls r1, r0, 1 - adds r1, r0 - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 5 - movs r2, 0x2 - ldrsb r2, [r3, r2] - lsls r1, r2, 4 - subs r1, r2 - lsls r1, 2 - adds r0, r1 - movs r1, 0x3 - ldrsb r1, [r3, r1] - adds r0, r1 - bx lr - thumb_func_end sub_8195E34 - - thumb_func_start sub_8195E58 -sub_8195E58: @ 8195E58 - push {lr} - bl RtcCalcLocalTime - ldr r0, =gLocalTime - bl sub_8195E34 - adds r1, r0, 0 - ldr r2, =gUnknown_0203CD80 - ldr r0, [r2] - cmp r0, r1 - bhi _08195E74 - subs r0, r1, r0 - cmp r0, 0x9 - bls _08195E84 -_08195E74: - str r1, [r2] - movs r0, 0x1 - b _08195E86 - .pool -_08195E84: - movs r0, 0 -_08195E86: - pop {r1} - bx r1 - thumb_func_end sub_8195E58 - - thumb_func_start sub_8195E8C -sub_8195E8C: @ 8195E8C - push {r4,r5,lr} - movs r5, 0x1 - ldr r4, =gPlayerParty - adds r0, r4, 0 - movs r1, 0x6 - bl GetMonData - cmp r0, 0 - bne _08195EAE - adds r0, r4, 0 - bl GetMonAbility - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1F - bne _08195EAE - movs r5, 0x2 -_08195EAE: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - lsls r1, r5, 1 - adds r1, r5 - cmp r0, r1 - blt _08195ED0 - movs r0, 0 - b _08195ED2 - .pool -_08195ED0: - movs r0, 0x1 -_08195ED2: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8195E8C - - thumb_func_start sub_8195ED8 -sub_8195ED8: @ 8195ED8 - push {r4,lr} - ldr r4, =gMapHeader - ldrb r0, [r4, 0x17] - bl is_light_level_1_2_3_or_6 - lsls r0, 24 - cmp r0, 0 - beq _08195F30 - ldrb r0, [r4, 0x14] - cmp r0, 0x39 - beq _08195F30 - cmp r0, 0xE - bne _08195F0E - movs r0, 0xF9 - lsls r0, 2 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08195F0E - movs r0, 0xDC - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _08195F30 -_08195F0E: - ldr r0, =gMapHeader - ldrb r0, [r0, 0x14] - cmp r0, 0x38 - bne _08195F38 - movs r0, 0xCF - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08195F38 - movs r0, 0x8B - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _08195F38 -_08195F30: - movs r0, 0 - b _08195F3A - .pool -_08195F38: - movs r0, 0x1 -_08195F3A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8195ED8 - - thumb_func_start sub_8195F40 -sub_8195F40: @ 8195F40 - push {lr} - ldr r1, =gUnknown_0203CD80 - ldrb r0, [r1, 0x6] - adds r0, 0x1 - strb r0, [r1, 0x6] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x9 - bhi _08195F5C - movs r0, 0 - b _08195F62 - .pool -_08195F5C: - movs r0, 0 - strb r0, [r1, 0x6] - movs r0, 0x1 -_08195F62: - pop {r1} - bx r1 - thumb_func_end sub_8195F40 - - thumb_func_start sub_8195F68 -sub_8195F68: @ 8195F68 - push {r4,lr} - bl sub_8195FCC - adds r4, r0, 0 - cmp r4, 0 - beq _08195FB8 - bl Random - lsls r0, 16 - lsrs r0, 16 - adds r1, r4, 0 - bl __umodsi3 - bl sub_8195FF8 - ldr r2, =gUnknown_0203CD80 - movs r1, 0 - strh r0, [r2, 0x4] - strb r1, [r2, 0x7] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x4E - beq _08195FB8 - ldrh r0, [r2, 0x4] - bl sub_8196844 - adds r4, r0, 0 - bl sub_819672C - ldr r1, =gMapHeader - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r1, 0x14] - cmp r0, r1 - bne _08195FC4 - adds r0, r4, 0 - bl sub_8196710 - cmp r0, 0 - bne _08195FC4 -_08195FB8: - movs r0, 0 - b _08195FC6 - .pool -_08195FC4: - movs r0, 0x1 -_08195FC6: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8195F68 - - thumb_func_start sub_8195FCC -sub_8195FCC: @ 8195FCC - push {r4,r5,lr} - movs r4, 0 - movs r5, 0 -_08195FD2: - movs r1, 0xAE - lsls r1, 1 - adds r0, r4, r1 - lsls r0, 16 - lsrs r0, 16 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _08195FE8 - adds r5, 0x1 -_08195FE8: - adds r4, 0x1 - cmp r4, 0x3F - bls _08195FD2 - adds r0, r5, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8195FCC - - thumb_func_start sub_8195FF8 -sub_8195FF8: @ 8195FF8 - push {r4-r6,lr} - adds r5, r0, 0 - movs r4, 0 - ldr r6, =gUnknown_085500A4 -_08196000: - movs r1, 0xAE - lsls r1, 1 - adds r0, r4, r1 - lsls r0, 16 - lsrs r0, 16 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _08196022 - cmp r5, 0 - bne _08196020 - ldrh r0, [r6] - b _0819602C - .pool -_08196020: - subs r5, 0x1 -_08196022: - adds r6, 0x10 - adds r4, 0x1 - cmp r4, 0x3F - bls _08196000 - movs r0, 0x4E -_0819602C: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8195FF8 - - thumb_func_start sub_8196034 -sub_8196034: @ 8196034 - push {lr} - ldr r0, =0x0000012f - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _08196078 - bl sub_8195F40 - cmp r0, 0 - beq _08196078 - bl sub_8195E58 - cmp r0, 0 - beq _08196078 - bl sub_8195E8C - cmp r0, 0 - beq _08196078 - bl sub_8195ED8 - cmp r0, 0 - beq _08196078 - bl sub_8195F68 - cmp r0, 0 - beq _08196078 - bl task_prev_quest - movs r0, 0x1 - b _0819607A - .pool -_08196078: - movs r0, 0 -_0819607A: - pop {r1} - bx r1 - thumb_func_end sub_8196034 - - thumb_func_start sub_8196080 -sub_8196080: @ 8196080 - push {lr} - ldr r1, =gUnknown_0203CD80 - movs r0, 0x1 - strb r0, [r1, 0x7] - bl task_prev_quest - pop {r0} - bx r0 - .pool - thumb_func_end sub_8196080 - - thumb_func_start sub_8196094 -sub_8196094: @ 8196094 - push {lr} - ldr r0, =sub_81960E0 - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8196094 - - thumb_func_start task_prev_quest -task_prev_quest: @ 81960A8 - push {lr} - ldr r0, =gUnknown_0203CD80 - ldrb r0, [r0, 0x7] - cmp r0, 0 - bne _081960C2 - bl ScriptContext2_Enable - bl player_bitmagic - bl sub_808B864 - bl sub_808BCF4 -_081960C2: - ldr r0, =0x00000107 - bl PlaySE - ldr r0, =sub_81960E0 - movs r1, 0x1 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end task_prev_quest - - thumb_func_start sub_81960E0 -sub_81960E0: @ 81960E0 - 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 - ldr r1, =gUnknown_0860EF78 - movs r2, 0 - ldrsh r0, [r4, r2] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - adds r0, r5, 0 - bl _call_via_r1 - cmp r0, 0 - beq _0819611E - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - movs r1, 0 - strh r1, [r4, 0x2] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x7 - bls _0819611E - adds r0, r5, 0 - bl DestroyTask -_0819611E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81960E0 - - thumb_func_start sub_819612C -sub_819612C: @ 819612C - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - adds r6, r4, 0 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r5, r0, r1 - ldr r0, =gUnknown_0860EF98 - bl AddWindow - strh r0, [r5, 0x4] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xFF - bne _0819615C - adds r0, r4, 0 - b _081961E0 - .pool -_0819615C: - ldr r1, =gUnknown_0860EA6C - movs r2, 0x80 - lsls r2, 1 - movs r3, 0x9C - lsls r3, 2 - movs r0, 0 - bl LoadBgTiles - lsls r0, 16 - ldr r1, =0xffff0000 - cmp r0, r1 - bne _08196188 - ldrb r0, [r5, 0x4] - bl RemoveWindow - adds r0, r4, 0 - b _081961E0 - .pool -_08196188: - ldr r1, =gUnknown_0860EB8C - ldr r3, =0x00000279 - movs r0, 0 - str r0, [sp] - movs r2, 0 - bl decompress_and_copy_tile_data_to_vram - cmp r0, 0 - beq _081961D8 - ldrb r0, [r5, 0x4] - movs r1, 0x88 - bl FillWindowPixelBuffer - ldr r0, =gUnknown_0860EA4C - movs r1, 0xE0 - movs r2, 0x20 - bl LoadPalette - ldr r0, =gUnknown_0860EB6C - movs r1, 0xF0 - movs r2, 0x20 - bl LoadPalette - ldr r1, =0xffffe000 - movs r0, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x1 - b _081961E6 - .pool -_081961D8: - ldrb r0, [r5, 0x4] - bl RemoveWindow - adds r0, r6, 0 -_081961E0: - bl DestroyTask - movs r0, 0 -_081961E6: - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_819612C - - thumb_func_start sub_81961F0 -sub_81961F0: @ 81961F0 - push {r4,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r4, r1, r0 - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - bne _08196268 - ldrb r0, [r4, 0x4] - bl PutWindowTilemap - movs r1, 0x4 - ldrsh r0, [r4, r1] - movs r1, 0x9C - lsls r1, 2 - movs r2, 0xE - bl sub_819645C - ldr r1, =0x0000f279 - movs r0, 0x4 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - str r0, [sp, 0xC] - movs r0, 0 - movs r2, 0x1 - movs r3, 0xF - bl WriteSequenceToBgTilemapBuffer - ldr r0, =sub_8196694 - movs r1, 0xA - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0xA] - ldrb r0, [r4, 0x4] - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0x1 - b _0819626A - .pool -_08196268: - movs r0, 0 -_0819626A: - add sp, 0x10 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81961F0 - - thumb_func_start sub_8196274 -sub_8196274: @ 8196274 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r4, r1, r0 - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _08196298 - movs r0, 0 - b _081962A4 - .pool -_08196298: - movs r1, 0x4 - ldrsh r0, [r4, r1] - ldr r1, =gUnknown_0860EF70 - bl sub_81965D8 - movs r0, 0x1 -_081962A4: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8196274 - - thumb_func_start sub_81962B0 -sub_81962B0: @ 81962B0 - push {lr} - movs r1, 0xC0 - lsls r1, 3 - movs r0, 0 - movs r2, 0x1 - bl ChangeBgY - cmp r0, 0 - bge _081962C6 - movs r0, 0 - b _081962D2 -_081962C6: - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x1 -_081962D2: - pop {r1} - bx r1 - thumb_func_end sub_81962B0 - - thumb_func_start sub_81962D8 -sub_81962D8: @ 81962D8 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r4, r1, r0 - movs r1, 0x4 - ldrsh r0, [r4, r1] - bl sub_8196648 - cmp r0, 0 - bne _08196328 - ldrb r0, [r4, 0x4] - movs r1, 0x88 - bl FillWindowPixelBuffer - ldr r1, =gUnknown_0203CD80 - ldrb r0, [r1, 0x7] - cmp r0, 0 - bne _0819630C - ldrh r0, [r1, 0x4] - ldr r1, =gStringVar4 - bl sub_81967AC -_0819630C: - movs r1, 0x4 - ldrsh r0, [r4, r1] - ldr r1, =gStringVar4 - bl sub_81965D8 - movs r0, 0x1 - b _0819632A - .pool -_08196328: - movs r0, 0 -_0819632A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81962D8 - - thumb_func_start sub_8196330 -sub_8196330: @ 8196330 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r4, r1, r0 - movs r1, 0x4 - ldrsh r0, [r4, r1] - bl sub_8196648 - cmp r0, 0 - bne _08196388 - bl IsSEPlaying - lsls r0, 24 - cmp r0, 0 - bne _08196388 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _08196388 - ldrb r0, [r4, 0x4] - movs r1, 0x88 - bl FillWindowPixelBuffer - ldrb r0, [r4, 0x4] - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0x84 - lsls r0, 1 - bl PlaySE - movs r0, 0x1 - b _0819638A - .pool -_08196388: - movs r0, 0 -_0819638A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8196330 - - thumb_func_start sub_8196390 -sub_8196390: @ 8196390 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r4, r1, r0 - movs r1, 0xC0 - lsls r1, 3 - movs r0, 0 - movs r2, 0x2 - bl ChangeBgY - ldr r1, =0xffffe000 - cmp r0, r1 - ble _081963C0 - movs r0, 0 - b _081963E8 - .pool -_081963C0: - movs r0, 0x1E - str r0, [sp] - movs r0, 0x6 - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0xE - bl FillBgTilemapBufferRect_Palette0 - ldrb r0, [r4, 0xA] - bl DestroyTask - ldrb r0, [r4, 0x4] - bl RemoveWindow - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0x1 -_081963E8: - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8196390 - - thumb_func_start sub_81963F0 -sub_81963F0: @ 81963F0 - push {lr} - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _08196454 - bl IsSEPlaying - lsls r0, 24 - cmp r0, 0 - bne _08196454 - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - ldr r0, =gUnknown_0203CD80 - ldrb r0, [r0, 0x7] - cmp r0, 0 - bne _08196446 - bl sub_81973A4 - movs r0, 0xFF - movs r1, 0 - movs r2, 0 - bl GetFieldObjectIdByLocalIdAndMap - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gMapObjects - adds r0, r1 - bl FieldObjectClearAnimIfSpecialAnimFinished - bl sub_80D338C - bl sub_809757C - bl ScriptContext2_Disable -_08196446: - movs r0, 0x1 - b _08196456 - .pool -_08196454: - movs r0, 0 -_08196456: - pop {r1} - bx r1 - thumb_func_end sub_81963F0 - - thumb_func_start sub_819645C -sub_819645C: @ 819645C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - adds r4, r0, 0 - adds r5, r1, 0 - adds r7, r2, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0 - bl GetWindowAttribute - mov r9, r0 - adds r0, r4, 0 - movs r1, 0x1 - bl GetWindowAttribute - str r0, [sp, 0x8] - adds r0, r4, 0 - movs r1, 0x2 - bl GetWindowAttribute - str r0, [sp, 0xC] - adds r0, r4, 0 - movs r1, 0x3 - bl GetWindowAttribute - adds r6, r0, 0 - adds r0, r4, 0 - movs r1, 0x4 - bl GetWindowAttribute - str r0, [sp, 0x10] - mov r0, r9 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - movs r1, 0xA - bl GetBgAttribute - lsls r0, 16 - lsrs r0, 16 - adds r5, r0 - lsls r7, 12 - movs r1, 0xF0 - lsls r1, 8 - adds r0, r1, 0 - ands r7, r0 - adds r1, r7, 0 - orrs r1, r5 - lsls r1, 16 - lsrs r1, 16 - ldr r2, [sp, 0x8] - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - mov r10, r2 - ldr r4, [sp, 0xC] - subs r4, 0x1 - lsls r4, 24 - lsrs r4, 24 - movs r3, 0x1 - mov r8, r3 - str r3, [sp] - str r3, [sp, 0x4] - mov r0, r9 - adds r3, r4, 0 - bl FillBgTilemapBufferRect_Palette0 - adds r1, r5, 0x1 - orrs r1, r7 - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0x8] - lsls r2, r0, 24 - lsrs r2, 24 - str r2, [sp, 0x14] - lsls r0, r6, 24 - lsrs r0, 24 - str r0, [sp, 0x18] - str r0, [sp] - mov r2, r8 - str r2, [sp, 0x4] - mov r0, r9 - ldr r2, [sp, 0x14] - adds r3, r4, 0 - bl FillBgTilemapBufferRect_Palette0 - adds r1, r5, 0x2 - orrs r1, r7 - lsls r1, 16 - lsrs r1, 16 - ldr r3, [sp, 0x8] - adds r0, r3, r6 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x1C] - mov r0, r8 - str r0, [sp] - str r0, [sp, 0x4] - mov r0, r9 - ldr r2, [sp, 0x1C] - adds r3, r4, 0 - bl FillBgTilemapBufferRect_Palette0 - adds r1, r5, 0x3 - orrs r1, r7 - lsls r1, 16 - lsrs r1, 16 - ldr r2, [sp, 0xC] - lsls r6, r2, 24 - lsrs r6, 24 - mov r3, r8 - str r3, [sp] - ldr r0, [sp, 0x10] - lsls r4, r0, 24 - lsrs r4, 24 - str r4, [sp, 0x4] - mov r0, r9 - mov r2, r10 - adds r3, r6, 0 - bl FillBgTilemapBufferRect_Palette0 - adds r1, r5, 0x4 - orrs r1, r7 - lsls r1, 16 - lsrs r1, 16 - mov r2, r8 - str r2, [sp] - str r4, [sp, 0x4] - mov r0, r9 - ldr r2, [sp, 0x1C] - adds r3, r6, 0 - bl FillBgTilemapBufferRect_Palette0 - adds r1, r5, 0x5 - orrs r1, r7 - lsls r1, 16 - lsrs r1, 16 - ldr r3, [sp, 0xC] - ldr r2, [sp, 0x10] - adds r0, r3, r2 - lsls r0, 24 - lsrs r4, r0, 24 - mov r3, r8 - str r3, [sp] - str r3, [sp, 0x4] - mov r0, r9 - mov r2, r10 - adds r3, r4, 0 - bl FillBgTilemapBufferRect_Palette0 - adds r1, r5, 0x6 - orrs r1, r7 - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0x18] - str r0, [sp] - mov r2, r8 - str r2, [sp, 0x4] - mov r0, r9 - ldr r2, [sp, 0x14] - adds r3, r4, 0 - bl FillBgTilemapBufferRect_Palette0 - adds r5, 0x7 - orrs r5, r7 - lsls r5, 16 - lsrs r5, 16 - mov r3, r8 - str r3, [sp] - str r3, [sp, 0x4] - mov r0, r9 - adds r1, r5, 0 - ldr r2, [sp, 0x1C] - adds r3, r4, 0 - bl FillBgTilemapBufferRect_Palette0 - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_819645C - - thumb_func_start sub_81965D8 -sub_81965D8: @ 81965D8 - push {lr} - sub sp, 0x10 - str r1, [sp] - mov r1, sp - movs r3, 0 - strb r0, [r1, 0x4] - mov r0, sp - movs r1, 0x1 - strb r1, [r0, 0x5] - movs r2, 0x20 - strb r2, [r0, 0x6] - strb r1, [r0, 0x7] - strb r2, [r0, 0x8] - strb r1, [r0, 0x9] - strb r3, [r0, 0xA] - strb r3, [r0, 0xB] - mov r3, sp - ldrb r2, [r3, 0xC] - subs r1, 0x11 - adds r0, r1, 0 - ands r0, r2 - strb r0, [r3, 0xC] - mov r2, sp - movs r3, 0xF - movs r0, 0xA0 - strb r0, [r2, 0xC] - ldrb r0, [r2, 0xD] - ands r1, r0 - movs r0, 0x8 - orrs r1, r0 - strb r1, [r2, 0xD] - ands r1, r3 - movs r0, 0xE0 - orrs r1, r0 - strb r1, [r2, 0xD] - ldr r2, =gTextFlags - ldrb r1, [r2] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - bl sav2_get_text_speed - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, sp - movs r2, 0 - bl AddTextPrinter - add sp, 0x10 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81965D8 - - thumb_func_start sub_8196648 -sub_8196648: @ 8196648 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gMain - ldrh r1, [r0, 0x2C] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0819666C - ldr r0, =gTextFlags - ldrb r1, [r0] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0] - b _08196678 - .pool -_0819666C: - ldr r2, =gTextFlags - ldrb r1, [r2] - movs r0, 0x2 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_08196678: - bl RunTextPrinters - lsls r0, r4, 24 - lsrs r0, 24 - bl IsTextPrinterActive - lsls r0, 16 - lsrs r0, 16 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8196648 - - thumb_func_start sub_8196694 -sub_8196694: @ 8196694 - push {lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r2, r1, r0 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - ble _081966FC - movs r1, 0 - strh r1, [r2] - ldrh r0, [r2, 0x2] - adds r0, 0x1 - strh r0, [r2, 0x2] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _081966C8 - strh r1, [r2, 0x2] -_081966C8: - movs r0, 0x2 - ldrsh r1, [r2, r0] - lsls r1, 4 - ldr r0, =0x00000279 - adds r1, r0 - strh r1, [r2, 0x4] - ldr r2, =0xfffff000 - adds r0, r2, 0 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x4 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - str r0, [sp, 0xC] - movs r0, 0 - movs r2, 0x1 - movs r3, 0xF - bl WriteSequenceToBgTilemapBuffer - movs r0, 0 - bl CopyBgTilemapBufferToVram -_081966FC: - add sp, 0x10 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8196694 - - thumb_func_start sub_8196710 -sub_8196710: @ 8196710 - ldr r1, =gSaveBlock1Ptr - ldr r1, [r1] - ldr r2, =0x000009ca - adds r1, r2 - adds r1, r0 - ldrb r1, [r1] - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - bx lr - .pool - thumb_func_end sub_8196710 - - thumb_func_start sub_819672C -sub_819672C: @ 819672C - push {lr} - ldr r1, =gUnknown_085500A4 - lsls r0, 4 - adds r0, r1 - ldrh r2, [r0, 0xA] - ldrh r1, [r0, 0xC] - adds r0, r2, 0 - bl get_mapheader_by_bank_and_number - ldrb r0, [r0, 0x14] - pop {r1} - bx r1 - .pool - thumb_func_end sub_819672C - - thumb_func_start sub_8196748 -sub_8196748: @ 8196748 - push {r4-r6,lr} - movs r5, 0 - movs r6, 0 - ldr r4, =gUnknown_085500A4 -_08196750: - ldrh r0, [r4] - bl trainer_flag_check - lsls r0, 24 - cmp r0, 0 - beq _0819675E - adds r6, 0x1 -_0819675E: - adds r4, 0x10 - adds r5, 0x1 - cmp r5, 0x3F - bls _08196750 - adds r0, r6, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8196748 - - thumb_func_start sub_8196774 -sub_8196774: @ 8196774 - push {r4-r7,lr} - adds r7, r0, 0 - movs r4, 0 - movs r6, 0 - ldr r5, =gUnknown_085500A4 -_0819677E: - ldrh r0, [r5] - bl trainer_flag_check - lsls r0, 24 - cmp r0, 0 - beq _0819679A - cmp r6, r7 - bne _08196798 - adds r0, r4, 0 - b _081967A4 - .pool -_08196798: - adds r6, 0x1 -_0819679A: - adds r5, 0x10 - adds r4, 0x1 - cmp r4, 0x4D - bls _0819677E - movs r0, 0x4E -_081967A4: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8196774 - - thumb_func_start sub_81967AC -sub_81967AC: @ 81967AC - push {r4-r7,lr} - adds r6, r1, 0 - movs r7, 0 - bl sub_8196844 - adds r5, r0, 0 - ldr r0, =gUnknown_0203CD88 - strh r7, [r0] - adds r0, r5, 0 - bl sub_8196710 - cmp r0, 0 - beq _081967EC - adds r0, r5, 0 - bl sub_819672C - ldr r1, =gMapHeader - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r1, 0x14] - cmp r0, r1 - bne _081967EC - adds r0, r5, 0 - adds r1, r6, 0 - bl sub_8196864 - b _08196830 - .pool -_081967EC: - adds r0, r5, 0 - bl sub_8196D74 - cmp r0, 0 - beq _0819680A - adds r0, r5, 0 - adds r1, r6, 0 - bl sub_8196890 - adds r4, r0, 0 - movs r7, 0x1 - adds r0, r5, 0 - bl sub_80B1E94 - b _08196832 -_0819680A: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - beq _08196828 - adds r0, r5, 0 - adds r1, r6, 0 - bl sub_81968BC - b _08196830 -_08196828: - adds r0, r5, 0 - adds r1, r6, 0 - bl sub_8196910 -_08196830: - adds r4, r0, 0 -_08196832: - adds r0, r5, 0 - adds r1, r4, 0 - adds r2, r6, 0 - bl sub_81969E0 - adds r0, r7, 0 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81967AC - - thumb_func_start sub_8196844 -sub_8196844: @ 8196844 - push {lr} - adds r3, r0, 0 - movs r2, 0 - ldr r1, =gUnknown_0860DEB8 -_0819684C: - ldrh r0, [r1] - cmp r0, r3 - beq _0819685C - adds r1, 0x14 - adds r2, 0x1 - b _0819684C - .pool -_0819685C: - adds r0, r2, 0 - pop {r1} - bx r1 - thumb_func_end sub_8196844 - - thumb_func_start sub_8196864 -sub_8196864: @ 8196864 - ldr r2, =gUnknown_0860DEB8 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrh r1, [r1, 0xE] - movs r2, 0xFF - lsrs r0, r1, 8 - subs r0, 0x1 - ands r1, r2 - subs r1, 0x1 - ldr r2, =gUnknown_0860EA2C - lsls r0, 2 - adds r0, r2 - lsls r1, 3 - ldr r0, [r0] - adds r0, r1 - bx lr - .pool - thumb_func_end sub_8196864 - - thumb_func_start sub_8196890 -sub_8196890: @ 8196890 - ldr r2, =gUnknown_0860DEB8 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrh r1, [r1, 0x10] - movs r2, 0xFF - lsrs r0, r1, 8 - subs r0, 0x1 - ands r1, r2 - subs r1, 0x1 - ldr r2, =gUnknown_0860EA2C - lsls r0, 2 - adds r0, r2 - lsls r1, 3 - ldr r0, [r0] - adds r0, r1 - bx lr - .pool - thumb_func_end sub_8196890 - - thumb_func_start sub_81968BC -sub_81968BC: @ 81968BC - push {r4,lr} - adds r4, r0, 0 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - ldr r2, =gUnknown_0860DEB8 - lsrs r0, 15 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 2 - adds r0, r1 - adds r2, 0x4 - adds r0, r2 - ldrh r4, [r0] - cmp r4, 0 - bne _081968EC - movs r0, 0 - bl SpriteCallbackDummy -_081968EC: - movs r1, 0xFF - lsrs r0, r4, 8 - subs r0, 0x1 - ands r4, r1 - subs r1, r4, 0x1 - ldr r2, =gUnknown_0860EA20 - lsls r0, 2 - adds r0, r2 - lsls r1, 3 - ldr r0, [r0] - adds r0, r1 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81968BC - - thumb_func_start sub_8196910 -sub_8196910: @ 8196910 - push {r4-r7,lr} - sub sp, 0x4 - adds r6, r0, 0 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081969AC - movs r5, 0 - movs r4, 0 - lsls r7, r6, 2 -_0819692C: - lsls r0, r4, 16 - lsrs r0, 16 - mov r1, sp - bl sub_8196E04 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bls _08196940 - adds r5, 0x1 -_08196940: - adds r4, 0x1 - cmp r4, 0x6 - ble _0819692C - cmp r5, 0 - beq _081969AC - bl Random - lsls r0, 16 - lsrs r0, 16 - adds r1, r5, 0 - bl __modsi3 - adds r5, r0, 0 - movs r4, 0 - b _08196962 -_0819695E: - subs r5, 0x1 -_08196960: - adds r4, 0x1 -_08196962: - cmp r4, 0x6 - bgt _08196980 - lsls r0, r4, 16 - lsrs r0, 16 - mov r1, sp - bl sub_8196E04 - ldr r1, =gUnknown_0203CD88 - strh r0, [r1, 0x2] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bls _08196960 - cmp r5, 0 - bne _0819695E -_08196980: - ldr r0, =gUnknown_0203CD88 - strh r4, [r0] - ldr r1, =gUnknown_0860DEB8 - adds r0, r7, r6 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0xC] - subs r2, r0, 0x1 - ldr r1, =gUnknown_0860EA34 - ldr r0, [sp] - lsls r0, 2 - adds r0, r1 - lsls r1, r2, 3 - ldr r0, [r0] - adds r0, r1 - b _081969D0 - .pool -_081969AC: - ldr r1, =gUnknown_0860DEB8 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 2 - adds r0, r1 - ldrh r2, [r0, 0xA] - lsrs r1, r2, 8 - subs r1, 0x1 - str r1, [sp] - movs r0, 0xFF - ands r0, r2 - subs r2, r0, 0x1 - ldr r0, =gUnknown_0860EA34 - lsls r1, 2 - adds r1, r0 - lsls r2, 3 - ldr r0, [r1] - adds r0, r2 -_081969D0: - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8196910 - - thumb_func_start sub_81969E0 -sub_81969E0: @ 81969E0 - push {r4,r5,lr} - adds r4, r1, 0 - adds r5, r2, 0 - adds r1, r4, 0x4 - bl sub_81969FC - ldr r1, [r4] - adds r0, r5, 0 - bl StringExpandPlaceholders - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81969E0 - - thumb_func_start sub_81969FC -sub_81969FC: @ 81969FC - push {r4-r7,lr} - adds r7, r0, 0 - adds r6, r1, 0 - movs r4, 0 - ldr r5, =gUnknown_0860EFA0 -_08196A06: - adds r1, r6, r4 - movs r0, 0 - ldrsb r0, [r1, r0] - cmp r0, 0 - blt _08196A1A - adds r1, r0, 0 - ldr r2, [r5] - adds r0, r7, 0 - bl sub_8196A2C -_08196A1A: - adds r5, 0x4 - adds r4, 0x1 - cmp r4, 0x2 - ble _08196A06 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81969FC - - thumb_func_start sub_8196A2C -sub_8196A2C: @ 8196A2C - push {lr} - ldr r3, =gUnknown_0860EFAC - lsls r1, 2 - adds r1, r3 - ldr r3, [r1] - adds r1, r2, 0 - bl _call_via_r3 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8196A2C - - thumb_func_start sub_8196A44 -sub_8196A44: @ 8196A44 - push {r4-r6,lr} - adds r5, r1, 0 - ldr r2, =gUnknown_0860DEB8 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrh r4, [r1] - movs r2, 0 - ldr r3, =gUnknown_0860EFC4 - adds r6, r3, 0 -_08196A5A: - lsls r1, r2, 3 - ldrh r0, [r3] - cmp r0, r4 - bne _08196A78 - adds r0, r6, 0x4 - adds r0, r1, r0 - ldr r1, [r0] - adds r0, r5, 0 - bl StringCopy - b _08196A90 - .pool -_08196A78: - adds r3, 0x8 - adds r2, 0x1 - cmp r2, 0x5 - bls _08196A5A - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - ldr r0, =gTrainers + 0x4 @ name offset - adds r1, r0 - adds r0, r5, 0 - bl StringCopy -_08196A90: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8196A44 - - thumb_func_start sub_8196A9C -sub_8196A9C: @ 8196A9C - push {r4,lr} - adds r4, r1, 0 - bl sub_819672C - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - movs r2, 0 - bl GetMapName - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8196A9C - - thumb_func_start sub_8196AB8 -sub_8196AB8: @ 8196AB8 - push {lr} - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x13 - bgt _08196AD4 - movs r0, 0 - b _08196B4A -_08196AD4: - adds r0, r1, 0 - subs r0, 0x14 - cmp r0, 0x13 - bhi _08196AE0 - movs r0, 0x1 - b _08196B4A -_08196AE0: - adds r0, r1, 0 - subs r0, 0x28 - cmp r0, 0x9 - bhi _08196AEC - movs r0, 0x2 - b _08196B4A -_08196AEC: - adds r0, r1, 0 - subs r0, 0x32 - cmp r0, 0x9 - bhi _08196AF8 - movs r0, 0x3 - b _08196B4A -_08196AF8: - adds r0, r1, 0 - subs r0, 0x3C - cmp r0, 0x9 - bhi _08196B04 - movs r0, 0x4 - b _08196B4A -_08196B04: - adds r0, r1, 0 - subs r0, 0x46 - cmp r0, 0x9 - bhi _08196B10 - movs r0, 0x5 - b _08196B4A -_08196B10: - adds r0, r1, 0 - subs r0, 0x50 - cmp r0, 0x4 - bhi _08196B1C - movs r0, 0x6 - b _08196B4A -_08196B1C: - adds r0, r1, 0 - subs r0, 0x55 - cmp r0, 0x4 - bhi _08196B28 - movs r0, 0x7 - b _08196B4A -_08196B28: - adds r0, r1, 0 - subs r0, 0x5A - cmp r0, 0x3 - bhi _08196B34 - movs r0, 0x8 - b _08196B4A -_08196B34: - adds r0, r1, 0 - subs r0, 0x5E - cmp r0, 0x3 - bhi _08196B40 - movs r0, 0x9 - b _08196B4A -_08196B40: - cmp r1, 0x62 - beq _08196B48 - movs r0, 0xB - b _08196B4A -_08196B48: - movs r0, 0xA -_08196B4A: - pop {r1} - bx r1 - thumb_func_end sub_8196AB8 - - thumb_func_start sub_8196B50 -sub_8196B50: @ 8196B50 - push {lr} - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x3B - bgt _08196B6C - movs r0, 0 - b _08196B92 -_08196B6C: - adds r0, r1, 0 - subs r0, 0x3C - cmp r0, 0x1D - bhi _08196B78 - movs r0, 0x1 - b _08196B92 -_08196B78: - adds r0, r1, 0 - subs r0, 0x5A - cmp r0, 0x4 - bhi _08196B84 - movs r0, 0x2 - b _08196B92 -_08196B84: - adds r0, r1, 0 - subs r0, 0x5F - cmp r0, 0x3 - bls _08196B90 - movs r0, 0x4 - b _08196B92 -_08196B90: - movs r0, 0x3 -_08196B92: - pop {r1} - bx r1 - thumb_func_end sub_8196B50 - - thumb_func_start sub_8196B98 -sub_8196B98: @ 8196B98 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r2, r0, 0 - mov r8, r1 - movs r3, 0 - ldr r0, =gWildMonHeaders - ldrb r1, [r0] - adds r7, r0, 0 - cmp r1, 0xFF - beq _08196C5C - ldr r1, =gUnknown_085500A4 - lsls r0, r2, 4 - adds r2, r0, r1 - ldrh r4, [r2, 0xA] - adds r1, r7, 0 -_08196BBA: - ldrb r0, [r1] - cmp r0, r4 - bne _08196BC8 - ldrb r0, [r1, 0x1] - ldrh r5, [r2, 0xC] - cmp r0, r5 - beq _08196BD2 -_08196BC8: - adds r1, 0x14 - adds r3, 0x1 - ldrb r0, [r1] - cmp r0, 0xFF - bne _08196BBA -_08196BD2: - adds r1, r7, 0 - lsls r0, r3, 2 - adds r0, r3 - lsls r5, r0, 2 - adds r0, r5, r1 - ldrb r0, [r0] - cmp r0, 0xFF - beq _08196C5C - movs r6, 0 - adds r0, r1, 0x4 - adds r0, r5, r0 - ldr r4, [r0] - cmp r4, 0 - beq _08196C02 - bl sub_8196AB8 - lsls r0, 24 - mov r2, sp - ldr r1, [r4, 0x4] - lsrs r0, 22 - adds r0, r1 - ldrh r0, [r0, 0x2] - strh r0, [r2] - movs r6, 0x1 -_08196C02: - adds r0, r7, 0 - adds r0, 0x8 - adds r0, r5, r0 - ldr r4, [r0] - cmp r4, 0 - beq _08196C26 - bl sub_8196B50 - lsls r0, 24 - lsls r1, r6, 1 - mov r3, sp - adds r2, r3, r1 - ldr r1, [r4, 0x4] - lsrs r0, 22 - adds r0, r1 - ldrh r0, [r0, 0x2] - strh r0, [r2] - adds r6, 0x1 -_08196C26: - cmp r6, 0 - beq _08196C5C - bl Random - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - bl __modsi3 - lsls r0, 1 - add r0, sp - ldrh r1, [r0] - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - mov r0, r8 - bl StringCopy - b _08196C62 - .pool -_08196C5C: - movs r0, 0xFF - mov r5, r8 - strb r0, [r5] -_08196C62: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8196B98 - - thumb_func_start sub_8196C70 -sub_8196C70: @ 8196C70 - push {r4-r7,lr} - adds r7, r1, 0 - ldr r2, =gUnknown_0860DEB8 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r1] - bl sub_80B2250 - lsls r0, 16 - lsrs r0, 16 - ldr r5, =gTrainers - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r0, r5, 0 - adds r0, 0x24 - adds r0, r4, r0 - ldr r6, [r0] - bl Random - lsls r0, 16 - lsrs r0, 16 - adds r4, r5 - adds r1, r4, 0 - adds r1, 0x20 - ldrb r1, [r1] - bl __modsi3 - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r4] - cmp r1, 0x1 - beq _08196CD4 - cmp r1, 0x1 - ble _08196CC2 - cmp r1, 0x2 - beq _08196CD0 - cmp r1, 0x3 - beq _08196CD4 -_08196CC2: - lsls r0, 3 - b _08196CD6 - .pool -_08196CD0: - lsls r0, 3 - b _08196CD6 -_08196CD4: - lsls r0, 4 -_08196CD6: - adds r0, r6 - ldrh r1, [r0, 0x4] - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - adds r0, r7, 0 - bl StringCopy - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8196C70 - - thumb_func_start sub_8196CF4 -sub_8196CF4: @ 8196CF4 - push {lr} - adds r0, r1, 0 - ldr r2, =gUnknown_0860EFF4 - ldr r1, =gUnknown_0203CD88 - ldrh r1, [r1] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl StringCopy - pop {r0} - bx r0 - .pool - thumb_func_end sub_8196CF4 - - thumb_func_start sub_8196D14 -sub_8196D14: @ 8196D14 - push {r4-r6,lr} - adds r5, r1, 0 - movs r4, 0 - ldr r0, =gUnknown_0203CD88 - ldrh r1, [r0, 0x2] - adds r6, r0, 0 - cmp r1, 0 - beq _08196D34 -_08196D24: - adds r0, r1, 0 - movs r1, 0xA - bl __divsi3 - adds r1, r0, 0 - adds r4, 0x1 - cmp r1, 0 - bne _08196D24 -_08196D34: - ldrh r1, [r6, 0x2] - lsls r3, r4, 24 - lsrs r3, 24 - adds r0, r5, 0 - movs r2, 0 - bl ConvertIntToDecimalStringN - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8196D14 - - thumb_func_start sub_8196D4C -sub_8196D4C: @ 8196D4C - push {r4,r5,lr} - movs r4, 0 - ldr r5, =gUnknown_0860F010 - b _08196D5C - .pool -_08196D58: - adds r5, 0x2 - adds r4, 0x1 -_08196D5C: - cmp r4, 0x7 - bhi _08196D6C - ldrh r0, [r5] - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _08196D58 -_08196D6C: - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8196D4C - - thumb_func_start sub_8196D74 -sub_8196D74: @ 8196D74 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r7, r0, 0 - bl sub_8196D4C - cmp r0, 0x4 - ble _08196DF4 - bl RtcGetLocalDayCount - adds r4, r0, 0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xA - bl ReadUnalignedWord - adds r6, r0, 0 - ldr r0, =0x0000ffff - ands r6, r0 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00002e6a - adds r0, r1 - ldrh r5, [r0] - bl sub_8196748 - mov r9, r0 - movs r0, 0xD - mov r1, r9 - muls r1, r0 - adds r0, r1, 0 - movs r1, 0xA - bl __divsi3 - mov r8, r0 - movs r0, 0x9 - bl GetGameStat - eors r4, r5 - eors r5, r0 - adds r4, r5 - eors r4, r6 - adds r0, r4, 0 - mov r1, r8 - bl __modsi3 - cmp r0, r9 - bge _08196DF4 - bl sub_8196774 - cmp r0, r7 - bne _08196DF4 - movs r0, 0x1 - b _08196DF6 - .pool -_08196DF4: - movs r0, 0 -_08196DF6: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8196D74 - - thumb_func_start sub_8196E04 -sub_8196E04: @ 8196E04 - push {r4-r6,lr} - adds r5, r1, 0 - lsls r0, 16 - lsrs r0, 16 - movs r4, 0 - cmp r0, 0x6 - bls _08196E14 - b _08196F7E -_08196E14: - lsls r0, 2 - ldr r1, =_08196E24 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08196E24: - .4byte _08196E9C - .4byte _08196E40 - .4byte _08196ED0 - .4byte _08196F38 - .4byte _08196E74 - .4byte _08196F04 - .4byte _08196F60 -_08196E40: - movs r3, 0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000d14 - adds r0, r1 -_08196E4A: - lsls r1, r3, 2 - adds r3, 0x1 - adds r1, r0 - movs r2, 0x1 -_08196E52: - ldrh r6, [r1] - cmp r4, r6 - bcs _08196E5A - ldrh r4, [r1] -_08196E5A: - adds r1, 0x2 - subs r2, 0x1 - cmp r2, 0 - bge _08196E52 - cmp r3, 0x1 - ble _08196E4A - movs r0, 0x3 - b _08196F7C - .pool -_08196E74: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000e08 - adds r0, r1 - movs r3, 0x1 -_08196E7E: - ldrh r6, [r0] - cmp r4, r6 - bcs _08196E86 - ldrh r4, [r0] -_08196E86: - adds r0, 0x2 - subs r3, 0x1 - cmp r3, 0 - bge _08196E7E - movs r0, 0x4 - b _08196F7C - .pool -_08196E9C: - movs r3, 0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - movs r1, 0xCF - lsls r1, 4 - adds r0, r1 -_08196EA8: - lsls r1, r3, 2 - adds r3, 0x1 - adds r1, r0 - movs r2, 0x1 -_08196EB0: - ldrh r6, [r1] - cmp r4, r6 - bcs _08196EB8 - ldrh r4, [r1] -_08196EB8: - adds r1, 0x2 - subs r2, 0x1 - cmp r2, 0 - bge _08196EB0 - movs r2, 0x2 - cmp r3, 0x3 - ble _08196EA8 - str r2, [r5] - b _08196F7E - .pool -_08196ED0: - movs r3, 0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - movs r1, 0xDD - lsls r1, 4 - adds r0, r1 -_08196EDC: - lsls r1, r3, 2 - adds r3, 0x1 - adds r1, r0 - movs r2, 0x1 -_08196EE4: - ldrh r6, [r1] - cmp r4, r6 - bcs _08196EEC - ldrh r4, [r1] -_08196EEC: - adds r1, 0x2 - subs r2, 0x1 - cmp r2, 0 - bge _08196EE4 - movs r2, 0x2 - cmp r3, 0x1 - ble _08196EDC - str r2, [r5] - b _08196F7E - .pool -_08196F04: - movs r3, 0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000dea - adds r0, r1 -_08196F0E: - lsls r1, r3, 2 - adds r3, 0x1 - adds r1, r0 - movs r2, 0x1 -_08196F16: - ldrh r6, [r1] - cmp r4, r6 - bcs _08196F1E - ldrh r4, [r1] -_08196F1E: - adds r1, 0x2 - subs r2, 0x1 - cmp r2, 0 - bge _08196F16 - movs r2, 0x2 - cmp r3, 0x1 - ble _08196F0E - str r2, [r5] - b _08196F7E - .pool -_08196F38: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000dde - adds r0, r1 - movs r3, 0x1 -_08196F42: - ldrh r6, [r0] - cmp r4, r6 - bcs _08196F4A - ldrh r4, [r0] -_08196F4A: - adds r0, 0x2 - subs r3, 0x1 - cmp r3, 0 - bge _08196F42 - movs r3, 0x2 - str r3, [r5] - b _08196F7E - .pool -_08196F60: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000e1e - adds r0, r1 - movs r3, 0x1 -_08196F6A: - ldrh r6, [r0] - cmp r4, r6 - bcs _08196F72 - ldrh r4, [r0] -_08196F72: - adds r0, 0x2 - subs r3, 0x1 - cmp r3, 0 - bge _08196F6A - movs r0, 0x5 -_08196F7C: - str r0, [r5] -_08196F7E: - adds r0, r4, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8196E04 - - thumb_func_start sub_8196F90 -sub_8196F90: @ 8196F90 - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x9 - bhi _08196F9E - movs r0, 0 - b _0819707A -_08196F9E: - cmp r4, 0x13 - bhi _08196FA6 - movs r0, 0x1 - b _0819707A -_08196FA6: - cmp r4, 0x1D - bhi _08196FAE - movs r0, 0x2 - b _0819707A -_08196FAE: - cmp r4, 0x27 - bhi _08196FB6 - movs r0, 0x3 - b _0819707A -_08196FB6: - cmp r4, 0x31 - bhi _08196FBE - movs r0, 0x4 - b _0819707A -_08196FBE: - cmp r4, 0x3B - bhi _08196FC6 - movs r0, 0x5 - b _0819707A -_08196FC6: - cmp r4, 0x45 - bhi _08196FCE - movs r0, 0x6 - b _0819707A -_08196FCE: - cmp r4, 0x4F - bhi _08196FD6 - movs r0, 0x7 - b _0819707A -_08196FD6: - cmp r4, 0x59 - bhi _08196FDE - movs r0, 0x8 - b _0819707A -_08196FDE: - cmp r4, 0x63 - bhi _08196FE6 - movs r0, 0x9 - b _0819707A -_08196FE6: - cmp r4, 0x6D - bhi _08196FEE - movs r0, 0xA - b _0819707A -_08196FEE: - cmp r4, 0x77 - bhi _08196FF6 - movs r0, 0xB - b _0819707A -_08196FF6: - cmp r4, 0x81 - bhi _08196FFE - movs r0, 0xC - b _0819707A -_08196FFE: - cmp r4, 0x8B - bhi _08197006 - movs r0, 0xD - b _0819707A -_08197006: - cmp r4, 0x95 - bhi _0819700E - movs r0, 0xE - b _0819707A -_0819700E: - cmp r4, 0x9F - bhi _08197016 - movs r0, 0xF - b _0819707A -_08197016: - cmp r4, 0xA9 - bhi _0819701E - movs r0, 0x10 - b _0819707A -_0819701E: - cmp r4, 0xB3 - bhi _08197026 - movs r0, 0x11 - b _0819707A -_08197026: - cmp r4, 0xBD - bhi _0819702E - movs r0, 0x12 - b _0819707A -_0819702E: - cmp r4, 0xC7 - bls _08197078 - movs r0, 0xCD - lsls r0, 1 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - bl GetSetPokedexFlag - lsls r0, 24 - cmp r0, 0 - beq _08197050 - subs r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 -_08197050: - ldr r0, =0x00000199 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - bl GetSetPokedexFlag - lsls r0, 24 - cmp r0, 0 - beq _0819706C - subs r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 -_0819706C: - cmp r4, 0xC7 - bls _08197078 - movs r0, 0x14 - b _0819707A - .pool -_08197078: - movs r0, 0x13 -_0819707A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8196F90 - - thumb_func_start sub_8197080 -sub_8197080: @ 8197080 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r8, r0 - movs r0, 0xFA - lsls r0, 2 - bl Alloc - adds r7, r0, 0 - cmp r7, 0 - bne _081970A2 - movs r0, 0xFF - mov r1, r8 - strb r0, [r1] - b _0819715C -_081970A2: - movs r0, 0 - bl sub_80C0844 - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0x1 - bl sub_80C0844 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, =gStringVar1 - mov r10, r0 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r1, =gStringVar2 - mov r9, r1 - mov r0, r9 - adds r1, r6, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - adds r0, r6, 0 - bl sub_8196F90 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =gUnknown_082A5C9C - adds r0, r7, 0 - bl StringCopy - adds r5, r0, 0 - movs r6, 0xFB - strb r6, [r5] - adds r5, 0x1 - ldr r1, =gUnknown_082A5D2C - adds r0, r5, 0 - bl StringCopy - adds r5, r0, 0 - strb r6, [r5] - adds r5, 0x1 - ldr r0, =gUnknown_0860F020 - lsls r4, 2 - adds r4, r0 - ldr r1, [r4] - adds r0, r5, 0 - bl StringCopy - mov r0, r8 - adds r1, r7, 0 - bl StringExpandPlaceholders - adds r5, r0, 0 - bl IsNationalPokedexEnabled - cmp r0, 0 - beq _08197156 - strb r6, [r5] - adds r5, 0x1 - movs r0, 0 - bl pokedex_count - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0x1 - bl pokedex_count - lsls r0, 16 - lsrs r6, r0, 16 - mov r0, r10 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - mov r0, r9 - adds r1, r6, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r1, =gUnknown_082A633D - adds r0, r5, 0 - bl StringExpandPlaceholders -_08197156: - adds r0, r7, 0 - bl Free -_0819715C: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8197080 - - thumb_func_start sub_8197184 -sub_8197184: @ 8197184 - push {r4,r5,lr} - adds r4, r1, 0 - adds r5, r2, 0 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl GetWindowAttribute - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0860EA6C - movs r2, 0x80 - lsls r2, 1 - lsls r4, 16 - lsrs r4, 16 - adds r3, r4, 0 - bl LoadBgTiles - ldr r0, =gUnknown_0860EA4C - lsls r5, 20 - lsrs r5, 16 - adds r1, r5, 0 - movs r2, 0x20 - bl LoadPalette - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8197184 - - thumb_func_start sub_81971C4 -sub_81971C4: @ 81971C4 - push {lr} - bl sub_819645C - pop {r0} - bx r0 - thumb_func_end sub_81971C4 - - thumb_func_start sub_81971D0 -sub_81971D0: @ 81971D0 - push {lr} - ldr r0, =gUnknown_0860F098 - bl InitWindows - ldr r0, =gUnknown_0203CD8C - movs r1, 0xFF - strb r1, [r0] - ldr r0, =gUnknown_0203CD8D - strb r1, [r0] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81971D0 - - thumb_func_start sub_81971F4 -sub_81971F4: @ 81971F4 - push {lr} - bl FreeAllWindowBuffers - pop {r0} - bx r0 - thumb_func_end sub_81971F4 - - thumb_func_start sub_8197200 -sub_8197200: @ 8197200 - push {lr} - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - bl DeactivateAllTextPrinters - bl sub_81973A4 - pop {r0} - bx r0 - thumb_func_end sub_8197200 - - thumb_func_start sub_8197224 -sub_8197224: @ 8197224 - push {lr} - bl RunTextPrinters - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - thumb_func_end sub_8197224 - - thumb_func_start AddTextPrinterParametrized -@ u16 AddTextPrinterParametrized(u8 windowId, u8 fontId, u8 *str, u8 speed, void ( *callback)(u16, struct TextPrinter *), u8 fgColor, u8 bgColor, u8 shadowColor) -AddTextPrinterParametrized: @ 8197238 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x10 - ldr r7, [sp, 0x28] - ldr r4, [sp, 0x2C] - mov r8, r4 - ldr r5, [sp, 0x30] - ldr r6, [sp, 0x34] - lsls r3, 24 - lsrs r3, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - str r2, [sp] - mov r2, sp - movs r4, 0 - strb r0, [r2, 0x4] - mov r0, sp - strb r1, [r0, 0x5] - strb r4, [r0, 0x6] - movs r1, 0x1 - strb r1, [r0, 0x7] - strb r4, [r0, 0x8] - strb r1, [r0, 0x9] - strb r4, [r0, 0xA] - strb r4, [r0, 0xB] - mov r4, sp - ldrb r2, [r4, 0xC] - subs r1, 0x11 - adds r0, r1, 0 - ands r0, r2 - strb r0, [r4, 0xC] - mov r0, sp - mov r2, r8 - lsls r2, 4 - movs r4, 0xF - strb r2, [r0, 0xC] - mov r2, sp - ands r5, r4 - ldrb r0, [r2, 0xD] - ands r1, r0 - orrs r1, r5 - strb r1, [r2, 0xD] - mov r0, sp - lsrs r6, 20 - ands r1, r4 - orrs r1, r6 - strb r1, [r0, 0xD] - ldr r2, =gTextFlags - ldrb r1, [r2] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - mov r0, sp - adds r1, r3, 0 - adds r2, r7, 0 - bl AddTextPrinter - lsls r0, 16 - lsrs r0, 16 - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end AddTextPrinterParametrized - - thumb_func_start AddTextPrinterForMessage -@ void AddTextPrinterForMessage(u8 allowSkippingDelayWithButtonPress) -AddTextPrinterForMessage: @ 81972C4 - push {r4,r5,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - movs r5, 0 - ldr r3, =gTextFlags - movs r4, 0x1 - ands r0, r4 - ldrb r2, [r3] - movs r1, 0x2 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3] - bl sav2_get_text_speed - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - ldr r2, =gStringVar4 - str r5, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x3 - str r0, [sp, 0xC] - movs r0, 0 - movs r1, 0x1 - bl AddTextPrinterParametrized - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end AddTextPrinterForMessage - - thumb_func_start AddTextPrinterForMessage_2 -@ void AddTextPrinterForMessage_2(u8 allowSkippingDelayWithButtonPress) -AddTextPrinterForMessage_2: @ 8197310 - push {r4,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - ldr r3, =gTextFlags - movs r4, 0x1 - ands r0, r4 - ldrb r2, [r3] - movs r1, 0x2 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3] - bl sav2_get_text_speed - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - ldr r2, =gStringVar4 - movs r0, 0 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x3 - str r0, [sp, 0xC] - movs r0, 0 - movs r1, 0x1 - bl AddTextPrinterParametrized - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end AddTextPrinterForMessage_2 - - thumb_func_start AddTextPrinterWithCustomSpeedForMessage -@ void AddTextPrinterWithCustomSpeedForMessage(u8 allowSkippingDelayWithButtonPress, u8 speed) -AddTextPrinterWithCustomSpeedForMessage: @ 819735C - push {r4,r5,lr} - sub sp, 0x10 - adds r3, r1, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r3, 24 - lsrs r3, 24 - ldr r4, =gTextFlags - movs r5, 0x1 - ands r0, r5 - ldrb r2, [r4] - movs r1, 0x2 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r4] - ldr r2, =gStringVar4 - movs r0, 0 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x3 - str r0, [sp, 0xC] - movs r0, 0 - movs r1, 0x1 - bl AddTextPrinterParametrized - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end AddTextPrinterWithCustomSpeedForMessage - - thumb_func_start sub_81973A4 -sub_81973A4: @ 81973A4 - push {lr} - movs r1, 0x80 - lsls r1, 2 - movs r0, 0 - movs r2, 0xF0 - bl copy_textbox_border_tile_patterns_to_vram - movs r1, 0x85 - lsls r1, 2 - movs r0, 0 - movs r2, 0xE0 - bl sub_809882C - pop {r0} - bx r0 - thumb_func_end sub_81973A4 - - thumb_func_start sub_81973C4 -sub_81973C4: @ 81973C4 - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =sub_81975F4 - adds r0, r5, 0 - bl CallWindowFunction - adds r0, r5, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - adds r0, r5, 0 - bl PutWindowTilemap - cmp r4, 0x1 - bne _081973F2 - adds r0, r5, 0 - movs r1, 0x3 - bl CopyWindowToVram -_081973F2: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81973C4 - - thumb_func_start sub_81973FC -sub_81973FC: @ 81973FC - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =sub_81974A4 - adds r0, r5, 0 - bl CallWindowFunction - adds r0, r5, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - adds r0, r5, 0 - bl PutWindowTilemap - cmp r4, 0x1 - bne _0819742A - adds r0, r5, 0 - movs r1, 0x3 - bl CopyWindowToVram -_0819742A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81973FC - - thumb_func_start sub_8197434 -sub_8197434: @ 8197434 - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =sub_8197804 - adds r0, r5, 0 - bl CallWindowFunction - adds r0, r5, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - adds r0, r5, 0 - bl ClearWindowTilemap - cmp r4, 0x1 - bne _08197462 - adds r0, r5, 0 - movs r1, 0x3 - bl CopyWindowToVram -_08197462: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8197434 - - thumb_func_start sub_819746C -sub_819746C: @ 819746C - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =sub_81977BC - adds r0, r5, 0 - bl CallWindowFunction - adds r0, r5, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - adds r0, r5, 0 - bl ClearWindowTilemap - cmp r4, 0x1 - bne _0819749A - adds r0, r5, 0 - movs r1, 0x3 - bl CopyWindowToVram -_0819749A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819746C - - thumb_func_start sub_81974A4 -sub_81974A4: @ 81974A4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - adds r4, r2, 0 - ldr r2, [sp, 0x3C] - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, 24 - lsls r4, 24 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x10] - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x14] - movs r3, 0x85 - lsls r3, 2 - lsrs r0, r1, 24 - str r0, [sp, 0xC] - movs r2, 0xFF - lsls r2, 24 - adds r2, r1 - mov r8, r2 - lsrs r2, 24 - lsrs r0, r4, 24 - mov r9, r0 - movs r0, 0xFF - lsls r0, 24 - adds r4, r0 - lsrs r4, 24 - movs r5, 0x1 - str r5, [sp] - str r5, [sp, 0x4] - movs r6, 0xE - str r6, [sp, 0x8] - adds r0, r7, 0 - adds r1, r3, 0 - adds r3, r4, 0 - bl FillBgTilemapBufferRect - ldr r1, =0x00000215 - ldr r2, [sp, 0x10] - str r2, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - adds r0, r7, 0 - ldr r2, [sp, 0xC] - adds r3, r4, 0 - bl FillBgTilemapBufferRect - ldr r1, =0x00000216 - ldr r3, [sp, 0xC] - ldr r2, [sp, 0x10] - adds r0, r3, r2 - lsls r0, 24 - mov r10, r0 - lsrs r2, r0, 24 - str r5, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - adds r0, r7, 0 - adds r3, r4, 0 - bl FillBgTilemapBufferRect - mov r5, r9 - ldr r0, [sp, 0x14] - add r0, r9 - cmp r9, r0 - bge _08197578 - mov r3, r8 - str r3, [sp, 0x18] - movs r6, 0x1 - movs r0, 0xE - mov r8, r0 -_0819753E: - lsls r4, r5, 24 - lsrs r4, 24 - str r6, [sp] - str r6, [sp, 0x4] - mov r2, r8 - str r2, [sp, 0x8] - adds r0, r7, 0 - ldr r1, =0x00000217 - ldr r3, [sp, 0x18] - lsrs r2, r3, 24 - adds r3, r4, 0 - bl FillBgTilemapBufferRect - str r6, [sp] - str r6, [sp, 0x4] - mov r0, r8 - str r0, [sp, 0x8] - adds r0, r7, 0 - ldr r1, =0x00000219 - mov r3, r10 - lsrs r2, r3, 24 - adds r3, r4, 0 - bl FillBgTilemapBufferRect - adds r5, 0x1 - ldr r0, [sp, 0x14] - add r0, r9 - cmp r5, r0 - blt _0819753E -_08197578: - ldr r1, =0x0000021a - ldr r2, [sp, 0xC] - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - ldr r4, [sp, 0x14] - add r4, r9 - lsls r4, 24 - lsrs r4, 24 - movs r5, 0x1 - str r5, [sp] - str r5, [sp, 0x4] - movs r6, 0xE - str r6, [sp, 0x8] - adds r0, r7, 0 - adds r3, r4, 0 - bl FillBgTilemapBufferRect - ldr r1, =0x0000021b - ldr r0, [sp, 0x10] - str r0, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - adds r0, r7, 0 - ldr r2, [sp, 0xC] - adds r3, r4, 0 - bl FillBgTilemapBufferRect - movs r1, 0x87 - lsls r1, 2 - ldr r3, [sp, 0xC] - ldr r0, [sp, 0x10] - adds r2, r3, r0 - lsls r2, 24 - lsrs r2, 24 - str r5, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - adds r0, r7, 0 - adds r3, r4, 0 - bl FillBgTilemapBufferRect - 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_81974A4 - - thumb_func_start sub_81975F4 -sub_81975F4: @ 81975F4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - adds r6, r0, 0 - adds r5, r2, 0 - mov r8, r3 - ldr r2, [sp, 0x44] - lsls r6, 24 - lsrs r6, 24 - lsls r0, r1, 24 - lsls r5, 24 - mov r1, r8 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - lsls r1, r2, 24 - lsrs r1, 24 - str r1, [sp, 0x10] - ldr r1, =0x00000201 - lsrs r2, r0, 24 - str r2, [sp, 0xC] - movs r3, 0xFE - lsls r3, 24 - adds r2, r0, r3 - lsrs r2, 24 - str r2, [sp, 0x14] - lsrs r0, r5, 24 - mov r10, r0 - movs r2, 0xFF - lsls r2, 24 - adds r5, r2 - lsrs r5, 24 - movs r4, 0x1 - str r4, [sp] - str r4, [sp, 0x4] - movs r3, 0xF - mov r9, r3 - str r3, [sp, 0x8] - adds r0, r6, 0 - ldr r2, [sp, 0x14] - adds r3, r5, 0 - bl FillBgTilemapBufferRect - ldr r1, =0x00000203 - ldr r0, [sp, 0xC] - subs r0, 0x1 - lsls r2, r0, 24 - lsrs r2, 24 - str r2, [sp, 0x18] - str r4, [sp] - str r4, [sp, 0x4] - mov r0, r9 - str r0, [sp, 0x8] - adds r0, r6, 0 - adds r3, r5, 0 - bl FillBgTilemapBufferRect - movs r1, 0x81 - lsls r1, 2 - mov r0, r8 - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x1C] - str r0, [sp] - str r4, [sp, 0x4] - mov r2, r9 - str r2, [sp, 0x8] - adds r0, r6, 0 - ldr r2, [sp, 0xC] - adds r3, r5, 0 - bl FillBgTilemapBufferRect - ldr r1, =0x00000205 - ldr r7, [sp, 0xC] - add r7, r8 - subs r0, r7, 0x1 - lsls r2, r0, 24 - lsrs r2, 24 - str r2, [sp, 0x20] - str r4, [sp] - str r4, [sp, 0x4] - mov r3, r9 - str r3, [sp, 0x8] - adds r0, r6, 0 - adds r3, r5, 0 - bl FillBgTilemapBufferRect - ldr r1, =0x00000206 - lsls r2, r7, 24 - lsrs r7, r2, 24 - str r4, [sp] - str r4, [sp, 0x4] - mov r0, r9 - str r0, [sp, 0x8] - adds r0, r6, 0 - adds r2, r7, 0 - adds r3, r5, 0 - bl FillBgTilemapBufferRect - ldr r1, =0x00000207 - str r4, [sp] - movs r5, 0x5 - str r5, [sp, 0x4] - mov r2, r9 - str r2, [sp, 0x8] - adds r0, r6, 0 - ldr r2, [sp, 0x14] - mov r3, r10 - bl FillBgTilemapBufferRect - ldr r1, =0x00000209 - add r8, r4 - mov r3, r8 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp] - str r5, [sp, 0x4] - mov r0, r9 - str r0, [sp, 0x8] - adds r0, r6, 0 - ldr r2, [sp, 0x18] - mov r3, r10 - bl FillBgTilemapBufferRect - ldr r1, =0x0000020a - str r4, [sp] - str r5, [sp, 0x4] - mov r2, r9 - str r2, [sp, 0x8] - adds r0, r6, 0 - adds r2, r7, 0 - mov r3, r10 - bl FillBgTilemapBufferRect - ldr r1, =0x00000a01 - ldr r3, [sp, 0x10] - add r10, r3 - mov r0, r10 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - str r4, [sp] - str r4, [sp, 0x4] - mov r2, r9 - str r2, [sp, 0x8] - adds r0, r6, 0 - ldr r2, [sp, 0x14] - mov r3, r10 - bl FillBgTilemapBufferRect - ldr r1, =0x00000a03 - str r4, [sp] - str r4, [sp, 0x4] - mov r3, r9 - str r3, [sp, 0x8] - adds r0, r6, 0 - ldr r2, [sp, 0x18] - mov r3, r10 - bl FillBgTilemapBufferRect - ldr r1, =0x00000a04 - ldr r0, [sp, 0x1C] - str r0, [sp] - str r4, [sp, 0x4] - mov r2, r9 - str r2, [sp, 0x8] - adds r0, r6, 0 - ldr r2, [sp, 0xC] - mov r3, r10 - bl FillBgTilemapBufferRect - ldr r1, =0x00000a05 - str r4, [sp] - str r4, [sp, 0x4] - mov r3, r9 - str r3, [sp, 0x8] - adds r0, r6, 0 - ldr r2, [sp, 0x20] - mov r3, r10 - bl FillBgTilemapBufferRect - ldr r1, =0x00000a06 - str r4, [sp] - str r4, [sp, 0x4] - mov r0, r9 - str r0, [sp, 0x8] - adds r0, r6, 0 - adds r2, r7, 0 - mov r3, r10 - bl FillBgTilemapBufferRect - add sp, 0x24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81975F4 - - thumb_func_start sub_81977BC -sub_81977BC: @ 81977BC - push {r4,r5,lr} - sub sp, 0xC - adds r4, r1, 0 - adds r5, r2, 0 - ldr r1, [sp, 0x18] - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsls r5, 24 - lsls r3, 24 - lsls r1, 24 - movs r2, 0xFF - lsls r2, 24 - adds r4, r2 - lsrs r4, 24 - adds r5, r2 - lsrs r5, 24 - movs r2, 0x80 - lsls r2, 18 - adds r3, r2 - lsrs r3, 24 - str r3, [sp] - adds r1, r2 - lsrs r1, 24 - str r1, [sp, 0x4] - movs r1, 0xE - str r1, [sp, 0x8] - movs r1, 0 - adds r2, r4, 0 - adds r3, r5, 0 - bl FillBgTilemapBufferRect - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81977BC - - thumb_func_start sub_8197804 -sub_8197804: @ 8197804 - push {r4,r5,lr} - sub sp, 0xC - adds r4, r1, 0 - adds r5, r2, 0 - ldr r1, [sp, 0x18] - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsls r5, 24 - lsls r3, 24 - lsls r1, 24 - movs r2, 0xFD - lsls r2, 24 - adds r4, r2 - lsrs r4, 24 - movs r2, 0xFF - lsls r2, 24 - adds r5, r2 - lsrs r5, 24 - movs r2, 0xC0 - lsls r2, 19 - adds r3, r2 - lsrs r3, 24 - str r3, [sp] - movs r2, 0x80 - lsls r2, 18 - adds r1, r2 - lsrs r1, 24 - str r1, [sp, 0x4] - movs r1, 0xE - str r1, [sp, 0x8] - movs r1, 0 - adds r2, r4, 0 - adds r3, r5, 0 - bl FillBgTilemapBufferRect - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8197804 - - thumb_func_start SetStandardWindowBorderStyle -@ void SetStandardWindowBorderStyle(u8 windowId, bool copyToVram) -SetStandardWindowBorderStyle: @ 8197854 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - movs r2, 0x85 - lsls r2, 2 - movs r3, 0xE - bl SetWindowBorderStyle - pop {r0} - bx r0 - thumb_func_end SetStandardWindowBorderStyle - - thumb_func_start sub_819786C -sub_819786C: @ 819786C - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - movs r6, 0x80 - lsls r6, 2 - adds r0, r4, 0 - adds r1, r6, 0 - movs r2, 0xF0 - bl copy_textbox_border_tile_patterns_to_vram - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - movs r3, 0xF - bl sub_8197B1C - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_819786C - - thumb_func_start sub_819789C -sub_819789C: @ 819789C - push {lr} - ldr r0, =gUnknown_0860F074 - movs r1, 0xE0 - movs r2, 0x14 - bl LoadPalette - pop {r0} - bx r0 - .pool - thumb_func_end sub_819789C - - thumb_func_start sub_81978B0 -sub_81978B0: @ 81978B0 - push {lr} - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - ldr r0, =gUnknown_0860F074 - movs r2, 0x14 - bl LoadPalette - pop {r0} - bx r0 - .pool - thumb_func_end sub_81978B0 - - thumb_func_start sub_81978C8 -sub_81978C8: @ 81978C8 - ldr r0, =gUnknown_0860F074 - bx lr - .pool - thumb_func_end sub_81978C8 - - thumb_func_start sub_81978D0 -sub_81978D0: @ 81978D0 - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xF - bls _081978DC - movs r1, 0 -_081978DC: - ldr r0, =gUnknown_0860F074 - lsls r1, 1 - adds r1, r0 - ldrh r0, [r1] - pop {r1} - bx r1 - .pool - thumb_func_end sub_81978D0 - - thumb_func_start DisplayItemMessageOnField -@ void DisplayItemMessageOnField(u8 taskId, u8 *str, void ( *callback)(u8 taskId)) -DisplayItemMessageOnField: @ 81978EC - push {r4-r6,lr} - sub sp, 0x10 - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_81973A4 - bl sav2_get_text_speed - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x80 - lsls r2, 2 - movs r1, 0x1 - str r1, [sp] - str r0, [sp, 0x4] - str r5, [sp, 0x8] - str r6, [sp, 0xC] - adds r0, r4, 0 - movs r1, 0 - movs r3, 0xF - bl DisplayMessageAndContinueTask - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end DisplayItemMessageOnField - - thumb_func_start sub_8197930 -sub_8197930: @ 8197930 - push {lr} - ldr r0, =gUnknown_0860F0A8 - movs r1, 0x85 - lsls r1, 2 - movs r2, 0xE - movs r3, 0 - bl CreateYesNoMenu - pop {r0} - bx r0 - .pool - thumb_func_end sub_8197930 - - thumb_func_start sub_8197948 -sub_8197948: @ 8197948 - push {lr} - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =gUnknown_0860F0A8 - movs r1, 0x85 - lsls r1, 2 - movs r2, 0xE - bl CreateYesNoMenu - pop {r0} - bx r0 - .pool - thumb_func_end sub_8197948 - - thumb_func_start sub_8197964 -sub_8197964: @ 8197964 - push {lr} - ldr r0, =gTextFlags - ldrb r1, [r0] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - bne _08197988 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrb r0, [r0, 0x14] - lsls r0, 29 - lsrs r0, 29 - b _0819798A - .pool -_08197988: - movs r0, 0x1 -_0819798A: - pop {r1} - bx r1 - thumb_func_end sub_8197964 - - thumb_func_start sav2_get_text_speed -sav2_get_text_speed: @ 8197990 - push {lr} - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldrb r1, [r2, 0x14] - lsls r0, r1, 29 - lsrs r0, 29 - cmp r0, 0x2 - bls _081979AC - movs r0, 0x8 - negs r0, r0 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x14] -_081979AC: - bl sub_8197964 - ldr r1, =gUnknown_0860F094 - adds r0, r1 - ldrb r0, [r0] - pop {r1} - bx r1 - .pool - thumb_func_end sav2_get_text_speed - - thumb_func_start sub_81979C4 -sub_81979C4: @ 81979C4 - push {r4,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r1, r0, 24 - ldr r4, =gUnknown_0203CD8C - ldrb r0, [r4] - cmp r0, 0xFF - bne _081979F6 - lsls r0, r1, 25 - movs r1, 0x80 - lsls r1, 18 - adds r0, r1 - lsrs r0, 24 - str r0, [sp] - movs r0, 0xF - str r0, [sp, 0x4] - ldr r0, =0x00000139 - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0x16 - movs r2, 0x1 - movs r3, 0x7 - bl sub_8198AA4 - strb r0, [r4] -_081979F6: - ldrb r0, [r4] - add sp, 0xC - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81979C4 - - thumb_func_start GetStartMenuWindowId -GetStartMenuWindowId: @ 8197A08 - ldr r0, =gUnknown_0203CD8C - ldrb r0, [r0] - bx lr - .pool - thumb_func_end GetStartMenuWindowId - - thumb_func_start remove_start_menu_window_maybe -remove_start_menu_window_maybe: @ 8197A14 - push {r4,lr} - ldr r4, =gUnknown_0203CD8C - ldrb r0, [r4] - cmp r0, 0xFF - beq _08197A26 - bl RemoveWindow - movs r0, 0xFF - strb r0, [r4] -_08197A26: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end remove_start_menu_window_maybe - - thumb_func_start sub_8197A30 -sub_8197A30: @ 8197A30 - movs r0, 0x80 - lsls r0, 2 - bx lr - thumb_func_end sub_8197A30 - - thumb_func_start sub_8197A38 -sub_8197A38: @ 8197A38 - movs r0, 0x85 - lsls r0, 2 - bx lr - thumb_func_end sub_8197A38 - - thumb_func_start AddMapNamePopUpWindow -AddMapNamePopUpWindow: @ 8197A40 - push {r4,lr} - sub sp, 0xC - ldr r4, =gUnknown_0203CD8D - ldrb r0, [r4] - cmp r0, 0xFF - bne _08197A66 - movs r0, 0x3 - str r0, [sp] - movs r0, 0xE - str r0, [sp, 0x4] - adds r0, 0xF9 - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r2, 0x1 - movs r3, 0xA - bl sub_8198AA4 - strb r0, [r4] -_08197A66: - ldrb r0, [r4] - add sp, 0xC - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end AddMapNamePopUpWindow - - thumb_func_start GetMapNamePopUpWindowId -GetMapNamePopUpWindowId: @ 8197A74 - ldr r0, =gUnknown_0203CD8D - ldrb r0, [r0] - bx lr - .pool - thumb_func_end GetMapNamePopUpWindowId - - thumb_func_start RemoveMapNamePopUpWindow -RemoveMapNamePopUpWindow: @ 8197A80 - push {r4,lr} - ldr r4, =gUnknown_0203CD8D - ldrb r0, [r4] - cmp r0, 0xFF - beq _08197A92 - bl RemoveWindow - movs r0, 0xFF - strb r0, [r4] -_08197A92: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end RemoveMapNamePopUpWindow - - thumb_func_start AddTextPrinterWithCallbackForMessage -@ void AddTextPrinterWithCallbackForMessage(u8 allowSkippingDelayWithButtonPress, void ( *callback)(u16, struct TextPrinter *)) -AddTextPrinterWithCallbackForMessage: @ 8197A9C - push {r4,r5,lr} - sub sp, 0x10 - adds r5, r1, 0 - lsls r0, 24 - lsrs r0, 24 - ldr r3, =gTextFlags - movs r4, 0x1 - ands r0, r4 - ldrb r2, [r3] - movs r1, 0x2 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3] - bl sav2_get_text_speed - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - ldr r2, =gStringVar4 - str r5, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x3 - str r0, [sp, 0xC] - movs r0, 0 - movs r1, 0x1 - bl AddTextPrinterParametrized - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end AddTextPrinterWithCallbackForMessage - - thumb_func_start sub_8197AE8 -sub_8197AE8: @ 8197AE8 - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x20 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect - cmp r4, 0x1 - bne _08197B12 - movs r0, 0 - bl CopyBgTilemapBufferToVram -_08197B12: - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8197AE8 - - thumb_func_start sub_8197B1C -sub_8197B1C: @ 8197B1C - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_0203CD9C - strh r2, [r0] - ldr r0, =gUnknown_0203CD9E - strb r3, [r0] - ldr r1, =sub_8197BB4 - adds r0, r5, 0 - bl CallWindowFunction - adds r0, r5, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - adds r0, r5, 0 - bl PutWindowTilemap - cmp r4, 0x1 - bne _08197B52 - adds r0, r5, 0 - movs r1, 0x3 - bl CopyWindowToVram -_08197B52: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8197B1C - - thumb_func_start sub_8197B64 -sub_8197B64: @ 8197B64 - push {r4-r6,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_0203CD9C - strh r2, [r0] - ldr r5, =gUnknown_0203CD9E - adds r0, r6, 0 - movs r1, 0x5 - bl GetWindowAttribute - strb r0, [r5] - ldr r1, =sub_8197BB4 - adds r0, r6, 0 - bl CallWindowFunction - adds r0, r6, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - adds r0, r6, 0 - bl PutWindowTilemap - cmp r4, 0x1 - bne _08197BA2 - adds r0, r6, 0 - movs r1, 0x3 - bl CopyWindowToVram -_08197BA2: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8197B64 - - thumb_func_start sub_8197BB4 -sub_8197BB4: @ 8197BB4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - mov r8, r0 - adds r5, r2, 0 - adds r6, r3, 0 - ldr r2, [sp, 0x44] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r0, r1, 24 - lsls r5, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r1, r2, 24 - lsrs r1, 24 - str r1, [sp, 0x10] - ldr r2, =gUnknown_0203CD9C - ldrh r1, [r2] - adds r1, 0x1 - lsls r1, 16 - lsrs r1, 16 - lsrs r3, r0, 24 - str r3, [sp, 0xC] - movs r3, 0xFE - lsls r3, 24 - adds r2, r0, r3 - lsrs r2, 24 - str r2, [sp, 0x14] - lsrs r0, r5, 24 - mov r9, r0 - movs r2, 0xFF - lsls r2, 24 - adds r5, r2 - lsrs r5, 24 - movs r4, 0x1 - str r4, [sp] - str r4, [sp, 0x4] - ldr r3, =gUnknown_0203CD9E - mov r10, r3 - ldrb r0, [r3] - str r0, [sp, 0x8] - mov r0, r8 - ldr r2, [sp, 0x14] - adds r3, r5, 0 - bl FillBgTilemapBufferRect - ldr r0, =gUnknown_0203CD9C - ldrh r1, [r0] - adds r1, 0x3 - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0xC] - subs r0, 0x1 - lsls r2, r0, 24 - lsrs r2, 24 - str r2, [sp, 0x18] - str r4, [sp] - str r4, [sp, 0x4] - mov r2, r10 - ldrb r0, [r2] - str r0, [sp, 0x8] - mov r0, r8 - ldr r2, [sp, 0x18] - adds r3, r5, 0 - bl FillBgTilemapBufferRect - ldr r3, =gUnknown_0203CD9C - ldrh r1, [r3] - adds r1, 0x4 - lsls r1, 16 - lsrs r1, 16 - subs r0, r6, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x1C] - str r0, [sp] - str r4, [sp, 0x4] - mov r2, r10 - ldrb r0, [r2] - str r0, [sp, 0x8] - mov r0, r8 - ldr r2, [sp, 0xC] - adds r3, r5, 0 - bl FillBgTilemapBufferRect - ldr r3, =gUnknown_0203CD9C - ldrh r1, [r3] - adds r1, 0x5 - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0xC] - adds r7, r0, r6 - subs r0, r7, 0x1 - lsls r2, r0, 24 - lsrs r2, 24 - str r2, [sp, 0x20] - str r4, [sp] - str r4, [sp, 0x4] - mov r2, r10 - ldrb r0, [r2] - str r0, [sp, 0x8] - mov r0, r8 - ldr r2, [sp, 0x20] - adds r3, r5, 0 - bl FillBgTilemapBufferRect - ldr r3, =gUnknown_0203CD9C - ldrh r1, [r3] - adds r1, 0x6 - lsls r1, 16 - lsrs r1, 16 - lsls r2, r7, 24 - lsrs r7, r2, 24 - str r4, [sp] - str r4, [sp, 0x4] - mov r2, r10 - ldrb r0, [r2] - str r0, [sp, 0x8] - mov r0, r8 - adds r2, r7, 0 - adds r3, r5, 0 - bl FillBgTilemapBufferRect - ldr r3, =gUnknown_0203CD9C - ldrh r1, [r3] - adds r1, 0x7 - lsls r1, 16 - lsrs r1, 16 - str r4, [sp] - movs r5, 0x5 - str r5, [sp, 0x4] - mov r2, r10 - ldrb r0, [r2] - str r0, [sp, 0x8] - mov r0, r8 - ldr r2, [sp, 0x14] - mov r3, r9 - bl FillBgTilemapBufferRect - ldr r3, =gUnknown_0203CD9C - ldrh r1, [r3] - adds r1, 0x9 - lsls r1, 16 - lsrs r1, 16 - adds r6, 0x1 - lsls r6, 24 - lsrs r6, 24 - str r6, [sp] - str r5, [sp, 0x4] - mov r2, r10 - ldrb r0, [r2] - str r0, [sp, 0x8] - mov r0, r8 - ldr r2, [sp, 0x18] - mov r3, r9 - bl FillBgTilemapBufferRect - ldr r3, =gUnknown_0203CD9C - ldrh r1, [r3] - adds r1, 0xA - lsls r1, 16 - lsrs r1, 16 - str r4, [sp] - str r5, [sp, 0x4] - mov r2, r10 - ldrb r0, [r2] - str r0, [sp, 0x8] - mov r0, r8 - adds r2, r7, 0 - mov r3, r9 - bl FillBgTilemapBufferRect - ldr r3, =0x00000801 - adds r1, r3, 0 - ldr r0, =gUnknown_0203CD9C - ldrh r0, [r0] - adds r1, r0 - lsls r1, 16 - lsrs r1, 16 - ldr r2, [sp, 0x10] - add r9, r2 - mov r3, r9 - lsls r3, 24 - lsrs r3, 24 - mov r9, r3 - str r4, [sp] - str r4, [sp, 0x4] - mov r2, r10 - ldrb r0, [r2] - str r0, [sp, 0x8] - mov r0, r8 - ldr r2, [sp, 0x14] - bl FillBgTilemapBufferRect - ldr r3, =0x00000803 - adds r1, r3, 0 - ldr r0, =gUnknown_0203CD9C - ldrh r0, [r0] - adds r1, r0 - lsls r1, 16 - lsrs r1, 16 - str r4, [sp] - str r4, [sp, 0x4] - mov r2, r10 - ldrb r0, [r2] - str r0, [sp, 0x8] - mov r0, r8 - ldr r2, [sp, 0x18] - mov r3, r9 - bl FillBgTilemapBufferRect - ldr r3, =0x00000804 - adds r1, r3, 0 - ldr r0, =gUnknown_0203CD9C - ldrh r0, [r0] - adds r1, r0 - lsls r1, 16 - lsrs r1, 16 - ldr r2, [sp, 0x1C] - str r2, [sp] - str r4, [sp, 0x4] - mov r3, r10 - ldrb r0, [r3] - str r0, [sp, 0x8] - mov r0, r8 - ldr r2, [sp, 0xC] - mov r3, r9 - bl FillBgTilemapBufferRect - ldr r0, =0x00000805 - adds r1, r0, 0 - ldr r2, =gUnknown_0203CD9C - ldrh r2, [r2] - adds r1, r2 - lsls r1, 16 - lsrs r1, 16 - str r4, [sp] - str r4, [sp, 0x4] - mov r3, r10 - ldrb r0, [r3] - str r0, [sp, 0x8] - mov r0, r8 - ldr r2, [sp, 0x20] - mov r3, r9 - bl FillBgTilemapBufferRect - ldr r0, =0x00000806 - adds r1, r0, 0 - ldr r2, =gUnknown_0203CD9C - ldrh r2, [r2] - adds r1, r2 - lsls r1, 16 - lsrs r1, 16 - str r4, [sp] - str r4, [sp, 0x4] - mov r3, r10 - ldrb r0, [r3] - str r0, [sp, 0x8] - mov r0, r8 - adds r2, r7, 0 - mov r3, r9 - bl FillBgTilemapBufferRect - add sp, 0x24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8197BB4 - - thumb_func_start sub_8197DF8 -sub_8197DF8: @ 8197DF8 - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =sub_8197E30 - adds r0, r5, 0 - bl CallWindowFunction - adds r0, r5, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r5, 0 - bl ClearWindowTilemap - cmp r4, 0x1 - bne _08197E26 - adds r0, r5, 0 - movs r1, 0x3 - bl CopyWindowToVram -_08197E26: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8197DF8 - - thumb_func_start sub_8197E30 -sub_8197E30: @ 8197E30 - push {r4,r5,lr} - sub sp, 0xC - adds r4, r1, 0 - adds r5, r2, 0 - ldr r1, [sp, 0x18] - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsls r5, 24 - lsls r3, 24 - lsls r1, 24 - movs r2, 0xFD - lsls r2, 24 - adds r4, r2 - lsrs r4, 24 - movs r2, 0xFF - lsls r2, 24 - adds r5, r2 - lsrs r5, 24 - movs r2, 0xC0 - lsls r2, 19 - adds r3, r2 - lsrs r3, 24 - str r3, [sp] - movs r2, 0x80 - lsls r2, 18 - adds r1, r2 - lsrs r1, 24 - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - adds r2, r4, 0 - adds r3, r5, 0 - bl FillBgTilemapBufferRect - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8197E30 - - thumb_func_start SetWindowBorderStyle -@ void SetWindowBorderStyle(u8 windowId, bool copyToVram, s16 tileStart, s8 palette) -SetWindowBorderStyle: @ 8197E80 - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_0203CD9C - strh r2, [r0] - ldr r0, =gUnknown_0203CD9E - strb r3, [r0] - ldr r1, =DrawWindowBorder - adds r0, r5, 0 - bl CallWindowFunction - adds r0, r5, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - adds r0, r5, 0 - bl PutWindowTilemap - cmp r4, 0x1 - bne _08197EB6 - adds r0, r5, 0 - movs r1, 0x3 - bl CopyWindowToVram -_08197EB6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end SetWindowBorderStyle - - thumb_func_start sub_8197EC8 -sub_8197EC8: @ 8197EC8 - push {r4-r6,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_0203CD9C - strh r2, [r0] - ldr r5, =gUnknown_0203CD9E - adds r0, r6, 0 - movs r1, 0x5 - bl GetWindowAttribute - strb r0, [r5] - ldr r1, =DrawWindowBorder - adds r0, r6, 0 - bl CallWindowFunction - adds r0, r6, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - adds r0, r6, 0 - bl PutWindowTilemap - cmp r4, 0x1 - bne _08197F06 - adds r0, r6, 0 - movs r1, 0x3 - bl CopyWindowToVram -_08197F06: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8197EC8 - - thumb_func_start DrawWindowBorder -DrawWindowBorder: @ 8197F18 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - mov r9, r0 - adds r6, r1, 0 - adds r4, r2, 0 - ldr r0, [sp, 0x38] - mov r1, r9 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - lsls r6, 24 - lsls r4, 24 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x10] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x14] - ldr r2, =gUnknown_0203CD9C - ldrh r1, [r2] - lsrs r0, r6, 24 - str r0, [sp, 0xC] - movs r2, 0xFF - lsls r2, 24 - adds r6, r2 - lsrs r6, 24 - lsrs r0, r4, 24 - mov r8, r0 - adds r4, r2 - lsrs r4, 24 - movs r5, 0x1 - str r5, [sp] - str r5, [sp, 0x4] - ldr r7, =gUnknown_0203CD9E - ldrb r0, [r7] - str r0, [sp, 0x8] - mov r0, r9 - adds r2, r6, 0 - adds r3, r4, 0 - bl FillBgTilemapBufferRect - ldr r2, =gUnknown_0203CD9C - ldrh r1, [r2] - adds r1, 0x1 - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0x10] - str r0, [sp] - str r5, [sp, 0x4] - ldrb r0, [r7] - str r0, [sp, 0x8] - mov r0, r9 - ldr r2, [sp, 0xC] - adds r3, r4, 0 - bl FillBgTilemapBufferRect - ldr r2, =gUnknown_0203CD9C - ldrh r1, [r2] - adds r1, 0x2 - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0xC] - ldr r2, [sp, 0x10] - adds r0, r2 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - str r5, [sp] - str r5, [sp, 0x4] - ldrb r0, [r7] - str r0, [sp, 0x8] - mov r0, r9 - mov r2, r10 - adds r3, r4, 0 - bl FillBgTilemapBufferRect - ldr r0, =gUnknown_0203CD9C - ldrh r1, [r0] - adds r1, 0x3 - lsls r1, 16 - lsrs r1, 16 - str r5, [sp] - ldr r2, [sp, 0x14] - str r2, [sp, 0x4] - ldrb r0, [r7] - str r0, [sp, 0x8] - mov r0, r9 - adds r2, r6, 0 - mov r3, r8 - bl FillBgTilemapBufferRect - ldr r0, =gUnknown_0203CD9C - ldrh r1, [r0] - adds r1, 0x5 - lsls r1, 16 - lsrs r1, 16 - str r5, [sp] - ldr r2, [sp, 0x14] - str r2, [sp, 0x4] - ldrb r0, [r7] - str r0, [sp, 0x8] - mov r0, r9 - mov r2, r10 - mov r3, r8 - bl FillBgTilemapBufferRect - ldr r0, =gUnknown_0203CD9C - ldrh r1, [r0] - adds r1, 0x6 - lsls r1, 16 - lsrs r1, 16 - ldr r2, [sp, 0x14] - add r8, r2 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - str r5, [sp] - str r5, [sp, 0x4] - ldrb r0, [r7] - str r0, [sp, 0x8] - mov r0, r9 - adds r2, r6, 0 - mov r3, r8 - bl FillBgTilemapBufferRect - ldr r2, =gUnknown_0203CD9C - ldrh r1, [r2] - adds r1, 0x7 - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0x10] - str r0, [sp] - str r5, [sp, 0x4] - ldrb r0, [r7] - str r0, [sp, 0x8] - mov r0, r9 - ldr r2, [sp, 0xC] - mov r3, r8 - bl FillBgTilemapBufferRect - ldr r2, =gUnknown_0203CD9C - ldrh r1, [r2] - adds r1, 0x8 - lsls r1, 16 - lsrs r1, 16 - str r5, [sp] - str r5, [sp, 0x4] - ldrb r0, [r7] - str r0, [sp, 0x8] - mov r0, r9 - mov r2, r10 - mov r3, r8 - bl FillBgTilemapBufferRect - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end DrawWindowBorder - - thumb_func_start sub_8198070 -sub_8198070: @ 8198070 - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =sub_81980A8 - adds r0, r5, 0 - bl CallWindowFunction - adds r0, r5, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r5, 0 - bl ClearWindowTilemap - cmp r4, 0x1 - bne _0819809E - adds r0, r5, 0 - movs r1, 0x3 - bl CopyWindowToVram -_0819809E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8198070 - - thumb_func_start sub_81980A8 -sub_81980A8: @ 81980A8 - push {r4,r5,lr} - sub sp, 0xC - adds r4, r1, 0 - adds r5, r2, 0 - ldr r1, [sp, 0x18] - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsls r5, 24 - lsls r3, 24 - lsls r1, 24 - movs r2, 0xFF - lsls r2, 24 - adds r4, r2 - lsrs r4, 24 - adds r5, r2 - lsrs r5, 24 - movs r2, 0x80 - lsls r2, 18 - adds r3, r2 - lsrs r3, 24 - str r3, [sp] - adds r1, r2 - lsrs r1, 24 - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - adds r2, r4, 0 - adds r3, r5, 0 - bl FillBgTilemapBufferRect - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81980A8 - - thumb_func_start sub_81980F0 -sub_81980F0: @ 81980F0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - ldr r4, [sp, 0x20] - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - lsls r3, 24 - lsrs r5, r3, 24 - lsls r4, 16 - lsrs r4, 16 - mov r0, sp - movs r1, 0 - movs r2, 0x8 - bl memset - cmp r6, 0x3 - bls _08198126 - movs r1, 0 - mov r0, sp - strb r1, [r0] - b _0819812A -_08198126: - mov r0, sp - strb r6, [r0] -_0819812A: - mov r1, sp - mov r0, r8 - strb r0, [r1, 0x2] - movs r0, 0x2 - strb r0, [r1, 0x4] - movs r0, 0x1E - subs r0, r7 - strb r0, [r1, 0x1] - strb r7, [r1, 0x3] - strb r5, [r1, 0x5] - strh r4, [r1, 0x6] - ldr r4, =gUnknown_0203CDA0 - mov r0, sp - bl AddWindow - strb r0, [r4] - cmp r5, 0xF - bls _08198158 - movs r5, 0xF0 - b _0819815C - .pool -_08198158: - lsls r0, r5, 28 - lsrs r5, r0, 24 -_0819815C: - ldr r0, =gUnknown_0860F0B0 - adds r1, r5, 0 - movs r2, 0x20 - bl LoadPalette - ldr r0, =gUnknown_0203CDA0 - ldrb r0, [r0] - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81980F0 - - thumb_func_start sub_8198180 -sub_8198180: @ 8198180 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - adds r6, r0, 0 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - ldr r5, =gUnknown_0203CDA0 - ldrb r0, [r5] - cmp r0, 0xFF - beq _081981EE - bl PutWindowTilemap - ldrb r0, [r5] - movs r1, 0xFF - bl FillWindowPixelBuffer - movs r0, 0 - adds r1, r6, 0 - movs r2, 0 - bl GetStringWidth - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldrb r0, [r5] - movs r1, 0x1 - bl GetWindowAttribute - movs r2, 0xEC - subs r2, r7 - lsls r0, 3 - subs r2, r0 - subs r2, r4 - lsls r2, 24 - lsrs r2, 24 - ldrb r0, [r5] - ldr r1, =gUnknown_0860F0D0 - str r1, [sp] - movs r1, 0 - str r1, [sp, 0x4] - str r6, [sp, 0x8] - movs r3, 0x1 - bl box_print - mov r0, r8 - cmp r0, 0 - beq _081981EE - ldrb r0, [r5] - movs r1, 0x3 - bl CopyWindowToVram -_081981EE: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8198180 - - thumb_func_start sub_8198204 -sub_8198204: @ 8198204 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - mov r10, r0 - adds r6, r1, 0 - ldr r0, [sp, 0x38] - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - mov r8, r3 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - movs r4, 0 - ldr r0, =gUnknown_0203CDA0 - ldrb r1, [r0] - adds r7, r0, 0 - cmp r1, 0xFF - beq _081982C8 - cmp r2, 0 - beq _08198244 - add r0, sp, 0x14 - strb r4, [r0] - adds r1, r0, 0 - b _0819824A - .pool -_08198244: - add r1, sp, 0x14 - movs r0, 0xF - strb r0, [r1] -_0819824A: - movs r0, 0x1 - strb r0, [r1, 0x1] - movs r0, 0x2 - strb r0, [r1, 0x2] - adds r5, r7, 0 - ldrb r0, [r5] - bl PutWindowTilemap - ldrb r0, [r5] - movs r1, 0xFF - bl FillWindowPixelBuffer - cmp r6, 0 - beq _0819829E - movs r0, 0 - adds r1, r6, 0 - movs r2, 0 - bl GetStringWidth - lsls r0, 16 - lsrs r4, r0, 16 - ldrb r0, [r5] - movs r1, 0x1 - bl GetWindowAttribute - movs r2, 0xEC - mov r1, r8 - subs r2, r1 - lsls r0, 3 - subs r2, r0 - subs r2, r4 - lsls r2, 24 - lsrs r2, 24 - ldrb r0, [r5] - add r1, sp, 0x14 - str r1, [sp] - movs r1, 0 - str r1, [sp, 0x4] - str r6, [sp, 0x8] - movs r3, 0x1 - bl box_print -_0819829E: - ldrb r0, [r7] - movs r1, 0 - str r1, [sp] - str r1, [sp, 0x4] - add r2, sp, 0x14 - str r2, [sp, 0x8] - str r1, [sp, 0xC] - mov r1, r10 - str r1, [sp, 0x10] - movs r1, 0x1 - movs r2, 0x4 - movs r3, 0x1 - bl AddTextPrinterParametrized2 - mov r2, r9 - cmp r2, 0 - beq _081982C8 - ldrb r0, [r7] - movs r1, 0x3 - bl CopyWindowToVram -_081982C8: - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8198204 - - thumb_func_start sub_81982D8 -sub_81982D8: @ 81982D8 - push {lr} - ldr r1, =gUnknown_0203CDA0 - ldrb r0, [r1] - cmp r0, 0xFF - beq _081982E8 - movs r1, 0x3 - bl CopyWindowToVram -_081982E8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81982D8 - - thumb_func_start sub_81982F0 -sub_81982F0: @ 81982F0 - push {r4,lr} - ldr r4, =gUnknown_0203CDA0 - ldrb r0, [r4] - cmp r0, 0xFF - beq _08198308 - movs r1, 0xFF - bl FillWindowPixelBuffer - ldrb r0, [r4] - movs r1, 0x3 - bl CopyWindowToVram -_08198308: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81982F0 - - thumb_func_start sub_8198314 -sub_8198314: @ 8198314 - push {r4,lr} - ldr r4, =gUnknown_0203CDA0 - ldrb r0, [r4] - cmp r0, 0xFF - beq _0819833C - movs r1, 0 - bl FillWindowPixelBuffer - ldrb r0, [r4] - bl ClearWindowTilemap - ldrb r0, [r4] - movs r1, 0x3 - bl CopyWindowToVram - ldrb r0, [r4] - bl RemoveWindow - movs r0, 0xFF - strb r0, [r4] -_0819833C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8198314 - - thumb_func_start sub_8198348 -sub_8198348: @ 8198348 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r4, [sp, 0x18] - mov r8, r4 - ldr r4, [sp, 0x1C] - ldr r5, [sp, 0x20] - ldr r6, [sp, 0x24] - mov r12, r6 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r7, r5, 24 - ldr r5, =gUnknown_0203CD90 - movs r6, 0 - strb r2, [r5] - strb r3, [r5, 0x1] - strb r6, [r5, 0x3] - subs r4, 0x1 - strb r4, [r5, 0x4] - strb r0, [r5, 0x5] - strb r1, [r5, 0x6] - mov r0, r8 - strb r0, [r5, 0x8] - mov r4, r12 - strb r4, [r5, 0xB] - cmp r7, 0 - blt _08198388 - movs r0, 0x4 - ldrsb r0, [r5, r0] - cmp r7, r0 - ble _08198390 -_08198388: - strb r6, [r5, 0x2] - b _08198392 - .pool -_08198390: - strb r7, [r5, 0x2] -_08198392: - movs r0, 0 - bl MoveMenuCursor - ldr r0, =gUnknown_0203CD90 - ldrb r0, [r0, 0x2] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8198348 - - thumb_func_start sub_81983AC -sub_81983AC: @ 81983AC - push {r4-r6,lr} - sub sp, 0x10 - ldr r4, [sp, 0x20] - ldr r5, [sp, 0x24] - ldr r6, [sp, 0x28] - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - str r4, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - movs r4, 0 - str r4, [sp, 0xC] - bl sub_8198348 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x10 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81983AC - - thumb_func_start sub_81983EC -sub_81983EC: @ 81983EC - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x14 - mov r8, r0 - adds r6, r1, 0 - ldr r4, [sp, 0x28] - ldr r5, [sp, 0x2C] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r6, 24 - lsrs r6, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - adds r0, r6, 0 - movs r1, 0x1 - str r2, [sp, 0xC] - str r3, [sp, 0x10] - bl GetMenuCursorDimensionByFont - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - mov r0, r8 - adds r1, r6, 0 - ldr r2, [sp, 0xC] - ldr r3, [sp, 0x10] - bl sub_81983AC - lsls r0, 24 - lsrs r0, 24 - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81983EC - - thumb_func_start RedrawMenuCursor -@ void RedrawMenuCursor(s8 oldPos, s8 newPos) -RedrawMenuCursor: @ 8198448 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0xC - adds r6, r0, 0 - mov r8, r1 - lsls r6, 24 - lsrs r6, 24 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r5, =gUnknown_0203CD90 - ldrb r0, [r5, 0x6] - movs r1, 0 - bl GetMenuCursorDimensionByFont - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldrb r0, [r5, 0x6] - movs r1, 0x1 - bl GetMenuCursorDimensionByFont - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r5, 0x5] - mov r9, r1 - ldrb r2, [r5] - ldrb r1, [r5, 0x8] - adds r3, r1, 0 - muls r3, r6 - ldrb r6, [r5, 0x1] - adds r3, r6 - lsls r3, 16 - lsrs r3, 16 - str r4, [sp] - str r0, [sp, 0x4] - mov r0, r9 - movs r1, 0x11 - bl FillWindowPixelRect - ldrb r0, [r5, 0x5] - ldrb r1, [r5, 0x6] - ldr r2, =gUnknown_085EE498 - ldrb r3, [r5] - ldrb r4, [r5, 0x8] - mov r6, r8 - muls r6, r4 - adds r4, r6, 0 - ldrb r5, [r5, 0x1] - adds r4, r5 - lsls r4, 24 - lsrs r4, 24 - str r4, [sp] - movs r4, 0 - str r4, [sp, 0x4] - str r4, [sp, 0x8] - bl PrintTextOnWindow - add sp, 0xC - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end RedrawMenuCursor - - thumb_func_start MoveMenuCursor -@ s8 MoveMenuCursor(s8 cursorDelta) -MoveMenuCursor: @ 81984D8 - push {r4,r5,lr} - ldr r1, =gUnknown_0203CD90 - ldrb r5, [r1, 0x2] - movs r2, 0x2 - ldrsb r2, [r1, r2] - lsls r0, 24 - asrs r3, r0, 24 - adds r2, r3 - movs r0, 0x3 - ldrsb r0, [r1, r0] - adds r4, r1, 0 - cmp r2, r0 - bge _081984FC - ldrb r0, [r4, 0x4] - b _0819850A - .pool -_081984FC: - movs r0, 0x4 - ldrsb r0, [r4, r0] - cmp r2, r0 - ble _08198508 - ldrb r0, [r4, 0x3] - b _0819850A -_08198508: - adds r0, r3, r5 -_0819850A: - strb r0, [r4, 0x2] - ldrb r1, [r4, 0x2] - adds r0, r5, 0 - bl RedrawMenuCursor - ldrb r0, [r4, 0x2] - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end MoveMenuCursor - - thumb_func_start MoveMenuCursorNoWrapAround -@ s8 MoveMenuCursorNoWrapAround(s8 cursorDelta) -MoveMenuCursorNoWrapAround: @ 819851C - push {r4,r5,lr} - ldr r1, =gUnknown_0203CD90 - ldrb r5, [r1, 0x2] - movs r2, 0x2 - ldrsb r2, [r1, r2] - lsls r0, 24 - asrs r3, r0, 24 - adds r2, r3 - movs r0, 0x3 - ldrsb r0, [r1, r0] - adds r4, r1, 0 - cmp r2, r0 - bge _08198540 - ldrb r0, [r4, 0x3] - b _0819854E - .pool -_08198540: - movs r0, 0x4 - ldrsb r0, [r4, r0] - cmp r2, r0 - ble _0819854C - ldrb r0, [r4, 0x4] - b _0819854E -_0819854C: - adds r0, r3, r5 -_0819854E: - strb r0, [r4, 0x2] - ldrb r1, [r4, 0x2] - adds r0, r5, 0 - bl RedrawMenuCursor - ldrb r0, [r4, 0x2] - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end MoveMenuCursorNoWrapAround - - thumb_func_start GetMenuCursorPos -GetMenuCursorPos: @ 8198560 - ldr r0, =gUnknown_0203CD90 - ldrb r0, [r0, 0x2] - bx lr - .pool - thumb_func_end GetMenuCursorPos - - thumb_func_start ProcessMenuInput -ProcessMenuInput: @ 819856C - push {r4,lr} - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08198598 - ldr r4, =gUnknown_0203CD90 - ldrb r0, [r4, 0xB] - cmp r0, 0 - bne _08198588 - movs r0, 0x5 - bl PlaySE -_08198588: - movs r0, 0x2 - ldrsb r0, [r4, r0] - b _081985D2 - .pool -_08198598: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081985A6 - movs r0, 0x1 - negs r0, r0 - b _081985D2 -_081985A6: - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081985BA - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - negs r0, r0 - b _081985CA -_081985BA: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081985CE - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 -_081985CA: - bl MoveMenuCursor -_081985CE: - movs r0, 0x2 - negs r0, r0 -_081985D2: - pop {r4} - pop {r1} - bx r1 - thumb_func_end ProcessMenuInput - - thumb_func_start ProcessMenuInputNoWrapAround -@ int ProcessMenuInputNoWrapAround() -ProcessMenuInputNoWrapAround: @ 81985D8 - push {r4-r6,lr} - ldr r4, =gUnknown_0203CD90 - ldrb r5, [r4, 0x2] - adds r6, r5, 0 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08198608 - ldrb r0, [r4, 0xB] - cmp r0, 0 - bne _081985F8 - movs r0, 0x5 - bl PlaySE -_081985F8: - movs r0, 0x2 - ldrsb r0, [r4, r0] - b _08198650 - .pool -_08198608: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08198616 - movs r0, 0x1 - negs r0, r0 - b _08198650 -_08198616: - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08198630 - movs r0, 0x1 - negs r0, r0 - bl MoveMenuCursorNoWrapAround - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - beq _0819864C - b _08198646 -_08198630: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0819864C - movs r0, 0x1 - bl MoveMenuCursorNoWrapAround - lsls r0, 24 - lsrs r0, 24 - cmp r6, r0 - beq _0819864C -_08198646: - movs r0, 0x5 - bl PlaySE -_0819864C: - movs r0, 0x2 - negs r0, r0 -_08198650: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end ProcessMenuInputNoWrapAround - - thumb_func_start ProcessMenuInput_other -ProcessMenuInput_other: @ 8198658 - push {r4,lr} - ldr r2, =gMain - ldrh r1, [r2, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08198684 - ldr r4, =gUnknown_0203CD90 - ldrb r0, [r4, 0xB] - cmp r0, 0 - bne _08198674 - movs r0, 0x5 - bl PlaySE -_08198674: - movs r0, 0x2 - ldrsb r0, [r4, r0] - b _081986BC - .pool -_08198684: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08198692 - movs r0, 0x1 - negs r0, r0 - b _081986BC -_08198692: - ldrh r0, [r2, 0x30] - movs r1, 0xF0 - ands r1, r0 - cmp r1, 0x40 - bne _081986A8 - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - negs r0, r0 - b _081986B4 -_081986A8: - cmp r1, 0x80 - bne _081986B8 - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 -_081986B4: - bl MoveMenuCursor -_081986B8: - movs r0, 0x2 - negs r0, r0 -_081986BC: - pop {r4} - pop {r1} - bx r1 - thumb_func_end ProcessMenuInput_other - - thumb_func_start ProcessMenuInputNoWrapAround_other -ProcessMenuInputNoWrapAround_other: @ 81986C4 - push {r4-r6,lr} - ldr r4, =gUnknown_0203CD90 - ldrb r5, [r4, 0x2] - adds r6, r5, 0 - ldr r2, =gMain - ldrh r1, [r2, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081986F4 - ldrb r0, [r4, 0xB] - cmp r0, 0 - bne _081986E4 - movs r0, 0x5 - bl PlaySE -_081986E4: - movs r0, 0x2 - ldrsb r0, [r4, r0] - b _0819873A - .pool -_081986F4: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08198702 - movs r0, 0x1 - negs r0, r0 - b _0819873A -_08198702: - ldrh r0, [r2, 0x30] - movs r1, 0xF0 - ands r1, r0 - cmp r1, 0x40 - bne _0819871E - movs r0, 0x1 - negs r0, r0 - bl MoveMenuCursorNoWrapAround - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - beq _08198736 - b _08198730 -_0819871E: - cmp r1, 0x80 - bne _08198736 - movs r0, 0x1 - bl MoveMenuCursorNoWrapAround - lsls r0, 24 - lsrs r0, 24 - cmp r6, r0 - beq _08198736 -_08198730: - movs r0, 0x5 - bl PlaySE -_08198736: - movs r0, 0x2 - negs r0, r0 -_0819873A: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end ProcessMenuInputNoWrapAround_other - - thumb_func_start PrintTextArray -PrintTextArray: @ 8198740 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - ldr r4, [sp, 0x2C] - ldr r5, [sp, 0x30] - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - lsls r3, 24 - lsrs r3, 24 - mov r8, r3 - lsls r4, 24 - lsrs r7, r4, 24 - lsls r5, 24 - lsrs r5, 24 - movs r4, 0 - cmp r4, r5 - bcs _081987A4 -_08198774: - lsls r0, r4, 3 - ldr r1, [sp, 0x34] - adds r0, r1 - ldr r2, [r0] - adds r0, r7, 0 - muls r0, r4 - add r0, r8 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - adds r0, r6, 0 - mov r1, r10 - mov r3, r9 - bl PrintTextOnWindow - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _08198774 -_081987A4: - adds r0, r6, 0 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end PrintTextArray - - thumb_func_start sub_81987BC -sub_81987BC: @ 81987BC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - ldr r4, [sp, 0x40] - ldr r5, [sp, 0x44] - ldr r6, [sp, 0x4C] - ldr r7, [sp, 0x50] - mov r8, r7 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x14] - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x18] - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x1C] - lsls r4, 24 - lsrs r4, 24 - mov r10, r4 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - mov r9, r6 - mov r0, r8 - lsls r0, 24 - lsrs r6, r0, 24 - movs r4, 0 - cmp r4, r5 - bcs _0819883C -_08198804: - lsls r0, r4, 3 - ldr r1, [sp, 0x48] - adds r0, r1 - ldr r2, [r0] - mov r0, r10 - muls r0, r4 - ldr r1, [sp, 0x1C] - adds r0, r1, r0 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - mov r0, r9 - str r0, [sp, 0xC] - str r6, [sp, 0x10] - adds r0, r7, 0 - ldr r1, [sp, 0x14] - ldr r3, [sp, 0x18] - bl sub_8199F74 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _08198804 -_0819883C: - adds r0, r7, 0 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81987BC - - thumb_func_start sub_8198854 -sub_8198854: @ 8198854 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - mov r8, r0 - adds r6, r1, 0 - adds r4, r2, 0 - adds r5, r3, 0 - ldr r7, [sp, 0x24] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r6, 24 - lsrs r6, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - adds r0, r6, 0 - movs r1, 0 - bl GetFontAttribute - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - str r4, [sp] - str r5, [sp, 0x4] - str r7, [sp, 0x8] - mov r0, r8 - adds r1, r6, 0 - movs r3, 0x1 - bl PrintTextArray - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8198854 - - thumb_func_start AddItemMenuActionTextPrinters -AddItemMenuActionTextPrinters: @ 81988A4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - adds r6, r1, 0 - mov r8, r2 - ldr r1, [sp, 0x38] - mov r9, r1 - ldr r1, [sp, 0x3C] - ldr r2, [sp, 0x40] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x10] - lsls r6, 24 - lsrs r6, 24 - mov r4, r8 - lsls r4, 24 - lsrs r4, 24 - mov r8, r4 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x14] - mov r0, r9 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - lsls r2, 24 - lsrs r7, r2, 24 - mov r0, sp - ldrb r1, [r0, 0x10] - strb r1, [r0, 0x4] - strb r6, [r0, 0x5] - adds r0, r6, 0 - movs r1, 0x5 - bl GetFontAttribute - mov r3, sp - lsls r0, 4 - ldrb r2, [r3, 0xC] - movs r5, 0xF - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xC] - adds r0, r6, 0 - movs r1, 0x6 - bl GetFontAttribute - mov r3, sp - adds r1, r5, 0 - ands r1, r0 - ldrb r2, [r3, 0xD] - movs r4, 0x10 - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0xD] - adds r0, r6, 0 - movs r1, 0x7 - bl GetFontAttribute - mov r3, sp - lsls r0, 4 - ldrb r2, [r3, 0xD] - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xD] - adds r0, r6, 0 - movs r1, 0x4 - bl GetFontAttribute - mov r1, sp - ands r5, r0 - ldrb r0, [r1, 0xC] - ands r4, r0 - orrs r4, r5 - strb r4, [r1, 0xC] - mov r0, sp - mov r2, r9 - strb r2, [r0, 0xA] - adds r0, r6, 0 - movs r1, 0x3 - bl GetFontAttribute - mov r1, sp - strb r0, [r1, 0xB] - mov r0, sp - mov r4, r8 - strb r4, [r0, 0x6] - strb r4, [r0, 0x8] - movs r4, 0 - cmp r4, r7 - bcs _0819899E - mov r5, sp -_0819896E: - ldr r1, [sp, 0x48] - adds r0, r1, r4 - ldrb r0, [r0] - lsls r0, 3 - ldr r2, [sp, 0x44] - adds r0, r2 - ldr r0, [r0] - str r0, [sp] - mov r0, r10 - muls r0, r4 - ldr r1, [sp, 0x14] - adds r0, r1, r0 - strb r0, [r5, 0x7] - strb r0, [r5, 0x9] - mov r0, sp - movs r1, 0xFF - movs r2, 0 - bl AddTextPrinter - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r7 - bcc _0819896E -_0819899E: - ldr r0, [sp, 0x10] - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end AddItemMenuActionTextPrinters - - thumb_func_start sub_81989B8 -sub_81989B8: @ 81989B8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x14 - mov r9, r0 - adds r4, r1, 0 - adds r6, r2, 0 - mov r8, r3 - ldr r7, [sp, 0x30] - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r4, 24 - lsrs r4, 24 - lsls r6, 24 - lsrs r6, 24 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - adds r0, r4, 0 - movs r1, 0 - bl GetFontAttribute - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - adds r0, r4, 0 - movs r1, 0x2 - bl GetFontAttribute - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - str r6, [sp, 0x4] - mov r0, r8 - str r0, [sp, 0x8] - str r7, [sp, 0xC] - ldr r0, [sp, 0x34] - str r0, [sp, 0x10] - mov r0, r9 - adds r1, r4, 0 - adds r2, r5, 0 - movs r3, 0x1 - bl AddItemMenuActionTextPrinters - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81989B8 - - thumb_func_start SetWindowTemplateFields -@ void SetWindowTemplateFields(WindowTemplate *template, char bg_id, char x, char y, char w, char h, char a7, s16 a8) -SetWindowTemplateFields: @ 8198A24 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r4, [sp, 0x18] - ldr r5, [sp, 0x1C] - ldr r6, [sp, 0x20] - ldr r7, [sp, 0x24] - mov r8, r7 - strb r1, [r0] - strb r2, [r0, 0x1] - strb r3, [r0, 0x2] - strb r4, [r0, 0x3] - strb r5, [r0, 0x4] - strb r6, [r0, 0x5] - mov r1, r8 - strh r1, [r0, 0x6] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end SetWindowTemplateFields - - thumb_func_start sub_8198A50 -sub_8198A50: @ 8198A50 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x18 - mov r8, r0 - ldr r0, [sp, 0x2C] - ldr r4, [sp, 0x30] - ldr r5, [sp, 0x34] - ldr r6, [sp, 0x38] - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 16 - lsrs r6, 16 - str r0, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - str r6, [sp, 0xC] - add r0, sp, 0x10 - bl SetWindowTemplateFields - ldr r0, [sp, 0x10] - ldr r1, [sp, 0x14] - mov r2, r8 - str r0, [r2] - str r1, [r2, 0x4] - mov r0, r8 - add sp, 0x18 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r2} - bx r2 - thumb_func_end sub_8198A50 - - thumb_func_start sub_8198AA4 -sub_8198AA4: @ 8198AA4 - push {r4-r6,lr} - sub sp, 0x18 - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - ldr r0, [sp, 0x28] - ldr r1, [sp, 0x2C] - ldr r2, [sp, 0x30] - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 16 - lsrs r2, 16 - str r3, [sp] - str r0, [sp, 0x4] - str r1, [sp, 0x8] - str r2, [sp, 0xC] - add r0, sp, 0x10 - adds r1, r4, 0 - adds r2, r5, 0 - adds r3, r6, 0 - bl SetWindowTemplateFields - add r0, sp, 0x10 - bl AddWindow - lsls r0, 16 - lsrs r0, 16 - add sp, 0x18 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8198AA4 - - thumb_func_start sub_8198AF8 -sub_8198AF8: @ 8198AF8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - adds r6, r1, 0 - mov r8, r2 - mov r9, r3 - ldr r4, [sp, 0x3C] - ldr r5, [sp, 0x40] - ldr r1, [sp, 0x44] - mov r10, r1 - lsls r6, 24 - lsrs r6, 24 - mov r1, r8 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - mov r1, r9 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 24 - lsrs r5, 24 - mov r1, r10 - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - ldr r7, =gUnknown_0203CD9F - bl AddWindow - strb r0, [r7] - ldrb r0, [r7] - movs r1, 0x1 - adds r2, r4, 0 - adds r3, r5, 0 - bl SetWindowBorderStyle - ldr r0, =gUnknown_085EE491 - str r0, [sp, 0xC] - add r1, sp, 0xC - ldrb r0, [r7] - strb r0, [r1, 0x4] - adds r0, r1, 0 - strb r6, [r0, 0x5] - adds r0, r6, 0 - movs r1, 0 - bl GetFontAttribute - add r1, sp, 0xC - add r0, r8 - strb r0, [r1, 0x6] - adds r0, r1, 0 - mov r1, r9 - strb r1, [r0, 0x7] - adds r1, r0, 0 - ldrb r0, [r0, 0x6] - strb r0, [r1, 0x8] - adds r0, r1, 0 - ldrb r0, [r0, 0x7] - strb r0, [r1, 0x9] - adds r0, r6, 0 - movs r1, 0x5 - bl GetFontAttribute - add r3, sp, 0xC - lsls r0, 4 - ldrb r2, [r3, 0xC] - movs r5, 0xF - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xC] - adds r0, r6, 0 - movs r1, 0x6 - bl GetFontAttribute - add r3, sp, 0xC - adds r1, r5, 0 - ands r1, r0 - ldrb r2, [r3, 0xD] - movs r4, 0x10 - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0xD] - adds r0, r6, 0 - movs r1, 0x7 - bl GetFontAttribute - add r3, sp, 0xC - lsls r0, 4 - ldrb r2, [r3, 0xD] - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xD] - adds r0, r6, 0 - movs r1, 0x4 - bl GetFontAttribute - add r1, sp, 0xC - ands r5, r0 - ldrb r0, [r1, 0xC] - ands r4, r0 - orrs r4, r5 - strb r4, [r1, 0xC] - adds r0, r6, 0 - movs r1, 0x2 - bl GetFontAttribute - add r1, sp, 0xC - strb r0, [r1, 0xA] - adds r0, r6, 0 - movs r1, 0x3 - bl GetFontAttribute - add r1, sp, 0xC - strb r0, [r1, 0xB] - adds r0, r1, 0 - movs r1, 0xFF - movs r2, 0 - bl AddTextPrinter - adds r0, r6, 0 - movs r1, 0x1 - bl GetFontAttribute - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r7] - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - mov r0, r10 - str r0, [sp, 0x8] - adds r0, r1, 0 - adds r1, r6, 0 - mov r2, r8 - mov r3, r9 - bl sub_81983AC - 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_8198AF8 - - thumb_func_start sub_8198C34 -sub_8198C34: @ 8198C34 - push {lr} - sub sp, 0xC - lsls r1, 24 - lsrs r1, 24 - lsls r2, 16 - lsrs r2, 16 - lsls r3, 24 - lsrs r3, 24 - str r2, [sp] - str r3, [sp, 0x4] - movs r2, 0 - str r2, [sp, 0x8] - movs r3, 0x1 - bl sub_8198AF8 - add sp, 0xC - pop {r0} - bx r0 - thumb_func_end sub_8198C34 - - thumb_func_start sub_8198C58 -sub_8198C58: @ 8198C58 - push {r4,lr} - bl ProcessMenuInputNoWrapAround - lsls r0, 24 - asrs r4, r0, 24 - movs r0, 0x2 - negs r0, r0 - cmp r4, r0 - beq _08198C6E - bl sub_8198C78 -_08198C6E: - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8198C58 - - thumb_func_start sub_8198C78 -sub_8198C78: @ 8198C78 - push {r4,lr} - ldr r4, =gUnknown_0203CD9F - ldrb r0, [r4] - movs r1, 0x1 - bl sub_8198070 - ldrb r0, [r4] - bl RemoveWindow - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8198C78 - - thumb_func_start sub_8198C94 -sub_8198C94: @ 8198C94 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - ldr r4, [sp, 0x40] - ldr r5, [sp, 0x44] - ldr r6, [sp, 0x48] - ldr r7, [sp, 0x4C] - mov r8, r7 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0xC] - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x10] - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x14] - lsls r4, 24 - lsrs r4, 24 - str r4, [sp, 0x18] - lsls r5, 24 - lsrs r5, 24 - str r5, [sp, 0x1C] - lsls r6, 24 - lsrs r6, 24 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - movs r5, 0 - cmp r5, r9 - bcs _08198D3A -_08198CE0: - movs r4, 0 - adds r1, r5, 0x1 - mov r8, r1 - cmp r4, r6 - bcs _08198D30 - ldr r7, [sp, 0x1C] - adds r0, r7, 0 - muls r0, r5 - ldr r1, [sp, 0x14] - adds r0, r1, r0 - lsls r0, 24 - lsrs r7, r0, 24 -_08198CF8: - adds r0, r5, 0 - muls r0, r6 - adds r0, r4 - lsls r0, 3 - ldr r1, [sp, 0x50] - adds r0, r1 - ldr r2, [r0] - ldr r0, [sp, 0x18] - adds r3, r0, 0 - muls r3, r4 - ldr r1, [sp, 0x10] - adds r3, r1, r3 - lsls r3, 24 - lsrs r3, 24 - str r7, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - mov r0, r10 - ldr r1, [sp, 0xC] - bl PrintTextOnWindow - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r6 - bcc _08198CF8 -_08198D30: - mov r7, r8 - lsls r0, r7, 24 - lsrs r5, r0, 24 - cmp r5, r9 - bcc _08198CE0 -_08198D3A: - mov r0, r10 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8198C94 - - thumb_func_start sub_8198D54 -sub_8198D54: @ 8198D54 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x18 - mov r9, r0 - mov r8, r1 - adds r4, r2, 0 - adds r5, r3, 0 - ldr r6, [sp, 0x34] - ldr r3, [sp, 0x38] - ldr r7, [sp, 0x3C] - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - mov r0, r8 - 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 - lsls r3, 24 - lsrs r3, 24 - movs r1, 0 - str r3, [sp, 0x14] - bl GetFontAttribute - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - str r4, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - ldr r3, [sp, 0x14] - str r3, [sp, 0xC] - str r7, [sp, 0x10] - mov r0, r9 - mov r1, r8 - movs r3, 0 - bl sub_8198C94 - add sp, 0x18 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8198D54 - - thumb_func_start sub_8198DBC -sub_8198DBC: @ 8198DBC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - ldr r4, [sp, 0x40] - ldr r5, [sp, 0x44] - ldr r6, [sp, 0x48] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x10] - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x14] - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x18] - lsls r4, 24 - lsrs r4, 24 - str r4, [sp, 0x1C] - lsls r5, 24 - lsrs r5, 24 - mov r8, r5 - lsls r6, 24 - lsrs r6, 24 - mov r10, r6 - mov r0, sp - ldrb r1, [r0, 0x10] - strb r1, [r0, 0x4] - strb r7, [r0, 0x5] - adds r0, r7, 0 - movs r1, 0x5 - bl GetFontAttribute - mov r3, sp - lsls r0, 4 - ldrb r2, [r3, 0xC] - movs r5, 0xF - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xC] - adds r0, r7, 0 - movs r1, 0x6 - bl GetFontAttribute - mov r3, sp - adds r1, r5, 0 - ands r1, r0 - ldrb r2, [r3, 0xD] - movs r4, 0x10 - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0xD] - adds r0, r7, 0 - movs r1, 0x7 - bl GetFontAttribute - mov r3, sp - lsls r0, 4 - ldrb r2, [r3, 0xD] - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xD] - adds r0, r7, 0 - movs r1, 0x4 - bl GetFontAttribute - mov r1, sp - ands r5, r0 - ldrb r0, [r1, 0xC] - ands r4, r0 - orrs r4, r5 - strb r4, [r1, 0xC] - adds r0, r7, 0 - movs r1, 0x2 - bl GetFontAttribute - mov r1, sp - strb r0, [r1, 0xA] - adds r0, r7, 0 - movs r1, 0x3 - bl GetFontAttribute - mov r1, sp - strb r0, [r1, 0xB] - movs r6, 0 - cmp r6, r10 - bcs _08198EDE -_08198E7A: - movs r5, 0 - adds r2, r6, 0x1 - mov r9, r2 - cmp r5, r8 - bcs _08198ED4 - mov r4, sp -_08198E86: - mov r0, r8 - muls r0, r6 - adds r0, r5 - ldr r1, [sp, 0x50] - adds r0, r1, r0 - ldrb r0, [r0] - lsls r0, 3 - ldr r2, [sp, 0x4C] - adds r0, r2 - ldr r0, [r0] - str r0, [sp] - ldr r1, [sp, 0x1C] - adds r0, r1, 0 - muls r0, r5 - ldr r2, [sp, 0x14] - adds r0, r2, r0 - strb r0, [r4, 0x6] - adds r0, r7, 0 - movs r1, 0x1 - bl GetFontAttribute - adds r1, r6, 0 - muls r1, r0 - ldr r0, [sp, 0x18] - adds r1, r0, r1 - strb r1, [r4, 0x7] - ldrb r0, [r4, 0x6] - strb r0, [r4, 0x8] - strb r1, [r4, 0x9] - mov r0, sp - movs r1, 0xFF - movs r2, 0 - bl AddTextPrinter - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, r8 - bcc _08198E86 -_08198ED4: - mov r1, r9 - lsls r0, r1, 24 - lsrs r6, r0, 24 - cmp r6, r10 - bcc _08198E7A -_08198EDE: - ldr r0, [sp, 0x10] - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8198DBC - - thumb_func_start sub_8198EF8 -sub_8198EF8: @ 8198EF8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x18 - mov r8, r0 - adds r3, r1, 0 - adds r4, r2, 0 - ldr r5, [sp, 0x30] - ldr r6, [sp, 0x34] - ldr r7, [sp, 0x38] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - adds r0, r3, 0 - movs r1, 0 - str r3, [sp, 0x14] - bl GetFontAttribute - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - str r4, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - str r7, [sp, 0xC] - ldr r0, [sp, 0x3C] - str r0, [sp, 0x10] - mov r0, r8 - ldr r3, [sp, 0x14] - adds r1, r3, 0 - movs r3, 0 - bl sub_8198DBC - add sp, 0x18 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8198EF8 - - thumb_func_start sub_8198F58 -sub_8198F58: @ 8198F58 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r4, [sp, 0x20] - mov r12, r4 - ldr r4, [sp, 0x24] - mov r8, r4 - ldr r4, [sp, 0x28] - mov r9, r4 - ldr r4, [sp, 0x2C] - mov r10, r4 - ldr r4, [sp, 0x30] - ldr r5, [sp, 0x34] - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r7, r5, 24 - ldr r5, =gUnknown_0203CD90 - movs r6, 0 - strb r2, [r5] - strb r3, [r5, 0x1] - strb r6, [r5, 0x3] - subs r4, 0x1 - strb r4, [r5, 0x4] - strb r0, [r5, 0x5] - strb r1, [r5, 0x6] - mov r0, r12 - strb r0, [r5, 0x7] - mov r4, r8 - strb r4, [r5, 0x8] - mov r0, r9 - strb r0, [r5, 0x9] - mov r4, r10 - strb r4, [r5, 0xA] - cmp r7, 0 - blt _08198FAC - movs r0, 0x4 - ldrsb r0, [r5, r0] - cmp r7, r0 - ble _08198FB4 -_08198FAC: - strb r6, [r5, 0x2] - b _08198FB6 - .pool -_08198FB4: - strb r7, [r5, 0x2] -_08198FB6: - movs r0, 0 - movs r1, 0 - bl sub_8199134 - ldr r0, =gUnknown_0203CD90 - ldrb r0, [r0, 0x2] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8198F58 - - thumb_func_start sub_8198FD4 -sub_8198FD4: @ 8198FD4 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - sub sp, 0x20 - mov r9, r0 - mov r8, r1 - mov r10, r2 - ldr r6, [sp, 0x3C] - ldr r4, [sp, 0x40] - ldr r5, [sp, 0x44] - ldr r2, [sp, 0x48] - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - mov r0, r10 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - lsls r3, 24 - lsrs r3, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r2, 24 - lsrs r2, 24 - mov r0, r8 - movs r1, 0x1 - str r2, [sp, 0x18] - str r3, [sp, 0x1C] - bl GetMenuCursorDimensionByFont - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - muls r1, r5 - lsls r1, 24 - lsrs r1, 24 - str r6, [sp] - str r0, [sp, 0x4] - str r4, [sp, 0x8] - str r5, [sp, 0xC] - str r1, [sp, 0x10] - ldr r2, [sp, 0x18] - str r2, [sp, 0x14] - mov r0, r9 - mov r1, r8 - mov r2, r10 - ldr r3, [sp, 0x1C] - bl sub_8198F58 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8198FD4 - - thumb_func_start sub_8199060 -sub_8199060: @ 8199060 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - mov r8, r0 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r0, r1, 24 - lsrs r7, r0, 24 - ldr r5, =gUnknown_0203CD90 - ldrb r0, [r5, 0x6] - movs r1, 0 - bl GetMenuCursorDimensionByFont - mov r9, r0 - mov r1, r9 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - ldrb r0, [r5, 0x6] - movs r1, 0x1 - bl GetMenuCursorDimensionByFont - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - ldrb r0, [r5, 0x9] - mov r10, r0 - mov r0, r8 - mov r1, r10 - bl __umodsi3 - ldrb r1, [r5, 0x7] - adds r4, r1, 0 - muls r4, r0 - ldrb r1, [r5] - adds r4, r1 - lsls r4, 24 - lsrs r4, 24 - mov r0, r8 - mov r1, r10 - bl __udivsi3 - ldrb r1, [r5, 0x8] - adds r3, r1, 0 - muls r3, r0 - ldrb r0, [r5, 0x1] - adds r3, r0 - lsls r3, 24 - lsrs r3, 24 - ldrb r0, [r5, 0x5] - mov r1, r9 - str r1, [sp] - str r6, [sp, 0x4] - movs r1, 0x11 - adds r2, r4, 0 - bl FillWindowPixelRect - ldrb r6, [r5, 0x9] - adds r0, r7, 0 - adds r1, r6, 0 - bl __umodsi3 - ldrb r1, [r5, 0x7] - adds r4, r1, 0 - muls r4, r0 - ldrb r0, [r5] - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r7, 0 - adds r1, r6, 0 - bl __udivsi3 - ldrb r1, [r5, 0x8] - adds r3, r1, 0 - muls r3, r0 - ldrb r1, [r5, 0x1] - adds r3, r1 - lsls r3, 24 - lsrs r3, 24 - ldrb r0, [r5, 0x5] - ldrb r1, [r5, 0x6] - ldr r2, =gUnknown_085EE498 - str r3, [sp] - movs r3, 0 - str r3, [sp, 0x4] - str r3, [sp, 0x8] - adds r3, r4, 0 - bl PrintTextOnWindow - 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_8199060 - - thumb_func_start sub_8199134 -sub_8199134: @ 8199134 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - ldr r1, =gUnknown_0203CD90 - ldrb r2, [r1, 0x2] - mov r8, r2 - lsls r0, 24 - asrs r6, r0, 24 - adds r5, r1, 0 - cmp r6, 0 - beq _0819918A - movs r7, 0x2 - ldrsb r7, [r5, r7] - ldrb r4, [r5, 0x9] - adds r0, r7, 0 - adds r1, r4, 0 - bl __modsi3 - adds r0, r6 - cmp r0, 0 - bge _08199174 - adds r0, r4, 0 - adds r0, 0xFF - add r0, r8 - b _08199188 - .pool -_08199174: - cmp r0, r4 - blt _08199184 - adds r0, r7, 0 - adds r1, r4, 0 - bl __divsi3 - muls r0, r4 - b _08199188 -_08199184: - mov r1, r8 - adds r0, r6, r1 -_08199188: - strb r0, [r5, 0x2] -_0819918A: - mov r2, r9 - lsls r0, r2, 24 - asrs r6, r0, 24 - cmp r6, 0 - beq _081991CE - movs r0, 0x2 - ldrsb r0, [r5, r0] - ldrb r4, [r5, 0x9] - adds r1, r4, 0 - bl __divsi3 - adds r1, r0, r6 - cmp r1, 0 - bge _081991B2 - ldrb r0, [r5, 0xA] - subs r0, 0x1 - muls r0, r4 - ldrb r1, [r5, 0x2] - adds r0, r1 - b _081991CC -_081991B2: - ldrb r0, [r5, 0xA] - cmp r1, r0 - blt _081991C4 - subs r0, 0x1 - adds r1, r4, 0 - muls r1, r0 - ldrb r0, [r5, 0x2] - subs r0, r1 - b _081991CC -_081991C4: - adds r0, r4, 0 - muls r0, r6 - ldrb r2, [r5, 0x2] - adds r0, r2 -_081991CC: - strb r0, [r5, 0x2] -_081991CE: - movs r1, 0x2 - ldrsb r1, [r5, r1] - movs r0, 0x4 - ldrsb r0, [r5, r0] - cmp r1, r0 - bgt _081991E4 - ldrb r1, [r5, 0x2] - mov r0, r8 - bl sub_8199060 - b _081991E8 -_081991E4: - mov r0, r8 - strb r0, [r5, 0x2] -_081991E8: - ldrb r0, [r5, 0x2] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8199134 - - thumb_func_start sub_81991F8 -sub_81991F8: @ 81991F8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - ldr r1, =gUnknown_0203CD90 - ldrb r7, [r1, 0x2] - lsls r0, 24 - asrs r4, r0, 24 - adds r5, r1, 0 - cmp r4, 0 - beq _0819922C - movs r0, 0x2 - ldrsb r0, [r5, r0] - ldrb r6, [r5, 0x9] - adds r1, r6, 0 - bl __modsi3 - adds r0, r4 - cmp r0, 0 - blt _0819922C - cmp r0, r6 - bge _0819922C - adds r0, r4, r7 - strb r0, [r5, 0x2] -_0819922C: - mov r1, r8 - lsls r0, r1, 24 - asrs r4, r0, 24 - cmp r4, 0 - beq _08199258 - movs r0, 0x2 - ldrsb r0, [r5, r0] - ldrb r6, [r5, 0x9] - adds r1, r6, 0 - bl __divsi3 - adds r0, r4 - cmp r0, 0 - blt _08199258 - ldrb r1, [r5, 0xA] - cmp r0, r1 - bge _08199258 - adds r0, r6, 0 - muls r0, r4 - ldrb r1, [r5, 0x2] - adds r0, r1 - strb r0, [r5, 0x2] -_08199258: - movs r1, 0x2 - ldrsb r1, [r5, r1] - movs r0, 0x4 - ldrsb r0, [r5, r0] - cmp r1, r0 - bgt _08199274 - ldrb r1, [r5, 0x2] - adds r0, r7, 0 - bl sub_8199060 - b _08199276 - .pool -_08199274: - strb r7, [r5, 0x2] -_08199276: - ldrb r0, [r5, 0x2] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81991F8 - - thumb_func_start sub_8199284 -sub_8199284: @ 8199284 - push {r4,lr} - ldr r4, =gMain - ldrh r1, [r4, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081992AC - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0203CD90 - ldrb r0, [r0, 0x2] - lsls r0, 24 - asrs r0, 24 - b _0819932C - .pool -_081992AC: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081992BA - movs r0, 0x1 - negs r0, r0 - b _0819932C -_081992BA: - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081992D0 - movs r0, 0x5 - bl PlaySE - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - b _08199324 -_081992D0: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081992E4 - movs r0, 0x5 - bl PlaySE - movs r0, 0 - movs r1, 0x1 - b _08199324 -_081992E4: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _081992F8 - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08199304 -_081992F8: - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - negs r0, r0 - b _08199322 -_08199304: - ldrh r1, [r4, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _0819931A - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08199328 -_0819931A: - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 -_08199322: - movs r1, 0 -_08199324: - bl sub_8199134 -_08199328: - movs r0, 0x2 - negs r0, r0 -_0819932C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8199284 - - thumb_func_start sub_8199334 -sub_8199334: @ 8199334 - push {r4-r6,lr} - ldr r5, =gUnknown_0203CD90 - ldrb r4, [r5, 0x2] - ldr r6, =gMain - ldrh r1, [r6, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0819935C - movs r0, 0x5 - bl PlaySE - movs r0, 0x2 - ldrsb r0, [r5, r0] - b _081993D2 - .pool -_0819935C: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0819936A - movs r0, 0x1 - negs r0, r0 - b _081993D2 -_0819936A: - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0819937A - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - b _081993BC -_0819937A: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08199388 - movs r0, 0 - movs r1, 0x1 - b _081993BC -_08199388: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _0819939C - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081993A2 -_0819939C: - movs r0, 0x1 - negs r0, r0 - b _081993BA -_081993A2: - ldrh r1, [r6, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _081993B8 - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _081993CE -_081993B8: - movs r0, 0x1 -_081993BA: - movs r1, 0 -_081993BC: - bl sub_81991F8 - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - beq _081993CE - movs r0, 0x5 - bl PlaySE -_081993CE: - movs r0, 0x2 - negs r0, r0 -_081993D2: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8199334 - - thumb_func_start sub_81993D8 -sub_81993D8: @ 81993D8 - push {r4,r5,lr} - ldr r4, =gMain - ldrh r1, [r4, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08199400 - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0203CD90 - ldrb r0, [r0, 0x2] - lsls r0, 24 - asrs r0, 24 - b _0819947C - .pool -_08199400: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0819940E - movs r0, 0x1 - negs r0, r0 - b _0819947C -_0819940E: - ldrh r0, [r4, 0x30] - movs r5, 0xF0 - adds r1, r5, 0 - ands r1, r0 - cmp r1, 0x40 - bne _08199428 - movs r0, 0x5 - bl PlaySE - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - b _08199474 -_08199428: - cmp r1, 0x80 - bne _08199438 - movs r0, 0x5 - bl PlaySE - movs r0, 0 - movs r1, 0x1 - b _08199474 -_08199438: - cmp r1, 0x20 - beq _08199448 - bl sub_812210C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08199454 -_08199448: - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - negs r0, r0 - b _08199472 -_08199454: - ldrh r1, [r4, 0x30] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0x10 - beq _0819946A - bl sub_812210C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08199478 -_0819946A: - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 -_08199472: - movs r1, 0 -_08199474: - bl sub_8199134 -_08199478: - movs r0, 0x2 - negs r0, r0 -_0819947C: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81993D8 - - thumb_func_start sub_8199484 -sub_8199484: @ 8199484 - push {r4-r6,lr} - ldr r6, =gUnknown_0203CD90 - ldrb r4, [r6, 0x2] - ldr r5, =gMain - ldrh r1, [r5, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081994AC - movs r0, 0x5 - bl PlaySE - movs r0, 0x2 - ldrsb r0, [r6, r0] - b _0819951E - .pool -_081994AC: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081994BA - movs r0, 0x1 - negs r0, r0 - b _0819951E -_081994BA: - ldrh r0, [r5, 0x30] - movs r6, 0xF0 - adds r1, r6, 0 - ands r1, r0 - cmp r1, 0x40 - bne _081994CE - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - b _08199508 -_081994CE: - cmp r1, 0x80 - bne _081994D8 - movs r0, 0 - movs r1, 0x1 - b _08199508 -_081994D8: - cmp r1, 0x20 - beq _081994E8 - bl sub_812210C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081994EE -_081994E8: - movs r0, 0x1 - negs r0, r0 - b _08199506 -_081994EE: - ldrh r1, [r5, 0x30] - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0x10 - beq _08199504 - bl sub_812210C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _0819951A -_08199504: - movs r0, 0x1 -_08199506: - movs r1, 0 -_08199508: - bl sub_81991F8 - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - beq _0819951A - movs r0, 0x5 - bl PlaySE -_0819951A: - movs r0, 0x2 - negs r0, r0 -_0819951E: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8199484 - - thumb_func_start InitMenuInUpperLeftCorner -@ int InitMenuInUpperLeftCorner(s8 windowId, s8 numItems, u8 initialCursorPos, bool doNotPlaySoundWhenAPressed) -InitMenuInUpperLeftCorner: @ 8199524 - push {r4-r6,lr} - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r5, r2, 24 - ldr r4, =gUnknown_0203CD90 - movs r6, 0 - strb r6, [r4] - movs r2, 0x1 - strb r2, [r4, 0x1] - strb r6, [r4, 0x3] - subs r1, 0x1 - strb r1, [r4, 0x4] - strb r0, [r4, 0x5] - strb r2, [r4, 0x6] - movs r0, 0x10 - strb r0, [r4, 0x8] - strb r3, [r4, 0xB] - cmp r5, 0 - blt _08199554 - movs r0, 0x4 - ldrsb r0, [r4, r0] - cmp r5, r0 - ble _0819955C -_08199554: - strb r6, [r4, 0x2] - b _0819955E - .pool -_0819955C: - strb r5, [r4, 0x2] -_0819955E: - movs r0, 0 - bl MoveMenuCursor - lsls r0, 24 - lsrs r0, 24 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end InitMenuInUpperLeftCorner - - thumb_func_start InitMenuInUpperLeftCornerPlaySoundWhenAPressed -InitMenuInUpperLeftCornerPlaySoundWhenAPressed: @ 8199570 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - movs r3, 0 - bl InitMenuInUpperLeftCorner - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end InitMenuInUpperLeftCornerPlaySoundWhenAPressed - - thumb_func_start PrintMenuTable -PrintMenuTable: @ 819958C - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r1, 24 - lsrs r7, r1, 24 - movs r5, 0 - cmp r5, r7 - bcs _081995D0 - movs r6, 0x80 - lsls r6, 17 - adds r4, r2, 0 -_081995AA: - ldr r2, [r4] - lsrs r0, r6, 24 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - mov r0, r8 - movs r1, 0x1 - movs r3, 0x8 - bl PrintTextOnWindow - movs r0, 0x80 - lsls r0, 21 - adds r6, r0 - adds r4, 0x8 - adds r5, 0x1 - cmp r5, r7 - bcc _081995AA -_081995D0: - mov r0, r8 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end PrintMenuTable - - thumb_func_start sub_81995E4 -sub_81995E4: @ 81995E4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - mov r9, r2 - mov r8, r3 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r7, r1, 24 - mov r0, sp - movs r1, 0 - mov r10, r1 - strb r6, [r0, 0x4] - mov r1, sp - movs r0, 0x1 - strb r0, [r1, 0x5] - movs r1, 0x5 - bl GetFontAttribute - mov r3, sp - lsls r0, 4 - ldrb r2, [r3, 0xC] - movs r5, 0xF - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xC] - movs r0, 0x1 - movs r1, 0x6 - bl GetFontAttribute - mov r3, sp - adds r1, r5, 0 - ands r1, r0 - ldrb r2, [r3, 0xD] - movs r4, 0x10 - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0xD] - movs r0, 0x1 - movs r1, 0x7 - bl GetFontAttribute - mov r3, sp - lsls r0, 4 - ldrb r2, [r3, 0xD] - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xD] - movs r0, 0x1 - movs r1, 0x4 - bl GetFontAttribute - mov r1, sp - ands r5, r0 - ldrb r0, [r1, 0xC] - ands r4, r0 - orrs r4, r5 - strb r4, [r1, 0xC] - mov r0, sp - mov r1, r10 - strb r1, [r0, 0xA] - strb r1, [r0, 0xB] - movs r1, 0x8 - strb r1, [r0, 0x6] - strb r1, [r0, 0x8] - movs r4, 0 - cmp r4, r7 - bcs _081996A6 - mov r5, sp -_0819967C: - mov r1, r8 - adds r0, r1, r4 - ldrb r0, [r0] - lsls r0, 3 - add r0, r9 - ldr r0, [r0] - str r0, [sp] - lsls r0, r4, 4 - adds r0, 0x1 - strb r0, [r5, 0x7] - strb r0, [r5, 0x9] - mov r0, sp - movs r1, 0xFF - movs r2, 0 - bl AddTextPrinter - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r7 - bcc _0819967C -_081996A6: - adds r0, r6, 0 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81995E4 - - thumb_func_start CreateYesNoMenu -@ void CreateYesNoMenu(struct WindowTemplate *windowTemplate, u16 borderFirstTileNum, u8 borderPalette, u8 initialCursorPos) -CreateYesNoMenu: @ 81996C0 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x10 - adds r4, r1, 0 - adds r5, r2, 0 - adds r6, r3, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - ldr r1, =gUnknown_0203CD9F - mov r8, r1 - bl AddWindow - mov r2, r8 - strb r0, [r2] - ldrb r0, [r2] - movs r1, 0x1 - adds r2, r4, 0 - adds r3, r5, 0 - bl SetWindowBorderStyle - ldr r0, =gUnknown_085EE491 - str r0, [sp] - mov r1, sp - mov r2, r8 - ldrb r0, [r2] - movs r2, 0 - mov r9, r2 - strb r0, [r1, 0x4] - mov r0, sp - movs r2, 0x1 - strb r2, [r0, 0x5] - movs r0, 0x8 - strb r0, [r1, 0x6] - mov r0, sp - strb r2, [r0, 0x7] - ldrb r0, [r0, 0x6] - strb r0, [r1, 0x8] - mov r0, sp - ldrb r0, [r0, 0x7] - strb r0, [r1, 0x9] - movs r0, 0x1 - movs r1, 0x5 - bl GetFontAttribute - mov r3, sp - lsls r0, 4 - ldrb r2, [r3, 0xC] - movs r5, 0xF - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xC] - movs r0, 0x1 - movs r1, 0x6 - bl GetFontAttribute - mov r3, sp - adds r1, r5, 0 - ands r1, r0 - ldrb r2, [r3, 0xD] - movs r4, 0x10 - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0xD] - movs r0, 0x1 - movs r1, 0x7 - bl GetFontAttribute - mov r3, sp - lsls r0, 4 - ldrb r2, [r3, 0xD] - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xD] - movs r0, 0x1 - movs r1, 0x4 - bl GetFontAttribute - mov r1, sp - ands r5, r0 - ldrb r0, [r1, 0xC] - ands r4, r0 - orrs r4, r5 - strb r4, [r1, 0xC] - mov r0, sp - mov r1, r9 - strb r1, [r0, 0xA] - strb r1, [r0, 0xB] - movs r1, 0xFF - movs r2, 0 - bl AddTextPrinter - mov r2, r8 - ldrb r0, [r2] - movs r1, 0x2 - adds r2, r6, 0 - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end CreateYesNoMenu - - thumb_func_start sub_81997AC -sub_81997AC: @ 81997AC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0xC] - lsls r2, 24 - lsrs r6, r2, 24 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x10] - movs r7, 0 - cmp r7, r3 - bcs _08199824 -_081997D4: - movs r4, 0 - adds r0, r7, 0x1 - mov r9, r0 - cmp r4, r6 - bcs _0819981C - lsls r0, r7, 4 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r5, 0x80 - lsls r5, 20 -_081997EC: - adds r0, r7, 0 - muls r0, r6 - adds r0, r4 - lsls r0, 3 - ldr r1, [sp, 0x34] - adds r0, r1 - ldr r2, [r0] - lsrs r3, r5, 24 - mov r0, r8 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - mov r0, r10 - movs r1, 0x1 - bl PrintTextOnWindow - ldr r1, [sp, 0xC] - lsls r0, r1, 24 - adds r5, r0 - adds r4, 0x1 - cmp r4, r6 - bcc _081997EC -_0819981C: - mov r7, r9 - ldr r4, [sp, 0x10] - cmp r7, r4 - bcc _081997D4 -_08199824: - mov r0, r10 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0x14 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81997AC - - thumb_func_start sub_819983C -sub_819983C: @ 819983C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x10] - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x14] - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - lsls r3, 24 - lsrs r3, 24 - mov r10, r3 - mov r0, sp - movs r6, 0 - ldrb r1, [r0, 0x10] - strb r1, [r0, 0x4] - mov r1, sp - movs r0, 0x1 - strb r0, [r1, 0x5] - movs r1, 0x5 - bl GetFontAttribute - mov r3, sp - lsls r0, 4 - ldrb r2, [r3, 0xC] - movs r5, 0xF - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xC] - movs r0, 0x1 - movs r1, 0x6 - bl GetFontAttribute - mov r3, sp - adds r1, r5, 0 - ands r1, r0 - ldrb r2, [r3, 0xD] - movs r4, 0x10 - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0xD] - movs r0, 0x1 - movs r1, 0x7 - bl GetFontAttribute - mov r3, sp - lsls r0, 4 - ldrb r2, [r3, 0xD] - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xD] - movs r0, 0x1 - movs r1, 0x4 - bl GetFontAttribute - mov r1, sp - ands r5, r0 - ldrb r0, [r1, 0xC] - ands r4, r0 - orrs r4, r5 - strb r4, [r1, 0xC] - mov r0, sp - strb r6, [r0, 0xA] - strb r6, [r0, 0xB] - movs r7, 0 - cmp r7, r10 - bcs _0819992A -_081998D6: - movs r5, 0 - adds r2, r7, 0x1 - mov r9, r2 - cmp r5, r8 - bcs _08199920 - mov r4, sp - lsls r0, r7, 4 - adds r6, r0, 0x1 -_081998E6: - mov r0, r8 - muls r0, r7 - adds r0, r5 - ldr r1, [sp, 0x3C] - adds r0, r1, r0 - ldrb r0, [r0] - lsls r0, 3 - ldr r2, [sp, 0x38] - adds r0, r2 - ldr r0, [r0] - str r0, [sp] - ldr r1, [sp, 0x14] - adds r0, r1, 0 - muls r0, r5 - adds r0, 0x8 - strb r0, [r4, 0x6] - strb r6, [r4, 0x7] - strb r0, [r4, 0x8] - strb r6, [r4, 0x9] - mov r0, sp - movs r1, 0xFF - movs r2, 0 - bl AddTextPrinter - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, r8 - bcc _081998E6 -_08199920: - mov r2, r9 - lsls r0, r2, 24 - lsrs r7, r0, 24 - cmp r7, r10 - bcc _081998D6 -_0819992A: - ldr r0, [sp, 0x10] - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_819983C - - thumb_func_start sub_8199944 -sub_8199944: @ 8199944 - push {r4-r7,lr} - ldr r4, [sp, 0x14] - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r7, r4, 24 - ldr r6, =gUnknown_0203CD90 - movs r4, 0 - mov r12, r4 - mov r4, r12 - strb r4, [r6] - movs r5, 0x1 - strb r5, [r6, 0x1] - strb r4, [r6, 0x3] - adds r4, r2, 0 - muls r4, r3 - subs r4, 0x1 - strb r4, [r6, 0x4] - strb r0, [r6, 0x5] - strb r5, [r6, 0x6] - strb r1, [r6, 0x7] - movs r0, 0x10 - strb r0, [r6, 0x8] - strb r2, [r6, 0x9] - strb r3, [r6, 0xA] - cmp r7, 0 - blt _08199986 - movs r0, 0x4 - ldrsb r0, [r6, r0] - cmp r7, r0 - ble _08199990 -_08199986: - mov r0, r12 - strb r0, [r6, 0x2] - b _08199992 - .pool -_08199990: - strb r7, [r6, 0x2] -_08199992: - movs r0, 0 - movs r1, 0 - bl sub_8199134 - ldr r0, =gUnknown_0203CD90 - ldrb r0, [r0, 0x2] - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8199944 - - thumb_func_start clear_scheduled_bg_copies_to_vram -@ void clear_scheduled_bg_copies_to_vram() -clear_scheduled_bg_copies_to_vram: @ 81999A8 - push {lr} - ldr r0, =gUnknown_0203CDA4 - movs r1, 0 - movs r2, 0x4 - bl memset - pop {r0} - bx r0 - .pool - thumb_func_end clear_scheduled_bg_copies_to_vram - - thumb_func_start schedule_bg_copy_tilemap_to_vram -@ void schedule_bg_copy_tilemap_to_vram(u8 bg_id) -schedule_bg_copy_tilemap_to_vram: @ 81999BC - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0203CDA4 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - bx lr - .pool - thumb_func_end schedule_bg_copy_tilemap_to_vram - - thumb_func_start do_scheduled_bg_tilemap_copies_to_vram -@ void do_scheduled_bg_tilemap_copies_to_vram() -do_scheduled_bg_tilemap_copies_to_vram: @ 81999D0 - push {r4,lr} - ldr r4, =gUnknown_0203CDA4 - ldrb r0, [r4] - cmp r0, 0x1 - bne _081999E4 - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0 - strb r0, [r4] -_081999E4: - ldrb r0, [r4, 0x1] - cmp r0, 0x1 - bne _081999F4 - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0 - strb r0, [r4, 0x1] -_081999F4: - ldrb r0, [r4, 0x2] - cmp r0, 0x1 - bne _08199A04 - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - movs r0, 0 - strb r0, [r4, 0x2] -_08199A04: - ldrb r0, [r4, 0x3] - cmp r0, 0x1 - bne _08199A14 - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - movs r0, 0 - strb r0, [r4, 0x3] -_08199A14: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end do_scheduled_bg_tilemap_copies_to_vram - - thumb_func_start reset_temp_tile_data_buffers -@ void reset_temp_tile_data_buffers() -reset_temp_tile_data_buffers: @ 8199A20 - push {lr} - ldr r3, =gUnknown_0203CDA8 - ldr r1, =gUnknown_0203CDAC - movs r2, 0 - adds r0, r1, 0 - adds r0, 0x7C -_08199A2C: - str r2, [r0] - subs r0, 0x4 - cmp r0, r1 - bge _08199A2C - movs r0, 0 - strh r0, [r3] - pop {r0} - bx r0 - .pool - thumb_func_end reset_temp_tile_data_buffers - - thumb_func_start free_temp_tile_data_buffers_if_possible -free_temp_tile_data_buffers_if_possible: @ 8199A44 - push {r4-r6,lr} - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _08199A88 - ldr r1, =gUnknown_0203CDA8 - ldrh r0, [r1] - cmp r0, 0 - beq _08199A7C - movs r4, 0 - ldrh r1, [r1] - cmp r4, r1 - bge _08199A76 - ldr r5, =gUnknown_0203CDAC - movs r6, 0 -_08199A64: - ldr r0, [r5] - bl Free - stm r5!, {r6} - adds r4, 0x1 - ldr r0, =gUnknown_0203CDA8 - ldrh r0, [r0] - cmp r4, r0 - blt _08199A64 -_08199A76: - ldr r1, =gUnknown_0203CDA8 - movs r0, 0 - strh r0, [r1] -_08199A7C: - movs r0, 0 - b _08199A8A - .pool -_08199A88: - movs r0, 0x1 -_08199A8A: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end free_temp_tile_data_buffers_if_possible - - thumb_func_start decompress_and_copy_tile_data_to_vram -@ int decompress_and_copy_tile_data_to_vram(u8 bg_id, int src, int size, u16 offset, u8 mode) -decompress_and_copy_tile_data_to_vram: @ 8199A90 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x8 - adds r4, r1, 0 - adds r5, r2, 0 - ldr r1, [sp, 0x24] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r3, 16 - lsrs r3, 16 - mov r9, r3 - lsls r1, 24 - lsrs r7, r1, 24 - ldr r6, =gUnknown_0203CDA8 - ldrh r0, [r6] - cmp r0, 0x1F - bhi _08199AF8 - adds r0, r4, 0 - add r1, sp, 0x4 - bl malloc_and_decompress - adds r4, r0, 0 - cmp r5, 0 - bne _08199AC8 - ldr r5, [sp, 0x4] -_08199AC8: - cmp r4, 0 - beq _08199AEC - lsls r2, r5, 16 - lsrs r2, 16 - str r7, [sp] - mov r0, r8 - adds r1, r4, 0 - mov r3, r9 - bl copy_decompressed_tile_data_to_vram - ldr r2, =gUnknown_0203CDAC - ldrh r0, [r6] - adds r1, r0, 0x1 - strh r1, [r6] - lsls r0, 16 - lsrs r0, 14 - adds r0, r2 - str r4, [r0] -_08199AEC: - adds r0, r4, 0 - b _08199AFA - .pool -_08199AF8: - movs r0, 0 -_08199AFA: - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end decompress_and_copy_tile_data_to_vram - - thumb_func_start copy_decompressed_tile_data_to_vram_autofree -@ void copy_decompressed_tile_data_to_vram_autofree(u8 bg_id, int src, u16 size, u16 offset, u8 mode) -copy_decompressed_tile_data_to_vram_autofree: @ 8199B08 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x8 - adds r5, r2, 0 - ldr r2, [sp, 0x24] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r3, 16 - lsrs r3, 16 - mov r9, r3 - lsls r2, 24 - lsrs r7, r2, 24 - adds r0, r1, 0 - add r1, sp, 0x4 - bl malloc_and_decompress - adds r6, r0, 0 - cmp r5, 0 - bne _08199B36 - ldr r5, [sp, 0x4] -_08199B36: - cmp r6, 0 - beq _08199B6E - ldr r0, =task_free_buf_after_copying_tile_data_to_vram - movs r1, 0 - bl CreateTask - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r2, r5, 16 - lsrs r2, 16 - str r7, [sp] - mov r0, r8 - adds r1, r6, 0 - mov r3, r9 - bl copy_decompressed_tile_data_to_vram - ldr r2, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r2 - strh r0, [r1, 0x8] - adds r0, r4, 0 - movs r1, 0x1 - adds r2, r6, 0 - bl SetWordTaskArg -_08199B6E: - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end copy_decompressed_tile_data_to_vram_autofree - - thumb_func_start task_free_buf_after_copying_tile_data_to_vram -@ void task_free_buf_after_copying_tile_data_to_vram(int task_id) -task_free_buf_after_copying_tile_data_to_vram: @ 8199B84 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0x8 - ldrsh r0, [r0, r1] - bl CheckForSpaceForDma3Request - lsls r0, 16 - cmp r0, 0 - bne _08199BB4 - adds r0, r4, 0 - movs r1, 0x1 - bl GetWordTaskArg - bl Free - adds r0, r4, 0 - bl DestroyTask -_08199BB4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task_free_buf_after_copying_tile_data_to_vram - - thumb_func_start malloc_and_decompress -@ void *malloc_and_decompress(void *src, int *size) -malloc_and_decompress: @ 8199BC0 - push {r4,r5,lr} - adds r5, r0, 0 - ldrb r0, [r5, 0x1] - strb r0, [r1] - ldrb r0, [r5, 0x2] - strb r0, [r1, 0x1] - ldrb r0, [r5, 0x3] - strb r0, [r1, 0x2] - movs r0, 0 - strb r0, [r1, 0x3] - ldr r0, [r1] - bl Alloc - adds r4, r0, 0 - cmp r4, 0 - beq _08199BE8 - adds r0, r5, 0 - adds r1, r4, 0 - bl LZ77UnCompWram -_08199BE8: - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end malloc_and_decompress - - thumb_func_start copy_decompressed_tile_data_to_vram -@ s16 copy_decompressed_tile_data_to_vram(u8 bg_id, int src, u16 size, u16 offset, u8 mode) -copy_decompressed_tile_data_to_vram: @ 8199BF0 - push {r4,lr} - adds r4, r1, 0 - ldr r1, [sp, 0x8] - lsls r0, 24 - lsrs r0, 24 - lsls r2, 16 - lsrs r2, 16 - lsls r3, 16 - lsrs r3, 16 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0 - beq _08199C18 - cmp r1, 0x1 - beq _08199C20 - ldr r0, =0x0000ffff - b _08199C2A - .pool -_08199C18: - adds r1, r4, 0 - bl LoadBgTiles - b _08199C26 -_08199C20: - adds r1, r4, 0 - bl LoadBgTilemap -_08199C26: - lsls r0, 16 - lsrs r0, 16 -_08199C2A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end copy_decompressed_tile_data_to_vram - - thumb_func_start sub_8199C30 -sub_8199C30: @ 8199C30 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - adds r5, r2, 0 - ldr r4, [sp, 0x28] - ldr r2, [sp, 0x2C] - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp] - lsls r5, 24 - lsrs r5, 24 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x4] - lsls r4, 24 - lsrs r4, 24 - lsls r2, 24 - lsrs r2, 24 - mov r10, r2 - bl GetBgTilemapBuffer - mov r8, r0 - adds r0, r5, r4 - cmp r5, r0 - bge _08199CA8 - mov r9, r0 -_08199C6E: - ldr r3, [sp] - ldr r1, [sp, 0x4] - adds r0, r3, r1 - adds r7, r5, 0x1 - cmp r3, r0 - bge _08199CA0 - lsls r6, r5, 5 - ldr r1, =0x00000fff - mov r12, r1 - mov r1, r10 - lsls r5, r1, 12 - adds r4, r0, 0 -_08199C86: - adds r1, r6, r3 - lsls r1, 1 - add r1, r8 - ldrh r2, [r1] - mov r0, r12 - ands r0, r2 - orrs r0, r5 - strh r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, r4 - blt _08199C86 -_08199CA0: - lsls r0, r7, 24 - lsrs r5, r0, 24 - cmp r5, r9 - blt _08199C6E -_08199CA8: - 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_8199C30 - - thumb_func_start sub_8199CBC -sub_8199CBC: @ 8199CBC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r10, r1 - ldr r1, [sp, 0x24] - ldr r4, [sp, 0x28] - lsls r0, 24 - lsrs r0, 24 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp] - lsls r1, 24 - lsrs r5, r1, 24 - lsls r4, 24 - lsrs r4, 24 - mov r8, r4 - bl GetBgTilemapBuffer - adds r7, r0, 0 - movs r0, 0 - cmp r0, r8 - bcs _08199D2A -_08199CF4: - movs r2, 0 - adds r6, r0, 0x1 - cmp r2, r5 - bcs _08199D22 - adds r4, r0, 0 - muls r4, r5 - ldr r1, [sp] - adds r0, r1 - lsls r3, r0, 5 -_08199D06: - adds r1, r4, r2 - lsls r1, 1 - add r1, r10 - adds r0, r3, r2 - add r0, r9 - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, r5 - bcc _08199D06 -_08199D22: - lsls r0, r6, 24 - lsrs r0, 24 - cmp r0, r8 - bcc _08199CF4 -_08199D2A: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8199CBC - - thumb_func_start sub_8199D3C -sub_8199D3C: @ 8199D3C - push {r4-r7,lr} - adds r6, r0, 0 - adds r5, r1, 0 - ldr r0, [sp, 0x14] - adds r4, r2, 0 - muls r4, r3 - cmp r0, 0x1 - bne _08199D64 - adds r3, r6, 0 - movs r2, 0 - cmp r2, r4 - bge _08199D8C -_08199D54: - adds r1, r3, r2 - ldrb r0, [r1] - adds r0, r5 - strb r0, [r1] - adds r2, 0x1 - cmp r2, r4 - blt _08199D54 - b _08199D8C -_08199D64: - cmp r4, 0 - ble _08199D8C - movs r0, 0xFC - lsls r0, 8 - mov r12, r0 - ldr r0, =0x000003ff - adds r7, r0, 0 - adds r3, r6, 0 - adds r2, r4, 0 -_08199D76: - ldrh r0, [r3] - mov r1, r12 - ands r1, r0 - adds r0, r5 - ands r0, r7 - orrs r1, r0 - strh r1, [r3] - adds r3, 0x2 - subs r2, 0x1 - cmp r2, 0 - bne _08199D76 -_08199D8C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8199D3C - - thumb_func_start sub_8199D98 -sub_8199D98: @ 8199D98 - push {lr} - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x3 - 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 ChangeBgY - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - pop {r0} - bx r0 - thumb_func_end sub_8199D98 - - thumb_func_start sub_8199DF0 -sub_8199DF0: @ 8199DF0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - mov r8, r2 - mov r9, r3 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r5, 0 - movs r1, 0x4 - bl GetBgAttribute - lsls r0, 16 - movs r7, 0x40 - cmp r0, 0 - bne _08199E16 - movs r7, 0x20 -_08199E16: - adds r0, r5, 0 - movs r1, 0x1 - bl GetBgAttribute - adds r4, r0, 0 - adds r0, r5, 0 - movs r1, 0xA - bl GetBgAttribute - lsls r4, 16 - lsrs r4, 2 - lsls r0, 16 - lsrs r0, 16 - add r0, r8 - muls r0, r7 - adds r4, r0 - lsls r0, r6, 24 - lsls r1, r6, 16 - orrs r0, r1 - lsls r1, r6, 8 - orrs r0, r1 - orrs r0, r6 - movs r1, 0xC0 - lsls r1, 19 - adds r4, r1 - mov r2, r9 - muls r2, r7 - lsls r2, 16 - lsrs r2, 16 - adds r1, r4, 0 - movs r3, 0x1 - bl RequestDma3Fill - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8199DF0 - - thumb_func_start box_print -box_print: @ 8199E64 - push {r4-r6,lr} - sub sp, 0x10 - adds r4, r1, 0 - ldr r6, [sp, 0x20] - ldr r5, [sp, 0x24] - ldr r1, [sp, 0x28] - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - str r1, [sp] - mov r1, sp - strb r0, [r1, 0x4] - mov r0, sp - strb r4, [r0, 0x5] - strb r2, [r0, 0x6] - strb r3, [r0, 0x7] - ldrb r0, [r0, 0x6] - strb r0, [r1, 0x8] - mov r0, sp - ldrb r0, [r0, 0x7] - strb r0, [r1, 0x9] - adds r0, r4, 0 - movs r1, 0x2 - bl GetFontAttribute - mov r1, sp - strb r0, [r1, 0xA] - adds r0, r4, 0 - movs r1, 0x3 - bl GetFontAttribute - mov r1, sp - strb r0, [r1, 0xB] - mov r3, sp - ldrb r2, [r3, 0xC] - movs r1, 0x10 - negs r1, r1 - adds r0, r1, 0 - ands r0, r2 - strb r0, [r3, 0xC] - mov r2, sp - ldrb r0, [r6, 0x1] - lsls r0, 4 - movs r4, 0xF - strb r0, [r2, 0xC] - ldrb r2, [r6] - adds r0, r4, 0 - ands r0, r2 - ldrb r2, [r3, 0xD] - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xD] - mov r2, sp - ldrb r0, [r6, 0x2] - lsls r0, 4 - ands r1, r4 - orrs r1, r0 - strb r1, [r2, 0xD] - mov r0, sp - adds r1, r5, 0 - movs r2, 0 - bl AddTextPrinter - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end box_print - - thumb_func_start AddTextPrinterParametrized2 -@ void AddTextPrinterParametrized2(u8 windowId, u8 fontId, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, struct TextColor *color, u8 speed, u8 *str) -AddTextPrinterParametrized2: @ 8199EEC - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x10 - adds r5, r1, 0 - ldr r1, [sp, 0x28] - mov r8, r1 - ldr r1, [sp, 0x2C] - mov r9, r1 - ldr r6, [sp, 0x30] - ldr r1, [sp, 0x34] - ldr r4, [sp, 0x38] - str r4, [sp] - mov r4, sp - strb r0, [r4, 0x4] - mov r0, sp - strb r5, [r0, 0x5] - strb r2, [r0, 0x6] - strb r3, [r0, 0x7] - mov r2, sp - ldrb r0, [r0, 0x6] - strb r0, [r2, 0x8] - mov r0, sp - ldrb r0, [r0, 0x7] - strb r0, [r2, 0x9] - mov r0, sp - mov r2, r8 - strb r2, [r0, 0xA] - mov r2, r9 - strb r2, [r0, 0xB] - ldrb r3, [r4, 0xC] - movs r2, 0x10 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r4, 0xC] - mov r3, sp - ldrb r0, [r6, 0x1] - lsls r0, 4 - movs r5, 0xF - strb r0, [r3, 0xC] - ldrb r3, [r6] - adds r0, r5, 0 - ands r0, r3 - ldrb r3, [r4, 0xD] - ands r2, r3 - orrs r2, r0 - strb r2, [r4, 0xD] - mov r3, sp - ldrb r0, [r6, 0x2] - lsls r0, 4 - ands r2, r5 - orrs r2, r0 - strb r2, [r3, 0xD] - lsls r1, 24 - lsrs r1, 24 - mov r0, sp - movs r2, 0 - bl AddTextPrinter - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end AddTextPrinterParametrized2 - - thumb_func_start sub_8199F74 -sub_8199F74: @ 8199F74 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - adds r6, r1, 0 - ldr r4, [sp, 0x2C] - ldr r1, [sp, 0x30] - mov r8, r1 - ldr r7, [sp, 0x34] - ldr r5, [sp, 0x38] - ldr r1, [sp, 0x3C] - mov r9, r1 - lsls r6, 24 - lsrs r6, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - mov r1, r8 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - str r2, [sp] - mov r1, sp - strb r0, [r1, 0x4] - mov r0, sp - strb r6, [r0, 0x5] - strb r3, [r0, 0x6] - strb r4, [r0, 0x7] - strb r3, [r0, 0x8] - strb r4, [r0, 0x9] - strb r5, [r0, 0xA] - mov r1, r9 - strb r1, [r0, 0xB] - mov r2, sp - ldrb r1, [r2, 0xC] - movs r5, 0x10 - negs r5, r5 - adds r0, r5, 0 - ands r0, r1 - strb r0, [r2, 0xC] - adds r0, r6, 0 - movs r1, 0x5 - bl GetFontAttribute - mov r3, sp - lsls r0, 4 - ldrb r2, [r3, 0xC] - movs r4, 0xF - adds r1, r4, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xC] - adds r0, r6, 0 - movs r1, 0x6 - bl GetFontAttribute - mov r2, sp - adds r1, r4, 0 - ands r1, r0 - ldrb r0, [r2, 0xD] - ands r5, r0 - orrs r5, r1 - strb r5, [r2, 0xD] - adds r0, r6, 0 - movs r1, 0x7 - bl GetFontAttribute - mov r2, sp - lsls r0, 4 - ldrb r1, [r2, 0xD] - ands r4, r1 - orrs r4, r0 - strb r4, [r2, 0xD] - mov r0, sp - mov r1, r8 - adds r2, r7, 0 - bl AddTextPrinter - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8199F74 - - thumb_func_start sub_819A024 -sub_819A024: @ 819A024 - push {r4-r7,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r7, r0, 24 - lsls r2, 16 - lsrs r4, r2, 16 - lsls r3, 16 - lsrs r5, r3, 16 - movs r2, 0 - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldrb r0, [r3] - ldr r6, =gStringVar4 - cmp r0, 0xFF - beq _0819A04C -_0819A042: - adds r2, 0x1 - adds r0, r3, r2 - ldrb r0, [r0] - cmp r0, 0xFF - bne _0819A042 -_0819A04C: - adds r0, r6, 0 - bl StringExpandPlaceholders - lsls r3, r4, 24 - lsrs r3, 24 - lsls r0, r5, 24 - lsrs r0, 24 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - adds r0, r7, 0 - movs r1, 0x1 - adds r2, r6, 0 - bl PrintTextOnWindow - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819A024 - - thumb_func_start sub_819A080 -sub_819A080: @ 819A080 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x28 - str r0, [sp] - str r1, [sp, 0x4] - ldr r0, [sp, 0x48] - ldr r4, [sp, 0x4C] - ldr r1, [sp, 0x50] - ldr r5, [sp, 0x54] - lsls r2, 16 - lsrs r2, 16 - str r2, [sp, 0x8] - lsls r3, 16 - lsrs r3, 16 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0xC] - lsls r4, 16 - lsrs r4, 16 - lsls r1, 16 - lsrs r1, 16 - lsls r5, 16 - lsrs r5, 16 - ldr r2, [sp, 0x4] - ldrh r0, [r2, 0x4] - ldr r2, [sp, 0xC] - subs r0, r2 - ldr r2, [sp, 0x8] - adds r2, r1, r2 - str r2, [sp, 0x10] - cmp r0, r1 - bge _0819A0CC - ldr r1, [sp, 0x8] - adds r0, r1 - str r0, [sp, 0x10] -_0819A0CC: - ldr r2, [sp, 0x4] - ldrh r1, [r2, 0x6] - subs r0, r1, r4 - cmp r0, r5 - bge _0819A0DE - adds r0, r3, r1 - subs r0, r4 - str r0, [sp, 0x14] - b _0819A0E2 -_0819A0DE: - adds r5, r3, r5 - str r5, [sp, 0x14] -_0819A0E2: - ldr r0, [sp] - ldrh r1, [r0, 0x4] - movs r2, 0x7 - adds r0, r1, 0 - ands r0, r2 - adds r1, r0 - asrs r1, 3 - str r1, [sp, 0x18] - ldr r0, [sp, 0x4] - ldrh r1, [r0, 0x4] - adds r0, r1, 0 - ands r0, r2 - adds r1, r0 - asrs r1, 3 - str r1, [sp, 0x1C] - mov r12, r3 - mov r8, r4 - ldr r1, [sp, 0x14] - cmp r12, r1 - blt _0819A10C - b _0819A24A -_0819A10C: - ldr r5, [sp, 0x8] - ldr r6, [sp, 0xC] - mov r2, r12 - adds r2, 0x1 - str r2, [sp, 0x20] - mov r0, r8 - adds r0, 0x1 - str r0, [sp, 0x24] - ldr r1, [sp, 0x10] - cmp r5, r1 - blt _0819A124 - b _0819A23A -_0819A124: - movs r7, 0x1 - movs r2, 0xF0 - mov r10, r2 - movs r0, 0xF - mov r9, r0 -_0819A12E: - asrs r0, r5, 1 - movs r1, 0x3 - ands r0, r1 - ldr r2, [sp] - ldr r1, [r2] - adds r1, r0 - asrs r0, r5, 3 - lsls r0, 5 - adds r1, r0 - mov r2, r12 - asrs r0, r2, 3 - ldr r2, [sp, 0x18] - muls r0, r2 - lsls r0, 5 - adds r1, r0 - mov r2, r12 - lsls r0, r2, 29 - lsrs r0, 27 - adds r3, r1, r0 - asrs r0, r6, 1 - movs r1, 0x3 - ands r0, r1 - ldr r2, [sp, 0x4] - ldr r1, [r2] - adds r1, r0 - asrs r0, r6, 3 - lsls r0, 5 - adds r1, r0 - mov r2, r8 - asrs r0, r2, 3 - ldr r2, [sp, 0x1C] - muls r0, r2 - lsls r0, 5 - adds r1, r0 - mov r2, r8 - lsls r0, r2, 29 - lsrs r0, 27 - adds r4, r1, r0 - adds r0, r4, 0 - ands r0, r7 - cmp r0, 0 - beq _0819A1DA - subs r4, 0x1 - adds r0, r6, 0 - ands r0, r7 - cmp r0, 0 - beq _0819A1B2 - ldrh r0, [r4] - ldr r2, =0x00000fff - ands r2, r0 - adds r0, r5, 0 - ands r0, r7 - cmp r0, 0 - beq _0819A1A8 - ldrb r1, [r3] - mov r0, r10 - ands r0, r1 - lsls r0, 8 - b _0819A22A - .pool -_0819A1A8: - ldrb r1, [r3] - mov r0, r9 - ands r0, r1 - lsls r0, 12 - b _0819A22A -_0819A1B2: - ldrh r0, [r4] - ldr r2, =0x0000f0ff - ands r2, r0 - adds r0, r5, 0 - ands r0, r7 - cmp r0, 0 - beq _0819A1D0 - ldrb r1, [r3] - mov r0, r10 - ands r0, r1 - lsls r0, 4 - b _0819A22A - .pool -_0819A1D0: - ldrb r1, [r3] - mov r0, r9 - ands r0, r1 - lsls r0, 8 - b _0819A22A -_0819A1DA: - adds r0, r6, 0 - ands r0, r7 - cmp r0, 0 - beq _0819A206 - ldrh r0, [r4] - ldr r2, =0x0000ff0f - ands r2, r0 - adds r0, r5, 0 - ands r0, r7 - cmp r0, 0 - beq _0819A1FC - ldrb r1, [r3] - mov r0, r10 - b _0819A228 - .pool -_0819A1FC: - ldrb r1, [r3] - mov r0, r9 - ands r0, r1 - lsls r0, 4 - b _0819A22A -_0819A206: - ldrh r0, [r4] - ldr r2, =0x0000fff0 - ands r2, r0 - adds r0, r5, 0 - ands r0, r7 - cmp r0, 0 - beq _0819A224 - ldrb r1, [r3] - mov r0, r10 - ands r0, r1 - lsrs r0, 4 - b _0819A22A - .pool -_0819A224: - ldrb r1, [r3] - mov r0, r9 -_0819A228: - ands r0, r1 -_0819A22A: - orrs r2, r0 - strh r2, [r4] - adds r5, 0x1 - adds r6, 0x1 - ldr r0, [sp, 0x10] - cmp r5, r0 - bge _0819A23A - b _0819A12E -_0819A23A: - ldr r1, [sp, 0x20] - mov r12, r1 - ldr r2, [sp, 0x24] - mov r8, r2 - ldr r0, [sp, 0x14] - cmp r12, r0 - bge _0819A24A - b _0819A10C -_0819A24A: - 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_819A080 - - thumb_func_start sub_819A25C -sub_819A25C: @ 819A25C - push {r4,lr} - adds r4, r0, 0 - adds r0, r1, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r0, 16 - lsrs r0, 16 - bl sub_80D30B0 - adds r1, r4, 0 - movs r2, 0x20 - bl LoadPalette - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_819A25C - - thumb_func_start sub_819A27C -sub_819A27C: @ 819A27C - push {r4-r6,lr} - sub sp, 0x8 - adds r6, r0, 0 - adds r0, r1, 0 - adds r1, r2, 0 - adds r4, r3, 0 - ldr r5, [sp, 0x18] - lsls r6, 24 - lsrs r6, 24 - lsls r0, 16 - lsrs r0, 16 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - movs r2, 0x1 - bl sub_80D2EDC - adds r1, r0, 0 - movs r0, 0x20 - str r0, [sp] - str r0, [sp, 0x4] - adds r0, r6, 0 - adds r2, r4, 0 - adds r3, r5, 0 - bl BlitBitmapToWindow - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_819A27C - - thumb_func_start sub_819A2BC -sub_819A2BC: @ 819A2BC - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x1 - beq _0819A2DC - cmp r1, 0x1 - ble _0819A2D2 - cmp r1, 0x2 - beq _0819A2E4 -_0819A2D2: - ldr r0, =gUnknown_08DC4318 - b _0819A2E6 - .pool -_0819A2DC: - ldr r0, =gUnknown_08DC4338 - b _0819A2E6 - .pool -_0819A2E4: - ldr r0, =gUnknown_08DC4358 -_0819A2E6: - adds r1, r2, 0 - movs r2, 0x20 - bl LoadPalette - pop {r0} - bx r0 - .pool - thumb_func_end sub_819A2BC - - thumb_func_start blit_move_info_icon -@ void blit_move_info_icon(u8 windowId, u8 a2, u16 x, u16 y) -blit_move_info_icon: @ 819A2F8 - push {r4,r5,lr} - sub sp, 0x18 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsls r2, 16 - lsrs r2, 16 - lsls r3, 16 - lsrs r3, 16 - ldr r4, =gUnknown_0860F0D4 - lsrs r1, 22 - adds r1, r4 - ldrh r5, [r1, 0x2] - lsls r5, 5 - ldr r4, =gUnknown_08DC4378 - adds r5, r4 - movs r4, 0x80 - str r4, [sp] - str r4, [sp, 0x4] - str r2, [sp, 0x8] - str r3, [sp, 0xC] - ldrb r2, [r1] - str r2, [sp, 0x10] - ldrb r1, [r1, 0x1] - str r1, [sp, 0x14] - adds r1, r5, 0 - movs r2, 0 - movs r3, 0 - bl BlitBitmapRectToWindow - add sp, 0x18 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end blit_move_info_icon - - thumb_func_start sub_819A344 -sub_819A344: @ 819A344 - push {r4-r7,lr} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r2, 24 - lsrs r2, 24 - adds r5, r1, 0 - movs r1, 0xFC - strb r1, [r5] - adds r5, 0x1 - movs r0, 0x1 - strb r0, [r5] - adds r5, 0x1 - strb r2, [r5] - adds r5, 0x1 - strb r1, [r5] - adds r5, 0x1 - movs r0, 0x3 - strb r0, [r5] - adds r5, 0x1 - adds r2, 0x1 - strb r2, [r5] - adds r5, 0x1 - cmp r3, 0x4 - bhi _0819A43C - lsls r0, r3, 2 - ldr r1, =_0819A384 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0819A384: - .4byte _0819A398 - .4byte _0819A3A8 - .4byte _0819A3D6 - .4byte _0819A404 - .4byte _0819A414 -_0819A398: - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - adds r0, r5, 0 - bl StringCopy - b _0819A43C - .pool -_0819A3A8: - bl IsNationalPokedexEnabled - cmp r0, 0 - beq _0819A3B8 - movs r0, 0x1 - bl pokedex_count - b _0819A3BE -_0819A3B8: - movs r0, 0x1 - bl sub_80C0844 -_0819A3BE: - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r5, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - adds r5, r0, 0 - movs r0, 0xFF - strb r0, [r5] - b _0819A43C -_0819A3D6: - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldrh r1, [r0, 0xE] - adds r0, r5, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - adds r5, r0, 0 - movs r0, 0xF0 - strb r0, [r5] - adds r5, 0x1 - ldr r0, [r4] - ldrb r1, [r0, 0x10] - adds r0, r5, 0 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - b _0819A43C - .pool -_0819A404: - ldr r0, =gMapHeader - ldrb r1, [r0, 0x14] - adds r0, r5, 0 - bl sub_81245DC - b _0819A43C - .pool -_0819A414: - ldr r4, =0x00000867 - movs r6, 0 - adds r7, r5, 0x1 -_0819A41A: - lsls r0, r4, 16 - lsrs r0, 16 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0819A42A - adds r6, 0x1 -_0819A42A: - adds r4, 0x1 - ldr r0, =0x0000086e - cmp r4, r0 - ble _0819A41A - adds r0, r6, 0 - subs r0, 0x5F - strb r0, [r5] - movs r0, 0xFF - strb r0, [r7] -_0819A43C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819A344 - - thumb_func_start sub_819A44C -sub_819A44C: @ 819A44C - push {r4,r5,lr} - adds r5, r0, 0 - ldrb r4, [r5, 0x5] - lsrs r4, 4 - movs r0, 0x65 - bl IndexOfSpritePaletteTag - lsls r0, 24 - lsls r4, 16 - lsrs r4, 16 - lsrs r0, 24 - cmp r4, r0 - bne _0819A4BA - adds r0, r5, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0819A4B0 - ldrh r1, [r5, 0x2E] - movs r2, 0x2E - ldrsh r0, [r5, r2] - cmp r0, 0 - beq _0819A484 - subs r0, r1, 0x1 - strh r0, [r5, 0x2E] - b _0819A4C2 -_0819A484: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x5 - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - bne _0819A4A6 - adds r0, r5, 0 - movs r1, 0 - bl StartSpriteAnim - movs r0, 0x20 - strh r0, [r5, 0x2E] - b _0819A4C2 -_0819A4A6: - adds r0, r5, 0 - movs r1, 0x1 - bl StartSpriteAnim - b _0819A4C2 -_0819A4B0: - adds r0, r5, 0 - movs r1, 0x1 - bl StartSpriteAnimIfDifferent - b _0819A4C2 -_0819A4BA: - adds r0, r5, 0 - movs r1, 0 - bl StartSpriteAnimIfDifferent -_0819A4C2: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_819A44C - - thumb_func_start sub_819A4C8 -sub_819A4C8: @ 819A4C8 - push {lr} - bl AnimateSprites - bl BuildOamBuffer - bl RunTextPrinters - bl UpdatePaletteFade - bl RunTasks - pop {r0} - bx r0 - thumb_func_end sub_819A4C8 - - thumb_func_start sub_819A4E4 -sub_819A4E4: @ 819A4E4 - push {lr} - bl LoadOam - bl ProcessSpriteCopyRequests - bl TransferPlttBuffer - pop {r0} - bx r0 - thumb_func_end sub_819A4E4 - - thumb_func_start sub_819A4F8 -sub_819A4F8: @ 819A4F8 - push {lr} - ldr r0, =gUnknown_0300127C - movs r1, 0 - str r1, [r0] - ldr r0, =sub_819A514 - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_819A4F8 - - thumb_func_start sub_819A514 -sub_819A514: @ 819A514 - push {r4,r5,lr} - sub sp, 0xC - ldr r0, =gMain - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0xA - bls _0819A528 - b _0819A98E -_0819A528: - lsls r0, 2 - ldr r1, =_0819A53C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0819A53C: - .4byte _0819A568 - .4byte _0819A5C0 - .4byte _0819A69C - .4byte _0819A77C - .4byte _0819A7CC - .4byte _0819A868 - .4byte _0819A8A4 - .4byte _0819A8AC - .4byte _0819A8C4 - .4byte _0819A8DC - .4byte _0819A8FC -_0819A568: - ldr r4, =gUnknown_0203CE3C - ldr r0, [r4] - cmp r0, 0 - beq _0819A578 - bl Free - movs r0, 0 - str r0, [r4] -_0819A578: - movs r0, 0 - bl SetHBlankCallback - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - str r0, [sp, 0x8] - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x05006000 - add r0, sp, 0x8 - bl CpuSet - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_08610428 - movs r0, 0 - movs r2, 0x3 - bl InitBgsFromTemplates - ldr r0, =gUnknown_08610434 - bl InitWindows - bl DeactivateAllTextPrinters - b _0819A8E6 - .pool -_0819A5C0: - ldr r5, =gUnknown_0203CE2C - movs r4, 0x88 - lsls r4, 3 - adds r0, r4, 0 - bl Alloc - str r0, [r5] - ldr r5, =gUnknown_0203CE30 - adds r0, r4, 0 - bl AllocZeroed - str r0, [r5] - ldr r5, =gUnknown_0203CE34 - movs r4, 0x80 - lsls r4, 4 - adds r0, r4, 0 - bl Alloc - str r0, [r5] - ldr r5, =gUnknown_0203CE38 - adds r0, r4, 0 - bl AllocZeroed - str r0, [r5] - 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, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4C - movs r1, 0 - bl SetGpuReg - movs r0, 0x40 - movs r1, 0 - bl SetGpuReg - movs r0, 0x44 - movs r1, 0 - bl SetGpuReg - movs r0, 0x42 - movs r1, 0 - bl SetGpuReg - movs r0, 0x46 - movs r1, 0 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4A - movs r1, 0 - bl SetGpuReg - ldr r1, =gMain - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _0819A8EE - .pool -_0819A69C: - bl ResetPaletteFade - bl ResetSpriteData - bl ResetTasks - bl FreeAllSpritePalettes - ldr r0, =gUnknown_08DC0754 - ldr r5, =gUnknown_0203CE2C - ldr r1, [r5] - movs r2, 0x88 - lsls r2, 2 - bl CpuSet - ldr r0, =gUnknown_0861033C - ldr r4, =gUnknown_0203CE30 - ldr r1, [r4] - movs r2, 0x30 - bl CpuSet - ldr r1, [r5] - movs r2, 0x88 - lsls r2, 3 - movs r0, 0x1 - movs r3, 0 - bl LoadBgTiles - ldr r1, [r4] - movs r0, 0x3 - movs r2, 0x60 - movs r3, 0 - bl LoadBgTiles - ldr r0, =gUnknown_08DC0B94 - ldr r4, =gUnknown_0203CE34 - ldr r1, [r4] - movs r2, 0x80 - lsls r2, 3 - bl CpuSet - ldr r1, [r4] - movs r2, 0x80 - lsls r2, 4 - movs r0, 0x1 - movs r3, 0 - bl LoadBgTilemap - ldr r0, =gUnknown_08DC0714 - movs r1, 0 - movs r2, 0x40 - bl LoadPalette - ldr r4, =gUnknown_0861046C - adds r0, r4, 0 - movs r1, 0xF0 - movs r2, 0x8 - bl LoadPalette - adds r0, r4, 0 - movs r1, 0xE0 - movs r2, 0xA - bl LoadPalette - ldr r0, =gUnknown_0300127C - ldr r1, [r0] - ldrb r0, [r1, 0x6] - cmp r0, 0x1 - bne _0819A738 - ldr r0, =gPlttBufferUnfaded - movs r2, 0xA9 - lsls r2, 2 - adds r1, r2 - ldrh r1, [r1] - movs r3, 0xE4 - lsls r3, 1 - adds r0, r3 - strh r1, [r0] -_0819A738: - ldr r0, =gUnknown_0861039C - movs r1, 0x20 - movs r2, 0x4 - bl LoadPalette - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _0819A8EE - .pool -_0819A77C: - ldr r0, =gUnknown_0203CE38 - ldr r1, [r0] - movs r0, 0x3 - bl SetBgTilemapBuffer - ldr r5, =gUnknown_0861023C - movs r4, 0x8 - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0x3 - adds r1, r5, 0 - movs r2, 0xB - movs r3, 0x4 - bl CopyToBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0x3 - adds r1, r5, 0 - movs r2, 0x2 - movs r3, 0x4 - bl CopyToBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0x3 - adds r1, r5, 0 - movs r2, 0x14 - movs r3, 0x4 - bl CopyToBgTilemapBufferRect - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - b _0819A8E6 - .pool -_0819A7CC: - ldr r0, =gUnknown_086103F4 - bl LoadSpritePalettes - ldr r0, =gUnknown_086103BC - bl LoadSpriteSheets - ldr r0, =gUnknown_086103E4 - bl LoadCompressedObjectPic - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - ldr r0, =sub_819A4E4 - bl SetVBlankCallback - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - movs r1, 0x9A - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - ldrb r0, [r0, 0x6] - cmp r0, 0x1 - bne _0819A854 - movs r0, 0x58 - movs r1, 0x98 - movs r2, 0x20 - movs r3, 0x60 - bl sub_819C5D0 - movs r0, 0x3 - bl ShowBg - ldr r1, =0x00001248 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x0000040b - movs r0, 0x52 - bl SetGpuReg - b _0819A85A - .pool -_0819A854: - movs r0, 0x3 - bl HideBg -_0819A85A: - ldr r1, =gMain - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _0819A8EE - .pool -_0819A868: - ldr r4, =gUnknown_0300127C - ldr r1, [r4] - ldrb r0, [r1, 0x6] - cmp r0, 0x1 - bne _0819A878 - ldr r0, =gUnknown_0203CF20 - ldrb r0, [r0] - strb r0, [r1, 0x3] -_0819A878: - bl sub_819A9AC - bl sub_819AA18 - ldr r0, [r4] - ldrb r0, [r0, 0x6] - cmp r0, 0x1 - bne _0819A88C - bl sub_819BE34 -_0819A88C: - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _0819A8EE - .pool -_0819A8A4: - bl sub_819BA64 - movs r0, 0x2 - b _0819A8E2 -_0819A8AC: - bl sub_819BCF8 - movs r0, 0x5 - bl PutWindowTilemap - ldr r1, =gMain - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _0819A8EE - .pool -_0819A8C4: - bl sub_819B9E8 - movs r0, 0x1 - bl PutWindowTilemap - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _0819A8EE - .pool -_0819A8DC: - bl sub_819B9B4 - movs r0, 0 -_0819A8E2: - bl PutWindowTilemap -_0819A8E6: - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 -_0819A8EE: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0819A98E - .pool -_0819A8FC: - ldr r0, =sub_819C69C - movs r1, 0 - bl CreateTask - ldr r2, =gUnknown_0300127C - ldr r1, [r2] - ldr r3, =0x000002a1 - adds r1, r3 - strb r0, [r1] - ldr r3, [r2] - ldrb r5, [r3, 0x6] - cmp r5, 0 - bne _0819A954 - ldr r4, =gTasks - ldr r1, =0x000002a1 - adds r0, r3, r1 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - strh r5, [r0, 0x8] - ldr r0, =sub_819B378 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r1, r0, 24 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - strh r5, [r0, 0x8] - b _0819A988 - .pool -_0819A954: - ldr r4, =gTasks - ldr r2, =0x000002a1 - adds r0, r3, r2 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - movs r2, 0 - movs r1, 0x1 - strh r1, [r0, 0x8] - ldr r1, =0x000002a2 - adds r0, r3, r1 - strb r2, [r0] - ldr r0, =sub_819B124 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r1, r0, 24 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - movs r1, 0xD - strh r1, [r0, 0x8] -_0819A988: - ldr r0, =sub_819A4C8 - bl SetMainCallback2 -_0819A98E: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819A514 - - thumb_func_start sub_819A9AC -sub_819A9AC: @ 819A9AC - push {r4,r5,lr} - ldr r5, =gUnknown_0300127C - ldr r4, [r5] - cmp r4, 0 - bne _0819AA12 - movs r0, 0xAB - lsls r0, 2 - bl AllocZeroed - str r0, [r5] - strb r4, [r0, 0x3] - ldr r1, [r5] - movs r0, 0x1 - strb r0, [r1, 0x5] - ldr r0, [r5] - strb r4, [r0, 0x6] - movs r2, 0 - movs r4, 0x6C - movs r3, 0 -_0819A9D2: - ldr r0, [r5] - adds r1, r2, 0 - muls r1, r4 - adds r0, r1 - strb r3, [r0, 0x10] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x5 - bls _0819A9D2 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x2 - beq _0819AA0C - movs r0, 0 - bl sub_819B484 - b _0819AA12 - .pool -_0819AA0C: - movs r0, 0 - bl sub_819B63C -_0819AA12: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_819A9AC - - thumb_func_start sub_819AA18 -sub_819AA18: @ 819AA18 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r4, 0 - mov r8, r4 - ldr r7, =gSprites -_0819AA24: - lsls r1, r4, 3 - adds r1, r4 - lsls r1, 2 - subs r1, r4 - adds r1, 0x20 - lsls r1, 16 - asrs r1, 16 - ldr r0, =gUnknown_086105D8 - movs r2, 0x40 - movs r3, 0x1 - bl CreateSprite - ldr r6, =gUnknown_0300127C - ldr r2, [r6] - movs r5, 0x6C - adds r1, r4, 0 - muls r1, r5 - adds r2, r1 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r2, 0xE] - ldrh r1, [r2, 0xE] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - mov r1, r8 - strh r1, [r0, 0x2E] - adds r0, r4, 0 - bl sub_819ADAC - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _0819AA24 - ldr r0, [r6] - ldrb r1, [r0, 0x3] - ldr r4, =gSprites - muls r1, r5 - adds r0, r1 - ldrh r0, [r0, 0xE] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldr r0, =gUnknown_086105F0 - movs r2, 0x20 - ldrsh r1, [r1, r2] - movs r2, 0x58 - movs r3, 0 - bl CreateSprite - ldr r1, [r6] - movs r5, 0 - strb r0, [r1, 0x4] - ldr r0, =gUnknown_08610608 - movs r1, 0xB0 - movs r2, 0x70 - movs r3, 0 - bl CreateSprite - ldr r1, [r6] - strb r0, [r1, 0x1] - ldr r0, =gUnknown_08610620 - movs r1, 0xB0 - movs r2, 0x90 - movs r3, 0 - bl CreateSprite - ldr r1, [r6] - strb r0, [r1, 0x2] - ldr r0, [r6] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldr r0, [r6] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - ldr r0, [r6] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x28 - strb r5, [r0] - ldr r0, [r6] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x29 - strb r5, [r0] - ldr r0, [r6] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x28 - strb r5, [r0] - ldr r0, [r6] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x29 - strb r5, [r0] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819AA18 - - thumb_func_start sub_819AB40 -sub_819AB40: @ 819AB40 - push {r4-r6,lr} - movs r4, 0 -_0819AB44: - ldr r6, =gUnknown_0300127C - ldr r1, [r6] - movs r0, 0x6C - muls r0, r4 - adds r1, r0 - ldrh r1, [r1, 0xE] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r5, =gSprites - adds r0, r5 - bl DestroySprite - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _0819AB44 - ldr r0, [r6] - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl DestroySprite - ldr r0, [r6] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl DestroySprite - ldr r0, [r6] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl DestroySprite - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819AB40 - - thumb_func_start sub_819ABA8 -sub_819ABA8: @ 819ABA8 - push {r4,lr} - lsls r0, 24 - cmp r0, 0 - ble _0819ABC8 - ldr r0, =gUnknown_0300127C - ldr r1, [r0] - ldrb r3, [r1, 0x3] - adds r2, r0, 0 - cmp r3, 0x5 - beq _0819ABC4 - adds r0, r3, 0x1 - b _0819ABDE - .pool -_0819ABC4: - movs r0, 0 - b _0819ABDE -_0819ABC8: - ldr r0, =gUnknown_0300127C - ldr r1, [r0] - ldrb r3, [r1, 0x3] - adds r2, r0, 0 - cmp r3, 0 - beq _0819ABDC - subs r0, r3, 0x1 - b _0819ABDE - .pool -_0819ABDC: - movs r0, 0x5 -_0819ABDE: - strb r0, [r1, 0x3] - ldr r2, [r2] - ldrb r3, [r2, 0x3] - ldr r4, =gSprites - ldrb r0, [r2, 0x4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - movs r0, 0x6C - muls r0, r3 - adds r2, r0 - ldrh r2, [r2, 0xE] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r4 - ldrh r0, [r0, 0x20] - strh r0, [r1, 0x20] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819ABA8 - - thumb_func_start sub_819AC10 -sub_819AC10: @ 819AC10 - push {lr} - lsls r0, 24 - cmp r0, 0 - ble _0819AC30 - ldr r0, =gUnknown_0300127C - ldr r1, [r0] - ldrb r3, [r1] - adds r2, r0, 0 - cmp r3, 0x2 - beq _0819AC2C - adds r0, r3, 0x1 - b _0819AC46 - .pool -_0819AC2C: - movs r0, 0 - b _0819AC46 -_0819AC30: - ldr r0, =gUnknown_0300127C - ldr r1, [r0] - ldrb r3, [r1] - adds r2, r0, 0 - cmp r3, 0 - beq _0819AC44 - subs r0, r3, 0x1 - b _0819AC46 - .pool -_0819AC44: - movs r0, 0x2 -_0819AC46: - strb r0, [r1] - ldr r3, =gSprites - ldr r2, [r2] - ldrb r0, [r2, 0x1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r0, [r2] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - ldrb r0, [r2, 0x2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r0, [r2] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - pop {r0} - bx r0 - .pool - thumb_func_end sub_819AC10 - - thumb_func_start sub_819AC78 -sub_819AC78: @ 819AC78 - push {lr} - lsls r0, 24 - cmp r0, 0 - ble _0819AC98 - ldr r0, =gUnknown_0300127C - ldr r1, [r0] - ldrb r3, [r1, 0x7] - adds r2, r0, 0 - cmp r3, 0x1 - beq _0819AC94 - adds r0, r3, 0x1 - b _0819ACAE - .pool -_0819AC94: - movs r0, 0 - b _0819ACAE -_0819AC98: - ldr r0, =gUnknown_0300127C - ldr r1, [r0] - ldrb r3, [r1, 0x7] - adds r2, r0, 0 - cmp r3, 0 - beq _0819ACAC - subs r0, r3, 0x1 - b _0819ACAE - .pool -_0819ACAC: - movs r0, 0x1 -_0819ACAE: - strb r0, [r1, 0x7] - ldr r3, =gSprites - ldr r2, [r2] - ldrb r0, [r2, 0x1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r0, [r2, 0x7] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - ldrb r0, [r2, 0x2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r0, [r2, 0x7] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - pop {r0} - bx r0 - .pool - thumb_func_end sub_819AC78 - - thumb_func_start sub_819ACE0 -sub_819ACE0: @ 819ACE0 - push {r4-r6,lr} - ldr r5, =gUnknown_0300127C - ldr r0, [r5] - ldrb r6, [r0, 0x3] - movs r1, 0x6C - adds r4, r6, 0 - muls r4, r1 - adds r0, r4 - ldrb r0, [r0, 0x10] - cmp r0, 0 - beq _0819AD60 - movs r0, 0x64 - bl IndexOfSpritePaletteTag - lsls r0, 24 - lsrs r3, r0, 24 - ldr r1, [r5] - ldrb r0, [r1, 0x5] - cmp r0, 0x3 - bne _0819AD44 - adds r0, r1, r4 - ldrb r0, [r0, 0x10] - cmp r0, 0x1 - bne _0819AD44 - movs r2, 0 - ldrb r0, [r1, 0x10] - cmp r0, 0x2 - beq _0819AD32 - movs r4, 0x6C -_0819AD1A: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x5 - bhi _0819AD32 - ldr r0, [r5] - adds r1, r2, 0 - muls r1, r4 - adds r0, r1 - ldrb r0, [r0, 0x10] - cmp r0, 0x2 - bne _0819AD1A -_0819AD32: - cmp r2, 0x6 - beq _0819AD9C - ldr r0, =gUnknown_0300127C - ldr r1, [r0] - movs r0, 0x6C - muls r0, r2 - adds r1, r0 - movs r0, 0x1 - strb r0, [r1, 0x10] -_0819AD44: - ldr r2, =gUnknown_0300127C - ldr r1, [r2] - movs r0, 0x6C - muls r0, r6 - adds r1, r0 - movs r0, 0 - strb r0, [r1, 0x10] - ldr r1, [r2] - ldrb r0, [r1, 0x5] - subs r0, 0x1 - b _0819AD78 - .pool -_0819AD60: - movs r0, 0x65 - bl IndexOfSpritePaletteTag - lsls r0, 24 - lsrs r3, r0, 24 - ldr r0, [r5] - adds r1, r0, r4 - ldrb r0, [r0, 0x5] - strb r0, [r1, 0x10] - ldr r1, [r5] - ldrb r0, [r1, 0x5] - adds r0, 0x1 -_0819AD78: - strb r0, [r1, 0x5] - ldr r2, =gSprites - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - movs r1, 0x6C - muls r1, r6 - adds r0, r1 - ldrh r0, [r0, 0xE] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - lsls r3, 4 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r3 - strb r0, [r1, 0x5] -_0819AD9C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819ACE0 - - thumb_func_start sub_819ADAC -sub_819ADAC: @ 819ADAC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - movs r1, 0x6C - muls r1, r4 - adds r0, r1 - ldrb r0, [r0, 0x10] - cmp r0, 0 - beq _0819ADCC - movs r0, 0x65 - b _0819ADCE - .pool -_0819ADCC: - movs r0, 0x64 -_0819ADCE: - bl IndexOfSpritePaletteTag - lsls r0, 24 - lsrs r3, r0, 24 - ldr r2, =gSprites - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - movs r1, 0x6C - muls r1, r4 - adds r0, r1 - ldrh r0, [r0, 0xE] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - lsls r3, 4 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r3 - strb r0, [r1, 0x5] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819ADAC - - thumb_func_start sub_819AE08 -sub_819AE08: @ 819AE08 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r6, r0, r1 - movs r1, 0x8 - ldrsh r0, [r6, r1] - cmp r0, 0x7 - beq _0819AE64 - cmp r0, 0x7 - bgt _0819AE30 - cmp r0, 0x6 - beq _0819AE36 - b _0819AF50 - .pool -_0819AE30: - cmp r0, 0x8 - beq _0819AEE8 - b _0819AF50 -_0819AE36: - ldr r1, =gPlttBufferUnfaded - ldr r0, =gPlttBufferFaded - movs r2, 0xE4 - lsls r2, 1 - adds r0, r2 - ldrh r0, [r0] - adds r1, r2 - movs r2, 0 - strh r0, [r1] - movs r0, 0x1 - negs r0, r0 - str r2, [sp] - movs r1, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - movs r0, 0x7 - strh r0, [r6, 0x8] - b _0819AF50 - .pool -_0819AE64: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _0819AF50 - ldr r4, =gUnknown_0300127C - ldr r0, [r4] - ldr r2, =0x000002a1 - adds r0, r2 - ldrb r0, [r0] - bl DestroyTask - ldr r1, [r4] - movs r3, 0xA6 - lsls r3, 2 - adds r0, r1, r3 - ldr r0, [r0] - movs r2, 0xA8 - lsls r2, 2 - adds r1, r2 - bl sub_819F444 - bl sub_819AB40 - ldr r4, =gUnknown_0203CE2C - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203CE30 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203CE34 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203CE38 - ldr r0, [r4] - bl Free - str r5, [r4] - bl FreeAllWindowBuffers - movs r0, 0x8 - strh r0, [r6, 0x8] - b _0819AF50 - .pool -_0819AEE8: - ldr r4, =gUnknown_0300127C - ldr r1, [r4] - ldr r0, =gPlttBufferUnfaded - movs r3, 0xE4 - lsls r3, 1 - adds r0, r3 - ldrh r0, [r0] - adds r3, 0xDC - adds r1, r3 - strh r0, [r1] - adds r0, r2, 0 - bl DestroyTask - ldr r1, [r4] - movs r0, 0x1 - strb r0, [r1, 0x6] - ldr r0, [r4] - ldrb r6, [r0, 0x3] - ldr r4, =gUnknown_0203CE3C - movs r0, 0x96 - lsls r0, 2 - bl AllocZeroed - str r0, [r4] - movs r4, 0 -_0819AF1A: - ldr r5, =gUnknown_0203CE3C - ldr r1, [r5] - movs r0, 0x64 - muls r0, r4 - adds r0, r1 - ldr r1, =gUnknown_0300127C - ldr r1, [r1] - movs r2, 0x6C - muls r2, r4 - adds r1, r2 - adds r1, 0x14 - movs r2, 0x64 - bl memcpy - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _0819AF1A - ldr r1, [r5] - ldr r0, =sub_819A514 - str r0, [sp] - movs r0, 0x1 - adds r2, r6, 0 - movs r3, 0x5 - bl sub_81BF8EC -_0819AF50: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819AE08 - - thumb_func_start bc_exit_to_overworld -bc_exit_to_overworld: @ 819AF68 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r7, =gUnknown_0300127C - ldr r0, [r7] - movs r1, 0xA8 - lsls r1, 2 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0819B00E - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r1, [r4, r0] - cmp r1, 0 - beq _0819AFA0 - cmp r1, 0x1 - beq _0819AFB8 - b _0819B00E - .pool -_0819AFA0: - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0819B00E -_0819AFB8: - bl UpdatePaletteFade - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _0819B00E - bl sub_819B764 - ldr r0, [r7] - ldr r1, =0x000002a1 - adds r0, r1 - ldrb r0, [r0] - bl DestroyTask - bl sub_819AB40 - ldr r4, =gUnknown_0203CE2C - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203CE34 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203CE38 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r0, [r7] - bl Free - str r5, [r7] - bl FreeAllWindowBuffers - ldr r0, =sub_80861B0 - bl SetMainCallback2 - adds r0, r6, 0 - bl DestroyTask -_0819B00E: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end bc_exit_to_overworld - - thumb_func_start sub_819B02C -sub_819B02C: @ 819B02C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r7, =gUnknown_0300127C - ldr r0, [r7] - movs r1, 0xA8 - lsls r1, 2 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0819B11A - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r5, r0, r1 - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0x5 - beq _0819B084 - cmp r0, 0x5 - bgt _0819B06C - cmp r0, 0x4 - beq _0819B07A - b _0819B11A - .pool -_0819B06C: - cmp r0, 0xA - bne _0819B11A - bl sub_819C4B4 - movs r0, 0x4 - strh r0, [r5, 0x8] - b _0819B11A -_0819B07A: - bl sub_819B8D4 - movs r0, 0x5 - strh r0, [r5, 0x8] - b _0819B11A -_0819B084: - ldr r2, =gMain - ldrh r1, [r2, 0x2E] - movs r0, 0x1 - mov r8, r0 - movs r6, 0x1 - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - beq _0819B0B8 - movs r0, 0x5 - bl PlaySE - ldr r0, [r7] - ldrb r4, [r0, 0x7] - cmp r4, 0 - bne _0819B0C6 - bl sub_819C568 - strh r4, [r5, 0x8] - ldr r0, =bc_exit_to_overworld - str r0, [r5] - b _0819B11A - .pool -_0819B0B8: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0819B0EC - movs r0, 0x5 - bl PlaySE -_0819B0C6: - movs r0, 0x4 - bl sub_819B958 - bl sub_819BC9C - ldr r0, [r7] - ldr r1, =0x000002a2 - adds r0, r1 - mov r1, r8 - strb r1, [r0] - strh r6, [r5, 0x8] - ldr r0, =sub_819B378 - str r0, [r5] - b _0819B11A - .pool -_0819B0EC: - ldrh r1, [r2, 0x30] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0819B106 - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - negs r0, r0 - bl sub_819AC78 - b _0819B11A -_0819B106: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0819B11A - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - bl sub_819AC78 -_0819B11A: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_819B02C - - thumb_func_start sub_819B124 -sub_819B124: @ 819B124 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldrh r0, [r0, 0x8] - subs r0, 0x2 - lsls r0, 16 - asrs r0, 16 - adds r6, r1, 0 - cmp r0, 0xB - bls _0819B144 - b _0819B36E -_0819B144: - lsls r0, 2 - ldr r1, =_0819B158 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0819B158: - .4byte _0819B188 - .4byte _0819B1EC - .4byte _0819B36E - .4byte _0819B36E - .4byte _0819B36E - .4byte _0819B36E - .4byte _0819B36E - .4byte _0819B1BC - .4byte _0819B36E - .4byte _0819B36E - .4byte _0819B300 - .4byte _0819B35C -_0819B188: - ldr r0, =gUnknown_0300127C - ldr r1, [r0] - ldrb r0, [r1, 0x6] - cmp r0, 0 - bne _0819B1A2 - ldr r2, =0x00000299 - adds r0, r1, r2 - movs r7, 0xA8 - lsls r7, 2 - adds r1, r7 - movs r2, 0 - bl sub_819F2B4 -_0819B1A2: - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - movs r0, 0x9 - b _0819B36C - .pool -_0819B1BC: - ldr r4, =gUnknown_0300127C - ldr r0, [r4] - movs r1, 0xA8 - lsls r1, 2 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _0819B1CE - b _0819B36E -_0819B1CE: - bl sub_819B844 - ldr r1, [r4] - movs r0, 0 - strb r0, [r1, 0x6] - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - b _0819B344 - .pool -_0819B1EC: - ldr r2, =gMain - ldrh r1, [r2, 0x2E] - movs r7, 0x1 - movs r6, 0x1 - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - beq _0819B27C - movs r0, 0x5 - bl PlaySE - bl sub_819BC04 - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - cmp r0, 0x1 - bne _0819B228 - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - ldr r2, =0x000002a2 - adds r0, r2 - b _0819B2AC - .pool -_0819B228: - cmp r0, 0x2 - bne _0819B248 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0xA - strh r1, [r0, 0x8] - ldr r1, =sub_819B02C - str r1, [r0] - b _0819B36E - .pool -_0819B248: - cmp r1, 0x3 - bne _0819B260 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0xB - strh r1, [r0, 0x8] - b _0819B2BA - .pool -_0819B260: - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0x6 - strh r1, [r0, 0x8] - ldr r1, =sub_819AE08 - str r1, [r0] - b _0819B36E - .pool -_0819B27C: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0819B2D0 - movs r0, 0x5 - bl PlaySE - ldr r4, =gUnknown_0300127C - ldr r1, [r4] - movs r2, 0xA6 - lsls r2, 2 - adds r0, r1, r2 - ldr r0, [r0] - adds r2, 0x8 - adds r1, r2 - movs r2, 0 - bl sub_819F3F8 - movs r0, 0x3 - bl sub_819B958 - ldr r0, [r4] - ldr r1, =0x000002a2 - adds r0, r1 -_0819B2AC: - strb r7, [r0] - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - strh r6, [r0, 0x8] -_0819B2BA: - ldr r1, =sub_819B378 - str r1, [r0] - b _0819B36E - .pool -_0819B2D0: - ldrh r1, [r2, 0x30] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0819B2EA - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - negs r0, r0 - bl sub_819AC10 - b _0819B36E -_0819B2EA: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0819B36E - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - bl sub_819AC10 - b _0819B36E -_0819B300: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - bne _0819B36E - ldr r4, =gUnknown_0300127C - ldr r2, [r4] - ldrb r0, [r2, 0x6] - cmp r0, 0x1 - bne _0819B338 - ldr r1, =gPlttBufferFaded - movs r7, 0xA9 - lsls r7, 2 - adds r0, r2, r7 - ldrh r0, [r0] - movs r2, 0xE4 - lsls r2, 1 - adds r1, r2 - strh r0, [r1] - ldr r0, =gPlttBufferUnfaded - subs r7, 0xBC - adds r1, r0, r7 - ldrh r1, [r1] - adds r0, r2 - strh r1, [r0] -_0819B338: - ldr r0, [r4] - strb r3, [r0, 0x6] - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r6 -_0819B344: - movs r1, 0x3 - strh r1, [r0, 0x8] - b _0819B36E - .pool -_0819B35C: - bl sub_819B844 - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - movs r0, 0xC -_0819B36C: - strh r0, [r1, 0x8] -_0819B36E: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819B124 - - thumb_func_start sub_819B378 -sub_819B378: @ 819B378 - push {r4-r7,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r5, =gUnknown_0300127C - ldr r3, [r5] - movs r7, 0xA8 - lsls r7, 2 - adds r0, r3, r7 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0819B476 - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r1, [r4, r0] - cmp r1, 0x1 - beq _0819B3DC - cmp r1, 0x1 - bgt _0819B3B4 - cmp r1, 0 - beq _0819B3BA - b _0819B476 - .pool -_0819B3B4: - cmp r1, 0xB - beq _0819B440 - b _0819B476 -_0819B3BA: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0819B476 - movs r0, 0x1 - movs r1, 0x1 - strh r1, [r4, 0x8] - ldr r2, =0x000002a2 - adds r1, r3, r2 - strb r0, [r1] - b _0819B476 - .pool -_0819B3DC: - ldr r2, =gMain - ldrh r0, [r2, 0x2E] - ands r1, r0 - cmp r1, 0 - beq _0819B40C - movs r0, 0x5 - bl PlaySE - ldr r0, [r5] - ldr r1, =0x000002a2 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - movs r0, 0x2 - strh r0, [r4, 0x8] - ldr r0, =sub_819B124 - str r0, [r4] - b _0819B476 - .pool -_0819B40C: - ldrh r1, [r2, 0x30] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0819B422 - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - negs r0, r0 - b _0819B432 -_0819B422: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0819B476 - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 -_0819B432: - bl sub_819ABA8 - bl sub_819BCF8 - bl sub_819B9E8 - b _0819B476 -_0819B440: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r6, 0x1 - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - beq _0819B476 - movs r0, 0x5 - bl PlaySE - ldr r1, [r5] - movs r2, 0xA6 - lsls r2, 2 - adds r0, r1, r2 - ldr r0, [r0] - adds r1, r7 - movs r2, 0 - bl sub_819F3F8 - bl sub_819BA64 - ldr r0, [r5] - ldr r1, =0x000002a2 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - strh r6, [r4, 0x8] -_0819B476: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819B378 - - thumb_func_start sub_819B484 -sub_819B484: @ 819B484 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x10] - movs r6, 0 - add r0, sp, 0xC - strb r6, [r0] - ldr r0, =0x000040ce - bl VarGet - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - ldr r7, =gSaveBlock2Ptr - ldr r2, [r7] - ldr r0, =0x00000ca9 - adds r4, r2, r0 - ldrb r0, [r4] - lsls r0, 30 - lsrs r0, 30 - adds r5, r0, 0 - lsls r0, r5, 1 - lsls r1, r6, 2 - adds r0, r1 - ldr r1, =0x00000de2 - adds r2, r1 - adds r2, r0 - ldrh r0, [r2] - movs r1, 0x7 - bl __udivsi3 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x18] - ldr r1, =gUnknown_0203BC8C - ldr r0, =gBattleFrontierMons - str r0, [r1] - ldrb r1, [r4] - movs r0, 0x3 - ands r0, r1 - movs r2, 0x32 - str r2, [sp, 0x14] - cmp r0, 0 - beq _0819B4EA - movs r3, 0x64 - str r3, [sp, 0x14] -_0819B4EA: - adds r0, r6, 0 - adds r1, r5, 0 - bl sub_81A6F70 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x1C] - ldr r1, [r7] - ldrb r0, [r1, 0xA] - mov r9, r0 - ldrb r0, [r1, 0xB] - lsls r0, 8 - mov r2, r9 - orrs r2, r0 - ldrb r0, [r1, 0xC] - lsls r0, 16 - orrs r2, r0 - ldrb r0, [r1, 0xD] - lsls r0, 24 - orrs r2, r0 - mov r9, r2 - movs r3, 0 - mov r8, r3 -_0819B518: - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - mov r2, r8 - lsls r0, r2, 1 - add r0, r8 - lsls r0, 2 - adds r1, r0 - movs r3, 0xE7 - lsls r3, 4 - adds r1, r3 - ldrh r5, [r1] - ldr r0, =gUnknown_0300127C - ldr r1, [r0] - ldr r2, [sp, 0x10] - add r2, r8 - movs r3, 0x6C - adds r0, r2, 0 - muls r0, r3 - adds r1, r0 - strh r5, [r1, 0xC] - mov r10, r2 - ldr r0, [sp, 0x1C] - cmp r8, r0 - bcs _0819B570 - ldr r0, [sp, 0x18] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - b _0819B572 - .pool -_0819B570: - ldr r0, [sp, 0x18] -_0819B572: - movs r1, 0 - bl sub_81A6CA8 - lsls r0, 24 - lsrs r6, r0, 24 - movs r1, 0x6C - mov r4, r10 - muls r4, r1 - adds r4, 0xC - ldr r2, =gUnknown_0300127C - ldr r0, [r2] - adds r0, r4 - adds r0, 0x8 - ldr r1, =gUnknown_0203BC8C - ldr r2, [r1] - lsls r5, 4 - adds r2, r5, r2 - ldrh r1, [r2] - ldrb r3, [r2, 0xC] - str r6, [sp] - ldrb r2, [r2, 0xB] - str r2, [sp, 0x4] - mov r2, r9 - str r2, [sp, 0x8] - ldr r2, [sp, 0x14] - bl sub_8068634 - movs r1, 0 - add r0, sp, 0xC - strb r1, [r0] - movs r6, 0 - adds r7, r5, 0 - movs r3, 0x1 - add r8, r3 - ldr r3, =gUnknown_0300127C -_0819B5B8: - ldr r0, [r3] - adds r0, r4 - adds r0, 0x8 - ldr r5, =gUnknown_0203BC8C - ldr r1, [r5] - adds r1, r7, r1 - lsls r2, r6, 1 - adds r1, 0x2 - adds r1, r2 - ldrh r1, [r1] - adds r2, r6, 0 - str r3, [sp, 0x20] - bl sub_81A7024 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r3, [sp, 0x20] - cmp r6, 0x3 - bls _0819B5B8 - movs r0, 0x6C - mov r4, r10 - muls r4, r0 - adds r4, 0xC - ldr r1, =gUnknown_0300127C - ldr r0, [r1] - adds r0, r4 - adds r0, 0x8 - movs r1, 0x20 - add r2, sp, 0xC - bl SetMonData - ldr r2, =gUnknown_0300127C - ldr r0, [r2] - adds r0, r4 - adds r0, 0x8 - ldr r1, [r5] - adds r1, r7, r1 - ldrb r2, [r1, 0xA] - lsls r2, 1 - ldr r1, =gBattleFrontierHeldItems - adds r2, r1 - movs r1, 0xC - bl SetMonData - mov r3, r8 - lsls r0, r3, 24 - lsrs r0, 24 - mov r8, r0 - cmp r0, 0x5 - bhi _0819B620 - b _0819B518 -_0819B620: - add sp, 0x24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819B484 - - thumb_func_start sub_819B63C -sub_819B63C: @ 819B63C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x10] - add r0, sp, 0xC - movs r1, 0 - strb r1, [r0] - ldr r2, =gUnknown_0203BC8C - ldr r0, =gSlateportBattleTentMons - str r0, [r2] - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldrb r3, [r1, 0xA] - ldrb r0, [r1, 0xB] - lsls r0, 8 - orrs r3, r0 - ldrb r0, [r1, 0xC] - lsls r0, 16 - orrs r3, r0 - ldrb r0, [r1, 0xD] - lsls r0, 24 - orrs r3, r0 - mov r10, r3 - movs r7, 0 - mov r9, r7 -_0819B678: - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - mov r2, r9 - lsls r0, r2, 1 - add r0, r9 - lsls r0, 2 - adds r1, r0 - movs r3, 0xE7 - lsls r3, 4 - adds r1, r3 - ldrh r1, [r1] - mov r8, r1 - ldr r7, =gUnknown_0300127C - ldr r0, [r7] - ldr r6, [sp, 0x10] - add r6, r9 - movs r1, 0x6C - adds r4, r6, 0 - muls r4, r1 - adds r1, r0, r4 - mov r2, r8 - strh r2, [r1, 0xC] - adds r4, 0xC - adds r0, r4 - adds r0, 0x8 - ldr r3, =gUnknown_0203BC8C - ldr r2, [r3] - mov r7, r8 - lsls r5, r7, 4 - adds r2, r5, r2 - ldrh r1, [r2] - ldrb r3, [r2, 0xC] - movs r7, 0 - str r7, [sp] - ldrb r2, [r2, 0xB] - str r2, [sp, 0x4] - mov r2, r10 - str r2, [sp, 0x8] - movs r2, 0x1E - bl sub_8068634 - add r0, sp, 0xC - movs r3, 0 - strb r3, [r0] - movs r0, 0x1 - add r9, r0 -_0819B6D4: - ldr r1, =gUnknown_0300127C - ldr r0, [r1] - adds r0, r4 - adds r0, 0x8 - ldr r3, =gUnknown_0203BC8C - ldr r2, [r3] - mov r3, r8 - lsls r1, r3, 4 - adds r1, r2 - lsls r2, r7, 1 - adds r1, 0x2 - adds r1, r2 - ldrh r1, [r1] - adds r2, r7, 0 - bl sub_81A7024 - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x3 - bls _0819B6D4 - movs r7, 0x6C - adds r4, r6, 0 - muls r4, r7 - adds r4, 0xC - ldr r1, =gUnknown_0300127C - ldr r0, [r1] - adds r0, r4 - adds r0, 0x8 - movs r1, 0x20 - add r2, sp, 0xC - bl SetMonData - ldr r2, =gUnknown_0300127C - ldr r0, [r2] - adds r0, r4 - adds r0, 0x8 - ldr r3, =gUnknown_0203BC8C - ldr r1, [r3] - adds r1, r5, r1 - ldrb r2, [r1, 0xA] - lsls r2, 1 - ldr r1, =gBattleFrontierHeldItems - adds r2, r1 - movs r1, 0xC - bl SetMonData - mov r7, r9 - lsls r0, r7, 24 - lsrs r0, 24 - mov r9, r0 - cmp r0, 0x5 - bls _0819B678 - add sp, 0x14 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819B63C - - thumb_func_start sub_819B764 -sub_819B764: @ 819B764 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r7, 0 - ldr r0, =gUnknown_0300127C - mov r10, r0 - ldr r1, =gSaveBlock2Ptr - mov r8, r1 -_0819B778: - movs r2, 0 - adds r0, r7, 0x1 - mov r9, r0 -_0819B77E: - mov r1, r10 - ldr r0, [r1] - movs r1, 0x6C - adds r6, r2, 0 - muls r6, r1 - adds r1, r0, r6 - ldrb r0, [r1, 0x10] - cmp r0, r9 - bne _0819B81C - movs r0, 0x64 - adds r5, r7, 0 - muls r5, r0 - ldr r2, =gPlayerParty - adds r5, r2 - adds r1, 0x14 - adds r0, r5, 0 - movs r2, 0x64 - bl memcpy - mov r0, r8 - ldr r1, [r0] - lsls r4, r7, 1 - adds r4, r7 - lsls r4, 2 - adds r1, r4 - mov r2, r10 - ldr r0, [r2] - adds r0, r6 - ldrh r0, [r0, 0xC] - movs r2, 0xE7 - lsls r2, 4 - adds r1, r2 - strh r0, [r1] - adds r0, r5, 0 - movs r1, 0 - movs r2, 0 - bl GetMonData - mov r2, r8 - ldr r1, [r2] - ldr r2, =0x00000e74 - adds r1, r2 - adds r1, r4 - str r0, [r1] - adds r0, r5, 0 - movs r1, 0x2E - movs r2, 0 - bl GetBoxMonData - mov r2, r8 - ldr r1, [r2] - adds r1, r4 - ldr r2, =0x00000e79 - adds r1, r2 - strb r0, [r1] - adds r0, r5, 0 - movs r1, 0x28 - movs r2, 0 - bl GetBoxMonData - mov r2, r8 - ldr r1, [r2] - adds r1, r4 - ldr r2, =0x00000e78 - adds r1, r2 - strb r0, [r1] - b _0819B826 - .pool -_0819B81C: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x5 - bls _0819B77E -_0819B826: - mov r1, r9 - lsls r0, r1, 24 - lsrs r7, r0, 24 - cmp r7, 0x2 - bls _0819B778 - bl CalculatePlayerPartyCount - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_819B764 - - thumb_func_start sub_819B844 -sub_819B844: @ 819B844 - push {r4,r5,lr} - ldr r5, =gUnknown_0300127C - ldr r1, [r5] - ldrb r0, [r1, 0x6] - cmp r0, 0 - bne _0819B852 - strb r0, [r1] -_0819B852: - ldr r4, =gSprites - ldr r2, [r5] - ldrb r1, [r2, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xB0 - strh r1, [r0, 0x20] - ldrb r0, [r2, 0x1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r0, [r2] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - ldrb r1, [r2, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xD0 - strh r1, [r0, 0x20] - ldrb r0, [r2, 0x2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r0, [r2] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - ldrb r0, [r2, 0x1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r1] - ldr r0, [r5] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - ands r2, r1 - strb r2, [r0] - bl sub_819BAFC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819B844 - - thumb_func_start sub_819B8D4 -sub_819B8D4: @ 819B8D4 - push {r4,r5,lr} - ldr r5, =gUnknown_0300127C - ldr r1, [r5] - movs r0, 0 - strb r0, [r1, 0x7] - ldr r4, =gSprites - ldr r2, [r5] - ldrb r1, [r2, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xB0 - strh r1, [r0, 0x20] - ldrb r1, [r2, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r3, 0x70 - strh r3, [r0, 0x22] - ldrb r1, [r2, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xD0 - strh r1, [r0, 0x20] - ldrb r1, [r2, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r3, [r0, 0x22] - ldrb r0, [r2, 0x1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r1] - ldr r0, [r5] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - ands r2, r1 - strb r2, [r0] - bl sub_819BBA8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819B8D4 - - thumb_func_start sub_819B958 -sub_819B958: @ 819B958 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =gSprites - ldr r3, =gUnknown_0300127C - ldr r0, [r3] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldr r0, [r3] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r4, 0 - movs r1, 0x2 - bl CopyWindowToVram - adds r0, r4, 0 - bl ClearWindowTilemap - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819B958 - - thumb_func_start sub_819B9B4 -sub_819B9B4: @ 819B9B4 - push {lr} - sub sp, 0xC - movs r0, 0 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r2, =gUnknown_085EEBB2 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x2 - bl PrintTextOnWindow - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_819B9B4 - - thumb_func_start sub_819B9E8 -sub_819B9E8: @ 819B9E8 - push {r4,r5,lr} - sub sp, 0xC - ldr r5, =gUnknown_0300127C - ldr r0, [r5] - ldrb r4, [r0, 0x3] - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x6C - muls r0, r4 - ldr r1, [r5] - adds r0, r1 - adds r0, 0x14 - movs r1, 0xB - movs r2, 0 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - ldr r4, =gStringVar4 - movs r1, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - adds r0, r4, 0 - bl StringCopy - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x56 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_08610479 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r3, 0x1 - bl box_print - movs r0, 0x1 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819B9E8 - - thumb_func_start sub_819BA64 -sub_819BA64: @ 819BA64 - push {lr} - sub sp, 0xC - movs r0, 0x2 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - ldrb r0, [r0, 0x5] - cmp r0, 0x1 - bne _0819BA88 - ldr r2, =gUnknown_085EEBC1 - b _0819BA9C - .pool -_0819BA88: - cmp r0, 0x2 - bne _0819BA94 - ldr r2, =gUnknown_085EEBDB - b _0819BA9C - .pool -_0819BA94: - ldr r2, =gUnknown_085EEC2D - cmp r0, 0x3 - bne _0819BA9C - ldr r2, =gUnknown_085EEBF6 -_0819BA9C: - movs r0, 0x5 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x1 - movs r3, 0x2 - bl PrintTextOnWindow - movs r0, 0x2 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_819BA64 - - thumb_func_start sub_819BAC8 -sub_819BAC8: @ 819BAC8 - push {lr} - sub sp, 0xC - movs r0, 0x2 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r2, =gUnknown_085EEC50 - movs r0, 0x5 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x1 - movs r3, 0x2 - bl PrintTextOnWindow - movs r0, 0x2 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_819BAC8 - - thumb_func_start sub_819BAFC -sub_819BAFC: @ 819BAFC - push {r4-r6,lr} - sub sp, 0xC - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - ldrb r2, [r0, 0x3] - movs r1, 0x6C - muls r1, r2 - adds r0, r1 - ldrb r5, [r0, 0x10] - movs r0, 0x3 - bl PutWindowTilemap - movs r0, 0x3 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r4, =gUnknown_08610476 - str r4, [sp] - movs r6, 0 - str r6, [sp, 0x4] - ldr r0, =gUnknown_085EEC15 - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0x7 - movs r3, 0x1 - bl box_print - cmp r5, 0 - beq _0819BB60 - str r4, [sp] - str r6, [sp, 0x4] - ldr r0, =gUnknown_085EEC24 - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0x7 - movs r3, 0x11 - bl box_print - b _0819BB74 - .pool -_0819BB60: - str r4, [sp] - str r5, [sp, 0x4] - ldr r0, =gUnknown_085EEC10 - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0x7 - movs r3, 0x11 - bl box_print -_0819BB74: - ldr r0, =gUnknown_08610476 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - ldr r0, =gUnknown_085EEC1D - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0x7 - movs r3, 0x21 - bl box_print - movs r0, 0x3 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819BAFC - - thumb_func_start sub_819BBA8 -sub_819BBA8: @ 819BBA8 - push {r4,r5,lr} - sub sp, 0xC - movs r0, 0x4 - bl PutWindowTilemap - movs r0, 0x4 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r5, =gUnknown_08610476 - str r5, [sp] - movs r4, 0 - str r4, [sp, 0x4] - ldr r0, =gUnknown_085EEC49 - str r0, [sp, 0x8] - movs r0, 0x4 - movs r1, 0x1 - movs r2, 0x7 - movs r3, 0x1 - bl box_print - str r5, [sp] - str r4, [sp, 0x4] - ldr r0, =gUnknown_085EEC4D - str r0, [sp, 0x8] - movs r0, 0x4 - movs r1, 0x1 - movs r2, 0x7 - movs r3, 0x11 - bl box_print - movs r0, 0x4 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819BBA8 - - thumb_func_start sub_819BC04 -sub_819BC04: @ 819BC04 - push {lr} - ldr r2, =gUnknown_030062E8 - ldr r1, =gUnknown_0861041C - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - str r0, [r2] - bl _call_via_r0 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_819BC04 - - thumb_func_start sub_819BC30 -sub_819BC30: @ 819BC30 - push {r4,lr} - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - ldrb r2, [r0, 0x3] - movs r1, 0x6C - muls r1, r2 - adds r0, r1 - ldrb r1, [r0, 0x10] - ldrh r0, [r0, 0xC] - cmp r1, 0 - bne _0819BC60 - bl sub_819C634 - cmp r0, 0 - bne _0819BC60 - bl sub_819BAC8 - movs r0, 0x3 - bl sub_819B958 - movs r0, 0x3 - b _0819BC96 - .pool -_0819BC60: - ldr r4, =gUnknown_0300127C - ldr r1, [r4] - movs r2, 0xA6 - lsls r2, 2 - adds r0, r1, r2 - ldr r0, [r0] - adds r2, 0x8 - adds r1, r2 - movs r2, 0 - bl sub_819F3F8 - bl sub_819ACE0 - bl sub_819BA64 - movs r0, 0x3 - bl sub_819B958 - ldr r0, [r4] - ldrb r0, [r0, 0x5] - cmp r0, 0x3 - bhi _0819BC94 - movs r0, 0x1 - b _0819BC96 - .pool -_0819BC94: - movs r0, 0x2 -_0819BC96: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_819BC30 - - thumb_func_start sub_819BC9C -sub_819BC9C: @ 819BC9C - push {lr} - bl sub_819C568 - bl sub_819ACE0 - bl sub_819BA64 - movs r0, 0x3 - bl sub_819B958 - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - ldrb r0, [r0, 0x5] - cmp r0, 0x3 - bhi _0819BCC4 - movs r0, 0x1 - b _0819BCC6 - .pool -_0819BCC4: - movs r0, 0x2 -_0819BCC6: - pop {r1} - bx r1 - thumb_func_end sub_819BC9C - - thumb_func_start sub_819BCCC -sub_819BCCC: @ 819BCCC - movs r0, 0 - bx lr - thumb_func_end sub_819BCCC - - thumb_func_start sub_819BCD0 -sub_819BCD0: @ 819BCD0 - push {lr} - ldr r0, =gUnknown_0300127C - ldr r1, [r0] - movs r2, 0xA6 - lsls r2, 2 - adds r0, r1, r2 - ldr r0, [r0] - adds r2, 0x8 - adds r1, r2 - movs r2, 0 - bl sub_819F3F8 - movs r0, 0x3 - bl sub_819B958 - movs r0, 0x1 - pop {r1} - bx r1 - .pool - thumb_func_end sub_819BCD0 - - thumb_func_start sub_819BCF8 -sub_819BCF8: @ 819BCF8 - push {r4,r5,lr} - sub sp, 0x2C - ldr r5, =gUnknown_0300127C - ldr r0, [r5] - ldrb r4, [r0, 0x3] - cmp r4, 0x5 - bhi _0819BD64 - movs r0, 0x5 - bl PutWindowTilemap - movs r0, 0x5 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x6C - muls r0, r4 - ldr r1, [r5] - adds r0, r1 - adds r0, 0x14 - movs r1, 0xB - movs r2, 0 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - add r1, sp, 0xC - bl sub_81DB468 - movs r0, 0x1 - add r1, sp, 0xC - movs r2, 0x76 - bl GetStringRightAlignXOffset - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x5 - movs r1, 0x1 - add r2, sp, 0xC - bl PrintTextOnWindow - movs r0, 0x5 - movs r1, 0x2 - bl CopyWindowToVram -_0819BD64: - add sp, 0x2C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819BCF8 - - thumb_func_start sub_819BD70 -sub_819BD70: @ 819BD70 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x10 - ldr r6, =gUnknown_0300127C - ldr r2, [r6] - ldrb r1, [r2, 0x3] - movs r0, 0x6C - adds r4, r1, 0 - muls r4, r0 - adds r4, r2 - adds r4, 0x14 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - bl GetMonData - mov r8, r0 - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0 - bl GetMonData - adds r1, r0, 0 - movs r0, 0x58 - str r0, [sp] - movs r0, 0x20 - str r0, [sp, 0x4] - movs r0, 0xF - str r0, [sp, 0x8] - ldr r0, =0x0000ffff - str r0, [sp, 0xC] - adds r0, r5, 0 - mov r2, r8 - movs r3, 0x1 - bl sub_818D7D8 - ldr r1, [r6] - movs r2, 0xA6 - lsls r2, 2 - adds r1, r2 - movs r3, 0 - strb r0, [r1] - ldr r4, =gSprites - ldr r0, [r6] - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x28 - strb r3, [r0] - ldr r0, [r6] - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x29 - strb r3, [r0] - ldr r0, [r6] - movs r1, 0xA8 - lsls r1, 2 - adds r0, r1 - strb r3, [r0] - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819BD70 - - thumb_func_start sub_819BE20 -sub_819BE20: @ 819BE20 - ldr r1, =gUnknown_0300127C - ldr r1, [r1] - movs r2, 0xA8 - lsls r2, 2 - adds r1, r2 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_819BE20 - - thumb_func_start sub_819BE34 -sub_819BE34: @ 819BE34 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - ldr r0, =gUnknown_08610638 - movs r1, 0x78 - movs r2, 0x40 - movs r3, 0x1 - bl CreateSprite - ldr r6, =gUnknown_0300127C - ldr r1, [r6] - ldr r2, =0x00000299 - mov r10, r2 - add r1, r10 - movs r7, 0 - strb r0, [r1] - ldr r0, [r6] - add r0, r10 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - mov r8, r1 - add r0, r8 - movs r1, 0x2 - bl StartSpriteAffineAnim - ldr r2, [r6] - ldrb r1, [r2, 0x3] - movs r0, 0x6C - adds r4, r1, 0 - muls r4, r0 - adds r4, r2 - adds r4, 0x14 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - bl GetMonData - mov r9, r0 - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0 - bl GetMonData - adds r1, r0, 0 - movs r0, 0x58 - str r0, [sp] - movs r0, 0x20 - str r0, [sp, 0x4] - movs r0, 0xF - str r0, [sp, 0x8] - ldr r0, =0x0000ffff - str r0, [sp, 0xC] - adds r0, r5, 0 - mov r2, r9 - movs r3, 0x1 - bl sub_818D7D8 - ldr r1, [r6] - movs r2, 0xA6 - lsls r2, 2 - adds r1, r2 - strb r0, [r1] - ldr r0, [r6] - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - adds r0, 0x28 - strb r7, [r0] - ldr r0, [r6] - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - adds r0, 0x29 - strb r7, [r0] - ldr r0, [r6] - add r0, r10 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - 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_819BE34 - - thumb_func_start sub_819BF2C -sub_819BF2C: @ 819BF2C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - movs r7, 0 - ldr r0, =gUnknown_0300127C - mov r9, r0 -_0819BF3E: - movs r2, 0 - adds r1, r7, 0x1 - mov r10, r1 - lsls r0, r7, 2 - mov r8, r0 -_0819BF48: - mov r0, r9 - ldr r1, [r0] - movs r0, 0x6C - adds r4, r2, 0 - muls r4, r0 - adds r0, r1, r4 - ldrb r0, [r0, 0x10] - cmp r0, r10 - bne _0819C008 - adds r4, r1 - adds r4, 0x14 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - bl GetMonData - adds r6, r0, 0 - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0 - bl GetMonData - adds r1, r0, 0 - lsls r0, r7, 3 - adds r0, r7 - lsls r0, 19 - movs r2, 0x80 - lsls r2, 13 - adds r0, r2 - asrs r0, 16 - str r0, [sp] - movs r0, 0x20 - str r0, [sp, 0x4] - adds r0, r7, 0 - adds r0, 0xD - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x8] - ldr r0, =0x0000ffff - str r0, [sp, 0xC] - adds r0, r5, 0 - adds r2, r6, 0 - movs r3, 0x1 - bl sub_818D7D8 - mov r2, r9 - ldr r1, [r2] - add r1, r8 - movs r2, 0xA5 - lsls r2, 2 - adds r1, r2 - strb r0, [r1] - mov r1, r9 - ldr r0, [r1] - add r0, r8 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r2, =gSprites - adds r0, r2 - adds r0, 0x28 - movs r1, 0 - strb r1, [r0] - mov r2, r9 - ldr r0, [r2] - add r0, r8 - movs r1, 0xA5 - lsls r1, 2 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r2, =gSprites - adds r0, r2 - adds r0, 0x29 - movs r1, 0 - strb r1, [r0] - b _0819C012 - .pool -_0819C008: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x5 - bls _0819BF48 -_0819C012: - mov r2, r10 - lsls r0, r2, 24 - lsrs r7, r0, 24 - cmp r7, 0x2 - bls _0819BF3E - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - movs r1, 0xA8 - lsls r1, 2 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - 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_819BF2C - - thumb_func_start sub_819C040 -sub_819C040: @ 819C040 - push {r4-r6,lr} - adds r4, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0819C0DC - ldr r3, =gSprites - ldr r6, =gUnknown_0300127C - ldr r2, [r6] - ldr r0, =0x00000295 - adds r5, r2, r0 - ldrb r0, [r5] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - adds r1, 0x3F - ldrb r0, [r1] - lsls r0, 26 - cmp r0, 0 - bge _0819C0DC - ldr r1, =0x0000029d - adds r0, r2, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 26 - cmp r0, 0 - bge _0819C0DC - adds r1, r4, 0 - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - ldrb r1, [r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - ldr r0, [r6] - ldr r1, =0x0000029d - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - ldr r0, =sub_819C1D0 - movs r1, 0x1 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r1, [r1] - bl _call_via_r1 - ldr r0, =SpriteCallbackDummy - str r0, [r4, 0x1C] -_0819C0DC: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819C040 - - thumb_func_start sub_819C100 -sub_819C100: @ 819C100 - push {r4-r7,lr} - adds r5, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0819C1BA - ldr r6, =gSprites - ldr r4, =gUnknown_0300127C - ldr r2, [r4] - ldr r7, =0x00000295 - adds r0, r2, r7 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 26 - cmp r0, 0 - bge _0819C1BA - ldr r1, =0x0000029d - adds r0, r2, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 26 - cmp r0, 0 - bge _0819C1BA - ldrb r0, [r5, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl FreeOamMatrix - ldr r0, [r4] - adds r0, r7 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl FreeOamMatrix - ldr r0, [r4] - ldr r1, =0x0000029d - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl FreeOamMatrix - ldr r0, [r4] - movs r1, 0xA8 - lsls r1, 2 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - ldr r0, [r4] - adds r0, r7 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - bl DestroySprite - ldr r0, [r4] - ldr r1, =0x0000029d - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - bl DestroySprite - adds r0, r5, 0 - bl DestroySprite -_0819C1BA: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819C100 - - thumb_func_start sub_819C1D0 -sub_819C1D0: @ 819C1D0 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0819C24E - cmp r0, 0x1 - bgt _0819C1F8 - cmp r0, 0 - beq _0819C1FE - b _0819C2BA - .pool -_0819C1F8: - cmp r0, 0x2 - beq _0819C270 - b _0819C2BA -_0819C1FE: - movs r0, 0x10 - strh r0, [r4, 0xE] - movs r0, 0xE0 - strh r0, [r4, 0x38] - movs r0, 0x40 - strh r0, [r4, 0x12] - movs r0, 0x41 - strh r0, [r4, 0x18] - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl SetGpuRegBits - ldrh r1, [r4, 0xE] - lsls r1, 8 - ldrh r0, [r4, 0x38] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x40 - bl SetGpuReg - ldrh r1, [r4, 0x12] - lsls r1, 8 - ldrh r0, [r4, 0x18] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x44 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0x3F - bl SetGpuReg - movs r0, 0x4A - movs r1, 0x37 - bl SetGpuReg - b _0819C2C6 -_0819C24E: - movs r0, 0x3 - bl ShowBg - ldr r1, =0x00001248 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x0000040b - movs r0, 0x52 - bl SetGpuReg - b _0819C2C6 - .pool -_0819C270: - ldrh r0, [r4, 0x12] - subs r0, 0x4 - strh r0, [r4, 0x12] - ldrh r1, [r4, 0x18] - adds r1, 0x4 - strh r1, [r4, 0x18] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x20 - ble _0819C28C - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0x5F - ble _0819C29E -_0819C28C: - movs r0, 0x20 - strh r0, [r4, 0x12] - movs r0, 0x60 - strh r0, [r4, 0x18] - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl ClearGpuRegBits -_0819C29E: - ldrh r1, [r4, 0x12] - lsls r1, 8 - ldrh r0, [r4, 0x18] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x44 - bl SetGpuReg - movs r1, 0x12 - ldrsh r0, [r4, r1] - cmp r0, 0x20 - bne _0819C2CC - b _0819C2C6 -_0819C2BA: - adds r0, r2, 0 - bl DestroyTask - bl sub_819BF2C - b _0819C2CC -_0819C2C6: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_0819C2CC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_819C1D0 - - thumb_func_start sub_819C2D4 -sub_819C2D4: @ 819C2D4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0819C2F6 - b _0819C410 -_0819C2F6: - cmp r0, 0x1 - bne _0819C2FC - b _0819C460 -_0819C2FC: - movs r0, 0x3 - bl HideBg - ldr r4, =gSprites - ldr r0, =gUnknown_0300127C - mov r8, r0 - ldr r0, [r0] - ldr r1, =0x00000299 - mov r12, r1 - add r0, r12 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - adds r1, 0x3E - ldrb r2, [r1] - movs r3, 0x5 - negs r3, r3 - adds r0, r3, 0 - ands r0, r2 - strb r0, [r1] - mov r0, r8 - ldr r2, [r0] - mov r1, r12 - adds r0, r2, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r6, r4, 0 - adds r6, 0x1C - adds r0, r6 - ldr r1, =sub_819C100 - str r1, [r0] - ldr r0, =0x00000295 - mov r9, r0 - add r2, r9 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r2, [r0] - adds r1, r3, 0 - ands r1, r2 - strb r1, [r0] - mov r1, r8 - ldr r2, [r1] - mov r1, r9 - adds r0, r2, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldr r1, =SpriteCallbackDummy - mov r10, r1 - str r1, [r0] - ldr r5, =0x0000029d - adds r2, r5 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - ands r3, r1 - strb r3, [r0] - mov r0, r8 - ldr r2, [r0] - adds r0, r2, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - mov r1, r10 - str r1, [r0] - add r2, r12 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x1 - bl StartSpriteAffineAnim - mov r1, r8 - ldr r0, [r1] - add r0, r9 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x1 - bl StartSpriteAffineAnim - mov r1, r8 - ldr r0, [r1] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x1 - bl StartSpriteAffineAnim - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl ClearGpuRegBits - adds r0, r7, 0 - bl DestroyTask - b _0819C4A4 - .pool -_0819C410: - movs r0, 0x10 - strh r0, [r4, 0xE] - movs r0, 0xE0 - strh r0, [r4, 0x38] - movs r0, 0x20 - strh r0, [r4, 0x12] - movs r0, 0x60 - strh r0, [r4, 0x18] - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl SetGpuRegBits - ldrh r1, [r4, 0xE] - lsls r1, 8 - ldrh r0, [r4, 0x38] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x40 - bl SetGpuReg - ldrh r1, [r4, 0x12] - lsls r1, 8 - ldrh r0, [r4, 0x18] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x44 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0x3F - bl SetGpuReg - movs r0, 0x4A - movs r1, 0x37 - bl SetGpuReg - b _0819C49E -_0819C460: - ldrh r0, [r4, 0x12] - adds r0, 0x4 - strh r0, [r4, 0x12] - ldrh r1, [r4, 0x18] - subs r1, 0x4 - strh r1, [r4, 0x18] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3F - bgt _0819C47C - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0x41 - bgt _0819C484 -_0819C47C: - movs r0, 0x40 - strh r0, [r4, 0x12] - movs r0, 0x41 - strh r0, [r4, 0x18] -_0819C484: - ldrh r1, [r4, 0x12] - lsls r1, 8 - ldrh r0, [r4, 0x18] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x44 - bl SetGpuReg - movs r1, 0x12 - ldrsh r0, [r4, r1] - cmp r0, 0x40 - bne _0819C4A4 -_0819C49E: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_0819C4A4: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_819C2D4 - - thumb_func_start sub_819C4B4 -sub_819C4B4: @ 819C4B4 - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r4, =gUnknown_08610638 - adds r0, r4, 0 - movs r1, 0x78 - movs r2, 0x40 - movs r3, 0x1 - bl CreateSprite - ldr r6, =gUnknown_0300127C - ldr r1, [r6] - ldr r2, =0x00000299 - mov r8, r2 - add r1, r8 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x2C - movs r2, 0x40 - movs r3, 0x1 - bl CreateSprite - ldr r1, [r6] - ldr r5, =0x00000295 - adds r1, r5 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0xC4 - movs r2, 0x40 - movs r3, 0x1 - bl CreateSprite - ldr r1, [r6] - ldr r4, =0x0000029d - adds r1, r4 - strb r0, [r1] - ldr r3, =gSprites - ldr r2, [r6] - add r8, r2 - mov r0, r8 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r3, 0x1C - adds r0, r3 - ldr r1, =sub_819C040 - str r1, [r0] - adds r5, r2, r5 - ldrb r1, [r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldr r5, =SpriteCallbackDummy - str r5, [r0] - adds r4, r2, r4 - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - str r5, [r0] - movs r0, 0xA8 - lsls r0, 2 - adds r2, r0 - movs r0, 0x1 - strb r0, [r2] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819C4B4 - - thumb_func_start sub_819C568 -sub_819C568: @ 819C568 - push {r4,lr} - ldr r4, =gUnknown_0300127C - ldr r0, [r4] - movs r1, 0xA5 - lsls r1, 2 - adds r0, r1 - ldrb r0, [r0] - bl sub_818D820 - ldr r0, [r4] - movs r1, 0xA6 - lsls r1, 2 - adds r0, r1 - ldrb r0, [r0] - bl sub_818D820 - ldr r0, [r4] - movs r1, 0xA7 - lsls r1, 2 - adds r0, r1 - ldrb r0, [r0] - bl sub_818D820 - ldr r0, =sub_819C2D4 - movs r1, 0x1 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r1, [r1] - bl _call_via_r1 - ldr r0, [r4] - movs r1, 0xA8 - lsls r1, 2 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819C568 - - thumb_func_start sub_819C5D0 -sub_819C5D0: @ 819C5D0 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r4, r0, 0 - adds r6, r1, 0 - adds r5, r2, 0 - mov r8, r3 - lsls r4, 16 - lsrs r4, 16 - lsls r6, 16 - lsrs r6, 16 - lsls r5, 16 - lsrs r5, 16 - mov r0, r8 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl SetGpuRegBits - lsls r4, 24 - lsrs r4, 16 - orrs r4, r6 - movs r0, 0x40 - adds r1, r4, 0 - bl SetGpuReg - lsls r5, 24 - lsrs r5, 16 - mov r0, r8 - orrs r5, r0 - movs r0, 0x44 - adds r1, r5, 0 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0x3F - bl SetGpuReg - movs r0, 0x4A - movs r1, 0x37 - bl SetGpuReg - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_819C5D0 - - thumb_func_start sub_819C634 -sub_819C634: @ 819C634 - push {r4-r7,lr} - lsls r0, 16 - ldr r2, =gUnknown_0203BC8C - ldr r1, [r2] - lsrs r0, 12 - adds r0, r1 - ldrh r6, [r0] - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - ldrb r5, [r0, 0x5] - movs r3, 0x1 - cmp r3, r5 - bcs _0819C694 - adds r4, r0, 0 - movs r0, 0x6C - mov r12, r0 - adds r7, r2, 0 -_0819C656: - movs r2, 0 -_0819C658: - mov r0, r12 - muls r0, r2 - adds r1, r4, r0 - ldrb r0, [r1, 0x10] - cmp r0, r3 - bne _0819C680 - ldrh r0, [r1, 0xC] - ldr r1, [r7] - lsls r0, 4 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r6 - bne _0819C68A - movs r0, 0 - b _0819C696 - .pool -_0819C680: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x5 - bls _0819C658 -_0819C68A: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, r5 - bcc _0819C656 -_0819C694: - movs r0, 0x1 -_0819C696: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_819C634 - - thumb_func_start sub_819C69C -sub_819C69C: @ 819C69C - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r5, r0, r1 - movs r0, 0x8 - ldrsh r2, [r5, r0] - cmp r2, 0x1 - beq _0819C6F8 - cmp r2, 0x1 - bgt _0819C6C4 - cmp r2, 0 - beq _0819C6CA - b _0819C7D8 - .pool -_0819C6C4: - cmp r2, 0x2 - beq _0819C7B4 - b _0819C7D8 -_0819C6CA: - ldr r1, =gUnknown_0300127C - ldr r0, [r1] - ldr r3, =0x000002a7 - adds r0, r3 - strb r2, [r0] - ldr r0, [r1] - adds r3, 0x1 - adds r0, r3 - strb r2, [r0] - ldr r0, [r1] - ldr r1, =0x000002a6 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - strh r1, [r5, 0x8] - b _0819C7D8 - .pool -_0819C6F8: - ldr r0, =gUnknown_0300127C - ldr r3, [r0] - ldr r2, =0x000002a2 - adds r1, r3, r2 - ldrb r1, [r1] - adds r7, r0, 0 - cmp r1, 0 - beq _0819C7D8 - ldr r1, =0x000002a9 - adds r0, r3, r1 - ldrb r4, [r0] - cmp r4, 0 - beq _0819C724 - movs r0, 0x2 - strh r0, [r5, 0x8] - b _0819C7D8 - .pool -_0819C724: - ldr r2, =0x000002a7 - adds r1, r3, r2 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r7] - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0x6 - bls _0819C764 - strb r4, [r1] - ldr r1, [r7] - subs r2, 0x1 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _0819C758 - movs r3, 0xAA - lsls r3, 2 - adds r1, r3 - ldrb r0, [r1] - subs r0, 0x1 - b _0819C762 - .pool -_0819C758: - movs r0, 0xAA - lsls r0, 2 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 -_0819C762: - strb r0, [r1] -_0819C764: - movs r0, 0x80 - lsls r0, 7 - ldr r1, [r7] - movs r4, 0xAA - lsls r4, 2 - adds r1, r4 - ldrb r1, [r1] - movs r2, 0 - bl BlendPalettes - ldr r2, [r7] - adds r4, r2, r4 - ldrb r0, [r4] - cmp r0, 0x5 - bls _0819C790 - ldr r3, =0x000002a6 - adds r1, r2, r3 - movs r0, 0 - b _0819C7D6 - .pool -_0819C790: - cmp r0, 0 - bne _0819C7D8 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - movs r1, 0x2 - strh r1, [r0, 0x8] - ldr r0, =0x000002a6 - adds r1, r2, r0 - movs r0, 0x1 - b _0819C7D6 - .pool -_0819C7B4: - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - ldr r2, =0x000002a9 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0xE - bls _0819C7D4 - movs r0, 0 - strb r0, [r1] - movs r0, 0x1 - strh r0, [r5, 0x8] - b _0819C7D8 - .pool -_0819C7D4: - adds r0, 0x1 -_0819C7D6: - strb r0, [r1] -_0819C7D8: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_819C69C - - thumb_func_start sub_819C7E0 -sub_819C7E0: @ 819C7E0 - push {lr} - bl AnimateSprites - bl BuildOamBuffer - bl RunTextPrinters - bl UpdatePaletteFade - bl RunTasks - pop {r0} - bx r0 - thumb_func_end sub_819C7E0 - - thumb_func_start sub_819C7FC -sub_819C7FC: @ 819C7FC - push {lr} - bl LoadOam - bl ProcessSpriteCopyRequests - bl TransferPlttBuffer - pop {r0} - bx r0 - thumb_func_end sub_819C7FC - - thumb_func_start sub_819C810 -sub_819C810: @ 819C810 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - ldr r4, =gPlayerParty - ldr r5, =gUnknown_03001284 - ldr r1, [r5] - ldrb r0, [r1, 0x12] - movs r6, 0x64 - muls r0, r6 - adds r0, r4 - ldr r2, =gEnemyParty - mov r9, r2 - ldrb r1, [r1, 0x13] - muls r1, r6 - add r1, r9 - movs r2, 0x64 - bl memcpy - movs r1, 0 - mov r0, sp - strb r1, [r0] - ldr r0, [r5] - ldrb r0, [r0, 0x12] - muls r0, r6 - adds r0, r4 - movs r1, 0x20 - mov r2, sp - bl SetMonData - ldr r3, =gSaveBlock2Ptr - mov r8, r3 - ldr r3, [r3] - ldr r4, [r5] - ldrb r0, [r4, 0x12] - lsls r2, r0, 1 - adds r2, r0 - lsls r2, 2 - adds r2, r3, r2 - ldrb r1, [r4, 0x13] - adds r1, 0x3 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r3, r0 - movs r1, 0xE7 - lsls r1, 4 - adds r0, r1 - ldrh r0, [r0] - adds r2, r1 - strh r0, [r2] - ldrb r0, [r4, 0x12] - lsls r2, r0, 1 - adds r2, r0 - lsls r2, 2 - adds r2, r3, r2 - ldrb r1, [r4, 0x13] - adds r1, 0x3 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r3, r0 - ldr r0, =0x00000e78 - adds r3, r0 - ldrb r1, [r3] - adds r2, r0 - strb r1, [r2] - ldr r0, [r5] - ldrb r0, [r0, 0x13] - muls r0, r6 - add r0, r9 - movs r1, 0 - movs r2, 0 - bl GetMonData - mov r1, r8 - ldr r2, [r1] - ldr r4, [r5] - ldrb r3, [r4, 0x12] - lsls r1, r3, 1 - adds r1, r3 - lsls r1, 2 - ldr r3, =0x00000e74 - adds r2, r3 - adds r2, r1 - str r0, [r2] - ldrb r0, [r4, 0x13] - muls r0, r6 - add r0, r9 - movs r1, 0x2E - movs r2, 0 - bl GetBoxMonData - mov r1, r8 - ldr r2, [r1] - ldr r1, [r5] - ldrb r3, [r1, 0x12] - lsls r1, r3, 1 - adds r1, r3 - lsls r1, 2 - adds r2, r1 - ldr r3, =0x00000e79 - adds r2, r3 - strb r0, [r2] - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819C810 - - thumb_func_start sub_819C90C -sub_819C90C: @ 819C90C - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r6, r0, r1 - movs r1, 0x8 - ldrsh r0, [r6, r1] - cmp r0, 0x7 - beq _0819C950 - cmp r0, 0x7 - bgt _0819C934 - cmp r0, 0x6 - beq _0819C93A - b _0819C9F0 - .pool -_0819C934: - cmp r0, 0x8 - beq _0819C9C4 - b _0819C9F0 -_0819C93A: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - movs r0, 0x7 - strh r0, [r6, 0x8] - b _0819C9F0 -_0819C950: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _0819C9F0 - ldr r4, =gUnknown_03001284 - ldr r0, [r4] - adds r0, 0x21 - ldrb r0, [r0] - bl DestroyTask - ldr r1, [r4] - ldr r0, [r1, 0x2C] - adds r1, 0x30 - bl sub_819F444 - bl sub_819E538 - ldr r4, =gUnknown_0203CE40 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203CE44 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203CE48 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203CE4C - ldr r0, [r4] - bl Free - str r5, [r4] - bl FreeAllWindowBuffers - movs r0, 0x8 - strh r0, [r6, 0x8] - b _0819C9F0 - .pool -_0819C9C4: - adds r0, r2, 0 - bl DestroyTask - ldr r2, =gUnknown_03001284 - ldr r1, [r2] - movs r0, 0x1 - strb r0, [r1, 0x15] - ldr r2, [r2] - ldr r0, =gPlttBufferUnfaded - movs r1, 0xF4 - lsls r1, 1 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r2, 0x24] - ldr r1, =gPlayerParty - ldrb r2, [r2, 0x3] - ldr r0, =sub_819DC1C - str r0, [sp] - movs r0, 0 - movs r3, 0x2 - bl sub_81BF8EC -_0819C9F0: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819C90C - - thumb_func_start sub_819CA08 -sub_819CA08: @ 819CA08 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r7, =gUnknown_03001284 - ldr r2, [r7] - adds r0, r2, 0 - adds r0, 0x30 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0819CAFE - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r1, [r4, r0] - cmp r1, 0x1 - beq _0819CA78 - cmp r1, 0x1 - bgt _0819CA44 - cmp r1, 0 - beq _0819CA4E - b _0819CAFE - .pool -_0819CA44: - cmp r1, 0x2 - beq _0819CA8C - cmp r1, 0x3 - beq _0819CAA4 - b _0819CAFE -_0819CA4E: - adds r0, r2, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x1 - bne _0819CA68 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - ldr r0, =gScriptResult - strh r1, [r0] - b _0819CAFE - .pool -_0819CA68: - movs r0, 0x2 - strh r0, [r4, 0x8] - ldr r1, =gScriptResult - movs r0, 0x1 - strh r0, [r1] - b _0819CAFE - .pool -_0819CA78: - adds r0, r2, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x1 - bne _0819CA9C - ldrb r0, [r2, 0x3] - strb r0, [r2, 0x13] - bl sub_819C810 - b _0819CA9C -_0819CA8C: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade -_0819CA9C: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0819CAFE -_0819CAA4: - bl UpdatePaletteFade - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _0819CAFE - ldr r0, [r7] - adds r0, 0x21 - ldrb r0, [r0] - bl DestroyTask - bl sub_819E538 - ldr r4, =gUnknown_0203CE40 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203CE44 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203CE48 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203CE4C - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r0, [r7] - bl Free - str r5, [r7] - bl FreeAllWindowBuffers - ldr r0, =sub_80861B0 - bl SetMainCallback2 - adds r0, r6, 0 - bl DestroyTask -_0819CAFE: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819CA08 - - thumb_func_start sub_819CB1C -sub_819CB1C: @ 819CB1C - push {r4-r7,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r7, =gUnknown_03001284 - ldr r0, [r7] - adds r0, 0x30 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0819CBD6 - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x4 - beq _0819CB50 - cmp r0, 0x5 - beq _0819CB5A - b _0819CBD6 - .pool -_0819CB50: - bl sub_819E9E0 - movs r0, 0x5 - strh r0, [r4, 0x8] - b _0819CBD6 -_0819CB5A: - ldr r2, =gMain - ldrh r1, [r2, 0x2E] - movs r6, 0x1 - adds r5, r6, 0 - ands r5, r1 - cmp r5, 0 - beq _0819CB86 - movs r0, 0x5 - bl PlaySE - ldr r0, [r7] - ldrb r0, [r0, 0x16] - cmp r0, 0 - bne _0819CB80 - strh r6, [r4, 0xA] - b _0819CB9C - .pool -_0819CB80: - movs r0, 0 - strh r0, [r4, 0xA] - b _0819CB96 -_0819CB86: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0819CBA8 - movs r0, 0x5 - bl PlaySE - strh r5, [r4, 0xA] -_0819CB96: - movs r0, 0x4 - bl sub_819EA64 -_0819CB9C: - ldrh r0, [r4, 0x14] - ldrh r1, [r4, 0x16] - lsls r0, 16 - orrs r0, r1 - str r0, [r4] - b _0819CBD6 -_0819CBA8: - ldrh r1, [r2, 0x30] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0819CBC2 - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - negs r0, r0 - bl sub_819E758 - b _0819CBD6 -_0819CBC2: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0819CBD6 - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - bl sub_819E758 -_0819CBD6: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_819CB1C - - thumb_func_start sub_819CBDC -sub_819CBDC: @ 819CBDC - 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 - movs r1, 0xA - ldrsh r0, [r2, r1] - cmp r0, 0x1 - bne _0819CC04 - movs r0, 0 - strh r0, [r2, 0x8] - ldr r0, =sub_819CA08 - b _0819CC16 - .pool -_0819CC04: - movs r0, 0 - strh r0, [r2, 0x8] - ldr r1, =sub_819CE40 - lsrs r0, r1, 16 - strh r0, [r2, 0x14] - strh r1, [r2, 0x16] - movs r0, 0x1 - strh r0, [r2, 0x12] - ldr r0, =sub_819D770 -_0819CC16: - str r0, [r2] - pop {r0} - bx r0 - .pool - thumb_func_end sub_819CBDC - - thumb_func_start sub_819CC24 -sub_819CC24: @ 819CC24 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - movs r0, 0x8 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _0819CC5A - ldr r0, =gUnknown_085EECBB - bl sub_819EBEC - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r0, 0x20 - strb r5, [r0] - movs r0, 0x4 - strh r0, [r4, 0x8] - ldr r1, =sub_819CBDC - lsrs r0, r1, 16 - strh r0, [r4, 0x14] - strh r1, [r4, 0x16] - ldr r0, =sub_819CB1C - str r0, [r4] -_0819CC5A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819CC24 - - thumb_func_start sub_819CC74 -sub_819CC74: @ 819CC74 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldr r0, [r1, 0x2C] - adds r1, 0x30 - movs r2, 0x1 - bl sub_819F3F8 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r2, r0, r1 - movs r1, 0xA - ldrsh r0, [r2, r1] - cmp r0, 0x1 - bne _0819CCB0 - movs r0, 0 - strh r0, [r2, 0x8] - ldr r0, =sub_819CA08 - b _0819CCC2 - .pool -_0819CCB0: - movs r0, 0 - strh r0, [r2, 0x8] - ldr r1, =sub_819CE40 - lsrs r0, r1, 16 - strh r0, [r2, 0x14] - strh r1, [r2, 0x16] - movs r0, 0x1 - strh r0, [r2, 0x12] - ldr r0, =sub_819D770 -_0819CCC2: - str r0, [r2] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819CC74 - - thumb_func_start sub_819CCD4 -sub_819CCD4: @ 819CCD4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r5, r1, r2 - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0819CD1A - ldr r4, =gUnknown_03001284 - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x2D - adds r1, 0x30 - movs r2, 0x1 - bl sub_819F2B4 - ldr r0, =gUnknown_085EECF0 - bl sub_819EBEC - ldr r0, [r4] - adds r0, 0x20 - movs r1, 0x1 - strb r1, [r0] - movs r0, 0x4 - strh r0, [r5, 0x8] - ldr r1, =sub_819CC74 - lsrs r0, r1, 16 - strh r0, [r5, 0x14] - strh r1, [r5, 0x16] - ldr r0, =sub_819CB1C - str r0, [r5] -_0819CD1A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819CCD4 - - thumb_func_start sub_819CD34 -sub_819CD34: @ 819CD34 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r5, r0, r1 - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0x3 - beq _0819CDA4 - cmp r0, 0x3 - bgt _0819CD60 - cmp r0, 0x2 - beq _0819CD66 - b _0819CE36 - .pool -_0819CD60: - cmp r0, 0x9 - beq _0819CD88 - b _0819CE36 -_0819CD66: - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldrb r0, [r1, 0x15] - cmp r0, 0 - bne _0819CD7C - adds r0, r1, 0 - adds r0, 0x2D - adds r1, 0x30 - movs r2, 0x1 - bl sub_819F2B4 -_0819CD7C: - movs r0, 0x9 - strh r0, [r5, 0x8] - b _0819CE36 - .pool -_0819CD88: - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r0, 0x30 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0819CE36 - bl sub_819E944 - movs r0, 0x3 - strh r0, [r5, 0x8] - b _0819CE36 - .pool -_0819CDA4: - ldr r7, =gUnknown_03001284 - ldr r0, [r7] - adds r0, 0x30 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0819CE36 - ldr r2, =gMain - ldrh r1, [r2, 0x2E] - movs r0, 0x1 - mov r8, r0 - mov r4, r8 - ands r4, r1 - cmp r4, 0 - beq _0819CDD8 - movs r0, 0x5 - bl PlaySE - adds r0, r6, 0 - bl sub_819F0A0 - b _0819CE36 - .pool -_0819CDD8: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0819CE14 - movs r0, 0x5 - bl PlaySE - ldr r1, [r7] - ldr r0, [r1, 0x2C] - adds r1, 0x30 - movs r2, 0x1 - bl sub_819F3F8 - movs r0, 0x3 - bl sub_819EA64 - strh r4, [r5, 0x8] - ldr r1, =sub_819CE40 - lsrs r0, r1, 16 - strh r0, [r5, 0x14] - strh r1, [r5, 0x16] - mov r1, r8 - strh r1, [r5, 0x12] - ldr r0, =sub_819D770 - str r0, [r5] - b _0819CE36 - .pool -_0819CE14: - ldrh r1, [r2, 0x30] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0819CE28 - movs r0, 0x1 - negs r0, r0 - bl sub_819E7C0 - b _0819CE36 -_0819CE28: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0819CE36 - movs r0, 0x1 - bl sub_819E7C0 -_0819CE36: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_819CD34 - - thumb_func_start sub_819CE40 -sub_819CE40: @ 819CE40 - 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 r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0819CE64 - cmp r0, 0x1 - beq _0819CE88 - b _0819CF4C - .pool -_0819CE64: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0819CF4C - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r0, 0x22 - movs r1, 0x1 - strb r1, [r0] - strh r1, [r4, 0x8] - b _0819CF4C - .pool -_0819CE88: - ldr r2, =gMain - ldrh r1, [r2, 0x2E] - adds r5, r1, 0 - ands r5, r0 - cmp r5, 0 - beq _0819CEBC - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r0, 0x22 - movs r1, 0 - strb r1, [r0] - bl sub_819EE08 - bl sub_819EAC0 - adds r0, r6, 0 - bl sub_819F184 - b _0819CF4C - .pool -_0819CEBC: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0819CEF8 - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r0, 0x22 - strb r5, [r0] - bl sub_819EE08 - bl sub_819EAC0 - ldr r1, =sub_819CC24 - lsrs r0, r1, 16 - strh r0, [r4, 0x14] - strh r1, [r4, 0x16] - strh r5, [r4, 0x8] - strh r5, [r4, 0x12] - ldr r0, =sub_819D588 - str r0, [r4] - b _0819CF4C - .pool -_0819CEF8: - ldrh r1, [r2, 0x30] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0819CF0C - movs r0, 0x1 - negs r0, r0 - bl sub_819E694 - b _0819CF2A -_0819CF0C: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0819CF1C - movs r0, 0x1 - bl sub_819E694 - b _0819CF2A -_0819CF1C: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0819CF34 - movs r0, 0x1 - bl sub_819E6E8 -_0819CF2A: - bl sub_819EFA8 - bl sub_819EB4C - b _0819CF4C -_0819CF34: - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0819CF4C - movs r0, 0x1 - negs r0, r0 - bl sub_819E6E8 - bl sub_819EFA8 - bl sub_819EB4C -_0819CF4C: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_819CE40 - - thumb_func_start sub_819CF54 -sub_819CF54: @ 819CF54 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r2, [r4, r0] - cmp r2, 0x1 - beq _0819CFA0 - cmp r2, 0x1 - bgt _0819CF7C - cmp r2, 0 - beq _0819CF82 - b _0819D05C - .pool -_0819CF7C: - cmp r2, 0x2 - beq _0819D03C - b _0819D05C -_0819CF82: - ldr r1, =gUnknown_03001284 - ldr r0, [r1] - adds r0, 0x27 - strb r2, [r0] - ldr r0, [r1] - adds r0, 0x28 - strb r2, [r0] - ldr r0, [r1] - adds r0, 0x26 - movs r1, 0x1 - strb r1, [r0] - strh r1, [r4, 0x8] - b _0819D05C - .pool -_0819CFA0: - ldr r1, =gUnknown_03001284 - ldr r2, [r1] - adds r0, r2, 0 - adds r0, 0x22 - ldrb r0, [r0] - adds r6, r1, 0 - cmp r0, 0 - beq _0819D05C - adds r0, r2, 0 - adds r0, 0x29 - ldrb r3, [r0] - cmp r3, 0 - beq _0819CFC4 - movs r0, 0x2 - strh r0, [r4, 0x8] - b _0819D05C - .pool -_0819CFC4: - adds r1, r2, 0 - adds r1, 0x27 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r6] - adds r1, r0, 0 - adds r1, 0x27 - ldrb r0, [r1] - cmp r0, 0x6 - bls _0819CFF8 - strb r3, [r1] - ldr r1, [r6] - adds r0, r1, 0 - adds r0, 0x26 - ldrb r0, [r0] - cmp r0, 0 - bne _0819CFF0 - adds r1, 0x28 - ldrb r0, [r1] - subs r0, 0x1 - b _0819CFF6 -_0819CFF0: - adds r1, 0x28 - ldrb r0, [r1] - adds r0, 0x1 -_0819CFF6: - strb r0, [r1] -_0819CFF8: - movs r0, 0x80 - lsls r0, 7 - ldr r1, [r6] - adds r1, 0x28 - ldrb r1, [r1] - movs r2, 0 - bl BlendPalettes - ldr r2, [r6] - adds r0, r2, 0 - adds r0, 0x28 - ldrb r0, [r0] - cmp r0, 0x5 - bls _0819D01C - adds r1, r2, 0 - adds r1, 0x26 - movs r0, 0 - b _0819D05A -_0819D01C: - cmp r0, 0 - bne _0819D05C - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0x2 - strh r1, [r0, 0x8] - adds r1, r2, 0 - adds r1, 0x26 - movs r0, 0x1 - b _0819D05A - .pool -_0819D03C: - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0x29 - ldrb r0, [r1] - cmp r0, 0xE - bls _0819D058 - movs r0, 0 - strb r0, [r1] - movs r0, 0x1 - strh r0, [r4, 0x8] - b _0819D05C - .pool -_0819D058: - adds r0, 0x1 -_0819D05A: - strb r0, [r1] -_0819D05C: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_819CF54 - - thumb_func_start sub_819D064 -sub_819D064: @ 819D064 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - movs r0, 0x8 - ldrsh r1, [r4, r0] - cmp r1, 0x1 - beq _0819D0A4 - cmp r1, 0x1 - bgt _0819D08C - cmp r1, 0 - beq _0819D092 - b _0819D118 - .pool -_0819D08C: - cmp r1, 0x2 - beq _0819D0BC - b _0819D118 -_0819D092: - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r0, 0x27 - strb r1, [r0] - strh r1, [r4, 0x10] - b _0819D0AE - .pool -_0819D0A4: - ldr r0, =gPlttBufferUnfaded+ 0x1E0 - movs r1, 0xE0 - movs r2, 0xA - bl LoadPalette -_0819D0AE: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0819D118 - .pool -_0819D0BC: - ldr r2, =gUnknown_03001284 - ldr r0, [r2] - adds r0, 0x28 - ldrb r0, [r0] - cmp r0, 0xF - bls _0819D0D2 - movs r0, 0x1 - strh r0, [r4, 0x10] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_0819D0D2: - ldr r1, [r2] - adds r1, 0x27 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r2] - adds r1, r0, 0 - adds r1, 0x27 - ldrb r0, [r1] - cmp r0, 0x3 - bls _0819D108 - movs r0, 0 - strb r0, [r1] - ldr r1, =gPlttBufferUnfaded - ldr r0, =gPlttBufferFaded - movs r3, 0xE4 - lsls r3, 1 - adds r0, r3 - ldrh r0, [r0] - adds r3, 0x20 - adds r1, r3 - strh r0, [r1] - ldr r1, [r2] - adds r1, 0x28 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_0819D108: - movs r0, 0x80 - lsls r0, 7 - ldr r1, [r2] - adds r1, 0x28 - ldrb r1, [r1] - movs r2, 0 - bl BlendPalettes -_0819D118: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819D064 - - thumb_func_start sub_819D12C -sub_819D12C: @ 819D12C - 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 - str r0, [sp] - ldr r1, =gTasks - lsls r0, 2 - ldr r2, [sp] - adds r0, r2 - lsls r0, 3 - adds r4, r0, r1 - movs r2, 0x8 - ldrsh r3, [r4, r2] - cmp r3, 0 - beq _0819D15C - cmp r3, 0x1 - beq _0819D168 - b _0819D310 - .pool -_0819D15C: - strh r3, [r4, 0xA] - strh r3, [r4, 0xC] - strh r3, [r4, 0xE] - movs r0, 0x1 - strh r0, [r4, 0x8] - b _0819D310 -_0819D168: - movs r3, 0 - str r3, [sp, 0x4] - movs r1, 0x2 - str r0, [sp, 0x8] - ldr r0, =gTasks - str r0, [sp, 0xC] -_0819D174: - lsls r0, r1, 24 - asrs r4, r0, 24 - mov r9, r0 - cmp r4, 0x2 - beq _0819D1F2 - ldr r2, =gSprites - ldr r3, =gUnknown_03001284 - ldr r0, [r3] - adds r0, 0x5 - mov r8, r0 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r6, r0, r2 - ldrh r1, [r6, 0x20] - mov r12, r1 - mov r7, r12 - ldr r1, [sp, 0x4] - subs r0, r1, r7 - lsls r0, 24 - lsrs r5, r0, 24 - mov r10, r2 - cmp r5, 0x10 - beq _0819D1BE - adds r0, r4, 0x2 - lsls r0, 1 - ldr r2, [sp, 0x8] - adds r0, r2 - ldr r1, =gTasks - adds r1, 0x8 - adds r0, r1 - movs r3, 0 - ldrsh r0, [r0, r3] - cmp r0, 0x1 - bne _0819D1D8 -_0819D1BE: - lsls r0, r7, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - mov r0, r12 - adds r0, 0xA - strh r0, [r6, 0x20] - b _0819D210 - .pool -_0819D1D8: - cmp r5, 0x10 - bls _0819D210 - adds r0, r4, 0x1 - add r0, r8 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r10 - ldrh r0, [r0, 0x20] - subs r0, 0x30 - strh r0, [r6, 0x20] - b _0819D210 -_0819D1F2: - ldr r3, =gSprites - ldr r4, =gUnknown_03001284 - ldr r0, [r4] - ldrb r1, [r0, 0x7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r2, [r0, 0x20] - lsls r1, r2, 24 - lsrs r1, 24 - str r1, [sp, 0x4] - adds r2, 0xA - strh r2, [r0, 0x20] - mov r10, r3 -_0819D210: - mov r0, r9 - asrs r2, r0, 24 - adds r0, r2, 0x1 - lsls r0, 1 - ldr r1, [sp, 0x8] - adds r0, r1 - ldr r1, =gTasks - adds r1, 0x8 - adds r0, r1 - movs r3, 0 - ldrsh r0, [r0, r3] - cmp r0, 0x1 - bne _0819D26A - ldr r1, =gUnknown_03001284 - ldr r0, [r1] - adds r0, 0x5 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - mov r3, r10 - adds r1, r0, r3 - movs r0, 0x20 - ldrsh r3, [r1, r0] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 4 - adds r0, 0x48 - cmp r3, r0 - ble _0819D260 - strh r0, [r1, 0x20] - movs r7, 0x1 - b _0819D26C - .pool -_0819D260: - movs r7, 0 - cmp r3, r0 - bne _0819D26C - movs r7, 0x1 - b _0819D26C -_0819D26A: - movs r7, 0 -_0819D26C: - mov r6, r10 - ldr r5, =gUnknown_03001284 - ldr r2, [r5] - mov r1, r9 - asrs r4, r1, 24 - adds r0, r2, 0x5 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r6 - movs r3, 0x20 - ldrsh r0, [r1, r3] - subs r0, 0x10 - cmp r0, 0xF0 - ble _0819D2F8 - ldrh r0, [r1, 0x20] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - ldr r0, =0x0000fff0 - strh r0, [r1, 0x20] - ldrb r0, [r2, 0x14] - cmp r0, 0x1 - bne _0819D2C0 - movs r0, 0x65 - bl IndexOfSpritePaletteTag - ldr r1, [r5] - adds r1, 0x5 - adds r1, r4 - ldrb r1, [r1] - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - adds r2, r6 - b _0819D2D8 - .pool -_0819D2C0: - movs r0, 0x64 - bl IndexOfSpritePaletteTag - ldr r2, =gUnknown_03001284 - ldr r1, [r2] - adds r1, 0x5 - adds r1, r4 - ldrb r1, [r1] - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - add r2, r10 -_0819D2D8: - lsls r0, 4 - ldrb r3, [r2, 0x5] - movs r1, 0xF - ands r1, r3 - orrs r1, r0 - strb r1, [r2, 0x5] - mov r3, r9 - asrs r0, r3, 23 - adds r0, 0x2 - ldr r1, [sp, 0x8] - adds r0, r1 - ldr r2, [sp, 0xC] - adds r2, 0x8 - adds r0, r2 - movs r1, 0x1 - strh r1, [r0] -_0819D2F8: - movs r0, 0xFF - lsls r0, 24 - add r0, r9 - lsrs r1, r0, 24 - cmp r0, 0 - blt _0819D306 - b _0819D174 -_0819D306: - cmp r7, 0x1 - bne _0819D310 - ldr r0, [sp] - bl DestroyTask -_0819D310: - 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_819D12C - - thumb_func_start sub_819D324 -sub_819D324: @ 819D324 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r7, r0, 24 - movs r0, 0 - mov r8, r0 - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r2, r0, r1 - ldrb r4, [r2, 0xE] - movs r0, 0xC - ldrsh r5, [r2, r0] - mov r10, r1 - cmp r5, 0x1 - bne _0819D352 - lsls r0, r4, 24 - negs r0, r0 - lsrs r4, r0, 24 -_0819D352: - movs r1, 0x8 - ldrsh r0, [r2, r1] - cmp r0, 0 - beq _0819D368 - cmp r0, 0x1 - bne _0819D360 - b _0819D480 -_0819D360: - b _0819D570 - .pool -_0819D368: - ldr r3, =gSprites - ldr r2, =gUnknown_03001284 - ldr r0, [r2] - ldrb r1, [r0, 0x8] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r0, [r0, 0x20] - cmp r5, 0 - bne _0819D39C - lsls r0, 16 - asrs r0, 16 - lsls r2, r4, 24 - asrs r1, r2, 24 - adds r0, r1 - movs r1, 0x1 - cmp r0, 0xEF - ble _0819D3B2 - movs r1, 0 - movs r0, 0xF0 - b _0819D3B0 - .pool -_0819D39C: - lsls r0, 16 - asrs r0, 16 - lsls r2, r4, 24 - asrs r1, r2, 24 - adds r0, r1 - movs r1, 0x1 - cmp r0, 0xA0 - bgt _0819D3B2 - movs r1, 0 - movs r0, 0xA0 -_0819D3B0: - mov r8, r0 -_0819D3B2: - cmp r1, 0x1 - bne _0819D3FC - movs r3, 0 - ldr r7, =gSprites - ldr r6, =gUnknown_03001284 - asrs r5, r2, 24 -_0819D3BE: - movs r4, 0 - adds r2, r3, 0x1 -_0819D3C2: - ldr r1, [r6] - lsls r0, r4, 1 - adds r0, r4 - adds r0, r3, r0 - adds r1, 0x8 - adds r1, r0 - ldrb r1, [r1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, r5 - strh r1, [r0, 0x20] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _0819D3C2 - lsls r0, r2, 24 - lsrs r3, r0, 24 - cmp r3, 0x2 - bls _0819D3BE - b _0819D570 - .pool -_0819D3FC: - movs r4, 0 - lsls r1, r7, 2 - mov r12, r1 - mov r6, r8 - adds r6, 0x10 - movs r0, 0x30 - add r0, r8 - mov r9, r0 - ldr r5, =gSprites -_0819D40E: - ldr r1, =gUnknown_03001284 - ldr r2, [r1] - lsls r3, r4, 1 - adds r3, r4 - adds r0, r2, 0 - adds r0, 0x8 - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - mov r1, r8 - strh r1, [r0, 0x20] - adds r0, r2, 0 - adds r0, 0x9 - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r6, [r0, 0x20] - adds r2, 0xA - adds r2, r3 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - mov r1, r9 - strh r1, [r0, 0x20] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _0819D40E - mov r1, r12 - adds r0, r1, r7 - lsls r0, 3 - add r0, r10 - ldrb r1, [r0, 0xA] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - add r0, r10 - movs r1, 0x1 - strh r1, [r0, 0xE] - adds r0, r7, 0 - bl DestroyTask - b _0819D570 - .pool -_0819D480: - ldr r2, =gSprites - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - ldrb r1, [r0, 0xE] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x20] - cmp r5, 0 - bne _0819D4B4 - lsls r0, 16 - asrs r0, 16 - lsls r2, r4, 24 - asrs r1, r2, 24 - adds r0, r1 - movs r1, 0x1 - cmp r0, 0xEF - ble _0819D4CA - movs r1, 0 - movs r0, 0xF0 - b _0819D4C8 - .pool -_0819D4B4: - lsls r0, 16 - asrs r0, 16 - lsls r2, r4, 24 - asrs r1, r2, 24 - adds r0, r1 - movs r1, 0x1 - cmp r0, 0xC0 - bgt _0819D4CA - movs r1, 0 - movs r0, 0xC0 -_0819D4C8: - mov r8, r0 -_0819D4CA: - cmp r1, 0x1 - bne _0819D510 - movs r3, 0 - ldr r7, =gSprites - ldr r6, =gUnknown_03001284 - asrs r5, r2, 24 -_0819D4D6: - movs r4, 0 - adds r2, r3, 0x1 -_0819D4DA: - ldr r0, [r6] - lsls r1, r4, 1 - adds r1, r3, r1 - adds r0, 0xE - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, r5 - strh r1, [r0, 0x20] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _0819D4DA - lsls r0, r2, 24 - lsrs r3, r0, 24 - cmp r3, 0x1 - bls _0819D4D6 - b _0819D570 - .pool -_0819D510: - movs r4, 0 - lsls r1, r7, 2 - mov r12, r1 - mov r6, r8 - adds r6, 0x10 - ldr r5, =gSprites - ldr r0, =gUnknown_03001284 - mov r9, r0 -_0819D520: - mov r1, r9 - ldr r2, [r1] - lsls r3, r4, 1 - adds r0, r2, 0 - adds r0, 0xE - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - mov r1, r8 - strh r1, [r0, 0x20] - adds r2, 0xF - adds r2, r3 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r6, [r0, 0x20] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _0819D520 - mov r1, r12 - adds r0, r1, r7 - lsls r0, 3 - add r0, r10 - ldrb r1, [r0, 0xA] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - add r0, r10 - movs r1, 0x1 - strh r1, [r0, 0x10] - adds r0, r7, 0 - bl DestroyTask -_0819D570: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819D324 - - thumb_func_start sub_819D588 -sub_819D588: @ 819D588 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r2, 0x8 - ldrsh r0, [r0, r2] - mov r8, r1 - cmp r0, 0x5 - bls _0819D5AA - b _0819D762 -_0819D5AA: - lsls r0, 2 - ldr r1, =_0819D5BC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0819D5BC: - .4byte _0819D5D4 - .4byte _0819D5F0 - .4byte _0819D60C - .4byte _0819D63C - .4byte _0819D6F0 - .4byte _0819D73A -_0819D5D4: - ldr r0, =gUnknown_08610918 - movs r1, 0xE0 - movs r2, 0xA - bl LoadPalette - bl sub_819ED34 - movs r0, 0x5 - bl PutWindowTilemap - b _0819D622 - .pool -_0819D5F0: - movs r0, 0x3 - bl sub_819EA64 - 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 _0819D762 - .pool -_0819D60C: - movs r0, 0x80 - lsls r0, 7 - ldr r1, =gUnknown_0860F13C - adds r1, 0x4A - ldrh r1, [r1] - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade -_0819D622: - 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 _0819D762 - .pool -_0819D63C: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - beq _0819D64E - b _0819D762 -_0819D64E: - movs r0, 0x5 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x5 - movs r1, 0x2 - bl CopyWindowToVram - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - ldrb r0, [r0, 0x14] - cmp r0, 0x1 - bne _0819D6B0 - ldr r0, =sub_819D324 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gTasks - lsls r2, r5, 2 - adds r2, r5 - lsls r2, 3 - adds r2, r1 - strh r6, [r2, 0xE] - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - strh r5, [r0, 0xA] - strh r6, [r0, 0x8] - strh r6, [r0, 0xC] - movs r1, 0x6 - strh r1, [r0, 0xE] - movs r0, 0x5 - strh r0, [r2, 0xC] - ldrh r0, [r2, 0x8] - adds r0, 0x1 - strh r0, [r2, 0x8] - b _0819D762 - .pool -_0819D6B0: - ldr r0, =sub_819D324 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r4, r0, 24 - ldr r3, =gTasks - lsls r2, r5, 2 - adds r2, r5 - lsls r2, 3 - adds r2, r3 - movs r1, 0x1 - strh r1, [r2, 0xE] - strh r6, [r2, 0x10] - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r3 - strh r5, [r0, 0xA] - strh r1, [r0, 0x8] - strh r6, [r0, 0xC] - movs r1, 0x6 - strh r1, [r0, 0xE] - ldrh r0, [r2, 0x8] - adds r0, 0x2 - strh r0, [r2, 0x8] - b _0819D762 - .pool -_0819D6F0: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - mov r1, r8 - adds r6, r0, r1 - ldrh r0, [r6, 0xC] - movs r2, 0xC - ldrsh r7, [r6, r2] - cmp r7, 0 - bne _0819D734 - ldr r0, =sub_819D324 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r4, r0, 24 - strh r7, [r6, 0x10] - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - add r0, r8 - strh r5, [r0, 0xA] - movs r1, 0x1 - strh r1, [r0, 0x8] - strh r7, [r0, 0xC] - movs r1, 0x6 - strh r1, [r0, 0xE] - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] - b _0819D762 - .pool -_0819D734: - subs r0, 0x1 - strh r0, [r6, 0xC] - b _0819D762 -_0819D73A: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - mov r1, r8 - adds r2, r0, r1 - movs r1, 0xE - ldrsh r0, [r2, r1] - cmp r0, 0x1 - bne _0819D762 - movs r1, 0x10 - ldrsh r0, [r2, r1] - cmp r0, 0x1 - bne _0819D762 - ldrh r0, [r2, 0x12] - strh r0, [r2, 0x8] - ldrh r0, [r2, 0x14] - ldrh r1, [r2, 0x16] - lsls r0, 16 - orrs r0, r1 - str r0, [r2] -_0819D762: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_819D588 - - thumb_func_start sub_819D770 -sub_819D770: @ 819D770 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =gUnknown_03001284 - ldr r0, [r1] - adds r0, 0x30 - ldrb r0, [r0] - adds r3, r1, 0 - cmp r0, 0x1 - bne _0819D78C - b _0819D9D8 -_0819D78C: - ldr r0, =gTasks - lsls r2, r6, 2 - adds r1, r2, r6 - lsls r1, 3 - adds r1, r0 - movs r4, 0x8 - ldrsh r1, [r1, r4] - mov r8, r0 - adds r5, r2, 0 - cmp r1, 0x8 - bls _0819D7A4 - b _0819D9D8 -_0819D7A4: - lsls r0, r1, 2 - ldr r1, =_0819D7BC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0819D7BC: - .4byte _0819D7E0 - .4byte _0819D868 - .4byte _0819D8AE - .4byte _0819D8F4 - .4byte _0819D910 - .4byte _0819D928 - .4byte _0819D936 - .4byte _0819D948 - .4byte _0819D9B0 -_0819D7E0: - ldr r0, [r3] - ldrb r7, [r0, 0x14] - cmp r7, 0x1 - bne _0819D828 - ldr r0, =sub_819D324 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r4, r0, 24 - ldr r3, =gTasks - adds r2, r5, r6 - lsls r2, 3 - adds r2, r3 - movs r1, 0 - strh r1, [r2, 0xE] - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r3 - strh r6, [r0, 0xA] - strh r1, [r0, 0x8] - strh r7, [r0, 0xC] - movs r1, 0x6 - strh r1, [r0, 0xE] - movs r0, 0xA - strh r0, [r2, 0xC] - ldrh r0, [r2, 0x8] - adds r0, 0x1 - strh r0, [r2, 0x8] - b _0819D9D8 - .pool -_0819D828: - ldr r0, =sub_819D324 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r4, r0, 24 - ldr r3, =gTasks - adds r2, r5, r6 - lsls r2, 3 - adds r2, r3 - movs r0, 0 - movs r1, 0x1 - strh r1, [r2, 0xE] - strh r0, [r2, 0x10] - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r3 - strh r6, [r0, 0xA] - strh r1, [r0, 0x8] - strh r1, [r0, 0xC] - movs r1, 0x6 - strh r1, [r0, 0xE] - ldrh r0, [r2, 0x8] - adds r0, 0x2 - strh r0, [r2, 0x8] - b _0819D9D8 - .pool -_0819D868: - adds r0, r5, r6 - lsls r0, 3 - mov r1, r8 - adds r5, r0, r1 - ldrh r0, [r5, 0xC] - movs r2, 0xC - ldrsh r7, [r5, r2] - cmp r7, 0 - bne _0819D8A8 - ldr r0, =sub_819D324 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r4, r0, 24 - strh r7, [r5, 0x10] - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - add r0, r8 - strh r6, [r0, 0xA] - movs r1, 0x1 - strh r1, [r0, 0x8] - strh r1, [r0, 0xC] - movs r1, 0x6 - strh r1, [r0, 0xE] - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - b _0819D9D8 - .pool -_0819D8A8: - subs r0, 0x1 - strh r0, [r5, 0xC] - b _0819D9D8 -_0819D8AE: - adds r0, r5, r6 - lsls r0, 3 - mov r1, r8 - adds r4, r0, r1 - movs r2, 0xE - ldrsh r0, [r4, r2] - cmp r0, 0x1 - beq _0819D8C0 - b _0819D9D8 -_0819D8C0: - movs r1, 0x10 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0819D8CA - b _0819D9D8 -_0819D8CA: - ldr r1, =gPlttBufferFaded - ldr r0, =gUnknown_0860F13C - adds r0, 0x4A - ldrh r0, [r0] - movs r2, 0xE2 - lsls r2, 1 - adds r1, r2 - strh r0, [r1] - bl sub_819ED34 - movs r0, 0x5 - bl PutWindowTilemap - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0819D9D8 - .pool -_0819D8F4: - movs r0, 0x80 - lsls r0, 7 - ldr r1, =gUnknown_0860F13C - adds r1, 0x4A - ldrh r1, [r1] - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - b _0819D990 - .pool -_0819D910: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0819D9D8 - movs r0, 0 - bl sub_819EDBC - b _0819D990 - .pool -_0819D928: - movs r0, 0x1 - bl sub_819EDBC - movs r0, 0x3 - bl PutWindowTilemap - b _0819D990 -_0819D936: - movs r0, 0x5 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x5 - movs r1, 0x2 - bl CopyWindowToVram - b _0819D990 -_0819D948: - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - ldrb r0, [r0, 0x14] - cmp r0, 0 - bne _0819D964 - ldr r0, =gUnknown_085EEC73 - bl sub_819EBEC - b _0819D96A - .pool -_0819D964: - ldr r0, =gUnknown_085EEC8B - bl sub_819EBEC -_0819D96A: - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldrb r0, [r1, 0x3] - cmp r0, 0x2 - bhi _0819D98C - ldr r2, =gSprites - ldrb r1, [r1, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] -_0819D98C: - bl sub_819EFA8 -_0819D990: - ldr r0, =gTasks - adds r1, r5, r6 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0819D9D8 - .pool -_0819D9B0: - bl sub_819EEF0 - bl sub_819EADC - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r0, 0x22 - movs r1, 0x1 - strb r1, [r0] - ldr r1, =gTasks - adds r0, r5, r6 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x12] - strh r1, [r0, 0x8] - ldrh r1, [r0, 0x14] - ldrh r2, [r0, 0x16] - lsls r1, 16 - orrs r1, r2 - str r1, [r0] -_0819D9D8: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819D770 - - thumb_func_start sub_819D9EC -sub_819D9EC: @ 819D9EC - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r0, 0x30 - ldrb r0, [r0] - cmp r0, 0x1 - bne _0819DA00 - b _0819DBCA -_0819DA00: - ldr r0, =gTasks - lsls r2, r6, 2 - adds r1, r2, r6 - lsls r1, 3 - adds r1, r0 - movs r3, 0x8 - ldrsh r1, [r1, r3] - adds r3, r0, 0 - adds r7, r2, 0 - cmp r1, 0x4 - bls _0819DA18 - b _0819DBCA -_0819DA18: - lsls r0, r1, 2 - ldr r1, =_0819DA30 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0819DA30: - .4byte _0819DA44 - .4byte _0819DA58 - .4byte _0819DA8C - .4byte _0819DABC - .4byte _0819DBB0 -_0819DA44: - bl sub_819EEF0 - ldr r0, =gTasks - adds r1, r7, r6 - lsls r1, 3 - adds r1, r0 - b _0819DB96 - .pool -_0819DA58: - bl sub_819EADC - ldr r2, =gSprites - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldr r0, =gTasks - adds r1, r7, r6 - lsls r1, 3 - adds r1, r0 - b _0819DB96 - .pool -_0819DA8C: - ldr r0, =sub_819D12C - movs r1, 0 - bl CreateTask - ldr r2, =gTasks - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r0, 0x21 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldr r1, =sub_819D064 - str r1, [r0] - b _0819DB90 - .pool -_0819DABC: - ldr r0, =sub_819D12C - bl FuncIsActiveTask - lsls r0, 24 - cmp r0, 0 - beq _0819DACA - b _0819DBCA -_0819DACA: - ldr r2, =gTasks - ldr r4, =gUnknown_03001284 - ldr r0, [r4] - adds r0, 0x21 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r1, 0x10 - ldrsh r0, [r0, r1] - cmp r0, 0x1 - bne _0819DBCA - bl sub_819EAC0 - ldr r0, [r4] - ldrb r0, [r0, 0x14] - cmp r0, 0 - bne _0819DB04 - movs r0, 0x1 - bl sub_819F048 - b _0819DB32 - .pool -_0819DB04: - movs r0, 0 - bl sub_819F048 - movs r2, 0 - ldr r5, =gSprites - movs r3, 0x4 -_0819DB10: - ldr r0, [r4] - adds r0, 0xB - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r3 - strb r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x2 - bls _0819DB10 -_0819DB32: - ldr r5, =gSprites - ldr r4, =gUnknown_03001284 - ldr r3, [r4] - ldrb r0, [r3, 0x4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - adds r0, r3, 0x5 - ldrb r2, [r3, 0x3] - adds r0, r2 - ldrb r2, [r0] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r5 - ldrh r0, [r0, 0x20] - movs r5, 0 - strh r0, [r1, 0x20] - ldr r2, =gTasks - adds r0, r3, 0 - adds r0, 0x21 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldr r1, =sub_819CF54 - str r1, [r0] - adds r3, 0x27 - strb r5, [r3] - ldr r0, [r4] - adds r0, 0x28 - movs r1, 0x6 - strb r1, [r0] - ldr r0, [r4] - adds r0, 0x26 - strb r5, [r0] - ldr r0, [r4] - adds r0, 0x21 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r1, 0x1 - strh r1, [r0, 0x8] -_0819DB90: - adds r1, r7, r6 - lsls r1, 3 - adds r1, r2 -_0819DB96: - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0819DBCA - .pool -_0819DBB0: - adds r0, r7, r6 - lsls r0, 3 - adds r0, r3 - movs r1, 0 - strh r1, [r0, 0x8] - ldr r2, =sub_819CE40 - lsrs r1, r2, 16 - strh r1, [r0, 0x14] - strh r2, [r0, 0x16] - movs r1, 0x1 - strh r1, [r0, 0x12] - ldr r1, =sub_819D770 - str r1, [r0] -_0819DBCA: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819D9EC - - thumb_func_start sub_819DBD8 -sub_819DBD8: @ 819DBD8 - push {r4,r5,lr} - ldr r5, =gUnknown_03001284 - ldr r4, [r5] - cmp r4, 0 - bne _0819DBF6 - movs r0, 0x34 - bl AllocZeroed - str r0, [r5] - strb r4, [r0, 0x3] - ldr r0, [r5] - adds r0, 0x30 - strb r4, [r0] - ldr r0, [r5] - strb r4, [r0, 0x15] -_0819DBF6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819DBD8 - - thumb_func_start sub_819DC00 -sub_819DC00: @ 819DC00 - push {lr} - ldr r0, =gUnknown_03001284 - movs r1, 0 - str r1, [r0] - ldr r0, =sub_819DC1C - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_819DC00 - - thumb_func_start sub_819DC1C -sub_819DC1C: @ 819DC1C - push {r4-r6,lr} - sub sp, 0xC - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r0, r1, r2 - ldrb r0, [r0] - adds r2, r1, 0 - cmp r0, 0xF - bls _0819DC32 - b _0819E0AA -_0819DC32: - lsls r0, 2 - ldr r1, =_0819DC44 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0819DC44: - .4byte _0819DC84 - .4byte _0819DCD4 - .4byte _0819DDA8 - .4byte _0819DE68 - .4byte _0819DE94 - .4byte _0819DECC - .4byte _0819DEEC - .4byte _0819DF10 - .4byte _0819DF30 - .4byte _0819DF3C - .4byte _0819DF64 - .4byte _0819DF70 - .4byte _0819DF78 - .4byte _0819DF8C - .4byte _0819DFA4 - .4byte _0819E01C -_0819DC84: - movs r0, 0 - bl SetHBlankCallback - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - str r0, [sp, 0x8] - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x05006000 - add r0, sp, 0x8 - bl CpuSet - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_086108B8 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - ldr r0, =gUnknown_086108C8 - bl InitWindows - bl DeactivateAllTextPrinters - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _0819E00E - .pool -_0819DCD4: - ldr r5, =gUnknown_0203CE40 - movs r4, 0x88 - lsls r4, 3 - adds r0, r4, 0 - bl Alloc - str r0, [r5] - ldr r5, =gUnknown_0203CE44 - adds r0, r4, 0 - bl AllocZeroed - str r0, [r5] - ldr r5, =gUnknown_0203CE48 - movs r4, 0x80 - lsls r4, 4 - adds r0, r4, 0 - bl Alloc - str r0, [r5] - ldr r5, =gUnknown_0203CE4C - adds r0, r4, 0 - bl AllocZeroed - str r0, [r5] - 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 - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4C - movs r1, 0 - bl SetGpuReg - movs r0, 0x40 - movs r1, 0 - bl SetGpuReg - movs r0, 0x44 - movs r1, 0 - bl SetGpuReg - movs r0, 0x42 - movs r1, 0 - bl SetGpuReg - movs r0, 0x46 - movs r1, 0 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4A - movs r1, 0 - bl SetGpuReg - b _0819E006 - .pool -_0819DDA8: - bl ResetPaletteFade - bl ResetSpriteData - bl ResetTasks - bl FreeAllSpritePalettes - bl dp13_810BB8C - ldr r0, =gUnknown_08DC0754 - ldr r5, =gUnknown_0203CE40 - ldr r1, [r5] - movs r2, 0x88 - lsls r2, 2 - bl CpuSet - ldr r0, =gUnknown_0861033C - ldr r4, =gUnknown_0203CE44 - ldr r1, [r4] - movs r2, 0x30 - bl CpuSet - ldr r1, [r5] - movs r2, 0x88 - lsls r2, 3 - movs r0, 0x1 - movs r3, 0 - bl LoadBgTiles - ldr r1, [r4] - movs r0, 0x3 - movs r2, 0x60 - movs r3, 0 - bl LoadBgTiles - ldr r0, =gUnknown_08DC0B94 - ldr r4, =gUnknown_0203CE48 - ldr r1, [r4] - movs r2, 0x80 - lsls r2, 3 - bl CpuSet - ldr r1, [r4] - movs r2, 0x80 - lsls r2, 4 - movs r0, 0x1 - movs r3, 0 - bl LoadBgTilemap - ldr r0, =gUnknown_08DC0714 - movs r1, 0 - movs r2, 0x40 - bl LoadPalette - ldr r4, =gUnknown_08610918 - adds r0, r4, 0 - movs r1, 0xF0 - movs r2, 0xA - bl LoadPalette - adds r0, r4, 0 - movs r1, 0xE0 - movs r2, 0xA - bl LoadPalette - ldr r0, =gUnknown_0861039C - movs r1, 0x20 - movs r2, 0x4 - bl LoadPalette - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _0819E00E - .pool -_0819DE68: - ldr r0, =gUnknown_0203CE4C - ldr r1, [r0] - movs r0, 0x3 - bl SetBgTilemapBuffer - ldr r1, =gUnknown_0861023C - movs r0, 0x8 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x3 - movs r2, 0xB - movs r3, 0x4 - bl CopyToBgTilemapBufferRect - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - b _0819E006 - .pool -_0819DE94: - ldr r0, =gUnknown_086106B0 - bl LoadSpritePalettes - ldr r0, =gUnknown_08610650 - bl LoadSpriteSheets - ldr r0, =gUnknown_086106A0 - bl LoadCompressedObjectPic - ldr r0, =sub_819C7FC - bl SetVBlankCallback - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _0819E00E - .pool -_0819DECC: - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldrb r0, [r1, 0x15] - cmp r0, 0x1 - bne _0819DEDC - ldr r0, =gUnknown_0203CF20 - ldrb r0, [r0] - strb r0, [r1, 0x3] -_0819DEDC: - movs r0, 0x87 - lsls r0, 3 - adds r1, r2, r0 - b _0819E00E - .pool -_0819DEEC: - bl sub_819DBD8 - bl sub_819E0C0 - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - ldrb r0, [r0, 0x15] - cmp r0, 0x1 - bne _0819DF02 - bl sub_819F304 -_0819DF02: - movs r0, 0 - bl sub_819F048 - b _0819E006 - .pool -_0819DF10: - ldr r0, =gUnknown_085EEC73 - bl sub_819EBEC - movs r0, 0x2 - bl PutWindowTilemap - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _0819E00E - .pool -_0819DF30: - bl sub_819EFA8 - movs r0, 0x8 - bl PutWindowTilemap - b _0819E006 -_0819DF3C: - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - ldrb r0, [r0, 0x15] - cmp r0, 0 - bne _0819DF4A - bl sub_819EB4C -_0819DF4A: - movs r0, 0x1 - bl PutWindowTilemap - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _0819E00E - .pool -_0819DF64: - bl sub_819EB18 - movs r0, 0 - bl PutWindowTilemap - b _0819E006 -_0819DF70: - movs r0, 0x87 - lsls r0, 3 - adds r1, r2, r0 - b _0819E00E -_0819DF78: - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - ldrb r0, [r0, 0x15] - cmp r0, 0 - beq _0819E006 - bl sub_819EE08 - b _0819E006 - .pool -_0819DF8C: - bl sub_819ED78 - movs r0, 0x3 - bl PutWindowTilemap - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _0819E00E - .pool -_0819DFA4: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - ldrb r0, [r0, 0x15] - cmp r0, 0x1 - bne _0819E000 - movs r0, 0x3 - bl ShowBg - ldr r1, =0x00001248 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x0000040b - movs r0, 0x52 - bl SetGpuReg - b _0819E006 - .pool -_0819E000: - movs r0, 0x3 - bl HideBg -_0819E006: - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 -_0819E00E: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0819E0AA - .pool -_0819E01C: - ldr r0, =sub_819CF54 - movs r1, 0 - bl CreateTask - ldr r6, =gUnknown_03001284 - ldr r1, [r6] - adds r1, 0x21 - strb r0, [r1] - ldr r0, [r6] - ldrb r5, [r0, 0x15] - cmp r5, 0 - bne _0819E06C - ldr r4, =gTasks - adds r0, 0x21 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - strh r5, [r0, 0x8] - ldr r0, =sub_819CE40 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r1, r0, 24 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - strh r5, [r0, 0x8] - b _0819E0A4 - .pool -_0819E06C: - bl sub_819EAF8 - ldr r4, =gTasks - ldr r2, [r6] - adds r0, r2, 0 - adds r0, 0x21 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - movs r3, 0 - movs r1, 0x1 - strh r1, [r0, 0x8] - adds r2, 0x22 - strb r3, [r2] - ldr r0, =sub_819CD34 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r1, r0, 24 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - movs r1, 0x2 - strh r1, [r0, 0x8] -_0819E0A4: - ldr r0, =sub_819C7E0 - bl SetMainCallback2 -_0819E0AA: - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819DC1C - - thumb_func_start sub_819E0C0 -sub_819E0C0: @ 819E0C0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - mov r1, sp - ldr r0, =gUnknown_08610834 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2,r5,r6} - stm r1!, {r2,r5,r6} - mov r1, sp - movs r0, 0x65 - strh r0, [r1, 0x2] - movs r6, 0 - ldr r4, =gUnknown_03001284 - movs r7, 0 - ldr r5, =gSprites -_0819E0E6: - lsls r1, r6, 1 - adds r1, r6 - lsls r1, 20 - movs r3, 0x90 - lsls r3, 15 - adds r1, r3 - asrs r1, 16 - mov r0, sp - movs r2, 0x40 - movs r3, 0x1 - bl CreateSprite - ldr r1, [r4] - adds r1, 0x5 - adds r1, r6 - strb r0, [r1] - ldr r0, [r4] - adds r0, 0x5 - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r7, [r0, 0x2E] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x2 - bls _0819E0E6 - ldr r7, =gUnknown_03001284 - ldr r1, [r7] - adds r0, r1, 0x5 - ldrb r1, [r1, 0x3] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =gSprites - adds r0, r4 - movs r5, 0x20 - ldrsh r1, [r0, r5] - ldr r0, =gUnknown_0861084C - movs r2, 0x58 - movs r3, 0 - bl CreateSprite - ldr r1, [r7] - movs r4, 0 - strb r0, [r1, 0x4] - ldr r0, =gUnknown_08610864 - movs r1, 0xB0 - movs r2, 0x70 - movs r3, 0 - bl CreateSprite - ldr r1, [r7] - strb r0, [r1, 0x1] - ldr r0, =gUnknown_0861087C - movs r1, 0xB0 - movs r2, 0x90 - movs r3, 0 - bl CreateSprite - ldr r1, [r7] - strb r0, [r1, 0x2] - ldr r0, [r7] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r6, =gSprites - adds r0, r6 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldr r0, [r7] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - ldr r0, [r7] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x28 - strb r4, [r0] - ldr r0, [r7] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x29 - strb r4, [r0] - ldr r0, [r7] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x28 - strb r4, [r0] - ldr r0, [r7] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x29 - strb r4, [r0] - ldr r0, [r7] - ldrb r0, [r0, 0x15] - movs r1, 0xC0 - str r1, [sp, 0x18] - cmp r0, 0x1 - bne _0819E1E8 - movs r2, 0xF0 - str r2, [sp, 0x18] -_0819E1E8: - mov r1, sp - ldr r0, =gUnknown_0861084C - ldm r0!, {r3-r5} - stm r1!, {r3-r5} - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - mov r0, sp - movs r4, 0x68 - mov r10, r4 - mov r5, r10 - strh r5, [r0] - movs r1, 0xF0 - movs r2, 0x78 - movs r3, 0xA - bl CreateSprite - ldr r1, [r7] - strb r0, [r1, 0x8] - mov r1, sp - ldr r0, =gUnknown_08610864 - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - ldm r0!, {r4-r6} - stm r1!, {r4-r6} - mov r0, sp - movs r1, 0x69 - mov r9, r1 - mov r2, r9 - strh r2, [r0] - movs r4, 0x80 - lsls r4, 1 - adds r1, r4, 0 - movs r2, 0x78 - movs r3, 0xA - bl CreateSprite - ldr r1, [r7] - strb r0, [r1, 0x9] - movs r5, 0x90 - lsls r5, 1 - mov r0, sp - adds r1, r5, 0 - movs r2, 0x78 - movs r3, 0xA - bl CreateSprite - ldr r1, [r7] - strb r0, [r1, 0xA] - mov r1, sp - ldr r0, =gUnknown_0861084C - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - mov r0, sp - movs r3, 0x6A - mov r8, r3 - mov r6, r8 - strh r6, [r0] - movs r1, 0xF0 - movs r2, 0x78 - movs r3, 0x1 - bl CreateSprite - ldr r1, [r7] - strb r0, [r1, 0xB] - mov r1, sp - ldr r0, =gUnknown_08610864 - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - mov r1, sp - movs r0, 0x6B - strh r0, [r1] - mov r0, sp - adds r1, r4, 0 - movs r2, 0x78 - movs r3, 0x1 - bl CreateSprite - ldr r1, [r7] - strb r0, [r1, 0xC] - mov r0, sp - movs r6, 0x6C - strh r6, [r0] - adds r1, r5, 0 - movs r2, 0x78 - movs r3, 0x1 - bl CreateSprite - ldr r1, [r7] - strb r0, [r1, 0xD] - mov r1, sp - ldr r0, =gUnknown_0861084C - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - mov r0, sp - mov r4, r10 - strh r4, [r0] - ldr r1, [sp, 0x18] - movs r2, 0x90 - movs r3, 0xA - bl CreateSprite - ldr r1, [r7] - strb r0, [r1, 0xE] - mov r1, sp - ldr r0, =gUnknown_08610864 - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - ldm r0!, {r2,r4,r5} - stm r1!, {r2,r4,r5} - mov r0, sp - mov r3, r9 - strh r3, [r0] - ldr r4, [sp, 0x18] - adds r4, 0x10 - adds r1, r4, 0 - movs r2, 0x90 - movs r3, 0xA - bl CreateSprite - ldr r1, [r7] - strb r0, [r1, 0xF] - mov r1, sp - ldr r0, =gUnknown_0861084C - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - mov r0, sp - mov r5, r8 - strh r5, [r0] - ldr r1, [sp, 0x18] - movs r2, 0x90 - movs r3, 0x1 - bl CreateSprite - ldr r1, [r7] - strb r0, [r1, 0x10] - mov r1, sp - ldr r0, =gUnknown_08610864 - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - mov r0, sp - strh r6, [r0] - adds r1, r4, 0 - movs r2, 0x90 - movs r3, 0x1 - bl CreateSprite - ldr r1, [r7] - strb r0, [r1, 0x11] - movs r6, 0 - ldr r5, =gSprites - adds r4, r7, 0 - movs r7, 0 - movs r0, 0x4 - mov r10, r0 -_0819E330: - ldr r0, [r4] - lsls r3, r6, 1 - adds r2, r3, r6 - adds r0, 0x8 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x28 - strb r7, [r0] - ldr r0, [r4] - adds r0, 0x8 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x29 - strb r7, [r0] - ldr r0, [r4] - adds r0, 0x9 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x28 - strb r7, [r0] - ldr r0, [r4] - adds r0, 0x9 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x29 - strb r7, [r0] - ldr r0, [r4] - adds r0, 0xA - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x28 - strb r7, [r0] - ldr r0, [r4] - adds r0, 0xA - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x29 - strb r7, [r0] - ldr r0, [r4] - adds r0, 0xE - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x28 - strb r7, [r0] - ldr r0, [r4] - adds r0, 0xE - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x29 - strb r7, [r0] - ldr r0, [r4] - adds r0, 0xF - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x28 - strb r7, [r0] - ldr r0, [r4] - adds r0, 0xF - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x29 - strb r7, [r0] - ldr r0, [r4] - adds r0, 0x8 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - mov r8, r0 - ldrb r1, [r0] - mov r0, r10 - orrs r1, r0 - mov r0, r8 - strb r1, [r0] - ldr r0, [r4] - adds r0, 0x9 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - mov r8, r0 - ldrb r1, [r0] - mov r0, r10 - orrs r1, r0 - mov r0, r8 - strb r1, [r0] - ldr r0, [r4] - adds r0, 0xA - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - mov r2, r10 - orrs r1, r2 - strb r1, [r0] - ldr r0, [r4] - adds r0, 0xE - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - ldr r0, [r4] - adds r0, 0xF - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r3, =gUnknown_03001284 - mov r8, r3 - ldr r0, =gSprites - mov r9, r0 - cmp r6, 0x1 - bhi _0819E496 - b _0819E330 -_0819E496: - ldr r0, [r3] - ldrb r0, [r0, 0xE] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r9 - adds r1, 0x3E - ldrb r2, [r1] - movs r3, 0x5 - negs r3, r3 - adds r0, r3, 0 - b _0819E4C8 - .pool -_0819E4C8: - ands r0, r2 - strb r0, [r1] - mov r1, r8 - ldr r0, [r1] - ldrb r1, [r0, 0xF] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r9 - adds r0, 0x3E - ldrb r2, [r0] - adds r1, r3, 0 - ands r1, r2 - strb r1, [r0] - mov r2, r8 - ldr r0, [r2] - ldrb r1, [r0, 0x8] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r9 - adds r0, 0x3E - ldrb r2, [r0] - adds r1, r3, 0 - ands r1, r2 - strb r1, [r0] - mov r4, r8 - ldr r0, [r4] - ldrb r1, [r0, 0x9] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r9 - adds r0, 0x3E - ldrb r2, [r0] - adds r1, r3, 0 - ands r1, r2 - strb r1, [r0] - ldr r0, [r4] - ldrb r1, [r0, 0xA] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r9 - adds r0, 0x3E - ldrb r1, [r0] - ands r3, r1 - strb r3, [r0] - add sp, 0x1C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_819E0C0 - - thumb_func_start sub_819E538 -sub_819E538: @ 819E538 - push {r4-r7,lr} - movs r5, 0 -_0819E53C: - ldr r6, =gUnknown_03001284 - ldr r0, [r6] - adds r0, 0x5 - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =gSprites - adds r0, r4 - bl DestroySprite - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _0819E53C - ldr r0, [r6] - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl DestroySprite - ldr r0, [r6] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl DestroySprite - ldr r0, [r6] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl DestroySprite - movs r5, 0 -_0819E590: - movs r4, 0 - lsls r6, r5, 1 -_0819E594: - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r1, r6, r5 - adds r1, r4, r1 - adds r0, 0x8 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySprite - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _0819E594 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bls _0819E590 - movs r5, 0 -_0819E5C6: - movs r4, 0 - adds r7, r5, 0x1 - lsls r6, r5, 1 -_0819E5CC: - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r1, r4, r6 - adds r0, 0xE - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySprite - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _0819E5CC - lsls r0, r7, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bls _0819E5C6 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819E538 - - thumb_func_start sub_819E608 -sub_819E608: @ 819E608 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x2 - bhi _0819E65C - ldr r4, =gSprites - ldr r5, =gUnknown_03001284 - ldr r0, [r5] - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - bl sub_819E8EC - ldr r0, [r5] - ldrb r2, [r0, 0x4] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - adds r0, 0x5 - adds r0, r6 - ldrb r2, [r0] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r4 - ldrh r0, [r0, 0x20] - strh r0, [r1, 0x20] - b _0819E684 - .pool -_0819E65C: - ldr r2, =gSprites - ldr r3, =gUnknown_03001284 - ldr r0, [r3] - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldr r0, [r3] - ldr r1, [r0, 0x18] - lsls r0, r6, 3 - adds r0, r1 - ldrb r0, [r0] - bl sub_819E838 -_0819E684: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819E608 - - thumb_func_start sub_819E694 -sub_819E694: @ 819E694 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl PlaySE - lsls r4, 24 - cmp r4, 0 - ble _0819E6C0 - ldr r1, =gUnknown_03001284 - ldr r2, [r1] - ldrb r0, [r2, 0x3] - adds r0, 0x1 - ldrb r3, [r2, 0x17] - cmp r0, r3 - bne _0819E6D8 - movs r0, 0 - b _0819E6D8 - .pool -_0819E6C0: - ldr r0, =gUnknown_03001284 - ldr r2, [r0] - ldrb r3, [r2, 0x3] - adds r1, r0, 0 - cmp r3, 0 - beq _0819E6D4 - subs r0, r3, 0x1 - b _0819E6D8 - .pool -_0819E6D4: - ldrb r0, [r2, 0x17] - subs r0, 0x1 -_0819E6D8: - strb r0, [r2, 0x3] - ldr r0, [r1] - ldrb r0, [r0, 0x3] - bl sub_819E608 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_819E694 - - thumb_func_start sub_819E6E8 -sub_819E6E8: @ 819E6E8 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl PlaySE - lsls r4, 24 - cmp r4, 0 - ble _0819E728 - ldr r0, =gUnknown_03001284 - ldr r2, [r0] - ldrb r1, [r2, 0x3] - adds r4, r0, 0 - cmp r1, 0x2 - bhi _0819E714 - movs r0, 0x3 - strb r0, [r2, 0x3] - b _0819E74A - .pool -_0819E714: - ldrb r0, [r2, 0x3] - adds r0, 0x1 - ldrb r1, [r2, 0x17] - cmp r0, r1 - beq _0819E722 - strb r0, [r2, 0x3] - b _0819E74A -_0819E722: - movs r0, 0 - strb r0, [r2, 0x3] - b _0819E74A -_0819E728: - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldrb r3, [r1, 0x3] - adds r2, r3, 0 - adds r4, r0, 0 - cmp r2, 0x2 - bls _0819E744 - cmp r2, 0 - beq _0819E744 - subs r0, r3, 0x1 - b _0819E748 - .pool -_0819E744: - ldrb r0, [r1, 0x17] - subs r0, 0x1 -_0819E748: - strb r0, [r1, 0x3] -_0819E74A: - ldr r0, [r4] - ldrb r0, [r0, 0x3] - bl sub_819E608 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_819E6E8 - - thumb_func_start sub_819E758 -sub_819E758: @ 819E758 - push {lr} - lsls r0, 24 - cmp r0, 0 - ble _0819E778 - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldrb r3, [r1, 0x16] - adds r2, r0, 0 - cmp r3, 0x1 - beq _0819E774 - adds r0, r3, 0x1 - b _0819E78E - .pool -_0819E774: - movs r0, 0 - b _0819E78E -_0819E778: - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldrb r3, [r1, 0x16] - adds r2, r0, 0 - cmp r3, 0 - beq _0819E78C - subs r0, r3, 0x1 - b _0819E78E - .pool -_0819E78C: - movs r0, 0x1 -_0819E78E: - strb r0, [r1, 0x16] - ldr r3, =gSprites - ldr r2, [r2] - ldrb r0, [r2, 0x1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r0, [r2, 0x16] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - ldrb r0, [r2, 0x2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r0, [r2, 0x16] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - pop {r0} - bx r0 - .pool - thumb_func_end sub_819E758 - - thumb_func_start sub_819E7C0 -sub_819E7C0: @ 819E7C0 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl PlaySE - lsls r4, 24 - cmp r4, 0 - ble _0819E7EC - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldrb r3, [r1] - adds r2, r0, 0 - cmp r3, 0x2 - beq _0819E7E8 - adds r0, r3, 0x1 - b _0819E802 - .pool -_0819E7E8: - movs r0, 0 - b _0819E802 -_0819E7EC: - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldrb r3, [r1] - adds r2, r0, 0 - cmp r3, 0 - beq _0819E800 - subs r0, r3, 0x1 - b _0819E802 - .pool -_0819E800: - movs r0, 0x2 -_0819E802: - strb r0, [r1] - ldr r3, =gSprites - ldr r2, [r2] - ldrb r0, [r2, 0x1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r0, [r2] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - ldrb r0, [r2, 0x2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r0, [r2] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819E7C0 - - thumb_func_start sub_819E838 -sub_819E838: @ 819E838 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r6, r0, 24 - movs r4, 0 - movs r0, 0x5 - negs r0, r0 - mov r9, r0 - movs r2, 0x4 - mov r8, r2 - ldr r0, =gSprites - mov r12, r0 - ldr r7, =gUnknown_03001284 -_0819E856: - cmp r6, 0x2 - bne _0819E898 - ldr r5, =gSprites - ldr r3, =gUnknown_03001284 - ldr r0, [r3] - adds r0, 0xB - adds r0, r4 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - adds r1, 0x3E - ldrb r2, [r1] - mov r0, r9 - ands r0, r2 - strb r0, [r1] - cmp r4, 0x1 - bhi _0819E8D4 - ldr r0, [r3] - adds r0, 0x10 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - b _0819E8CA - .pool -_0819E898: - cmp r6, 0x3 - bne _0819E8D4 - cmp r4, 0x1 - bhi _0819E8BA - ldr r0, [r7] - adds r0, 0x10 - adds r0, r4 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r12 - adds r1, 0x3E - ldrb r2, [r1] - mov r0, r9 - ands r0, r2 - strb r0, [r1] -_0819E8BA: - ldr r0, [r7] - adds r0, 0xB - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r12 -_0819E8CA: - adds r0, 0x3E - ldrb r1, [r0] - mov r2, r8 - orrs r1, r2 - strb r1, [r0] -_0819E8D4: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _0819E856 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_819E838 - - thumb_func_start sub_819E8EC -sub_819E8EC: @ 819E8EC - push {r4-r6,lr} - movs r2, 0 - ldr r5, =gSprites - ldr r4, =gUnknown_03001284 - adds r6, r5, 0 - movs r3, 0x4 -_0819E8F8: - ldr r0, [r4] - adds r0, 0xB - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r3 - strb r1, [r0] - cmp r2, 0x1 - bhi _0819E92C - ldr r0, [r4] - adds r0, 0x10 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r3 - strb r1, [r0] -_0819E92C: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x2 - bls _0819E8F8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819E8EC - - thumb_func_start sub_819E944 -sub_819E944: @ 819E944 - push {r4,r5,lr} - ldr r0, =gUnknown_03001284 - ldr r3, [r0] - ldrb r1, [r3, 0x15] - adds r5, r0, 0 - cmp r1, 0x1 - bne _0819E95C - movs r0, 0 - strb r0, [r3, 0x15] - b _0819E960 - .pool -_0819E95C: - movs r0, 0 - strb r0, [r3] -_0819E960: - ldr r4, =gSprites - ldr r2, [r5] - ldrb r1, [r2, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xB0 - strh r1, [r0, 0x20] - ldrb r0, [r2, 0x1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r0, [r2] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - ldrb r1, [r2, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xD0 - strh r1, [r0, 0x20] - ldrb r0, [r2, 0x2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r0, [r2] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - ldrb r0, [r2, 0x1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r1] - ldr r0, [r5] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - ands r2, r1 - strb r2, [r0] - bl sub_819EC20 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819E944 - - thumb_func_start sub_819E9E0 -sub_819E9E0: @ 819E9E0 - push {r4,r5,lr} - ldr r5, =gUnknown_03001284 - ldr r1, [r5] - movs r0, 0 - strb r0, [r1, 0x16] - ldr r4, =gSprites - ldr r2, [r5] - ldrb r1, [r2, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xB0 - strh r1, [r0, 0x20] - ldrb r1, [r2, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r3, 0x70 - strh r3, [r0, 0x22] - ldrb r1, [r2, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xD0 - strh r1, [r0, 0x20] - ldrb r1, [r2, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r3, [r0, 0x22] - ldrb r0, [r2, 0x1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r1] - ldr r0, [r5] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - ands r2, r1 - strb r2, [r0] - bl sub_819EC94 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819E9E0 - - thumb_func_start sub_819EA64 -sub_819EA64: @ 819EA64 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =gSprites - ldr r3, =gUnknown_03001284 - ldr r0, [r3] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldr r0, [r3] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r4, 0 - movs r1, 0x2 - bl CopyWindowToVram - adds r0, r4, 0 - bl ClearWindowTilemap - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819EA64 - - thumb_func_start sub_819EAC0 -sub_819EAC0: @ 819EAC0 - push {lr} - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - movs r1, 0x2 - bl CopyWindowToVram - pop {r0} - bx r0 - thumb_func_end sub_819EAC0 - - thumb_func_start sub_819EADC -sub_819EADC: @ 819EADC - push {lr} - movs r0, 0x7 - bl PutWindowTilemap - movs r0, 0x7 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x7 - movs r1, 0x2 - bl CopyWindowToVram - pop {r0} - bx r0 - thumb_func_end sub_819EADC - - thumb_func_start sub_819EAF8 -sub_819EAF8: @ 819EAF8 - push {lr} - bl sub_819EAC0 - movs r0, 0x5 - bl PutWindowTilemap - movs r0, 0x5 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x5 - movs r1, 0x2 - bl CopyWindowToVram - pop {r0} - bx r0 - thumb_func_end sub_819EAF8 - - thumb_func_start sub_819EB18 -sub_819EB18: @ 819EB18 - push {lr} - sub sp, 0xC - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r2, =gUnknown_085EEC66 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x2 - bl PrintTextOnWindow - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_819EB18 - - thumb_func_start sub_819EB4C -sub_819EB4C: @ 819EB4C - push {r4,lr} - sub sp, 0xC - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldrb r0, [r1, 0x3] - cmp r0, 0x2 - bls _0819EB70 - movs r0, 0x1 - movs r1, 0x2 - bl CopyWindowToVram - b _0819EBD4 - .pool -_0819EB70: - ldrb r2, [r1, 0x3] - ldrb r0, [r1, 0x14] - cmp r0, 0 - bne _0819EB84 - movs r0, 0x64 - muls r0, r2 - ldr r1, =gPlayerParty - b _0819EB8A - .pool -_0819EB84: - movs r0, 0x64 - muls r0, r2 - ldr r1, =gEnemyParty -_0819EB8A: - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl GetMonData - lsls r0, 16 - lsrs r1, r0, 16 - ldr r4, =gStringVar4 - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - adds r0, r4, 0 - bl StringCopy - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x56 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_08610925 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r3, 0x1 - bl box_print - movs r0, 0x1 - movs r1, 0x3 - bl CopyWindowToVram -_0819EBD4: - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819EB4C - - thumb_func_start sub_819EBEC -sub_819EBEC: @ 819EBEC - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - movs r0, 0x2 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x5 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0x2 - bl PrintTextOnWindow - movs r0, 0x2 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_819EBEC - - thumb_func_start sub_819EC20 -sub_819EC20: @ 819EC20 - push {r4,r5,lr} - sub sp, 0xC - movs r0, 0x3 - bl PutWindowTilemap - movs r0, 0x3 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r5, =gUnknown_08610922 - str r5, [sp] - movs r4, 0 - str r4, [sp, 0x4] - ldr r0, =gUnknown_085EECAA - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0xF - movs r3, 0x1 - bl box_print - str r5, [sp] - str r4, [sp, 0x4] - ldr r0, =gUnknown_085EECA5 - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0xF - movs r3, 0x11 - bl box_print - str r5, [sp] - str r4, [sp, 0x4] - ldr r0, =gUnknown_085EECB2 - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0xF - movs r3, 0x21 - bl box_print - movs r0, 0x3 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819EC20 - - thumb_func_start sub_819EC94 -sub_819EC94: @ 819EC94 - push {r4,r5,lr} - sub sp, 0xC - movs r0, 0x4 - bl PutWindowTilemap - movs r0, 0x4 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r5, =gUnknown_08610922 - str r5, [sp] - movs r4, 0 - str r4, [sp, 0x4] - ldr r0, =gUnknown_085EECCA - str r0, [sp, 0x8] - movs r0, 0x4 - movs r1, 0x1 - movs r2, 0x7 - movs r3, 0x1 - bl box_print - str r5, [sp] - str r4, [sp, 0x4] - ldr r0, =gUnknown_085EECCE - str r0, [sp, 0x8] - movs r0, 0x4 - movs r1, 0x1 - movs r2, 0x7 - movs r3, 0x11 - bl box_print - movs r0, 0x4 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819EC94 - - thumb_func_start sub_819ECF0 -sub_819ECF0: @ 819ECF0 - push {r4-r6,lr} - sub sp, 0xC - adds r6, r0, 0 - adds r5, r1, 0 - adds r4, r2, 0 - movs r0, 0 - adds r1, r6, 0 - movs r2, 0x46 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_08610922 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r6, [sp, 0x8] - adds r0, r4, 0 - movs r1, 0 - adds r3, r5, 0 - bl box_print - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819ECF0 - - thumb_func_start sub_819ED34 -sub_819ED34: @ 819ED34 - push {lr} - movs r0, 0x5 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - ldrb r0, [r0, 0x14] - cmp r0, 0 - beq _0819ED56 - cmp r0, 0x1 - bne _0819ED60 - ldr r0, =gUnknown_085EECD1 - movs r1, 0 - movs r2, 0x5 - bl sub_819ECF0 -_0819ED56: - ldr r0, =gUnknown_085EECDD - movs r1, 0x18 - movs r2, 0x5 - bl sub_819ECF0 -_0819ED60: - movs r0, 0x5 - movs r1, 0x3 - bl CopyWindowToVram - pop {r0} - bx r0 - .pool - thumb_func_end sub_819ED34 - - thumb_func_start sub_819ED78 -sub_819ED78: @ 819ED78 - push {lr} - movs r0, 0x3 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - ldrb r0, [r0, 0x14] - cmp r0, 0 - beq _0819ED9A - cmp r0, 0x1 - bne _0819EDA4 - ldr r0, =gUnknown_085EECD1 - movs r1, 0x8 - movs r2, 0x3 - bl sub_819ECF0 -_0819ED9A: - ldr r0, =gUnknown_085EECDD - movs r1, 0x20 - movs r2, 0x3 - bl sub_819ECF0 -_0819EDA4: - movs r0, 0x3 - movs r1, 0x3 - bl CopyWindowToVram - pop {r0} - bx r0 - .pool - thumb_func_end sub_819ED78 - - thumb_func_start sub_819EDBC -sub_819EDBC: @ 819EDBC - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _0819EDCC - cmp r0, 0x1 - beq _0819EDEC - b _0819EDF6 -_0819EDCC: - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - ldrb r0, [r0, 0x14] - cmp r0, 0x1 - bne _0819EDF6 - ldr r0, =gUnknown_085EECD1 - movs r1, 0x8 - movs r2, 0x3 - bl sub_819ECF0 - b _0819EDF6 - .pool -_0819EDEC: - ldr r0, =gUnknown_085EECDD - movs r1, 0x20 - movs r2, 0x3 - bl sub_819ECF0 -_0819EDF6: - movs r0, 0x3 - movs r1, 0x3 - bl CopyWindowToVram - pop {r0} - bx r0 - .pool - thumb_func_end sub_819EDBC - - thumb_func_start sub_819EE08 -sub_819EE08: @ 819EE08 - push {r4,lr} - sub sp, 0x18 - ldr r0, =gUnknown_08610918 - add r1, sp, 0xC - movs r2, 0x4 - bl CpuSet - ldr r0, =gUnknown_03001284 - ldr r2, [r0] - ldrb r0, [r2, 0x15] - cmp r0, 0 - bne _0819EE3C - add r0, sp, 0xC - ldr r1, =gPlttBufferFaded - movs r2, 0xE4 - lsls r2, 1 - adds r1, r2 - ldrh r1, [r1] - strh r1, [r0, 0x8] - b _0819EE42 - .pool -_0819EE3C: - add r1, sp, 0xC - ldrh r0, [r2, 0x24] - strh r0, [r1, 0x8] -_0819EE42: - add r0, sp, 0xC - movs r1, 0xF0 - movs r2, 0xA - bl LoadPalette - movs r0, 0x7 - bl PutWindowTilemap - movs r0, 0x7 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldrb r0, [r1, 0x3] - cmp r0, 0x2 - bls _0819EE74 - movs r0, 0x7 - movs r1, 0x3 - bl CopyWindowToVram - b _0819EED8 - .pool -_0819EE74: - ldrb r2, [r1, 0x3] - ldrb r0, [r1, 0x14] - cmp r0, 0 - bne _0819EE88 - movs r0, 0x64 - muls r0, r2 - ldr r1, =gPlayerParty - b _0819EE8E - .pool -_0819EE88: - movs r0, 0x64 - muls r0, r2 - ldr r1, =gEnemyParty -_0819EE8E: - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl GetMonData - lsls r0, 16 - lsrs r1, r0, 16 - ldr r4, =gStringVar4 - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - adds r0, r4, 0 - bl StringCopy - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x56 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_08610925 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x7 - movs r1, 0x1 - movs r3, 0x1 - bl box_print - movs r0, 0x7 - movs r1, 0x3 - bl CopyWindowToVram -_0819EED8: - add sp, 0x18 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819EE08 - - thumb_func_start sub_819EEF0 -sub_819EEF0: @ 819EEF0 - push {r4,lr} - sub sp, 0xC - ldr r0, =gUnknown_08610918 - movs r1, 0xE0 - movs r2, 0xA - bl LoadPalette - ldr r0, =gPlttBufferUnfaded+ 0x1E0 - ldr r1, =gPlttBufferFaded + 0x1C0 - movs r2, 0x5 - bl CpuSet - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldrb r0, [r1, 0x3] - cmp r0, 0x2 - bls _0819EF2C - movs r0, 0x1 - movs r1, 0x2 - bl CopyWindowToVram - b _0819EF90 - .pool -_0819EF2C: - ldrb r2, [r1, 0x3] - ldrb r0, [r1, 0x14] - cmp r0, 0 - bne _0819EF40 - movs r0, 0x64 - muls r0, r2 - ldr r1, =gPlayerParty - b _0819EF46 - .pool -_0819EF40: - movs r0, 0x64 - muls r0, r2 - ldr r1, =gEnemyParty -_0819EF46: - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl GetMonData - lsls r0, 16 - lsrs r1, r0, 16 - ldr r4, =gStringVar4 - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - adds r0, r4, 0 - bl StringCopy - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x56 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_08610925 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r3, 0x1 - bl box_print - movs r0, 0x1 - movs r1, 0x3 - bl CopyWindowToVram -_0819EF90: - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819EEF0 - - thumb_func_start sub_819EFA8 -sub_819EFA8: @ 819EFA8 - push {r4-r6,lr} - sub sp, 0x2C - ldr r6, =gUnknown_03001284 - ldr r0, [r6] - ldrb r4, [r0, 0x3] - adds r5, r4, 0 - movs r0, 0x8 - movs r1, 0 - bl FillWindowPixelBuffer - cmp r4, 0x2 - bls _0819EFD0 - movs r0, 0x8 - movs r1, 0x2 - bl CopyWindowToVram - b _0819F03A - .pool -_0819EFD0: - movs r0, 0x8 - bl PutWindowTilemap - ldr r0, [r6] - ldrb r0, [r0, 0x14] - cmp r0, 0 - bne _0819EFEC - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - b _0819EFF2 - .pool -_0819EFEC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty -_0819EFF2: - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - add r1, sp, 0xC - bl sub_81DB468 - movs r0, 0x1 - add r1, sp, 0xC - movs r2, 0x76 - bl GetStringRightAlignXOffset - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x8 - movs r1, 0x1 - add r2, sp, 0xC - bl PrintTextOnWindow - movs r0, 0x8 - movs r1, 0x2 - bl CopyWindowToVram -_0819F03A: - add sp, 0x2C - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819EFA8 - - thumb_func_start sub_819F048 -sub_819F048: @ 819F048 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r4, =gUnknown_03001284 - ldr r3, [r4] - ldrb r0, [r3, 0x15] - cmp r0, 0x1 - beq _0819F094 - cmp r2, 0 - beq _0819F068 - cmp r2, 0x1 - beq _0819F080 - b _0819F094 - .pool -_0819F068: - strb r2, [r3, 0x14] - ldr r0, [r4] - strb r2, [r0, 0x3] - ldr r1, [r4] - movs r0, 0x4 - strb r0, [r1, 0x17] - ldr r1, [r4] - ldr r0, =gUnknown_08610928 - b _0819F092 - .pool -_0819F080: - movs r1, 0 - strb r2, [r3, 0x14] - ldr r0, [r4] - strb r1, [r0, 0x3] - ldr r1, [r4] - movs r0, 0x5 - strb r0, [r1, 0x17] - ldr r1, [r4] - ldr r0, =gUnknown_08610948 -_0819F092: - str r0, [r1, 0x18] -_0819F094: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F048 - - thumb_func_start sub_819F0A0 -sub_819F0A0: @ 819F0A0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r3, =gUnknown_03001280 - ldr r2, =gUnknown_086108AC - ldr r1, =gUnknown_03001284 - ldr r1, [r1] - ldrb r1, [r1] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - str r1, [r3] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F0A0 - - thumb_func_start sub_819F0CC -sub_819F0CC: @ 819F0CC - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =gUnknown_03001284 - ldr r1, [r5] - ldr r0, [r1, 0x2C] - adds r1, 0x30 - movs r2, 0x1 - bl sub_819F3F8 - ldr r0, [r5] - ldrb r1, [r0, 0x3] - movs r5, 0 - strb r1, [r0, 0x12] - movs r0, 0x3 - bl sub_819EA64 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - strh r5, [r0, 0x8] - ldr r1, =sub_819D9EC - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F0CC - - thumb_func_start sub_819F114 -sub_819F114: @ 819F114 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0x6 - strh r0, [r1, 0x8] - ldr r0, =sub_819C90C - str r0, [r1] - bx lr - .pool - thumb_func_end sub_819F114 - - thumb_func_start sub_819F134 -sub_819F134: @ 819F134 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldr r0, [r1, 0x2C] - adds r1, 0x30 - movs r2, 0x1 - bl sub_819F3F8 - movs r0, 0x3 - bl sub_819EA64 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x8] - ldr r2, =sub_819CE40 - lsrs r1, r2, 16 - strh r1, [r0, 0x14] - strh r2, [r0, 0x16] - movs r1, 0x1 - strh r1, [r0, 0x12] - ldr r1, =sub_819D770 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F134 - - thumb_func_start sub_819F184 -sub_819F184: @ 819F184 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r3, =gUnknown_03001280 - ldr r1, =gUnknown_03001284 - ldr r2, [r1] - ldrb r1, [r2, 0x3] - ldr r2, [r2, 0x18] - lsls r1, 3 - adds r1, r2 - ldr r1, [r1, 0x4] - str r1, [r3] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F184 - - thumb_func_start sub_819F1AC -sub_819F1AC: @ 819F1AC - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r2, =sub_819CC24 - lsrs r0, r2, 16 - movs r3, 0 - strh r0, [r1, 0x14] - strh r2, [r1, 0x16] - strh r3, [r1, 0x8] - strh r3, [r1, 0x12] - ldr r0, =sub_819D588 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_819F1AC - - thumb_func_start sub_819F1DC -sub_819F1DC: @ 819F1DC - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r2, =sub_819D9EC - lsrs r0, r2, 16 - movs r3, 0 - strh r0, [r1, 0x14] - strh r2, [r1, 0x16] - strh r3, [r1, 0x12] - strh r3, [r1, 0x8] - ldr r0, =sub_819D588 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_819F1DC - - thumb_func_start sub_819F20C -sub_819F20C: @ 819F20C - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r5, =gUnknown_03001284 - ldr r1, [r5] - ldrb r0, [r1, 0x14] - cmp r0, 0 - bne _0819F240 - ldr r3, =gTasks - lsls r4, r6, 2 - adds r0, r4, r6 - lsls r0, 3 - adds r0, r3 - ldr r2, =sub_819CD34 - lsrs r1, r2, 16 - strh r1, [r0, 0x14] - strh r2, [r0, 0x16] - movs r1, 0x2 - strh r1, [r0, 0x12] - b _0819F292 - .pool -_0819F240: - ldrb r0, [r1, 0x3] - bl sub_819F59C - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bne _0819F278 - ldr r1, [r5] - adds r0, r1, 0 - adds r0, 0x2D - adds r1, 0x30 - movs r2, 0x1 - bl sub_819F2B4 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x8] - strh r4, [r0, 0x12] - ldr r1, =sub_819F488 - b _0819F29E - .pool -_0819F278: - ldr r4, =gTasks - lsls r5, r6, 2 - adds r0, r5, r6 - lsls r0, 3 - adds r0, r4 - ldr r2, =sub_819CCD4 - lsrs r1, r2, 16 - movs r3, 0 - strh r1, [r0, 0x14] - strh r2, [r0, 0x16] - strh r3, [r0, 0x12] - adds r3, r4, 0 - adds r4, r5, 0 -_0819F292: - adds r0, r4, r6 - lsls r0, 3 - adds r0, r3 - movs r1, 0 - strh r1, [r0, 0x8] - ldr r1, =sub_819D588 -_0819F29E: - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F20C - - thumb_func_start sub_819F2B4 -sub_819F2B4: @ 819F2B4 - push {r4-r6,lr} - adds r4, r0, 0 - adds r6, r1, 0 - lsls r5, r2, 24 - lsrs r5, 24 - ldr r0, =gUnknown_08610894 - movs r1, 0x78 - movs r2, 0x40 - movs r3, 0x1 - bl CreateSprite - strb r0, [r4] - ldr r2, =gSprites - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r2, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_819F600 - str r1, [r0] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r5, [r0, 0x3C] - movs r0, 0x1 - strb r0, [r6] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F2B4 - - thumb_func_start sub_819F304 -sub_819F304: @ 819F304 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - sub sp, 0x10 - ldr r0, =gUnknown_08610894 - movs r1, 0x78 - movs r2, 0x40 - movs r3, 0x1 - bl CreateSprite - ldr r6, =gUnknown_03001284 - ldr r1, [r6] - adds r1, 0x2D - movs r2, 0 - mov r10, r2 - strb r0, [r1] - ldr r0, [r6] - adds r0, 0x2D - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - mov r8, r1 - add r0, r8 - movs r1, 0x2 - bl StartSpriteAffineAnim - ldr r0, [r6] - ldrb r1, [r0, 0x3] - movs r0, 0x64 - adds r4, r1, 0 - muls r4, r0 - ldr r0, =gPlayerParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - bl GetMonData - mov r9, r0 - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0 - bl GetMonData - adds r2, r0, 0 - movs r0, 0x58 - str r0, [sp] - movs r0, 0x20 - str r0, [sp, 0x4] - movs r0, 0xF - str r0, [sp, 0x8] - ldr r0, =0x0000ffff - str r0, [sp, 0xC] - adds r0, r5, 0 - mov r1, r9 - movs r3, 0x1 - bl sub_818D7D8 - ldr r1, [r6] - adds r1, 0x2C - strb r0, [r1] - ldr r0, [r6] - adds r0, 0x2C - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - adds r0, 0x28 - mov r2, r10 - strb r2, [r0] - ldr r0, [r6] - adds r0, 0x2C - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - adds r0, 0x29 - strb r2, [r0] - ldr r0, [r6] - adds r0, 0x2D - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F304 - - thumb_func_start sub_819F3F8 -sub_819F3F8: @ 819F3F8 - push {r4-r6,lr} - adds r4, r0, 0 - adds r6, r1, 0 - lsls r5, r2, 24 - lsrs r5, 24 - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_818D820 - ldr r0, =sub_819F7B4 - movs r1, 0x1 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r5, [r1, 0x16] - lsrs r4, 8 - lsls r4, 24 - lsrs r4, 24 - strh r4, [r1, 0x14] - ldr r1, [r1] - bl _call_via_r1 - movs r0, 0x1 - strb r0, [r6] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F3F8 - - thumb_func_start sub_819F444 -sub_819F444: @ 819F444 - push {r4-r6,lr} - adds r4, r0, 0 - adds r6, r1, 0 - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_818D820 - ldr r5, =gSprites - lsls r4, 16 - lsrs r1, r4, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r0, [r0, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl FreeOamMatrix - lsrs r4, 24 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r5 - bl DestroySprite - movs r0, 0 - strb r0, [r6] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F444 - - thumb_func_start sub_819F488 -sub_819F488: @ 819F488 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_03001284 - ldr r0, [r1] - adds r0, 0x30 - ldrb r0, [r0] - adds r3, r1, 0 - cmp r0, 0x1 - beq _0819F58A - ldr r2, =gTasks - lsls r1, r4, 2 - adds r0, r1, r4 - lsls r0, 3 - adds r0, r2 - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r5, r1, 0 - cmp r0, 0x4 - bhi _0819F58A - lsls r0, 2 - ldr r1, =_0819F4C8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0819F4C8: - .4byte _0819F4DC - .4byte _0819F4F8 - .4byte _0819F52C - .4byte _0819F548 - .4byte _0819F568 -_0819F4DC: - ldr r0, =gUnknown_085EED0A - bl sub_819EBEC - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r0, 0x20 - movs r1, 0 - strb r1, [r0] - b _0819F54E - .pool -_0819F4F8: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0819F50C - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0819F58A -_0819F50C: - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldr r0, [r1, 0x2C] - adds r1, 0x30 - movs r2, 0x1 - bl sub_819F3F8 - b _0819F54E - .pool -_0819F52C: - ldr r0, [r3] - adds r0, 0x30 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0819F58A - movs r0, 0x5 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x5 - movs r1, 0x2 - bl CopyWindowToVram - b _0819F54E -_0819F548: - ldr r0, =gUnknown_085EEC8B - bl sub_819EBEC -_0819F54E: - ldr r0, =gTasks - adds r1, r5, r4 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0819F58A - .pool -_0819F568: - bl sub_819EEF0 - bl sub_819EADC - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r0, 0x22 - movs r1, 0x1 - strb r1, [r0] - ldr r1, =gTasks - adds r0, r5, r4 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x12] - strh r1, [r0, 0x8] - ldr r1, =sub_819CE40 - str r1, [r0] -_0819F58A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F488 - - thumb_func_start sub_819F59C -sub_819F59C: @ 819F59C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r0, r1 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl GetMonData - lsls r0, 16 - lsrs r5, r0, 16 - movs r4, 0 -_0819F5B8: - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - ldrb r0, [r0, 0x12] - cmp r4, r0 - beq _0819F5EC - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - cmp r0, r5 - bne _0819F5EC - movs r0, 0x1 - b _0819F5F8 - .pool -_0819F5EC: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _0819F5B8 - movs r0, 0 -_0819F5F8: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_819F59C - - thumb_func_start sub_819F600 -sub_819F600: @ 819F600 - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0819F640 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_819F69C - movs r1, 0x1 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldrh r2, [r4, 0x3C] - strh r2, [r1, 0x16] - ldr r1, [r1] - bl _call_via_r1 - ldr r0, =SpriteCallbackDummy - str r0, [r4, 0x1C] -_0819F640: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F600 - - thumb_func_start sub_819F654 -sub_819F654: @ 819F654 - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0819F694 - ldrb r0, [r4, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl FreeOamMatrix - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0x1 - bne _0819F688 - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r0, 0x30 - movs r1, 0 - strb r1, [r0] - b _0819F68E - .pool -_0819F688: - movs r0, 0 - bl sub_819BE20 -_0819F68E: - adds r0, r4, 0 - bl DestroySprite -_0819F694: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_819F654 - - thumb_func_start sub_819F69C -sub_819F69C: @ 819F69C - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0819F71A - cmp r0, 0x1 - bgt _0819F6C4 - cmp r0, 0 - beq _0819F6CA - b _0819F77C - .pool -_0819F6C4: - cmp r0, 0x2 - beq _0819F73C - b _0819F77C -_0819F6CA: - movs r0, 0x58 - strh r0, [r4, 0xE] - movs r0, 0x98 - strh r0, [r4, 0x38] - movs r0, 0x40 - strh r0, [r4, 0x12] - movs r0, 0x41 - strh r0, [r4, 0x18] - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl SetGpuRegBits - ldrh r1, [r4, 0xE] - lsls r1, 8 - ldrh r0, [r4, 0x38] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x40 - bl SetGpuReg - ldrh r1, [r4, 0x12] - lsls r1, 8 - ldrh r0, [r4, 0x18] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x44 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0x3F - bl SetGpuReg - movs r0, 0x4A - movs r1, 0x37 - bl SetGpuReg - b _0819F7A6 -_0819F71A: - movs r0, 0x3 - bl ShowBg - ldr r1, =0x00001248 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x0000040b - movs r0, 0x52 - bl SetGpuReg - b _0819F7A6 - .pool -_0819F73C: - ldrh r0, [r4, 0x12] - subs r0, 0x4 - strh r0, [r4, 0x12] - ldrh r1, [r4, 0x18] - adds r1, 0x4 - strh r1, [r4, 0x18] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x20 - ble _0819F758 - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0x5F - ble _0819F760 -_0819F758: - movs r0, 0x20 - strh r0, [r4, 0x12] - movs r0, 0x60 - strh r0, [r4, 0x18] -_0819F760: - ldrh r1, [r4, 0x12] - lsls r1, 8 - ldrh r0, [r4, 0x18] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x44 - bl SetGpuReg - movs r2, 0x12 - ldrsh r0, [r4, r2] - cmp r0, 0x20 - bne _0819F7AC - b _0819F7A6 -_0819F77C: - adds r0, r5, 0 - bl DestroyTask - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - movs r2, 0x16 - ldrsh r0, [r1, r2] - cmp r0, 0x1 - bne _0819F7A0 - bl sub_819F8E0 - b _0819F7AC - .pool -_0819F7A0: - bl sub_819BD70 - b _0819F7AC -_0819F7A6: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_0819F7AC: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_819F69C - - thumb_func_start sub_819F7B4 -sub_819F7B4: @ 819F7B4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0819F844 - cmp r0, 0x1 - beq _0819F894 - movs r0, 0x3 - bl HideBg - ldr r3, =gSprites - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r4, 0x16] - strh r1, [r0, 0x3C] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r3, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_819F654 - str r1, [r0] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0x1 - bl StartSpriteAffineAnim - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl ClearGpuRegBits - adds r0, r5, 0 - bl DestroyTask - b _0819F8D8 - .pool -_0819F844: - movs r0, 0x58 - strh r0, [r4, 0xE] - movs r0, 0x98 - strh r0, [r4, 0x38] - movs r0, 0x20 - strh r0, [r4, 0x12] - movs r0, 0x60 - strh r0, [r4, 0x18] - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl SetGpuRegBits - ldrh r1, [r4, 0xE] - lsls r1, 8 - ldrh r0, [r4, 0x38] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x40 - bl SetGpuReg - ldrh r1, [r4, 0x12] - lsls r1, 8 - ldrh r0, [r4, 0x18] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x44 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0x3F - bl SetGpuReg - movs r0, 0x4A - movs r1, 0x37 - bl SetGpuReg - b _0819F8D2 -_0819F894: - ldrh r0, [r4, 0x12] - adds r0, 0x4 - strh r0, [r4, 0x12] - ldrh r1, [r4, 0x18] - subs r1, 0x4 - strh r1, [r4, 0x18] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3F - bgt _0819F8B0 - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0x41 - bgt _0819F8B8 -_0819F8B0: - movs r0, 0x40 - strh r0, [r4, 0x12] - movs r0, 0x41 - strh r0, [r4, 0x18] -_0819F8B8: - ldrh r1, [r4, 0x12] - lsls r1, 8 - ldrh r0, [r4, 0x18] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x44 - bl SetGpuReg - movs r1, 0x12 - ldrsh r0, [r4, r1] - cmp r0, 0x40 - bne _0819F8D8 -_0819F8D2: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_0819F8D8: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_819F7B4 - - thumb_func_start sub_819F8E0 -sub_819F8E0: @ 819F8E0 - push {r4-r6,lr} - sub sp, 0x10 - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldrb r0, [r1, 0x14] - cmp r0, 0 - bne _0819F900 - ldrb r1, [r1, 0x3] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - b _0819F908 - .pool -_0819F900: - ldrb r1, [r1, 0x3] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gEnemyParty -_0819F908: - adds r6, r1, r0 - adds r0, r6, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r6, 0 - movs r1, 0 - movs r2, 0 - bl GetMonData - adds r5, r0, 0 - adds r0, r6, 0 - movs r1, 0x1 - movs r2, 0 - bl GetMonData - adds r1, r0, 0 - movs r0, 0x58 - str r0, [sp] - movs r0, 0x20 - str r0, [sp, 0x4] - movs r0, 0xF - str r0, [sp, 0x8] - ldr r0, =0x0000ffff - str r0, [sp, 0xC] - adds r0, r4, 0 - adds r2, r5, 0 - movs r3, 0x1 - bl sub_818D7D8 - ldr r2, =gUnknown_03001284 - ldr r1, [r2] - adds r1, 0x2C - movs r3, 0 - strb r0, [r1] - ldr r4, =gSprites - ldr r0, [r2] - adds r0, 0x2C - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x28 - strb r3, [r0] - ldr r0, [r2] - adds r0, 0x2C - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x29 - strb r3, [r0] - ldr r0, [r2] - adds r0, 0x30 - strb r3, [r0] - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F8E0 - - thumb_func_start sub_819F99C -sub_819F99C: @ 819F99C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r2, =gSaveBlock2Ptr - ldr r1, [r2] - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - adds r1, r0 - adds r1, 0xDE - ldrb r1, [r1] - movs r6, 0 - adds r7, r2, 0 - ldr r0, =gStringVar1 - mov r8, r0 - cmp r1, 0 - beq _0819F9DC -_0819F9C2: - adds r0, r1, 0 - movs r1, 0xA - bl __udivsi3 - lsls r0, 24 - lsrs r1, r0, 24 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r1, 0 - beq _0819F9DC - cmp r6, 0x3 - bls _0819F9C2 -_0819F9DC: - lsls r4, r5, 4 - adds r4, r5 - lsls r4, 2 - ldr r1, [r7] - adds r1, r4, r1 - movs r0, 0x8A - lsls r0, 1 - adds r1, r0 - mov r0, r8 - bl StringCopy7 - ldr r0, [r7] - adds r0, r4 - ldr r1, =0x0000011b - adds r0, r1 - ldrb r1, [r0] - mov r0, r8 - bl ConvertInternationalString - ldr r0, =gStringVar2 - ldr r1, [r7] - adds r1, r4 - adds r1, 0xDE - ldrb r1, [r1] - movs r2, 0x1 - adds r3, r6, 0 - bl ConvertIntToDecimalStringN - ldr r1, =gUnknown_08611330 - ldr r0, [r7] - adds r0, r4 - adds r0, 0xDC - ldrb r0, [r0] - lsls r0, 27 - lsrs r0, 25 - adds r0, r1 - ldr r1, [r0] - ldr r0, =gStringVar4 - bl StringExpandPlaceholders - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F99C - - thumb_func_start sub_819FA50 -sub_819FA50: @ 819FA50 - push {lr} - bl EnableBothScriptContexts - pop {r0} - bx r0 - thumb_func_end sub_819FA50 - - thumb_func_start sub_819FA5C -sub_819FA5C: @ 819FA5C - push {r4,r5,lr} - adds r3, r0, 0 - movs r2, 0 - adds r4, r3, 0 - adds r4, 0x28 - ldr r0, =0x0000ffff - adds r5, r0, 0 -_0819FA6A: - lsls r0, r2, 1 - adds r0, r4, r0 - ldrh r1, [r0] - orrs r1, r5 - strh r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x5 - bls _0819FA6A - adds r1, r3, 0 - adds r1, 0x38 - movs r0, 0xFF - strb r0, [r1] - ldrb r1, [r3] - movs r0, 0x20 - negs r0, r0 - ands r0, r1 - movs r1, 0x10 - orrs r0, r1 - strb r0, [r3] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819FA5C - - thumb_func_start sub_819FAA0 -sub_819FAA0: @ 819FAA0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r3, =gSaveBlock2Ptr - ldr r1, [r3] - adds r1, 0xB2 - ldrb r2, [r1] - movs r0, 0x19 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - movs r0, 0 - mov r12, r0 - adds r5, r3, 0 - mov r8, r0 - ldr r1, =0x0000ffff - mov r10, r1 -_0819FAC6: - movs r2, 0 - mov r3, r12 - lsls r7, r3, 4 - movs r4, 0x1 - add r4, r12 - mov r9, r4 - adds r0, r7, r3 - lsls r3, r0, 2 -_0819FAD6: - ldr r1, [r5] - lsls r0, r2, 1 - adds r0, r3 - movs r4, 0x82 - lsls r4, 1 - adds r1, r4 - adds r1, r0 - ldrh r0, [r1] - mov r4, r10 - orrs r0, r4 - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x5 - bls _0819FAD6 - ldr r2, [r5] - mov r0, r12 - adds r3, r7, r0 - lsls r3, 2 - adds r2, r3 - adds r2, 0xDC - ldrb r1, [r2] - movs r0, 0x20 - negs r0, r0 - ands r0, r1 - movs r1, 0x10 - orrs r0, r1 - strb r0, [r2] - ldr r0, [r5] - adds r0, r3 - movs r1, 0x8A - lsls r1, 1 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldr r1, [r5] - adds r1, r3 - adds r1, 0xDC - ldrb r2, [r1] - movs r0, 0x61 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r0, [r5] - adds r0, r3 - adds r0, 0xDE - mov r4, r8 - strb r4, [r0] - ldr r0, [r5] - adds r0, r3 - adds r0, 0xDD - strb r4, [r0] - movs r2, 0 - ldr r6, =gSaveBlock2Ptr - movs r4, 0x88 - lsls r4, 1 -_0819FB48: - ldr r0, [r6] - adds r1, r2, r3 - adds r0, r4 - adds r0, r1 - mov r1, r8 - strb r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x3 - bls _0819FB48 - ldr r0, [r5] - mov r3, r12 - adds r2, r7, r3 - lsls r2, 2 - adds r0, r2 - ldr r4, =gGameLanguage - ldrb r1, [r4] - ldr r3, =0x0000011b - adds r0, r3 - strb r1, [r0] - ldr r0, [r5] - movs r4, 0x8E - lsls r4, 1 - adds r0, r4 - adds r0, r2 - mov r1, r8 - str r1, [r0] - mov r3, r9 - lsls r0, r3, 24 - lsrs r0, 24 - mov r12, r0 - cmp r0, 0x3 - bls _0819FAC6 - bl sub_81A087C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819FAA0 - - thumb_func_start sub_819FBB0 -sub_819FBB0: @ 819FBB0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB1 - ldrb r0, [r0] - movs r1, 0x3 - ands r1, r0 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - bx lr - .pool - thumb_func_end sub_819FBB0 - - thumb_func_start sub_819FBC8 -sub_819FBC8: @ 819FBC8 - push {r4,r5,lr} - ldr r2, =gSaveBlock2Ptr - ldr r0, [r2] - adds r0, 0xDE - ldrb r0, [r0] - cmp r0, 0 - bne _0819FC10 - adds r4, r2, 0 - ldr r5, =gUnknown_08611548 -_0819FBDA: - bl Random - ldr r2, [r4] - lsls r0, 16 - movs r1, 0xE0 - lsls r1, 11 - ands r1, r0 - lsrs r1, 16 - adds r1, r5 - ldrb r0, [r1] - adds r2, 0xB0 - strb r0, [r2] - ldr r0, [r4] - adds r1, r0, 0 - adds r1, 0xB0 - adds r0, 0xDC - ldrb r0, [r0] - lsls r0, 27 - ldrb r1, [r1] - lsrs r0, 27 - cmp r1, r0 - beq _0819FBDA - b _0819FC38 - .pool -_0819FC10: - adds r4, r2, 0 -_0819FC12: - bl Random - ldr r2, [r4] - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xF - ands r0, r1 - adds r2, 0xB0 - strb r0, [r2] - ldr r0, [r4] - adds r1, r0, 0 - adds r1, 0xB0 - adds r0, 0xDC - ldrb r0, [r0] - lsls r0, 27 - ldrb r1, [r1] - lsrs r0, 27 - cmp r1, r0 - beq _0819FC12 -_0819FC38: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_819FBC8 - - thumb_func_start sub_819FC40 -sub_819FC40: @ 819FC40 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gSaveBlock2Ptr - ldr r2, [r1] - adds r2, 0xB1 - movs r1, 0x3 - ands r0, r1 - ldrb r3, [r2] - subs r1, 0x7 - ands r1, r3 - orrs r1, r0 - strb r1, [r2] - bx lr - .pool - thumb_func_end sub_819FC40 - - thumb_func_start sub_819FC60 -sub_819FC60: @ 819FC60 - push {r4-r7,lr} - sub sp, 0xC - movs r5, 0 -_0819FC66: - mov r1, sp - adds r0, r1, r5 - strb r5, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x9 - bls _0819FC66 - movs r5, 0 -_0819FC78: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - mov r7, sp - adds r2, r7, r4 - ldrb r3, [r2] - adds r1, r7, r0 - ldrb r0, [r1] - strb r0, [r2] - strb r3, [r1] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x31 - bls _0819FC78 - movs r5, 0 - ldr r6, =gSaveBlock2Ptr - movs r4, 0xF -_0819FCBC: - ldr r3, [r6] - adds r3, 0xB4 - adds r3, r5 - lsls r2, r5, 1 - mov r1, sp - adds r0, r1, r2 - ldrb r0, [r0] - adds r1, r4, 0 - ands r1, r0 - lsls r1, 4 - adds r2, 0x1 - mov r7, sp - adds r0, r7, r2 - ldrb r2, [r0] - adds r0, r4, 0 - ands r0, r2 - orrs r1, r0 - strb r1, [r3] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _0819FCBC - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819FC60 - - thumb_func_start sub_819FCF8 -sub_819FCF8: @ 819FCF8 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - movs r5, 0 - cmp r0, 0x2 - bne _0819FD4C - ldr r6, =gUnknown_030062EC -_0819FD06: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 24 - lsrs r5, r0, 24 - movs r3, 0 - movs r2, 0 - ldr r1, [r6] - lsls r0, r5, 2 - adds r0, r5 - lsls r4, r0, 1 - adds r1, 0x2 -_0819FD26: - lsls r0, r2, 1 - adds r0, r4 - adds r0, r1, r0 - ldrh r0, [r0] - cmp r0, 0 - beq _0819FD38 - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 -_0819FD38: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x4 - bls _0819FD26 - cmp r3, 0x3 - bhi _0819FD06 - b _0819FD5A - .pool -_0819FD4C: - cmp r0, 0x1 - bne _0819FD5A - ldrb r0, [r2] - adds r1, r0 - ldrb r5, [r1] - adds r0, 0x1 - strb r0, [r2] -_0819FD5A: - adds r0, r5, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_819FCF8 - - thumb_func_start sub_819FD64 -sub_819FD64: @ 819FD64 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - movs r5, 0 - mov r0, sp - adds r0, 0xC - str r0, [sp, 0x14] - mov r1, sp - adds r1, 0x10 - str r1, [sp, 0x18] - adds r1, r0, 0 -_0819FD80: - adds r0, r1, r5 - strb r5, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _0819FD80 - movs r5, 0 - ldr r6, [sp, 0x14] -_0819FD92: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 24 - lsrs r4, r0, 24 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - adds r2, r6, r4 - ldrb r3, [r2] - adds r1, r6, r0 - ldrb r0, [r1] - strb r0, [r2] - strb r3, [r1] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x9 - bls _0819FD92 - movs r5, 0 - ldr r2, =gUnknown_086114D3 -_0819FDD0: - mov r4, sp - adds r1, r4, r5 - adds r0, r5, r2 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x9 - bls _0819FDD0 - movs r5, 0 -_0819FDE6: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 24 - lsrs r4, r0, 24 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - mov r6, sp - adds r2, r6, r4 - ldrb r3, [r2] - adds r1, r6, r0 - ldrb r0, [r1] - strb r0, [r2] - strb r3, [r1] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x31 - bls _0819FDE6 - ldr r4, =gUnknown_030062EC - movs r0, 0x30 - bl AllocZeroed - str r0, [r4] - movs r1, 0 - strb r1, [r0] - movs r5, 0 - movs r2, 0x4 -_0819FE34: - movs r3, 0 -_0819FE36: - ldr r0, [r4] - lsls r1, r3, 2 - adds r1, r3 - adds r1, r5, r1 - adds r0, 0x20 - adds r0, r1 - strb r2, [r0] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x2 - bls _0819FE36 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x4 - bls _0819FE34 - movs r0, 0 - ldr r7, [sp, 0x18] - strb r0, [r7] - movs r5, 0 -_0819FE60: - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - lsls r4, r5, 2 - adds r3, r4 - mov r1, sp - adds r6, r1, r5 - ldrb r0, [r6] - adds r3, 0xB8 - movs r2, 0x3 - ands r2, r0 - ldrb r0, [r3] - movs r7, 0x4 - negs r7, r7 - adds r1, r7, 0 - ands r0, r1 - orrs r0, r2 - strb r0, [r3] - ldrb r0, [r6] - adds r5, 0x1 - str r5, [sp, 0x1C] - mov r8, r4 - cmp r0, 0x3 - beq _0819FF62 - ldrb r0, [r6] - ldr r1, [sp, 0x14] - ldr r2, [sp, 0x18] - bl sub_819FCF8 - ldr r1, =gSaveBlock2Ptr - ldr r3, [r1] - add r3, r8 - adds r3, 0xB8 - movs r2, 0x3 - ands r2, r0 - lsls r2, 2 - ldrb r0, [r3] - movs r4, 0xD - negs r4, r4 - adds r1, r4, 0 - ands r0, r1 - orrs r0, r2 - strb r0, [r3] - ldr r7, =gSaveBlock2Ptr - ldr r0, [r7] - add r0, r8 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 28 - lsrs r7, r0, 30 - ldrb r0, [r6] - cmp r0, 0x2 - bne _0819FF62 - lsls r0, r7, 2 - adds r0, r7 - mov r10, r0 - ldr r0, =gUnknown_030062EC - mov r9, r0 -_0819FED2: - bl Random - lsls r0, 16 - lsrs r4, r0, 16 - movs r1, 0x3 - ands r4, r1 - movs r3, 0 - mov r6, r9 - ldr r2, [r6] - ldrb r0, [r2] - adds r1, r0, 0x1 - lsls r5, r7, 2 - cmp r3, r1 - bge _0819FF12 - adds r2, 0x20 - mov r6, r10 - adds r0, r2, r6 - ldrb r0, [r0] - cmp r0, r4 - beq _0819FF12 - adds r6, r1, 0 - adds r1, r5, r7 -_0819FEFE: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, r6 - bge _0819FF12 - adds r0, r3, r1 - adds r0, r2, r0 - ldrb r0, [r0] - cmp r0, r4 - bne _0819FEFE -_0819FF12: - mov r1, r9 - ldr r0, [r1] - ldrb r0, [r0] - adds r0, 0x1 - ldr r1, =gUnknown_030062EC - cmp r3, r0 - bne _0819FED2 - ldr r0, [r1] - orrs r5, r7 - ldrb r2, [r0] - adds r1, r5, r2 - adds r0, 0x20 - adds r0, r1 - strb r4, [r0] - ldr r6, =gSaveBlock2Ptr - ldr r2, [r6] - add r2, r8 - adds r2, 0xB8 - movs r7, 0x3 - ands r4, r7 - lsls r3, r4, 4 - ldrb r0, [r2] - movs r4, 0x31 - negs r4, r4 - adds r1, r4, 0 - ands r0, r1 - orrs r0, r3 - strb r0, [r2] - ldr r0, [r6] - add r0, r8 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 28 - lsrs r0, 30 - bl sub_819FF98 - ldr r1, [r6] - add r1, r8 - adds r1, 0xBA - strh r0, [r1] -_0819FF62: - ldr r6, [sp, 0x1C] - lsls r0, r6, 24 - lsrs r5, r0, 24 - cmp r5, 0x8 - bhi _0819FF6E - b _0819FE60 -_0819FF6E: - ldr r4, =gUnknown_030062EC - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819FD64 - - thumb_func_start sub_819FF98 -sub_819FF98: @ 819FF98 - 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 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0xC] - movs r7, 0 - ldr r1, [sp] - cmp r1, 0x2 - bhi _0819FFE0 - ldr r2, =gSaveBlock2Ptr - ldr r1, [r2] - adds r0, r1, 0 - adds r0, 0xB4 - ldr r3, [sp] - adds r0, r3 - ldrb r4, [r0] - adds r1, 0xB2 - ldrb r0, [r1] - lsls r0, 29 - lsrs r0, 29 - asrs r0, r3 - movs r1, 0x1 - ands r0, r1 - lsls r0, 2 - asrs r4, r0 - movs r0, 0xF - ands r4, r0 - b _0819FFE4 - .pool -_0819FFE0: - movs r4, 0 - ldr r2, =gSaveBlock2Ptr -_0819FFE4: - ldr r3, =gUnknown_08610970 - lsls r1, r4, 1 - ldr r4, [r2] - adds r0, r4, 0 - adds r0, 0xB0 - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, r0 - adds r3, 0x34 - adds r1, r3 - ldrh r1, [r1] - str r1, [sp, 0x8] - ldr r1, =gLevelUpLearnsets - ldr r2, [sp, 0x8] - lsls r0, r2, 2 - adds r0, r1 - ldr r6, [r0] - movs r3, 0 - adds r4, 0xB1 - ldrb r1, [r4] - movs r0, 0x3 - ands r0, r1 - movs r5, 0x3C - cmp r0, 0x1 - bne _081A001A - movs r5, 0x32 -_081A001A: - ldrh r1, [r6] - ldr r4, =0x0000ffff - cmp r1, r4 - beq _081A004C - movs r2, 0xFE - lsls r2, 8 - adds r0, r2, 0 - ands r0, r1 - lsls r1, r5, 9 - cmp r0, r1 - bgt _081A004C - adds r5, r2, 0 - adds r2, r1, 0 -_081A0034: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - lsls r0, r3, 1 - adds r0, r6 - ldrh r1, [r0] - cmp r1, r4 - beq _081A004C - adds r0, r5, 0 - ands r0, r1 - cmp r0, r2 - ble _081A0034 -_081A004C: - adds r5, r3, 0 - movs r3, 0 - str r3, [sp, 0x4] -_081A0052: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081A0068 - ldr r0, [sp, 0xC] - cmp r0, 0x1 - bne _081A00E0 -_081A0068: - ldr r1, =0x000001ff - mov r8, r1 -_081A006C: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3A - bl __umodsi3 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, [sp, 0x8] - adds r1, r4, 0 - bl CanSpeciesLearnTMHM - adds r2, r0, 0 - cmp r2, 0 - beq _081A006C - ldr r2, =0x00000121 - adds r0, r4, r2 - bl ItemIdToBattleMoveId - lsls r0, 16 - lsrs r7, r0, 16 - movs r2, 0x1 - cmp r5, 0x4 - bhi _081A00BC - movs r3, 0 - b _081A00C6 - .pool -_081A00BC: - subs r0, r5, 0x4 - b _081A00C2 -_081A00C0: - adds r0, r3, 0x1 -_081A00C2: - lsls r0, 24 - lsrs r3, r0, 24 -_081A00C6: - cmp r3, r5 - bcs _081A00DA - lsls r0, r3, 1 - adds r0, r6 - ldrh r0, [r0] - mov r1, r8 - ands r0, r1 - cmp r0, r7 - bne _081A00C0 - movs r2, 0 -_081A00DA: - cmp r2, 0x1 - bne _081A006C - b _081A0146 -_081A00E0: - cmp r5, 0x4 - bhi _081A00EA - movs r2, 0x1 - str r2, [sp, 0xC] - b _081A0168 -_081A00EA: - subs r4, r5, 0x4 - ldr r3, =0x000001ff - mov r10, r3 - mov r8, r3 - lsls r0, r4, 24 - mov r9, r0 -_081A00F6: - bl Random - lsls r0, 16 - lsrs r0, 16 - adds r1, r4, 0 - bl __modsi3 - lsls r0, 24 - lsrs r0, 23 - adds r0, r6 - ldrh r0, [r0] - mov r7, r8 - ands r7, r0 - movs r2, 0x1 - mov r1, r9 - lsrs r3, r1, 24 - cmp r3, r5 - bcs _081A0142 - lsls r0, r3, 1 - adds r0, r6 - ldrh r1, [r0] - mov r0, r8 - b _081A013A - .pool -_081A0128: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, r5 - bcs _081A0142 - lsls r0, r3, 1 - adds r0, r6 - ldrh r0, [r0] - mov r1, r10 -_081A013A: - ands r0, r1 - cmp r0, r7 - bne _081A0128 - movs r2, 0 -_081A0142: - cmp r2, 0x1 - bne _081A00F6 -_081A0146: - ldr r0, [sp] - adds r1, r7, 0 - bl sub_81A0194 - lsls r0, 24 - cmp r0, 0 - beq _081A0168 - ldr r0, =gUnknown_08611370 - adds r0, r7, r0 - ldrb r0, [r0] - cmp r0, 0 - bne _081A0170 - ldr r0, [sp, 0x4] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] -_081A0168: - ldr r2, [sp, 0x4] - cmp r2, 0x4 - bhi _081A0170 - b _081A0052 -_081A0170: - ldr r0, =gUnknown_030062EC - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - adds r0, r7, 0 - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_819FF98 - - thumb_func_start sub_81A0194 -sub_81A0194: @ 81A0194 - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 16 - lsrs r5, r1, 16 - movs r3, 0 - ldr r0, =gUnknown_030062EC - mov r12, r0 - ldr r2, [r0] - lsls r1, r4, 2 - adds r0, r1, r4 - lsls r6, r0, 1 - adds r2, 0x2 - adds r7, r1, 0 -_081A01B0: - lsls r0, r3, 1 - adds r0, r6 - adds r0, r2, r0 - ldrh r0, [r0] - cmp r0, r5 - bne _081A01C4 - movs r0, 0 - b _081A01E2 - .pool -_081A01C4: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x4 - bls _081A01B0 - mov r2, r12 - ldr r1, [r2] - adds r0, r7, r4 - ldrb r2, [r1] - adds r0, r2 - lsls r0, 1 - adds r1, 0x2 - adds r1, r0 - strh r5, [r1] - movs r0, 0x1 -_081A01E2: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81A0194 - - thumb_func_start sub_81A01E8 -sub_81A01E8: @ 81A01E8 - push {r4-r7,lr} - mov r12, r1 - lsls r0, 16 - lsrs r2, r0, 16 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB1 - ldrb r1, [r0] - movs r0, 0x3 - ands r0, r1 - movs r4, 0x3C - cmp r0, 0x1 - bne _081A0204 - movs r4, 0x32 -_081A0204: - ldr r1, =gLevelUpLearnsets - lsls r0, r2, 2 - adds r0, r1 - ldr r6, [r0] - movs r5, 0 - ldrh r1, [r6] - ldr r3, =0x0000ffff - cmp r1, r3 - beq _081A0240 - movs r2, 0xFE - lsls r2, 8 - adds r0, r2, 0 - ands r0, r1 - lsls r1, r4, 9 - cmp r0, r1 - bgt _081A0240 - adds r4, r2, 0 - adds r2, r1, 0 -_081A0228: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 1 - adds r0, r6 - ldrh r1, [r0] - cmp r1, r3 - beq _081A0240 - adds r0, r4, 0 - ands r0, r1 - cmp r0, r2 - ble _081A0228 -_081A0240: - adds r4, r5, 0 - cmp r4, 0x4 - bls _081A0248 - movs r4, 0x4 -_081A0248: - movs r2, 0 - cmp r2, r4 - bcs _081A026C - ldr r7, =0x000001ff -_081A0250: - lsls r3, r2, 1 - add r3, r12 - adds r2, 0x1 - subs r0, r5, r2 - lsls r0, 1 - adds r0, r6 - ldrh r1, [r0] - adds r0, r7, 0 - ands r0, r1 - strh r0, [r3] - lsls r2, 24 - lsrs r2, 24 - cmp r2, r4 - bcc _081A0250 -_081A026C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A01E8 - - thumb_func_start sub_81A0284 -sub_81A0284: @ 81A0284 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r5, r2, 24 - ldr r1, =gSaveBlock2Ptr - ldr r2, [r1] - adds r0, r2, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - adds r7, r1, 0 - cmp r0, 0x2 - bhi _081A02B8 - movs r0, 0 - b _081A037C - .pool -_081A02B8: - movs r4, 0 - movs r3, 0 - adds r0, r2, 0 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - ldr r1, =gUnknown_08610970 - mov r12, r1 - lsls r6, 1 - lsls r5, 1 - mov r9, r5 - cmp r0, 0 - beq _081A02F4 - adds r2, r7, 0 -_081A02D4: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x8 - bhi _081A02F4 - ldr r0, [r2] - lsls r1, r3, 2 - adds r0, r1 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - cmp r0, 0 - bne _081A02D4 -_081A02F4: - ldr r0, [r7] - adds r0, 0xB0 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r6, r0 - mov r1, r12 - adds r1, 0x34 - adds r0, r1 - ldrh r0, [r0] - mov r1, sp - bl sub_81A01E8 - movs r3, 0 - cmp r3, r4 - bcs _081A0376 - ldr r1, [r7] - adds r0, r1, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - subs r0, 0x3 - cmp r3, r0 - bge _081A0376 - adds r6, r7, 0 - adds r5, r1, 0 -_081A032A: - lsls r0, r3, 2 - adds r2, r5, r0 - adds r0, r2, 0 - adds r0, 0xB8 - ldrb r1, [r0] - lsls r0, r1, 30 - lsrs r0, 30 - cmp r0, 0x2 - bne _081A035C - lsls r0, r1, 28 - lsrs r0, 30 - cmp r0, r8 - bne _081A035C - lsrs r0, r1, 6 - cmp r0, 0 - beq _081A035C - lsls r0, r1, 26 - lsrs r0, 30 - lsls r0, 1 - mov r7, sp - adds r1, r7, r0 - adds r0, r2, 0 - adds r0, 0xBA - ldrh r0, [r0] - strh r0, [r1] -_081A035C: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, r4 - bcs _081A0376 - ldr r0, [r6] - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - subs r0, 0x3 - cmp r3, r0 - blt _081A032A -_081A0376: - mov r0, sp - add r0, r9 - ldrh r0, [r0] -_081A037C: - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A0284 - - thumb_func_start sub_81A0390 -sub_81A0390: @ 81A0390 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r5, 0 - ldr r7, =gSaveBlock2Ptr - adds r6, r7, 0 - movs r4, 0 -_081A03A6: - ldr r0, [r6] - lsls r2, r5, 1 - adds r2, r5 - lsls r2, 2 - adds r0, r2 - adds r1, r0, 0 - adds r1, 0xE0 - strh r4, [r1] - adds r0, 0xEA - strh r4, [r0] - movs r3, 0 -_081A03BC: - ldr r0, [r6] - lsls r1, r3, 1 - adds r1, r2 - adds r0, 0xE2 - adds r0, r1 - strh r4, [r0] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x3 - bls _081A03BC - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _081A03A6 - ldr r0, [r7] - adds r0, 0xB1 - ldrb r0, [r0] - lsrs r3, r0, 6 - movs r5, 0 -_081A03E6: - lsls r0, r3, 2 - mov r1, sp - adds r2, r1, r0 - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, 0xE0 - ldr r1, [r7] - adds r1, r0 - str r1, [r2] - adds r0, r3, 0x1 - movs r1, 0x3 - bl __modsi3 - lsls r0, 24 - lsrs r3, r0, 24 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _081A03E6 - movs r5, 0 - ldr r7, =gSaveBlock2Ptr - ldr r6, =gUnknown_086109A4 -_081A0416: - ldr r0, [r7] - mov r12, r0 - adds r0, 0xB4 - adds r0, r5 - ldrb r2, [r0] - mov r0, r12 - adds r0, 0xB2 - ldrb r0, [r0] - lsls r0, 29 - lsrs r0, 29 - asrs r0, r5 - movs r1, 0x1 - ands r0, r1 - lsls r0, 2 - asrs r2, r0 - movs r0, 0xF - ands r2, r0 - lsls r0, r5, 2 - mov r1, sp - adds r3, r1, r0 - ldr r4, [r3] - lsls r2, 1 - mov r0, r12 - adds r0, 0xB0 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r2, r0 - adds r2, r6 - ldrh r0, [r2] - strh r0, [r4] - ldr r1, [r3] - ldrh r0, [r1] - adds r1, 0x2 - bl sub_81A01E8 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _081A0416 - movs r5, 0 - cmp r5, r8 - bcs _081A04D6 - ldr r7, =gSaveBlock2Ptr -_081A0470: - ldr r1, [r7] - lsls r0, r5, 2 - adds r4, r1, r0 - adds r0, r4, 0 - adds r0, 0xB8 - ldrb r2, [r0] - lsls r0, r2, 30 - lsrs r1, r0, 30 - lsls r0, r2, 28 - lsrs r3, r0, 30 - adds r6, r3, 0 - cmp r1, 0x1 - bne _081A04A8 - lsrs r0, r2, 6 - cmp r0, 0 - beq _081A04CC - lsls r0, r3, 2 - add r0, sp - ldr r1, [r0] - adds r0, r4, 0 - adds r0, 0xBA - ldrh r0, [r0] - strh r0, [r1, 0xA] - b _081A04CC - .pool -_081A04A8: - cmp r1, 0x2 - bne _081A04CC - lsls r0, r2, 24 - lsrs r0, 30 - cmp r0, 0 - beq _081A04CC - lsls r2, 26 - lsrs r2, 30 - lsls r0, r6, 2 - add r0, sp - ldr r1, [r0] - lsls r2, 1 - adds r1, 0x2 - adds r1, r2 - adds r0, r4, 0 - adds r0, 0xBA - ldrh r0, [r0] - strh r0, [r1] -_081A04CC: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, r8 - bcc _081A0470 -_081A04D6: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81A0390 - - thumb_func_start sub_81A04E4 -sub_81A04E4: @ 81A04E4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - lsls r0, 24 - lsrs r0, 24 - movs r7, 0x2 - cmp r0, 0x6 - bls _081A04FC - b _081A064C -_081A04FC: - lsls r0, 2 - ldr r1, =_081A050C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A050C: - .4byte _081A0528 - .4byte _081A0540 - .4byte _081A05B4 - .4byte _081A05F4 - .4byte _081A061C - .4byte _081A064C - .4byte _081A0634 -_081A0528: - movs r0, 0x12 - mov r10, r0 - movs r6, 0x8 - ldr r0, =gUnknown_085EAEB1 - str r0, [sp, 0xC] - ldr r0, =gUnknown_085EAEB8 - str r0, [sp, 0x10] - b _081A0652 - .pool -_081A0540: - movs r7, 0x3 - movs r1, 0x12 - mov r10, r1 - movs r6, 0x6 - movs r4, 0 - ldr r0, =gSpeciesNames - mov r9, r0 - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - movs r1, 0xB2 - adds r1, r3 - mov r12, r1 - adds r5, r3, 0 - adds r5, 0xB0 - ldr r0, =gUnknown_086109A4 - mov r8, r0 -_081A0560: - adds r0, r3, 0 - adds r0, 0xB4 - adds r0, r4 - ldrb r2, [r0] - mov r1, r12 - ldrb r0, [r1] - lsls r0, 29 - lsrs r0, 29 - asrs r0, r4 - movs r1, 0x1 - ands r0, r1 - lsls r0, 2 - asrs r2, r0 - movs r0, 0xF - ands r2, r0 - lsls r2, 1 - ldrb r1, [r5] - movs r0, 0x58 - muls r0, r1 - adds r2, r0 - add r2, r8 - ldrh r1, [r2] - lsls r0, r4, 2 - mov r2, sp - adds r2, r0 - adds r2, 0xC - movs r0, 0xB - muls r0, r1 - add r0, r9 - str r0, [r2] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _081A0560 - b _081A0652 - .pool -_081A05B4: - movs r0, 0x12 - mov r10, r0 - movs r6, 0x8 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - cmp r0, 0x2 - bls _081A05CC - b _081A06FA -_081A05CC: - ldr r0, =gUnknown_030062F0 - ldr r3, [r0] - ldrh r0, [r3, 0x2] - movs r2, 0xB - muls r0, r2 - ldr r1, =gSpeciesNames - adds r0, r1 - str r0, [sp, 0x10] - ldrh r0, [r3] - muls r0, r2 - adds r0, r1 - str r0, [sp, 0xC] - b _081A0652 - .pool -_081A05F4: - movs r1, 0x11 - mov r10, r1 - movs r6, 0x8 - ldr r0, =gUnknown_030062F0 - ldr r3, [r0] - ldrh r0, [r3, 0x4] - movs r2, 0xD - muls r0, r2 - ldr r1, =gMoveNames - adds r0, r1 - str r0, [sp, 0xC] - ldrh r0, [r3, 0x6] - muls r0, r2 - adds r0, r1 - str r0, [sp, 0x10] - b _081A0652 - .pool -_081A061C: - movs r0, 0x12 - mov r10, r0 - movs r6, 0x8 - ldr r0, =gUnknown_085ED193 - str r0, [sp, 0xC] - ldr r0, =gUnknown_085ED198 - str r0, [sp, 0x10] - b _081A0652 - .pool -_081A0634: - movs r1, 0x14 - mov r10, r1 - movs r6, 0x8 - ldr r0, =gUnknown_085EAE62 - str r0, [sp, 0xC] - ldr r0, =gUnknown_085EAE66 - str r0, [sp, 0x10] - b _081A0652 - .pool -_081A064C: - movs r0, 0 - mov r10, r0 - movs r6, 0 -_081A0652: - movs r5, 0 - movs r4, 0 - lsls r1, r7, 25 - mov r8, r1 - cmp r4, r7 - bcs _081A067E -_081A065E: - lsls r0, r4, 2 - add r0, sp - adds r0, 0xC - ldr r1, [r0] - movs r0, 0x1 - movs r2, 0 - bl GetStringWidth - cmp r0, r5 - ble _081A0674 - adds r5, r0, 0 -_081A0674: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r7 - bcc _081A065E -_081A067E: - adds r0, r5, 0 - bl convert_pixel_width_to_tile_width - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - mov r0, r10 - adds r1, r4, 0 - bl sub_80E2D5C - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - mov r0, r8 - lsrs r3, r0, 24 - mov r0, r10 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_81A0784 - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r5, 0 - movs r1, 0 - bl SetStandardWindowBorderStyle - movs r4, 0 - cmp r4, r7 - bcs _081A06E6 -_081A06B8: - lsls r0, r4, 2 - add r0, sp - adds r0, 0xC - ldr r2, [r0] - lsls r0, r4, 4 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - adds r0, r5, 0 - movs r1, 0x1 - movs r3, 0x8 - bl PrintTextOnWindow - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r7 - bcc _081A06B8 -_081A06E6: - adds r0, r5, 0 - adds r1, r7, 0 - movs r2, 0 - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed - movs r0, 0x1 - adds r1, r7, 0 - adds r2, r5, 0 - bl sub_81A0804 -_081A06FA: - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81A04E4 - - thumb_func_start sub_81A070C -sub_81A070C: @ 81A070C - 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 - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081A0730 - bl ProcessMenuInputNoWrapAround - b _081A0734 - .pool -_081A0730: - bl ProcessMenuInput -_081A0734: - lsls r0, 24 - lsrs r0, 24 - lsls r0, 24 - asrs r1, r0, 24 - movs r0, 0x2 - negs r0, r0 - cmp r1, r0 - beq _081A0778 - adds r0, 0x1 - cmp r1, r0 - bne _081A0764 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081A0778 - movs r0, 0x5 - bl PlaySE - ldr r1, =gScriptResult - movs r0, 0x7F - strh r0, [r1] - b _081A0768 - .pool -_081A0764: - ldr r0, =gScriptResult - strh r1, [r0] -_081A0768: - ldrb r0, [r4, 0xC] - bl sub_81A07E8 - adds r0, r5, 0 - bl DestroyTask - bl EnableBothScriptContexts -_081A0778: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A070C - - thumb_func_start sub_81A0784 -sub_81A0784: @ 81A0784 - push {r4,r5,lr} - sub sp, 0x20 - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 24 - lsls r5, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x80 - lsls r0, 17 - adds r4, r0 - lsrs r4, 24 - adds r5, r0 - lsrs r5, 24 - str r2, [sp] - str r3, [sp, 0x4] - movs r0, 0xF - str r0, [sp, 0x8] - movs r0, 0x64 - str r0, [sp, 0xC] - add r0, sp, 0x10 - movs r1, 0 - adds r2, r4, 0 - adds r3, r5, 0 - bl sub_8198A50 - ldr r0, [sp, 0x10] - ldr r1, [sp, 0x14] - str r0, [sp, 0x18] - str r1, [sp, 0x1C] - add r0, sp, 0x18 - bl AddWindow - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - adds r0, r4, 0 - add sp, 0x20 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81A0784 - - thumb_func_start sub_81A07E8 -sub_81A07E8: @ 81A07E8 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_8198070 - adds r0, r4, 0 - bl RemoveWindow - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81A07E8 - - thumb_func_start sub_81A0804 -sub_81A0804: @ 81A0804 - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r2, 24 - lsrs r6, r2, 24 - ldr r0, =sub_81A070C - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0, r1 - strh r4, [r1, 0x10] - cmp r5, 0x3 - bls _081A0840 - movs r0, 0x1 - b _081A0842 - .pool -_081A0840: - movs r0, 0 -_081A0842: - strh r0, [r1, 0x12] - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - strh r6, [r0, 0x14] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A0804 - - thumb_func_start sub_81A085C -sub_81A085C: @ 81A085C - push {lr} - ldr r1, =gUnknown_086114E0 - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A085C - - thumb_func_start sub_81A087C -sub_81A087C: @ 81A087C - push {r4-r7,lr} - bl sub_819FBC8 - ldr r3, =gSaveBlock2Ptr - ldr r1, [r3] - adds r1, 0xB1 - ldrb r2, [r1] - movs r0, 0x4 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r3] - adds r1, 0xB1 - ldrb r2, [r1] - movs r0, 0x3D - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r3] - adds r1, 0xB1 - ldrb r2, [r1] - movs r0, 0x3F - ands r0, r2 - strb r0, [r1] - ldr r1, [r3] - adds r1, 0xB2 - ldrb r2, [r1] - movs r0, 0x8 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - movs r4, 0 - movs r1, 0 -_081A08BE: - ldr r0, [r3] - adds r0, 0xB4 - adds r0, r4 - strb r1, [r0] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _081A08BE - movs r4, 0 - ldr r5, =gSaveBlock2Ptr - movs r0, 0x4 - negs r0, r0 - mov r12, r0 - movs r7, 0xD - negs r7, r7 - movs r6, 0x31 - negs r6, r6 -_081A08E2: - ldr r1, [r5] - lsls r3, r4, 2 - adds r1, r3 - adds r1, 0xB8 - ldrb r2, [r1] - mov r0, r12 - ands r0, r2 - strb r0, [r1] - ldr r1, [r5] - adds r1, r3 - adds r1, 0xB8 - ldrb r2, [r1] - adds r0, r7, 0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r5] - adds r1, r3 - adds r1, 0xB8 - ldrb r2, [r1] - adds r0, r6, 0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r5] - adds r1, r3 - adds r1, 0xB8 - ldrb r2, [r1] - movs r0, 0x3F - ands r0, r2 - strb r0, [r1] - ldr r0, [r5] - adds r0, r3 - adds r0, 0xBA - movs r1, 0 - strh r1, [r0] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x8 - bls _081A08E2 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A087C - - thumb_func_start sub_81A093C -sub_81A093C: @ 81A093C - push {lr} - bl sub_819FBB0 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _081A0954 - ldr r0, =gScriptResult - strh r1, [r0] - b _081A095A - .pool -_081A0954: - ldr r1, =gScriptResult - movs r0, 0x1 - strh r0, [r1] -_081A095A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A093C - - thumb_func_start sub_81A0964 -sub_81A0964: @ 81A0964 - push {lr} - ldr r0, =gSpecialVar_0x8005 - ldrb r0, [r0] - bl sub_819FC40 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A0964 - - thumb_func_start sub_81A0978 -sub_81A0978: @ 81A0978 - push {lr} - bl sub_819FBC8 - pop {r0} - bx r0 - thumb_func_end sub_81A0978 - - thumb_func_start sub_81A0984 -sub_81A0984: @ 81A0984 - push {lr} - bl sub_819FD64 - pop {r0} - bx r0 - thumb_func_end sub_81A0984 - - thumb_func_start sub_81A0990 -sub_81A0990: @ 81A0990 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - adds r2, 0xB1 - ldrb r3, [r2] - lsls r1, r3, 26 - lsrs r1, 28 - adds r1, 0x1 - movs r0, 0xF - ands r1, r0 - lsls r1, 2 - movs r0, 0x3D - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - bx lr - .pool - thumb_func_end sub_81A0990 - - thumb_func_start sub_81A09B4 -sub_81A09B4: @ 81A09B4 - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_81A09B4 - - thumb_func_start sub_81A09D0 -sub_81A09D0: @ 81A09D0 - push {lr} - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - subs r1, r0, 0x3 - cmp r1, 0 - bge _081A09F4 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - b _081A0A1C - .pool -_081A09F4: - ldr r2, =gScriptResult - cmp r1, 0x8 - ble _081A09FE - movs r0, 0x1 - strh r0, [r2] -_081A09FE: - ldr r0, [r3] - lsls r1, 2 - adds r0, r1 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - cmp r0, 0 - bne _081A0A18 - movs r0, 0x1 - b _081A0A1A - .pool -_081A0A18: - movs r0, 0 -_081A0A1A: - strh r0, [r2] -_081A0A1C: - pop {r0} - bx r0 - thumb_func_end sub_81A09D0 - - thumb_func_start sub_81A0A20 -sub_81A0A20: @ 81A0A20 - push {lr} - ldr r0, =gSpecialVar_0x8005 - ldrb r0, [r0] - bl sub_81A04E4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A0A20 - - thumb_func_start sub_81A0A34 -sub_81A0A34: @ 81A0A34 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8197224 - lsls r0, 16 - cmp r0, 0 - bne _081A0A68 - adds r0, r4, 0 - bl DestroyTask - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0 - beq _081A0A64 - ldr r0, =EnableBothScriptContexts - bl sub_81A172C - b _081A0A68 - .pool -_081A0A64: - bl EnableBothScriptContexts -_081A0A68: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81A0A34 - - thumb_func_start sub_81A0A70 -sub_81A0A70: @ 81A0A70 - push {lr} - ldr r1, =gSpecialVar_0x8006 - ldrh r0, [r1] - cmp r0, 0x6 - bne _081A0A94 - ldr r1, =gUnknown_08610FF0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 3 - b _081A0C66 - .pool -_081A0A94: - cmp r0, 0x7 - bne _081A0AB0 - ldr r1, =gUnknown_08610FF0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 3 - adds r1, 0x4 - b _081A0C66 - .pool -_081A0AB0: - cmp r0, 0x8 - bne _081A0ACC - ldr r1, =gUnknown_086111B0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 3 - b _081A0C66 - .pool -_081A0ACC: - cmp r0, 0x9 - bne _081A0AE8 - ldr r1, =gUnknown_086111B0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 3 - adds r1, 0x4 - b _081A0C66 - .pool -_081A0AE8: - cmp r0, 0x4 - bne _081A0B04 - ldr r1, =gUnknown_08611230 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 3 - b _081A0C66 - .pool -_081A0B04: - cmp r0, 0x5 - bne _081A0B20 - ldr r1, =gUnknown_08611230 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 3 - adds r1, 0x4 - b _081A0C66 - .pool -_081A0B20: - cmp r0, 0xA - bne _081A0B40 - ldr r2, =gUnknown_08611070 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - b _081A0BD6 - .pool -_081A0B40: - cmp r0, 0xB - bne _081A0B5C - ldr r1, =gUnknown_086112B0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 3 - b _081A0C66 - .pool -_081A0B5C: - cmp r0, 0xC - bne _081A0B7C - ldr r2, =gUnknown_08611070 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, 0xC - b _081A0BD6 - .pool -_081A0B7C: - cmp r0, 0xD - bne _081A0B9C - ldr r2, =gUnknown_08611070 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, 0x4 - b _081A0BD6 - .pool -_081A0B9C: - ldrh r0, [r1] - cmp r0, 0x10 - bne _081A0BC0 - ldr r2, =gUnknown_08611070 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, 0x10 - b _081A0BD6 - .pool -_081A0BC0: - cmp r0, 0xE - bne _081A0BE4 - ldr r2, =gUnknown_08611070 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, 0x8 -_081A0BD6: - adds r0, r2 - ldr r1, [r0] - b _081A0C7A - .pool -_081A0BE4: - cmp r0, 0xF - bne _081A0C00 - ldr r1, =gUnknown_086112B0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 3 - adds r1, 0x4 - b _081A0C66 - .pool -_081A0C00: - cmp r0, 0 - bne _081A0C1C - ldr r1, =gUnknown_08610EF0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 4 - b _081A0C66 - .pool -_081A0C1C: - cmp r0, 0x1 - bne _081A0C38 - ldr r1, =gUnknown_08610EF0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 4 - adds r1, 0x4 - b _081A0C66 - .pool -_081A0C38: - cmp r0, 0x2 - bne _081A0C54 - ldr r1, =gUnknown_08610EF0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 4 - adds r1, 0x8 - b _081A0C66 - .pool -_081A0C54: - cmp r0, 0x3 - bne _081A0C74 - ldr r1, =gUnknown_08610EF0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 4 - adds r1, 0xC -_081A0C66: - adds r0, r1 - ldr r1, [r0] - b _081A0C7A - .pool -_081A0C74: - bl EnableBothScriptContexts - b _081A0C8E -_081A0C7A: - ldr r0, =gStringVar4 - bl StringExpandPlaceholders - movs r0, 0x1 - bl AddTextPrinterForMessage - ldr r0, =sub_81A0A34 - movs r1, 0x1 - bl CreateTask -_081A0C8E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A0A70 - - thumb_func_start sub_81A0C9C -sub_81A0C9C: @ 81A0C9C - push {lr} - bl ScriptContext2_Enable - bl player_bitmagic - bl sub_808B864 - bl sub_808BCF4 - movs r0, 0 - movs r1, 0x1 - bl sub_81973C4 - bl sub_81A0A70 - pop {r0} - bx r0 - thumb_func_end sub_81A0C9C - - thumb_func_start sub_81A0CC0 -sub_81A0CC0: @ 81A0CC0 - push {lr} - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - adds r0, r2, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r1, r0, 26 - lsrs r0, r1, 28 - cmp r0, 0x2 - bhi _081A0CE4 - ldr r1, =gScriptResult - movs r0, 0x2 - b _081A0D34 - .pool -_081A0CE4: - lsrs r0, r1, 28 - cmp r0, 0xB - bhi _081A0D30 - lsrs r0, r1, 28 - subs r0, 0x3 - lsls r0, 2 - adds r0, r2, r0 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - cmp r0, 0x2 - beq _081A0D18 - cmp r0, 0x2 - bgt _081A0D08 - cmp r0, 0x1 - beq _081A0D0E - b _081A0D30 -_081A0D08: - cmp r0, 0x3 - beq _081A0D24 - b _081A0D30 -_081A0D0E: - ldr r1, =gScriptResult - movs r0, 0x4 - b _081A0D34 - .pool -_081A0D18: - ldr r1, =gScriptResult - movs r0, 0x3 - b _081A0D34 - .pool -_081A0D24: - ldr r1, =gScriptResult - movs r0, 0x1 - b _081A0D34 - .pool -_081A0D30: - ldr r1, =gScriptResult - movs r0, 0x5 -_081A0D34: - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A0CC0 - - thumb_func_start sub_81A0D40 -sub_81A0D40: @ 81A0D40 - push {r4,lr} - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0 - beq _081A0D6E - ldr r4, =gSpecialVar_0x8006 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - adds r2, 0xB2 - ldrb r3, [r2] - lsls r0, r3, 29 - lsrs r0, 29 - movs r1, 0x1 - ldrb r4, [r4] - lsls r1, r4 - orrs r1, r0 - movs r0, 0x7 - ands r1, r0 - movs r0, 0x8 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] -_081A0D6E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A0D40 - - thumb_func_start sub_81A0D80 -sub_81A0D80: @ 81A0D80 - push {lr} - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - adds r0, r3, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r1, r0, 26 - lsrs r0, r1, 28 - cmp r0, 0x2 - bls _081A0DCE - subs r0, 0x3 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0 - beq _081A0DC0 - lsls r2, 2 - adds r2, r3, r2 - adds r2, 0xB8 - ldrb r1, [r2] - movs r0, 0x3F - ands r0, r1 - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] - b _081A0DCE - .pool -_081A0DC0: - lsls r0, r2, 2 - adds r0, r3, r0 - adds r0, 0xB8 - ldrb r2, [r0] - movs r1, 0x3F - ands r1, r2 - strb r1, [r0] -_081A0DCE: - pop {r0} - bx r0 - thumb_func_end sub_81A0D80 - - thumb_func_start sub_81A0DD4 -sub_81A0DD4: @ 81A0DD4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r6, 0 - movs r2, 0 - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - ldr r3, =gUnknown_030062F0 - mov r9, r3 - cmp r0, 0 - beq _081A0E14 - adds r3, r1, 0 -_081A0DF4: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x8 - bhi _081A0E14 - ldr r0, [r3] - lsls r1, r2, 2 - adds r0, r1 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - cmp r0, 0 - bne _081A0DF4 -_081A0E14: - mov r4, r9 - movs r0, 0x8 - bl AllocZeroed - adds r7, r0, 0 - str r7, [r4] - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x2 - bne _081A0E88 - ldr r0, =gSaveBlock2Ptr - ldr r5, [r0] - adds r6, r5, 0 - adds r6, 0xB1 - ldrb r0, [r6] - lsls r1, r0, 26 - lsrs r0, r1, 28 - cmp r0, 0x2 - bls _081A0E3C - b _081A0FCE -_081A0E3C: - adds r2, r5, 0 - adds r2, 0xB4 - adds r0, r2, r0 - ldrb r0, [r0] - lsrs r4, r0, 4 - ldr r3, =gUnknown_08610970 - lsls r1, r4, 1 - adds r5, 0xB0 - ldrb r0, [r5] - movs r4, 0x58 - muls r0, r4 - adds r1, r0 - adds r3, 0x34 - adds r1, r3 - ldrh r0, [r1] - strh r0, [r7, 0x2] - ldrb r0, [r6] - lsls r0, 26 - lsrs r0, 28 - adds r2, r0 - ldrb r1, [r2] - movs r0, 0xF - ands r0, r1 - lsls r0, 1 - ldrb r1, [r5] - muls r1, r4 - adds r0, r1 - adds r0, r3 - b _081A0FCA - .pool -_081A0E88: - cmp r0, 0x3 - bne _081A0F54 - ldr r0, =gSaveBlock2Ptr - mov r8, r0 - ldr r5, [r0] - movs r1, 0xB1 - adds r1, r5 - mov r12, r1 - ldrb r0, [r1] - lsls r2, r0, 26 - lsrs r0, r2, 28 - cmp r0, 0x2 - bhi _081A0EA4 - b _081A0FCE -_081A0EA4: - adds r1, r0, 0 - adds r0, r6, 0x3 - cmp r1, r0 - blt _081A0EAE - b _081A0FCE -_081A0EAE: - adds r0, r1, 0 - subs r0, 0x3 - lsls r0, 2 - adds r0, r5, r0 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - cmp r0, 0x2 - beq _081A0EC4 - b _081A0FCE -_081A0EC4: - adds r0, r1, 0 - subs r0, 0x3 - lsls r0, 2 - adds r0, r5, r0 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 28 - lsrs r6, r0, 30 - adds r0, r5, 0 - adds r0, 0xB2 - ldrb r1, [r0] - lsls r1, 29 - lsrs r1, 29 - asrs r1, r6 - movs r0, 0x1 - ands r1, r0 - adds r0, r5, 0 - adds r0, 0xB4 - adds r0, r6 - ldrb r4, [r0] - lsls r1, 2 - asrs r4, r1 - movs r0, 0xF - ands r4, r0 - ldr r2, =gUnknown_08610970 - lsls r1, r4, 1 - adds r0, r5, 0 - adds r0, 0xB0 - ldrb r3, [r0] - movs r0, 0x58 - muls r0, r3 - adds r1, r0 - adds r2, 0x34 - adds r1, r2 - ldrh r0, [r1] - strh r0, [r7] - mov r3, r12 - ldrb r0, [r3] - lsls r0, 26 - lsrs r0, 28 - subs r0, 0x3 - lsls r0, 2 - adds r0, r5, r0 - adds r0, 0xB8 - ldrb r2, [r0] - lsls r2, 26 - lsrs r2, 30 - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_81A0284 - mov r1, r9 - ldr r2, [r1] - strh r0, [r2, 0x4] - mov r3, r8 - ldr r1, [r3] - adds r0, r1, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - subs r0, 0x3 - lsls r0, 2 - adds r1, r0 - adds r1, 0xBA - ldrh r0, [r1] - strh r0, [r2, 0x6] - b _081A0FCE - .pool -_081A0F54: - cmp r0, 0x4 - bne _081A0FCE - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - adds r0, r3, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r2, r0, 26 - lsrs r0, r2, 28 - cmp r0, 0x2 - bls _081A0FCE - adds r1, r0, 0 - adds r0, r6, 0x3 - cmp r1, r0 - bge _081A0FCE - adds r0, r1, 0 - subs r0, 0x3 - lsls r0, 2 - adds r0, r3, r0 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - cmp r0, 0x1 - bne _081A0FCE - adds r0, r1, 0 - subs r0, 0x3 - lsls r0, 2 - adds r0, r3, r0 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 28 - lsrs r6, r0, 30 - adds r0, r3, 0 - adds r0, 0xB2 - ldrb r1, [r0] - lsls r1, 29 - lsrs r1, 29 - asrs r1, r6 - movs r0, 0x1 - ands r1, r0 - adds r0, r3, 0 - adds r0, 0xB4 - adds r0, r6 - ldrb r0, [r0] - lsls r1, 2 - asrs r0, r1 - movs r1, 0xF - ands r0, r1 - ldr r2, =gUnknown_08610970 - lsls r0, 1 - adds r1, r3, 0 - adds r1, 0xB0 - ldrb r3, [r1] - movs r1, 0x58 - muls r1, r3 - adds r0, r1 - adds r2, 0x34 - adds r0, r2 -_081A0FCA: - ldrh r0, [r0] - strh r0, [r7] -_081A0FCE: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A0DD4 - - thumb_func_start sub_81A0FE4 -sub_81A0FE4: @ 81A0FE4 - push {r4,lr} - ldr r4, =gUnknown_030062F0 - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A0FE4 - - thumb_func_start sub_81A0FFC -sub_81A0FFC: @ 81A0FFC - push {r4-r6,lr} - sub sp, 0x10 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x1 - beq _081A1028 - cmp r0, 0x1 - bgt _081A1018 - cmp r0, 0 - beq _081A101E - b _081A11E6 - .pool -_081A1018: - cmp r0, 0x2 - beq _081A1030 - b _081A11E6 -_081A101E: - ldr r5, =gStringVar1 - b _081A1032 - .pool -_081A1028: - ldr r5, =gStringVar2 - b _081A1032 - .pool -_081A1030: - ldr r5, =gStringVar3 -_081A1032: - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - cmp r0, 0x9 - bls _081A103C - b _081A11E6 -_081A103C: - lsls r0, 2 - ldr r1, =_081A1054 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A1054: - .4byte _081A107C - .4byte _081A1094 - .4byte _081A10AC - .4byte _081A10C4 - .4byte _081A10DC - .4byte _081A10F4 - .4byte _081A1118 - .4byte _081A1164 - .4byte _081A1140 - .4byte _081A1184 -_081A107C: - ldr r0, =gUnknown_030062F0 - ldr r0, [r0] - ldrh r1, [r0] - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - b _081A1174 - .pool -_081A1094: - ldr r0, =gUnknown_030062F0 - ldr r0, [r0] - ldrh r1, [r0, 0x2] - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - b _081A1174 - .pool -_081A10AC: - ldr r0, =gUnknown_030062F0 - ldr r0, [r0] - ldrh r1, [r0] - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - b _081A1174 - .pool -_081A10C4: - ldr r0, =gUnknown_030062F0 - ldr r0, [r0] - ldrh r1, [r0, 0x4] - movs r0, 0xD - muls r1, r0 - ldr r0, =gMoveNames - adds r1, r0 - b _081A1174 - .pool -_081A10DC: - ldr r0, =gUnknown_030062F0 - ldr r0, [r0] - ldrh r1, [r0, 0x6] - movs r0, 0xD - muls r1, r0 - ldr r0, =gMoveNames - adds r1, r0 - b _081A1174 - .pool -_081A10F4: - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - subs r0, 0x3 - lsls r0, 2 - adds r1, r0 - adds r1, 0xBA - ldrh r0, [r1] - bl ItemId_GetItem - adds r1, r0, 0 - b _081A1174 - .pool -_081A1118: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - movs r1, 0x2 - bl sub_81A1650 - adds r1, r0, 0 - mov r0, sp - movs r2, 0x2 - bl sub_81DB5E8 - adds r0, r5, 0 - mov r1, sp - bl StringCopy - b _081A11E6 - .pool -_081A1140: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB1 - ldrb r1, [r0] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x1 - bne _081A115C - ldr r1, =gUnknown_085EAEB1 - b _081A1174 - .pool -_081A115C: - ldr r1, =gUnknown_085EAEB8 - b _081A1174 - .pool -_081A1164: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - movs r1, 0x82 - lsls r1, 1 - adds r0, r1 - bl ConvertBattleFrontierTrainerSpeechToString - ldr r1, =gStringVar4 -_081A1174: - adds r0, r5, 0 - bl StringCopy - b _081A11E6 - .pool -_081A1184: - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - adds r1, r3, 0 - adds r1, 0xB1 - ldrb r1, [r1] - lsls r4, r1, 24 - lsrs r1, r4, 30 - adds r6, r0, 0 - cmp r1, 0x2 - bhi _081A11C0 - adds r0, r3, 0 - adds r0, 0xB4 - adds r0, r1 - ldrb r2, [r0] - adds r0, r3, 0 - adds r0, 0xB2 - ldrb r0, [r0] - lsls r0, 29 - lsrs r0, 29 - asrs r0, r1 - movs r1, 0x1 - ands r0, r1 - lsls r0, 2 - asrs r2, r0 - movs r0, 0xF - ands r2, r0 - b _081A11C2 - .pool -_081A11C0: - movs r2, 0 -_081A11C2: - ldr r3, =gUnknown_08610970 - lsls r1, r2, 1 - ldr r0, [r6] - adds r0, 0xB0 - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, r0 - adds r3, 0x34 - adds r1, r3 - ldrh r1, [r1] - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - adds r0, r5, 0 - bl StringCopy -_081A11E6: - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A0FFC - - thumb_func_start sub_81A11F8 -sub_81A11F8: @ 81A11F8 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r0, =gSpecialVar_0x8005 - ldrb r1, [r0] - adds r2, 0xB1 - lsls r1, 6 - ldrb r3, [r2] - movs r0, 0x3F - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - bx lr - .pool - thumb_func_end sub_81A11F8 - - thumb_func_start sub_81A1218 -sub_81A1218: @ 81A1218 - push {lr} - bl sub_81AAC28 - pop {r0} - bx r0 - thumb_func_end sub_81A1218 - - thumb_func_start sub_81A1224 -sub_81A1224: @ 81A1224 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r1, =gSaveBlock2Ptr - ldr r3, [r1] - adds r0, r3, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - adds r7, r1, 0 - cmp r0, 0x2 - bhi _081A1242 - b _081A1362 -_081A1242: - movs r5, 0 - movs r2, 0 - adds r0, r3, 0 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - ldr r1, =gSpecialVar_0x8005 - mov r12, r1 - ldr r1, =gScriptResult - mov r8, r1 - cmp r0, 0 - beq _081A127C - adds r3, r7, 0 -_081A125C: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x8 - bhi _081A127C - ldr r0, [r3] - lsls r1, r2, 2 - adds r0, r1 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - cmp r0, 0 - bne _081A125C -_081A127C: - movs r4, 0 - cmp r4, r5 - bcs _081A1322 - ldr r0, [r7] - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - subs r0, 0x3 - cmp r4, r0 - bge _081A1322 - adds r6, r7, 0 - mov r9, r4 -_081A1296: - ldr r3, [r6] - lsls r0, r4, 2 - adds r2, r3, r0 - adds r0, r2, 0 - adds r0, 0xB8 - ldrb r1, [r0] - lsls r0, r1, 30 - lsrs r0, 30 - cmp r0, 0x1 - bne _081A1308 - lsrs r0, r1, 6 - cmp r0, 0 - beq _081A1308 - adds r0, r2, 0 - adds r0, 0xBA - ldrh r0, [r0] - mov r2, r12 - ldrh r2, [r2] - cmp r0, r2 - bne _081A1308 - adds r0, r3, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - subs r0, 0x3 - lsls r0, 2 - adds r0, r3, r0 - adds r0, 0xB8 - ldrb r2, [r0] - movs r1, 0x3F - ands r1, r2 - strb r1, [r0] - ldr r1, [r6] - adds r0, r1, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - subs r0, 0x3 - lsls r0, 2 - adds r1, r0 - mov r2, r12 - ldrh r0, [r2] - adds r1, 0xBA - strh r0, [r1] - mov r1, r9 - mov r0, r8 - strh r1, [r0] - b _081A1362 - .pool -_081A1308: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcs _081A1322 - ldr r0, [r6] - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - subs r0, 0x3 - cmp r4, r0 - blt _081A1296 -_081A1322: - ldr r2, [r7] - adds r0, r2, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - subs r0, 0x3 - lsls r0, 2 - adds r2, r0 - adds r2, 0xB8 - ldrb r1, [r2] - movs r0, 0x3F - ands r0, r1 - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] - ldr r1, [r7] - adds r0, r1, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - subs r0, 0x3 - lsls r0, 2 - adds r1, r0 - mov r2, r12 - ldrh r0, [r2] - adds r1, 0xBA - strh r0, [r1] - movs r0, 0x1 - mov r1, r8 - strh r0, [r1] -_081A1362: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81A1224 - - thumb_func_start sub_81A1370 -sub_81A1370: @ 81A1370 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - movs r2, 0x8A - lsls r2, 1 - adds r1, r2 - ldrb r1, [r1] - adds r4, r0, 0 - cmp r1, 0xFF - beq _081A1422 - movs r5, 0 -_081A138E: - ldr r1, [r4] - adds r2, r5, 0x1 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r3, r1, r0 - movs r5, 0x8A - lsls r5, 1 - adds r0, r3, r5 - ldrb r0, [r0] - cmp r0, 0xFF - bne _081A13B8 - adds r0, r3, 0 - adds r0, 0xDC - adds r1, 0xDC - movs r2, 0x44 - bl memcpy - b _081A1422 - .pool -_081A13B8: - adds r5, r2, 0 - cmp r5, 0x2 - ble _081A138E - ldr r0, =0x0000ffff - mov r10, r0 - movs r2, 0x1 - negs r2, r2 - mov r9, r2 - movs r5, 0x1 - ldr r7, =gSaveBlock2Ptr - movs r0, 0x90 - lsls r0, 1 - mov r8, r0 - movs r6, 0x44 -_081A13D4: - ldr r0, [r7] - add r0, r8 - adds r0, 0x34 - bl ReadUnalignedWord - adds r4, r0, 0 - ldr r0, [r7] - adds r0, 0xA - bl ReadUnalignedWord - cmp r4, r0 - bne _081A13FC - ldr r0, [r7] - adds r0, r6 - adds r0, 0xDE - ldrb r0, [r0] - cmp r0, r10 - bge _081A13FC - mov r10, r0 - mov r9, r5 -_081A13FC: - movs r2, 0x44 - add r8, r2 - adds r6, 0x44 - adds r5, 0x1 - cmp r5, 0x3 - ble _081A13D4 - mov r5, r9 - cmp r5, 0 - ble _081A1422 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - lsls r0, r5, 4 - add r0, r9 - lsls r0, 2 - adds r0, r1, r0 - adds r0, 0xDC - adds r1, 0xDC - bl memcpy -_081A1422: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1370 - - thumb_func_start sub_81A1438 -sub_81A1438: @ 81A1438 - push {r4,r5,lr} - ldr r4, =gSaveBlock2Ptr - ldr r2, [r4] - adds r0, r2, 0 - adds r0, 0xB0 - ldrb r0, [r0] - adds r2, 0xDC - movs r1, 0x1F - ands r1, r0 - ldrb r3, [r2] - movs r0, 0x20 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - ldr r2, [r4] - adds r0, r2, 0 - adds r0, 0xB1 - ldrb r1, [r0] - lsls r1, 30 - adds r2, 0xDC - lsrs r1, 25 - ldrb r3, [r2] - movs r0, 0x61 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - movs r2, 0 - ldr r0, [r4] - b _081A148C - .pool -_081A147C: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x8 - bhi _081A1496 - ldr r0, [r4] - lsls r1, r2, 2 - adds r0, r1 -_081A148C: - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - cmp r0, 0 - bne _081A147C -_081A1496: - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - adds r0, 0xDD - strb r2, [r0] - ldr r0, [r4] - adds r1, r0, 0 - adds r1, 0xDE - ldrb r0, [r1] - cmp r0, 0xFE - bhi _081A14AE - adds r0, 0x1 - strb r0, [r1] -_081A14AE: - ldr r0, [r4] - adds r0, 0xDD - ldrb r0, [r0] - bl sub_81A0390 - movs r2, 0 - adds r3, r4, 0 - movs r4, 0x88 - lsls r4, 1 - adds r5, r3, 0 -_081A14C2: - ldr r0, [r3] - adds r1, r0, r4 - adds r1, r2 - adds r0, 0xA - adds r0, r2 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x3 - bls _081A14C2 - ldr r1, [r5] - movs r2, 0x8A - lsls r2, 1 - adds r0, r1, r2 - bl StringCopy - ldr r1, [r5] - ldr r0, =gGameLanguage - ldrb r0, [r0] - ldr r2, =0x0000011b - adds r1, r2 - strb r0, [r1] - ldr r0, [r5] - adds r0, 0xDC - bl sub_8165AE8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1438 - - thumb_func_start sub_81A150C -sub_81A150C: @ 81A150C - push {lr} - ldr r2, =gUnknown_08610970 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xDC - ldrb r0, [r0] - lsls r0, 27 - lsrs r0, 27 - movs r1, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x32 - ldrb r2, [r0] - movs r1, 0 - ldr r3, =gUnknown_085DCEDC - ldrb r0, [r3] - cmp r0, r2 - beq _081A1542 -_081A1530: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x1D - bhi _081A1542 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _081A1530 -_081A1542: - cmp r1, 0x1E - beq _081A1568 - ldr r0, =gUnknown_085DCF0E - adds r0, r1, r0 - ldrb r1, [r0] - ldr r0, =0x00004010 - bl VarSet - b _081A1594 - .pool -_081A1568: - movs r1, 0 - ldr r3, =gUnknown_085DCEFA - ldrb r0, [r3] - cmp r0, r2 - beq _081A1584 -_081A1572: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x13 - bhi _081A1584 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _081A1572 -_081A1584: - cmp r1, 0x14 - beq _081A1594 - ldr r0, =gUnknown_085DCF2C - adds r0, r1, r0 - ldrb r1, [r0] - ldr r0, =0x00004010 - bl VarSet -_081A1594: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A150C - - thumb_func_start sub_81A15A4 -sub_81A15A4: @ 81A15A4 - push {lr} - ldr r2, =gUnknown_08610970 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x32 - ldrb r2, [r0] - movs r1, 0 - ldr r3, =gUnknown_085DCEDC - ldrb r0, [r3] - cmp r0, r2 - beq _081A15D6 -_081A15C4: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x1D - bhi _081A15D6 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _081A15C4 -_081A15D6: - cmp r1, 0x1E - beq _081A15FC - ldr r0, =gUnknown_085DCF0E - adds r0, r1, r0 - ldrb r1, [r0] - ldr r0, =0x00004010 - bl VarSet - b _081A1628 - .pool -_081A15FC: - movs r1, 0 - ldr r3, =gUnknown_085DCEFA - ldrb r0, [r3] - cmp r0, r2 - beq _081A1618 -_081A1606: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x13 - bhi _081A1618 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _081A1606 -_081A1618: - cmp r1, 0x14 - beq _081A1628 - ldr r0, =gUnknown_085DCF2C - adds r0, r1, r0 - ldrb r1, [r0] - ldr r0, =0x00004010 - bl VarSet -_081A1628: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A15A4 - - thumb_func_start sub_81A1638 -sub_81A1638: @ 81A1638 - ldr r1, =gSpecialVar_0x8004 - movs r0, 0x1 - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_81A1638 - - thumb_func_start sub_81A1644 -sub_81A1644: @ 81A1644 - ldr r1, =gSpecialVar_0x8004 - movs r0, 0x1 - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_81A1644 - - thumb_func_start sub_81A1650 -sub_81A1650: @ 81A1650 - push {lr} - movs r2, 0x58 - muls r2, r0 - ldr r0, =gUnknown_08610970 - adds r2, r0 - subs r0, r1, 0x1 - cmp r0, 0x6 - bhi _081A16AC - lsls r0, 2 - ldr r1, =_081A1674 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A1674: - .4byte _081A1690 - .4byte _081A1694 - .4byte _081A169A - .4byte _081A16A0 - .4byte _081A16A6 - .4byte _081A16AC - .4byte _081A16AC -_081A1690: - adds r0, r2, 0 - b _081A16B0 -_081A1694: - adds r0, r2, 0 - adds r0, 0x8 - b _081A16B0 -_081A169A: - adds r0, r2, 0 - adds r0, 0x10 - b _081A16B0 -_081A16A0: - adds r0, r2, 0 - adds r0, 0x18 - b _081A16B0 -_081A16A6: - adds r0, r2, 0 - adds r0, 0x20 - b _081A16B0 -_081A16AC: - adds r0, r2, 0 - adds r0, 0x28 -_081A16B0: - pop {r1} - bx r1 - thumb_func_end sub_81A1650 - - thumb_func_start sub_81A16B4 -sub_81A16B4: @ 81A16B4 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081A16CE - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081A16D4 -_081A16CE: - adds r0, r2, 0 - bl SwitchTaskToFollowupFunc -_081A16D4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A16B4 - - thumb_func_start sub_81A16DC -sub_81A16DC: @ 81A16DC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081A16F6 - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081A1718 -_081A16F6: - ldr r2, =gUnknown_030062F4 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x8] - movs r3, 0xA - ldrsh r0, [r0, r3] - lsls r0, 16 - orrs r1, r0 - str r1, [r2] - bl _call_via_r1 - adds r0, r4, 0 - bl DestroyTask -_081A1718: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A16DC - - thumb_func_start sub_81A172C -sub_81A172C: @ 81A172C - push {r4,lr} - adds r4, r0, 0 - ldr r0, =sub_81A16DC - movs r1, 0x1 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x8] - lsrs r4, 16 - strh r4, [r1, 0xA] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A172C - - thumb_func_start sub_81A175C -sub_81A175C: @ 81A175C - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =sub_81A16B4 - adds r0, r4, 0 - movs r1, 0x1 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - adds r2, r5, 0 - bl SetTaskFuncWithFollowupFunc - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A175C - - thumb_func_start sub_81A1780 -sub_81A1780: @ 81A1780 - push {lr} - ldr r1, =gUnknown_08611C18 - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1780 - - thumb_func_start sub_81A17A0 -sub_81A17A0: @ 81A17A0 - push {lr} - movs r0, 0x80 - lsls r0, 7 - movs r1, 0xFF - bl VarSet - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca8 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x4 - bhi _081A1822 - lsls r0, 2 - ldr r1, =_081A17D0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A17D0: - .4byte _081A1822 - .4byte _081A17E4 - .4byte _081A1810 - .4byte _081A17EC - .4byte _081A17E8 -_081A17E4: - movs r0, 0 - b _081A17EE -_081A17E8: - movs r0, 0 - b _081A17EE -_081A17EC: - movs r0, 0x1 -_081A17EE: - bl sub_813A878 - movs r0, 0x80 - lsls r0, 7 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - ldr r2, =0x00000ca8 - adds r1, r2 - ldrb r1, [r1] - bl VarSet - b _081A1822 - .pool -_081A1810: - movs r0, 0x80 - lsls r0, 7 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - ldr r2, =0x00000ca8 - adds r1, r2 - ldrb r1, [r1] - bl VarSet -_081A1822: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A17A0 - - thumb_func_start sub_81A1830 -sub_81A1830: @ 81A1830 - push {r4-r6,lr} - ldr r0, =0x000040cf - bl VarGet - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r6, 0 - bl sub_81A3B30 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bne _081A184C - movs r5, 0x1 -_081A184C: - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x7 - bls _081A1856 - b _081A1956 -_081A1856: - lsls r0, 2 - ldr r1, =_081A186C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A186C: - .4byte _081A188C - .4byte _081A18A8 - .4byte _081A18C8 - .4byte _081A18E4 - .4byte _081A1956 - .4byte _081A1900 - .4byte _081A1918 - .4byte _081A1938 -_081A188C: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000ca8 - adds r0, r2 - ldrb r0, [r0] - strh r0, [r1] - b _081A1956 - .pool -_081A18A8: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000ca9 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - strh r0, [r1] - b _081A1956 - .pool -_081A18C8: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000cb2 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r1] - b _081A1956 - .pool -_081A18E4: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000ca9 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 29 - b _081A1926 - .pool -_081A1900: - ldr r2, =gScriptResult - ldr r1, =gBattleOutcome - ldrb r0, [r1] - strh r0, [r2] - movs r0, 0 - strb r0, [r1] - b _081A1956 - .pool -_081A1918: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000ca9 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 28 -_081A1926: - lsrs r0, 31 - strh r0, [r1] - b _081A1956 - .pool -_081A1938: - ldr r4, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - movs r0, 0xD0 - lsls r0, 4 - adds r2, r0 - ldr r3, =gUnknown_08611BFC - lsls r0, r5, 1 - lsls r1, r6, 2 - adds r0, r1 - adds r0, r3 - ldrh r1, [r2] - ldrh r0, [r0] - ands r0, r1 - strh r0, [r4] -_081A1956: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1830 - - thumb_func_start sub_81A1968 -sub_81A1968: @ 81A1968 - push {r4,r5,lr} - ldr r0, =0x000040cf - bl VarGet - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r5, 0 - bl sub_81A3B30 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bne _081A1984 - movs r4, 0x1 -_081A1984: - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x7 - bls _081A198E - b _081A1AC4 -_081A198E: - lsls r0, 2 - ldr r1, =_081A19A4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A19A4: - .4byte _081A19C4 - .4byte _081A19E0 - .4byte _081A1A0C - .4byte _081A1A28 - .4byte _081A1A50 - .4byte _081A1AC4 - .4byte _081A1A7C - .4byte _081A1AA8 -_081A19C4: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =gSpecialVar_0x8006 - ldrh r1, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - strb r1, [r0] - b _081A1AC4 - .pool -_081A19E0: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r1, =0x00000ca9 - adds r2, r1 - movs r1, 0x3 - ands r1, r0 - ldrb r3, [r2] - movs r0, 0x4 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - b _081A1AC4 - .pool -_081A1A0C: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =gSpecialVar_0x8006 - ldrh r1, [r1] - ldr r2, =0x00000cb2 - adds r0, r2 - strh r1, [r0] - b _081A1AC4 - .pool -_081A1A28: - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r1, =0x00000ca9 - adds r3, r1 - movs r1, 0x1 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r3] - movs r0, 0x5 - negs r0, r0 - b _081A1A94 - .pool -_081A1A50: - movs r2, 0 - ldr r5, =gSaveBlock2Ptr - ldr r4, =0x00000caa - ldr r3, =gUnknown_0203CEF8 -_081A1A58: - ldr r1, [r5] - lsls r0, r2, 1 - adds r1, r4 - adds r1, r0 - adds r0, r2, r3 - ldrb r0, [r0] - strh r0, [r1] - adds r2, 0x1 - cmp r2, 0x3 - ble _081A1A58 - b _081A1AC4 - .pool -_081A1A7C: - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r2, =0x00000ca9 - adds r3, r2 - movs r1, 0x1 - ands r1, r0 - lsls r1, 3 - ldrb r2, [r3] - movs r0, 0x9 - negs r0, r0 -_081A1A94: - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - b _081A1AC4 - .pool -_081A1AA8: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - movs r0, 0xD0 - lsls r0, 4 - adds r2, r0 - ldr r3, =gUnknown_08611BFC - lsls r1, r4, 1 - lsls r0, r5, 2 - adds r1, r0 - adds r1, r3 - ldrh r0, [r2] - ldrh r1, [r1] - orrs r0, r1 - strh r0, [r2] -_081A1AC4: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1968 - - thumb_func_start sub_81A1AD4 -sub_81A1AD4: @ 81A1AD4 - push {r4-r7,lr} - bl sub_81B8558 - movs r3, 0 - ldr r4, =gSpecialVar_0x8005 - ldrh r0, [r4] - cmp r3, r0 - bge _081A1B00 - ldr r7, =gUnknown_0203CEF8 - ldr r6, =gSaveBlock2Ptr - ldr r5, =0x00000caa -_081A1AEA: - adds r2, r3, r7 - ldr r0, [r6] - lsls r1, r3, 1 - adds r0, r5 - adds r0, r1 - ldrh r0, [r0] - strb r0, [r2] - adds r3, 0x1 - ldrh r0, [r4] - cmp r3, r0 - blt _081A1AEA -_081A1B00: - bl sub_80F94E8 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1AD4 - - thumb_func_start sub_81A1B1C -sub_81A1B1C: @ 81A1B1C - push {lr} - bl DoSoftReset - pop {r0} - bx r0 - thumb_func_end sub_81A1B1C - - thumb_func_start sub_81A1B28 -sub_81A1B28: @ 81A1B28 - ldr r1, =gUnknown_0203BC88 - ldr r0, =gBattleFrontierTrainers - str r0, [r1] - bx lr - .pool - thumb_func_end sub_81A1B28 - - thumb_func_start sub_81A1B38 -sub_81A1B38: @ 81A1B38 - push {r4,r5,lr} - movs r4, 0 - movs r5, 0x64 -_081A1B3E: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000caa - adds r0, r2 - adds r1, r0, r1 - ldrh r0, [r1] - subs r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x5 - bhi _081A1B76 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldrh r1, [r1] - subs r1, 0x1 - muls r1, r5 - adds r0, r1 - movs r1, 0x8E - lsls r1, 2 - adds r0, r1 - ldr r2, =gPlayerParty - adds r1, r4, 0 - muls r1, r5 - adds r1, r2 - movs r2, 0x64 - bl memcpy -_081A1B76: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _081A1B3E - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1B38 - - thumb_func_start sub_81A1B98 -sub_81A1B98: @ 81A1B98 - push {lr} - ldr r0, =gSpecialVar_0x8006 - ldrh r1, [r0] - adds r2, r0, 0 - cmp r1, 0x3 - bls _081A1BA8 - movs r0, 0 - strh r0, [r2] -_081A1BA8: - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x7 - bhi _081A1C1E - lsls r0, 2 - ldr r1, =_081A1BC8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A1BC8: - .4byte _081A1BE8 - .4byte _081A1BF0 - .4byte _081A1BF8 - .4byte _081A1C0E - .4byte _081A1C06 - .4byte _081A1C00 - .4byte _081A1C14 - .4byte _081A1C1A -_081A1BE8: - ldrb r0, [r2] - bl sub_81A1EA8 - b _081A1C1E -_081A1BF0: - ldrb r0, [r2] - bl sub_81A2134 - b _081A1C1E -_081A1BF8: - ldrb r0, [r2] - bl sub_81A2460 - b _081A1C1E -_081A1C00: - bl sub_81A2698 - b _081A1C1E -_081A1C06: - ldrb r0, [r2] - bl sub_81A2C94 - b _081A1C1E -_081A1C0E: - bl sub_81A2968 - b _081A1C1E -_081A1C14: - bl sub_81A2F38 - b _081A1C1E -_081A1C1A: - bl sub_81A2FF8 -_081A1C1E: - pop {r0} - bx r0 - thumb_func_end sub_81A1B98 - - thumb_func_start sub_81A1C24 -sub_81A1C24: @ 81A1C24 - push {lr} - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - ldr r2, =0x00000cdc - adds r1, r2 - ldr r1, [r1] - ands r1, r0 - cmp r1, 0 - bne _081A1C44 - movs r0, 0 - b _081A1C46 - .pool -_081A1C44: - movs r0, 0x1 -_081A1C46: - pop {r1} - bx r1 - thumb_func_end sub_81A1C24 - - thumb_func_start sub_81A1C4C -sub_81A1C4C: @ 81A1C4C - push {r4,r5,lr} - sub sp, 0xC - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0xE0 - bl GetStringCenterAlignXOffset - adds r3, r0, 0 - lsls r0, r5, 3 - adds r5, r0, 0x1 - ldr r0, =gUnknown_0203AB74 - ldrb r0, [r0] - lsls r3, 24 - lsrs r3, 24 - lsls r1, r5, 24 - lsrs r1, 24 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - bl PrintTextOnWindow - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1C4C - - thumb_func_start sub_81A1C90 -sub_81A1C90: @ 81A1C90 - push {r4,lr} - sub sp, 0x34 - adds r2, r0, 0 - ldr r3, =gUnknown_0203AB74 - movs r1, 0xAE - mov r0, sp - adds r0, 0x2F -_081A1C9E: - strb r1, [r0] - subs r0, 0x1 - add r4, sp, 0xC - cmp r0, r4 - bge _081A1C9E - add r1, sp, 0x30 - movs r0, 0xFF - strb r0, [r1] - lsls r0, r2, 3 - adds r2, r0, 0x1 - ldrb r0, [r3] - lsls r1, r2, 24 - lsrs r1, 24 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0x4 - bl PrintTextOnWindow - add sp, 0x34 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1C90 - - thumb_func_start sub_81A1CD8 -sub_81A1CD8: @ 81A1CD8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - adds r5, r0, 0 - adds r4, r2, 0 - ldr r0, [sp, 0x30] - lsls r1, 16 - lsrs r6, r1, 16 - lsls r4, 24 - lsrs r4, 24 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0xC] - lsls r0, 24 - lsrs r0, 24 - adds r7, r0, 0 - ldr r0, =gUnknown_0203AB74 - mov r10, r0 - ldrb r0, [r0] - str r7, [sp] - movs r1, 0xFF - mov r9, r1 - str r1, [sp, 0x4] - movs r1, 0 - mov r8, r1 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - adds r3, r4, 0 - bl PrintTextOnWindow - ldr r0, =0x0000270f - cmp r6, r0 - bls _081A1D24 - adds r6, r0, 0 -_081A1D24: - ldr r0, =gStringVar1 - adds r1, r6, 0 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EE302 - adds r0, r4, 0 - bl StringExpandPlaceholders - mov r1, r10 - ldrb r0, [r1] - str r7, [sp] - mov r1, r9 - str r1, [sp, 0x4] - mov r1, r8 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - ldr r3, [sp, 0xC] - bl PrintTextOnWindow - 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_81A1CD8 - - thumb_func_start sub_81A1D78 -sub_81A1D78: @ 81A1D78 - push {r4,r5,lr} - sub sp, 0x4 - ldr r5, [sp, 0x10] - lsls r0, 24 - lsls r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r5, 24 - lsrs r5, 24 - ldr r4, =gSaveBlock2Ptr - ldr r4, [r4] - lsrs r1, 23 - lsrs r0, 22 - adds r1, r0 - movs r0, 0xCF - lsls r0, 4 - adds r4, r0 - adds r4, r1 - ldrh r1, [r4] - ldr r0, =gUnknown_085EE319 - str r5, [sp] - bl sub_81A1CD8 - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1D78 - - thumb_func_start sub_81A1DBC -sub_81A1DBC: @ 81A1DBC - push {lr} - lsls r0, 24 - lsls r1, 24 - ldr r2, =gSaveBlock2Ptr - ldr r2, [r2] - lsrs r1, 23 - lsrs r0, 22 - adds r1, r0 - movs r0, 0xCE - lsls r0, 4 - adds r2, r0 - adds r2, r1 - ldrh r0, [r2] - ldr r1, =0x0000270f - cmp r0, r1 - bls _081A1DDE - adds r0, r1, 0 -_081A1DDE: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A1DBC - - thumb_func_start sub_81A1DEC -sub_81A1DEC: @ 81A1DEC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - ldr r4, [sp, 0x20] - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - lsls r3, 24 - lsrs r3, 24 - mov r9, r3 - lsls r4, 24 - lsrs r7, r4, 24 - adds r0, r5, 0 - adds r1, r6, 0 - bl sub_81A1DBC - lsls r0, 16 - lsrs r4, r0, 16 - cmp r5, 0x1 - beq _081A1E38 - cmp r5, 0x1 - ble _081A1E2C - cmp r5, 0x2 - beq _081A1E48 - cmp r5, 0x3 - beq _081A1E58 -_081A1E2C: - cmp r6, 0 - beq _081A1E34 - movs r0, 0x2 - b _081A1E66 -_081A1E34: - movs r0, 0x1 - b _081A1E66 -_081A1E38: - cmp r6, 0 - beq _081A1E42 - movs r0, 0x80 - lsls r0, 8 - b _081A1E66 -_081A1E42: - movs r0, 0x80 - lsls r0, 7 - b _081A1E66 -_081A1E48: - cmp r6, 0 - beq _081A1E52 - movs r0, 0x80 - lsls r0, 10 - b _081A1E66 -_081A1E52: - movs r0, 0x80 - lsls r0, 9 - b _081A1E66 -_081A1E58: - cmp r6, 0 - beq _081A1E62 - movs r0, 0x80 - lsls r0, 12 - b _081A1E66 -_081A1E62: - movs r0, 0x80 - lsls r0, 11 -_081A1E66: - bl sub_81A1C24 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081A1E88 - ldr r0, =gUnknown_085EE311 - str r7, [sp] - adds r1, r4, 0 - mov r2, r8 - mov r3, r9 - bl sub_81A1CD8 - b _081A1E96 - .pool -_081A1E88: - ldr r0, =gUnknown_085EE320 - str r7, [sp] - adds r1, r4, 0 - mov r2, r8 - mov r3, r9 - bl sub_81A1CD8 -_081A1E96: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1DEC - - thumb_func_start sub_81A1EA8 -sub_81A1EA8: @ 81A1EA8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0xC - lsls r0, 24 - lsrs r7, r0, 24 - ldr r4, =gUnknown_0203AB74 - ldr r0, =gUnknown_08611C74 - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r4] - movs r1, 0x11 - bl FillWindowPixelBuffer - cmp r7, 0 - bne _081A1EF0 - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EE158 - bl StringExpandPlaceholders - b _081A1F28 - .pool -_081A1EF0: - cmp r7, 0x1 - bne _081A1F08 - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EE178 - bl StringExpandPlaceholders - b _081A1F28 - .pool -_081A1F08: - cmp r7, 0x2 - bne _081A1F20 - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EE198 - bl StringExpandPlaceholders - b _081A1F28 - .pool -_081A1F20: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EE1B7 - bl StringExpandPlaceholders -_081A1F28: - ldr r0, =gStringVar4 - movs r1, 0x2 - bl sub_81A1C4C - ldr r6, =gUnknown_0203AB74 - ldrb r0, [r6] - ldr r2, =gUnknown_085EE2F2 - movs r1, 0x31 - mov r8, r1 - str r1, [sp] - movs r5, 0xFF - str r5, [sp, 0x4] - movs r4, 0 - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x10 - bl PrintTextOnWindow - ldrb r0, [r6] - ldr r2, =gUnknown_085EE2F9 - movs r1, 0x61 - mov r9, r1 - str r1, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x10 - bl PrintTextOnWindow - movs r0, 0xA - bl sub_81A1C90 - mov r0, r8 - str r0, [sp] - adds r0, r7, 0 - movs r1, 0 - movs r2, 0x48 - movs r3, 0x84 - bl sub_81A1DEC - movs r0, 0x41 - str r0, [sp] - adds r0, r7, 0 - movs r1, 0 - movs r2, 0x48 - movs r3, 0x84 - bl sub_81A1D78 - mov r1, r9 - str r1, [sp] - adds r0, r7, 0 - movs r1, 0x1 - movs r2, 0x48 - movs r3, 0x84 - bl sub_81A1DEC - movs r0, 0x71 - str r0, [sp] - adds r0, r7, 0 - movs r1, 0x1 - movs r2, 0x48 - movs r3, 0x84 - bl sub_81A1D78 - ldrb r0, [r6] - bl PutWindowTilemap - ldrb r0, [r6] - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1EA8 - - thumb_func_start sub_81A1FD8 -sub_81A1FD8: @ 81A1FD8 - push {lr} - lsls r0, 24 - lsls r1, 24 - ldr r2, =gSaveBlock2Ptr - ldr r2, [r2] - lsrs r1, 23 - lsrs r0, 22 - adds r1, r0 - ldr r0, =0x00000d0c - adds r2, r0 - adds r2, r1 - ldrh r0, [r2] - ldr r1, =0x0000270f - cmp r0, r1 - bls _081A1FF8 - adds r0, r1, 0 -_081A1FF8: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A1FD8 - - thumb_func_start sub_81A2008 -sub_81A2008: @ 81A2008 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - mov r12, r0 - adds r7, r1, 0 - adds r4, r2, 0 - ldr r6, [sp, 0x2C] - ldr r5, [sp, 0x30] - lsls r4, 16 - lsrs r4, 16 - lsls r3, 24 - lsrs r3, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_0203AB74 - mov r10, r0 - ldrb r0, [r0] - str r5, [sp] - movs r1, 0xFF - mov r9, r1 - str r1, [sp, 0x4] - movs r1, 0 - mov r8, r1 - str r1, [sp, 0x8] - movs r1, 0x1 - mov r2, r12 - bl PrintTextOnWindow - ldr r0, =gStringVar1 - adds r1, r4, 0 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - adds r0, r4, 0 - adds r1, r7, 0 - bl StringExpandPlaceholders - mov r1, r10 - ldrb r0, [r1] - str r5, [sp] - mov r1, r9 - str r1, [sp, 0x4] - mov r1, r8 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - adds r3, r6, 0 - bl PrintTextOnWindow - 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_81A2008 - - thumb_func_start sub_81A2094 -sub_81A2094: @ 81A2094 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x8 - ldr r4, [sp, 0x24] - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - lsls r3, 24 - lsrs r7, r3, 24 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - adds r1, r6, 0 - bl sub_81A1FD8 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - cmp r5, 0 - beq _081A20CC - cmp r5, 0x1 - beq _081A20D8 -_081A20CC: - cmp r6, 0 - beq _081A20D4 - movs r0, 0x8 - b _081A20E6 -_081A20D4: - movs r0, 0x4 - b _081A20E6 -_081A20D8: - cmp r6, 0 - beq _081A20E2 - movs r0, 0x80 - lsls r0, 14 - b _081A20E6 -_081A20E2: - movs r0, 0x80 - lsls r0, 13 -_081A20E6: - bl sub_81A1C24 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081A210C - ldr r0, =gUnknown_085EE311 - ldr r1, =gUnknown_085EE338 - str r7, [sp] - str r4, [sp, 0x4] - mov r2, r8 - mov r3, r9 - bl sub_81A2008 - b _081A211C - .pool -_081A210C: - ldr r0, =gUnknown_085EE320 - ldr r1, =gUnknown_085EE338 - str r7, [sp] - str r4, [sp, 0x4] - mov r2, r8 - mov r3, r9 - bl sub_81A2008 -_081A211C: - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2094 - - thumb_func_start sub_81A2134 -sub_81A2134: @ 81A2134 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - lsls r0, 24 - lsrs r7, r0, 24 - ldr r4, =gUnknown_0203AB74 - ldr r0, =gUnknown_08611C74 - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r4] - movs r1, 0x11 - bl FillWindowPixelBuffer - cmp r7, 0 - bne _081A217C - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EE1DB - bl StringExpandPlaceholders - b _081A2184 - .pool -_081A217C: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EE1FE - bl StringExpandPlaceholders -_081A2184: - ldr r0, =gStringVar4 - movs r1, 0 - bl sub_81A1C4C - ldr r1, =gUnknown_0203AB74 - ldrb r0, [r1] - ldr r2, =gUnknown_085EE2F2 - movs r6, 0x21 - str r6, [sp] - movs r5, 0xFF - str r5, [sp, 0x4] - movs r4, 0 - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl PrintTextOnWindow - ldr r1, =gUnknown_0203AB74 - ldrb r0, [r1] - ldr r2, =gUnknown_085EE2F9 - movs r1, 0x61 - str r1, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl PrintTextOnWindow - movs r0, 0xA - bl sub_81A1C90 - str r6, [sp] - adds r0, r7, 0 - movs r1, 0 - movs r2, 0x40 - movs r3, 0x79 - bl sub_81A2094 - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - lsls r5, r7, 2 - ldr r1, =0x00000d14 - adds r0, r1 - adds r0, r5 - ldrh r2, [r0] - movs r0, 0x79 - mov r9, r0 - str r0, [sp] - movs r0, 0x31 - str r0, [sp, 0x4] - ldr r0, =gUnknown_085EE319 - ldr r1, =gUnknown_085EE338 - movs r3, 0x40 - bl sub_81A2008 - ldr r1, =gUnknown_085EE332 - mov r10, r1 - ldr r0, =gUnknown_085EE349 - mov r8, r0 - ldr r0, [r4] - ldr r1, =0x00000d1c - adds r0, r1 - adds r0, r5 - ldrh r2, [r0] - movs r6, 0x70 - str r6, [sp] - movs r0, 0x41 - str r0, [sp, 0x4] - mov r0, r10 - mov r1, r8 - movs r3, 0x40 - bl sub_81A2008 - movs r0, 0x61 - str r0, [sp] - adds r0, r7, 0 - movs r1, 0x1 - movs r2, 0x40 - movs r3, 0x79 - bl sub_81A2094 - ldr r0, [r4] - ldr r1, =0x00000d16 - adds r0, r1 - adds r0, r5 - ldrh r2, [r0] - mov r0, r9 - str r0, [sp] - movs r0, 0x71 - str r0, [sp, 0x4] - ldr r0, =gUnknown_085EE319 - ldr r1, =gUnknown_085EE338 - movs r3, 0x40 - bl sub_81A2008 - ldr r0, [r4] - ldr r1, =0x00000d1e - adds r0, r1 - adds r0, r5 - ldrh r2, [r0] - str r6, [sp] - movs r0, 0x81 - str r0, [sp, 0x4] - mov r0, r10 - mov r1, r8 - movs r3, 0x40 - bl sub_81A2008 - ldr r1, =gUnknown_0203AB74 - ldrb r0, [r1] - bl PutWindowTilemap - ldr r1, =gUnknown_0203AB74 - ldrb r0, [r1] - movs r1, 0x3 - bl CopyWindowToVram - 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_81A2134 - - thumb_func_start sub_81A22B8 -sub_81A22B8: @ 81A22B8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - adds r5, r0, 0 - adds r4, r2, 0 - ldr r0, [sp, 0x30] - lsls r1, 16 - lsrs r6, r1, 16 - lsls r4, 24 - lsrs r4, 24 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0xC] - lsls r0, 24 - lsrs r0, 24 - adds r7, r0, 0 - ldr r0, =gUnknown_0203AB74 - mov r10, r0 - ldrb r0, [r0] - str r7, [sp] - movs r1, 0xFF - mov r9, r1 - str r1, [sp, 0x4] - movs r1, 0 - mov r8, r1 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - adds r3, r4, 0 - bl PrintTextOnWindow - ldr r0, =0x0000270f - cmp r6, r0 - bls _081A2304 - adds r6, r0, 0 -_081A2304: - ldr r0, =gStringVar1 - adds r1, r6, 0 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EE302 - adds r0, r4, 0 - bl StringExpandPlaceholders - mov r1, r10 - ldrb r0, [r1] - str r7, [sp] - mov r1, r9 - str r1, [sp, 0x4] - mov r1, r8 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - ldr r3, [sp, 0xC] - bl PrintTextOnWindow - 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_81A22B8 - - thumb_func_start sub_81A2358 -sub_81A2358: @ 81A2358 - push {r4,r5,lr} - sub sp, 0x4 - ldr r5, [sp, 0x10] - lsls r0, 24 - lsls r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r5, 24 - lsrs r5, 24 - ldr r4, =gSaveBlock2Ptr - ldr r4, [r4] - lsrs r1, 23 - lsrs r0, 22 - adds r1, r0 - movs r0, 0xDD - lsls r0, 4 - adds r4, r0 - adds r4, r1 - ldrh r1, [r4] - ldr r0, =gUnknown_085EE319 - str r5, [sp] - bl sub_81A22B8 - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2358 - - thumb_func_start sub_81A239C -sub_81A239C: @ 81A239C - push {lr} - lsls r0, 24 - lsls r1, 24 - ldr r2, =gSaveBlock2Ptr - ldr r2, [r2] - lsrs r1, 23 - lsrs r0, 22 - adds r1, r0 - ldr r0, =0x00000dc8 - adds r2, r0 - adds r2, r1 - ldrh r0, [r2] - ldr r1, =0x0000270f - cmp r0, r1 - bls _081A23BC - adds r0, r1, 0 -_081A23BC: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A239C - - thumb_func_start sub_81A23CC -sub_81A23CC: @ 81A23CC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - ldr r4, [sp, 0x20] - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - lsls r3, 24 - lsrs r3, 24 - mov r9, r3 - lsls r4, 24 - lsrs r7, r4, 24 - adds r0, r5, 0 - adds r1, r6, 0 - bl sub_81A239C - lsls r0, 16 - lsrs r4, r0, 16 - cmp r5, 0 - beq _081A2404 - cmp r5, 0x1 - beq _081A2410 -_081A2404: - cmp r6, 0 - beq _081A240C - movs r0, 0x20 - b _081A241E -_081A240C: - movs r0, 0x10 - b _081A241E -_081A2410: - cmp r6, 0 - beq _081A241A - movs r0, 0x80 - lsls r0, 16 - b _081A241E -_081A241A: - movs r0, 0x80 - lsls r0, 15 -_081A241E: - bl sub_81A1C24 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081A2440 - ldr r0, =gUnknown_085EE311 - str r7, [sp] - adds r1, r4, 0 - mov r2, r8 - mov r3, r9 - bl sub_81A22B8 - b _081A244E - .pool -_081A2440: - ldr r0, =gUnknown_085EE320 - str r7, [sp] - adds r1, r4, 0 - mov r2, r8 - mov r3, r9 - bl sub_81A22B8 -_081A244E: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A23CC - - thumb_func_start sub_81A2460 -sub_81A2460: @ 81A2460 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0xC - lsls r0, 24 - lsrs r7, r0, 24 - ldr r4, =gUnknown_0203AB74 - ldr r0, =gUnknown_08611C74 - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r4] - movs r1, 0x11 - bl FillWindowPixelBuffer - cmp r7, 0 - bne _081A24A8 - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EE221 - bl StringExpandPlaceholders - b _081A24B0 - .pool -_081A24A8: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EE241 - bl StringExpandPlaceholders -_081A24B0: - ldr r0, =gStringVar4 - movs r1, 0x2 - bl sub_81A1C4C - ldr r6, =gUnknown_0203AB74 - ldrb r0, [r6] - ldr r2, =gUnknown_085EE2F2 - movs r1, 0x31 - mov r8, r1 - str r1, [sp] - movs r5, 0xFF - str r5, [sp, 0x4] - movs r4, 0 - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x10 - bl PrintTextOnWindow - ldrb r0, [r6] - ldr r2, =gUnknown_085EE2F9 - movs r1, 0x61 - mov r9, r1 - str r1, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x10 - bl PrintTextOnWindow - movs r0, 0xA - bl sub_81A1C90 - mov r0, r8 - str r0, [sp] - adds r0, r7, 0 - movs r1, 0 - movs r2, 0x48 - movs r3, 0x83 - bl sub_81A23CC - movs r0, 0x41 - str r0, [sp] - adds r0, r7, 0 - movs r1, 0 - movs r2, 0x48 - movs r3, 0x83 - bl sub_81A2358 - mov r1, r9 - str r1, [sp] - adds r0, r7, 0 - movs r1, 0x1 - movs r2, 0x48 - movs r3, 0x83 - bl sub_81A23CC - movs r0, 0x71 - str r0, [sp] - adds r0, r7, 0 - movs r1, 0x1 - movs r2, 0x48 - movs r3, 0x83 - bl sub_81A2358 - ldrb r0, [r6] - bl PutWindowTilemap - ldrb r0, [r6] - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2460 - - thumb_func_start sub_81A2560 -sub_81A2560: @ 81A2560 - push {lr} - lsls r0, 24 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - lsrs r0, 23 - ldr r2, =0x00000e04 - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - ldr r1, =0x0000270f - cmp r0, r1 - bls _081A257A - adds r0, r1, 0 -_081A257A: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A2560 - - thumb_func_start sub_81A258C -sub_81A258C: @ 81A258C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - mov r12, r0 - adds r7, r1, 0 - adds r4, r2, 0 - ldr r6, [sp, 0x2C] - ldr r5, [sp, 0x30] - lsls r4, 16 - lsrs r4, 16 - lsls r3, 24 - lsrs r3, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_0203AB74 - mov r10, r0 - ldrb r0, [r0] - str r5, [sp] - movs r1, 0xFF - mov r9, r1 - str r1, [sp, 0x4] - movs r1, 0 - mov r8, r1 - str r1, [sp, 0x8] - movs r1, 0x1 - mov r2, r12 - bl PrintTextOnWindow - ldr r0, =gStringVar1 - adds r1, r4, 0 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - adds r0, r4, 0 - adds r1, r7, 0 - bl StringExpandPlaceholders - mov r1, r10 - ldrb r0, [r1] - str r5, [sp] - mov r1, r9 - str r1, [sp, 0x4] - mov r1, r8 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - adds r3, r6, 0 - bl PrintTextOnWindow - 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_81A258C - - thumb_func_start sub_81A2618 -sub_81A2618: @ 81A2618 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - lsls r2, 24 - lsrs r5, r2, 24 - lsls r3, 24 - lsrs r6, r3, 24 - adds r0, r4, 0 - bl sub_81A2560 - lsls r0, 16 - lsrs r7, r0, 16 - cmp r4, 0 - beq _081A2648 - movs r0, 0x80 - lsls r0, 4 - b _081A264C -_081A2648: - movs r0, 0x80 - lsls r0, 3 -_081A264C: - bl sub_81A1C24 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081A2674 - ldr r0, =gUnknown_085EE311 - ldr r1, =gUnknown_085EE35B - str r5, [sp] - str r6, [sp, 0x4] - adds r2, r7, 0 - mov r3, r8 - bl sub_81A2008 - b _081A2684 - .pool -_081A2674: - ldr r0, =gUnknown_085EE320 - ldr r1, =gUnknown_085EE35B - str r5, [sp] - str r6, [sp, 0x4] - adds r2, r7, 0 - mov r3, r8 - bl sub_81A2008 -_081A2684: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2618 - - thumb_func_start sub_81A2698 -sub_81A2698: @ 81A2698 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - ldr r6, =gUnknown_0203AB74 - ldr r0, =gUnknown_08611C74 - bl AddWindow - strb r0, [r6] - ldrb r0, [r6] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r6] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EE261 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0 - bl sub_81A1C4C - ldrb r0, [r6] - ldr r2, =gUnknown_085EE2F2 - movs r1, 0x21 - str r1, [sp] - movs r5, 0xFF - str r5, [sp, 0x4] - movs r4, 0 - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl PrintTextOnWindow - ldrb r0, [r6] - ldr r2, =gUnknown_085EE2F9 - movs r1, 0x61 - str r1, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl PrintTextOnWindow - movs r0, 0xA - bl sub_81A1C90 - movs r0, 0 - movs r1, 0x40 - movs r2, 0x72 - movs r3, 0x21 - bl sub_81A2618 - ldr r0, =gUnknown_085EE319 - mov r10, r0 - ldr r7, =gUnknown_085EE35B - ldr r5, =gSaveBlock2Ptr - ldr r0, [r5] - ldr r1, =0x00000e08 - adds r0, r1 - ldrh r2, [r0] - movs r4, 0x72 - str r4, [sp] - movs r0, 0x31 - str r0, [sp, 0x4] - mov r0, r10 - adds r1, r7, 0 - movs r3, 0x40 - bl sub_81A258C - ldr r0, =gUnknown_085EE332 - mov r8, r0 - ldr r1, =gUnknown_085EE36D - mov r9, r1 - ldr r0, [r5] - ldr r1, =0x00000e0c - adds r0, r1 - ldrh r2, [r0] - str r4, [sp] - movs r0, 0x41 - str r0, [sp, 0x4] - mov r0, r8 - mov r1, r9 - movs r3, 0x40 - bl sub_81A258C - movs r0, 0x1 - movs r1, 0x40 - movs r2, 0x72 - movs r3, 0x61 - bl sub_81A2618 - ldr r0, [r5] - ldr r1, =0x00000e0a - adds r0, r1 - ldrh r2, [r0] - str r4, [sp] - movs r0, 0x71 - str r0, [sp, 0x4] - mov r0, r10 - adds r1, r7, 0 - movs r3, 0x40 - bl sub_81A258C - ldr r0, [r5] - ldr r1, =0x00000e0e - adds r0, r1 - ldrh r2, [r0] - str r4, [sp] - movs r0, 0x81 - str r0, [sp, 0x4] - mov r0, r8 - mov r1, r9 - movs r3, 0x40 - bl sub_81A258C - ldrb r0, [r6] - bl PutWindowTilemap - ldrb r0, [r6] - movs r1, 0x3 - bl CopyWindowToVram - 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_81A2698 - - thumb_func_start sub_81A27E8 -sub_81A27E8: @ 81A27E8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - adds r5, r0, 0 - adds r4, r2, 0 - ldr r0, [sp, 0x30] - lsls r1, 16 - lsrs r6, r1, 16 - lsls r4, 24 - lsrs r4, 24 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0xC] - lsls r0, 24 - lsrs r0, 24 - adds r7, r0, 0 - ldr r0, =gUnknown_0203AB74 - mov r10, r0 - ldrb r0, [r0] - str r7, [sp] - movs r1, 0xFF - mov r9, r1 - str r1, [sp, 0x4] - movs r1, 0 - mov r8, r1 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - adds r3, r4, 0 - bl PrintTextOnWindow - ldr r0, =0x0000270f - cmp r6, r0 - bls _081A2834 - adds r6, r0, 0 -_081A2834: - ldr r0, =gStringVar1 - adds r1, r6, 0 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EE381 - adds r0, r4, 0 - bl StringExpandPlaceholders - mov r1, r10 - ldrb r0, [r1] - str r7, [sp] - mov r1, r9 - str r1, [sp, 0x4] - mov r1, r8 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - ldr r3, [sp, 0xC] - bl PrintTextOnWindow - 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_81A27E8 - - thumb_func_start sub_81A2888 -sub_81A2888: @ 81A2888 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r1, 0 - adds r5, r2, 0 - lsls r0, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r3, 24 - lsrs r3, 24 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - lsrs r0, 23 - ldr r2, =0x00000dde - adds r1, r2 - adds r1, r0 - ldrh r1, [r1] - ldr r0, =gUnknown_085EE319 - str r3, [sp] - adds r2, r4, 0 - adds r3, r5, 0 - bl sub_81A27E8 - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2888 - - thumb_func_start sub_81A28CC -sub_81A28CC: @ 81A28CC - push {lr} - lsls r0, 24 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - lsrs r0, 23 - ldr r2, =0x00000dda - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - ldr r1, =0x0000270f - cmp r0, r1 - bls _081A28E6 - adds r0, r1, 0 -_081A28E6: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A28CC - - thumb_func_start sub_81A28F8 -sub_81A28F8: @ 81A28F8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - lsls r3, 24 - lsrs r6, r3, 24 - adds r0, r4, 0 - bl sub_81A28CC - lsls r0, 16 - lsrs r5, r0, 16 - cmp r4, 0 - beq _081A2926 - movs r0, 0x80 - b _081A2928 -_081A2926: - movs r0, 0x40 -_081A2928: - bl sub_81A1C24 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081A2948 - ldr r0, =gUnknown_085EE311 - str r6, [sp] - adds r1, r5, 0 - adds r2, r7, 0 - mov r3, r8 - bl sub_81A27E8 - b _081A2956 - .pool -_081A2948: - ldr r0, =gUnknown_085EE320 - str r6, [sp] - adds r1, r5, 0 - adds r2, r7, 0 - mov r3, r8 - bl sub_81A27E8 -_081A2956: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A28F8 - - thumb_func_start sub_81A2968 -sub_81A2968: @ 81A2968 - push {r4-r6,lr} - sub sp, 0xC - ldr r5, =gUnknown_0203AB74 - ldr r0, =gUnknown_08611C74 - bl AddWindow - strb r0, [r5] - ldrb r0, [r5] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r5] - movs r1, 0x11 - bl FillWindowPixelBuffer - movs r0, 0xA - bl sub_81A1C90 - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EE27C - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x2 - bl sub_81A1C4C - ldrb r0, [r5] - ldr r2, =gUnknown_085EE2F2 - movs r1, 0x31 - str r1, [sp] - movs r6, 0xFF - str r6, [sp, 0x4] - movs r4, 0 - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x10 - bl PrintTextOnWindow - ldrb r0, [r5] - ldr r2, =gUnknown_085EE2F9 - movs r1, 0x61 - str r1, [sp] - str r6, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x10 - bl PrintTextOnWindow - movs r0, 0 - movs r1, 0x48 - movs r2, 0x7E - movs r3, 0x31 - bl sub_81A28F8 - movs r0, 0 - movs r1, 0x48 - movs r2, 0x7E - movs r3, 0x41 - bl sub_81A2888 - movs r0, 0x1 - movs r1, 0x48 - movs r2, 0x7E - movs r3, 0x61 - bl sub_81A28F8 - movs r0, 0x1 - movs r1, 0x48 - movs r2, 0x7E - movs r3, 0x71 - bl sub_81A2888 - ldrb r0, [r5] - bl PutWindowTilemap - ldrb r0, [r5] - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2968 - - thumb_func_start sub_81A2A28 -sub_81A2A28: @ 81A2A28 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - mov r12, r0 - ldr r4, [sp, 0x38] - ldr r5, [sp, 0x3C] - ldr r0, [sp, 0x40] - lsls r1, 16 - lsrs r7, r1, 16 - lsls r2, 16 - lsrs r2, 16 - str r2, [sp, 0xC] - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - str r4, [sp, 0x10] - lsls r5, 24 - lsrs r5, 24 - str r5, [sp, 0x14] - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - ldr r0, =gUnknown_0203AB74 - mov r10, r0 - ldrb r0, [r0] - str r6, [sp] - movs r1, 0xFF - mov r9, r1 - str r1, [sp, 0x4] - movs r1, 0 - mov r8, r1 - str r1, [sp, 0x8] - movs r1, 0x1 - mov r2, r12 - bl PrintTextOnWindow - ldr r0, =0x0000270f - cmp r7, r0 - bls _081A2A80 - adds r7, r0, 0 -_081A2A80: - ldr r5, =gStringVar1 - adds r0, r5, 0 - adds r1, r7, 0 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EE302 - adds r0, r4, 0 - bl StringExpandPlaceholders - mov r1, r10 - ldrb r0, [r1] - str r6, [sp] - mov r1, r9 - str r1, [sp, 0x4] - mov r1, r8 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - ldr r3, [sp, 0x10] - bl PrintTextOnWindow - adds r0, r5, 0 - ldr r1, [sp, 0xC] - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r1, =gUnknown_085EE392 - adds r0, r4, 0 - bl StringExpandPlaceholders - mov r1, r10 - ldrb r0, [r1] - str r6, [sp] - mov r1, r9 - str r1, [sp, 0x4] - mov r1, r8 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - ldr r3, [sp, 0x14] - bl PrintTextOnWindow - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2A28 - - thumb_func_start sub_81A2B04 -sub_81A2B04: @ 81A2B04 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - adds r6, r2, 0 - ldr r4, [sp, 0x24] - ldr r5, [sp, 0x28] - lsls r0, 24 - lsls r1, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - ldr r2, =gSaveBlock2Ptr - ldr r2, [r2] - lsrs r1, 23 - lsrs r0, 22 - adds r1, r0 - ldr r7, =0x00000dea - adds r0, r2, r7 - adds r0, r1 - ldrh r0, [r0] - mov r8, r0 - ldr r0, =0x00000dfa - adds r2, r0 - adds r2, r1 - ldrh r2, [r2] - ldr r0, =gUnknown_085EE319 - str r3, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - mov r1, r8 - adds r3, r6, 0 - bl sub_81A2A28 - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2B04 - - thumb_func_start sub_81A2B70 -sub_81A2B70: @ 81A2B70 - push {lr} - lsls r0, 24 - lsls r1, 24 - ldr r2, =gSaveBlock2Ptr - ldr r2, [r2] - lsrs r1, 23 - lsrs r0, 22 - adds r1, r0 - ldr r0, =0x00000de2 - adds r2, r0 - adds r2, r1 - ldrh r0, [r2] - ldr r1, =0x0000270f - cmp r0, r1 - bls _081A2B90 - adds r0, r1, 0 -_081A2B90: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A2B70 - - thumb_func_start sub_81A2BA0 -sub_81A2BA0: @ 81A2BA0 - push {lr} - lsls r0, 24 - lsls r1, 24 - ldr r2, =gSaveBlock2Ptr - ldr r2, [r2] - lsrs r1, 23 - lsrs r0, 22 - adds r1, r0 - ldr r0, =0x00000df2 - adds r2, r0 - adds r2, r1 - ldrh r0, [r2] - ldr r1, =0x0000270f - cmp r0, r1 - bls _081A2BC0 - adds r0, r1, 0 -_081A2BC0: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A2BA0 - - thumb_func_start sub_81A2BD0 -sub_81A2BD0: @ 81A2BD0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - ldr r4, [sp, 0x30] - ldr r5, [sp, 0x34] - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0xC] - lsls r3, 24 - lsrs r3, 24 - mov r8, r3 - lsls r4, 24 - lsrs r4, 24 - mov r9, r4 - lsls r5, 24 - lsrs r5, 24 - mov r10, r5 - adds r0, r6, 0 - adds r1, r7, 0 - bl sub_81A2B70 - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r6, 0 - adds r1, r7, 0 - bl sub_81A2BA0 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r6, 0 - beq _081A2C20 - cmp r6, 0x1 - beq _081A2C30 -_081A2C20: - cmp r7, 0 - beq _081A2C2A - movs r0, 0x80 - lsls r0, 2 - b _081A2C3E -_081A2C2A: - movs r0, 0x80 - lsls r0, 1 - b _081A2C3E -_081A2C30: - cmp r7, 0 - beq _081A2C3A - movs r0, 0x80 - lsls r0, 18 - b _081A2C3E -_081A2C3A: - movs r0, 0x80 - lsls r0, 17 -_081A2C3E: - bl sub_81A1C24 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081A2C68 - ldr r0, =gUnknown_085EE311 - mov r1, r8 - str r1, [sp] - mov r1, r9 - str r1, [sp, 0x4] - mov r1, r10 - str r1, [sp, 0x8] - adds r1, r5, 0 - adds r2, r4, 0 - ldr r3, [sp, 0xC] - bl sub_81A2A28 - b _081A2C80 - .pool -_081A2C68: - ldr r0, =gUnknown_085EE320 - mov r1, r8 - str r1, [sp] - mov r1, r9 - str r1, [sp, 0x4] - mov r1, r10 - str r1, [sp, 0x8] - adds r1, r5, 0 - adds r2, r4, 0 - ldr r3, [sp, 0xC] - bl sub_81A2A28 -_081A2C80: - 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_81A2BD0 - - thumb_func_start sub_81A2C94 -sub_81A2C94: @ 81A2C94 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - lsls r0, 24 - lsrs r7, r0, 24 - ldr r4, =gUnknown_0203AB74 - ldr r0, =gUnknown_08611C74 - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r4] - movs r1, 0x11 - bl FillWindowPixelBuffer - cmp r7, 0 - bne _081A2CD8 - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EE298 - bl StringExpandPlaceholders - b _081A2CE0 - .pool -_081A2CD8: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EE2B8 - bl StringExpandPlaceholders -_081A2CE0: - ldr r0, =gStringVar4 - movs r1, 0 - bl sub_81A1C4C - ldr r0, =gUnknown_0203AB74 - mov r8, r0 - ldrb r0, [r0] - ldr r2, =gUnknown_085EE2F2 - movs r6, 0x21 - str r6, [sp] - movs r5, 0xFF - str r5, [sp, 0x4] - movs r4, 0 - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl PrintTextOnWindow - mov r1, r8 - ldrb r0, [r1] - ldr r2, =gUnknown_085EE326 - str r6, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x98 - bl PrintTextOnWindow - mov r1, r8 - ldrb r0, [r1] - ldr r2, =gUnknown_085EE2F9 - movs r1, 0x61 - str r1, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl PrintTextOnWindow - movs r0, 0xA - bl sub_81A1C90 - movs r4, 0x9E - str r4, [sp] - movs r0, 0x31 - str r0, [sp, 0x4] - adds r0, r7, 0 - movs r1, 0 - movs r2, 0x8 - movs r3, 0x40 - bl sub_81A2BD0 - str r4, [sp] - movs r0, 0x41 - str r0, [sp, 0x4] - adds r0, r7, 0 - movs r1, 0 - movs r2, 0x8 - movs r3, 0x40 - bl sub_81A2B04 - str r4, [sp] - movs r0, 0x71 - str r0, [sp, 0x4] - adds r0, r7, 0 - movs r1, 0x1 - movs r2, 0x8 - movs r3, 0x40 - bl sub_81A2BD0 - str r4, [sp] - movs r0, 0x81 - str r0, [sp, 0x4] - adds r0, r7, 0 - movs r1, 0x1 - movs r2, 0x8 - movs r3, 0x40 - bl sub_81A2B04 - mov r1, r8 - ldrb r0, [r1] - bl PutWindowTilemap - mov r1, r8 - ldrb r0, [r1] - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2C94 - - thumb_func_start sub_81A2DB4 -sub_81A2DB4: @ 81A2DB4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - adds r5, r0, 0 - adds r4, r2, 0 - ldr r0, [sp, 0x30] - lsls r1, 16 - lsrs r6, r1, 16 - lsls r4, 24 - lsrs r4, 24 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0xC] - lsls r0, 24 - lsrs r0, 24 - adds r7, r0, 0 - ldr r0, =gUnknown_0203AB74 - mov r10, r0 - ldrb r0, [r0] - str r7, [sp] - movs r1, 0xFF - mov r9, r1 - str r1, [sp, 0x4] - movs r1, 0 - mov r8, r1 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - adds r3, r4, 0 - bl PrintTextOnWindow - ldr r0, =0x0000270f - cmp r6, r0 - bls _081A2E00 - adds r6, r0, 0 -_081A2E00: - ldr r0, =gStringVar1 - adds r1, r6, 0 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EE39C - adds r0, r4, 0 - bl StringExpandPlaceholders - mov r1, r10 - ldrb r0, [r1] - str r7, [sp] - mov r1, r9 - str r1, [sp, 0x4] - mov r1, r8 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - ldr r3, [sp, 0xC] - bl PrintTextOnWindow - 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_81A2DB4 - - thumb_func_start sub_81A2E54 -sub_81A2E54: @ 81A2E54 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r1, 0 - adds r5, r2, 0 - lsls r0, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r3, 24 - lsrs r3, 24 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - lsrs r0, 23 - ldr r2, =0x00000e1e - adds r1, r2 - adds r1, r0 - ldrh r1, [r1] - ldr r0, =gUnknown_085EE319 - str r3, [sp] - adds r2, r4, 0 - adds r3, r5, 0 - bl sub_81A2DB4 - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2E54 - - thumb_func_start sub_81A2E98 -sub_81A2E98: @ 81A2E98 - push {lr} - lsls r0, 24 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - lsrs r0, 23 - ldr r2, =0x00000e1a - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - ldr r1, =0x0000270f - cmp r0, r1 - bls _081A2EB2 - adds r0, r1, 0 -_081A2EB2: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A2E98 - - thumb_func_start sub_81A2EC4 -sub_81A2EC4: @ 81A2EC4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - lsls r3, 24 - lsrs r6, r3, 24 - adds r0, r4, 0 - bl sub_81A2E98 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r4, 0 - beq _081A2EF4 - movs r0, 0x80 - lsls r0, 6 - b _081A2EF8 -_081A2EF4: - movs r0, 0x80 - lsls r0, 5 -_081A2EF8: - bl sub_81A1C24 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081A2F18 - ldr r0, =gUnknown_085EE311 - str r6, [sp] - adds r1, r5, 0 - adds r2, r7, 0 - mov r3, r8 - bl sub_81A2DB4 - b _081A2F26 - .pool -_081A2F18: - ldr r0, =gUnknown_085EE320 - str r6, [sp] - adds r1, r5, 0 - adds r2, r7, 0 - mov r3, r8 - bl sub_81A2DB4 -_081A2F26: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2EC4 - - thumb_func_start sub_81A2F38 -sub_81A2F38: @ 81A2F38 - push {r4-r6,lr} - sub sp, 0xC - ldr r5, =gUnknown_0203AB74 - ldr r0, =gUnknown_08611C74 - bl AddWindow - strb r0, [r5] - ldrb r0, [r5] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r5] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EE2D8 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x2 - bl sub_81A1C4C - ldrb r0, [r5] - ldr r2, =gUnknown_085EE2F2 - movs r1, 0x31 - str r1, [sp] - movs r6, 0xFF - str r6, [sp, 0x4] - movs r4, 0 - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl PrintTextOnWindow - ldrb r0, [r5] - ldr r2, =gUnknown_085EE2F9 - movs r1, 0x61 - str r1, [sp] - str r6, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl PrintTextOnWindow - movs r0, 0xA - bl sub_81A1C90 - movs r0, 0 - movs r1, 0x40 - movs r2, 0x6F - movs r3, 0x31 - bl sub_81A2EC4 - movs r0, 0 - movs r1, 0x40 - movs r2, 0x6F - movs r3, 0x41 - bl sub_81A2E54 - movs r0, 0x1 - movs r1, 0x40 - movs r2, 0x6F - movs r3, 0x61 - bl sub_81A2EC4 - movs r0, 0x1 - movs r1, 0x40 - movs r2, 0x6F - movs r3, 0x71 - bl sub_81A2E54 - ldrb r0, [r5] - bl PutWindowTilemap - ldrb r0, [r5] - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2F38 - - thumb_func_start sub_81A2FF8 -sub_81A2FF8: @ 81A2FF8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0xC - ldr r4, =gUnknown_0203AB74 - ldr r0, =gUnknown_08611C7C - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r4] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, =gStringVar4 - mov r9, r0 - ldr r1, =gUnknown_085EDF86 - bl StringExpandPlaceholders - movs r0, 0x1 - mov r1, r9 - movs r2, 0xD0 - bl GetStringCenterAlignXOffset - adds r3, r0, 0 - ldrb r0, [r4] - lsls r3, 24 - lsrs r3, 24 - movs r1, 0x1 - str r1, [sp] - movs r6, 0xFF - str r6, [sp, 0x4] - movs r5, 0 - str r5, [sp, 0x8] - mov r2, r9 - bl PrintTextOnWindow - ldr r7, =gUnknown_085EDFA0 - movs r0, 0x1 - adds r1, r7, 0 - movs r2, 0x26 - bl GetStringRightAlignXOffset - adds r3, r0, 0 - adds r3, 0x32 - ldrb r0, [r4] - lsls r3, 24 - lsrs r3, 24 - movs r1, 0x19 - mov r8, r1 - str r1, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - adds r2, r7, 0 - bl PrintTextOnWindow - ldr r7, =gUnknown_085EDFA4 - movs r0, 0x1 - adds r1, r7, 0 - movs r2, 0x26 - bl GetStringRightAlignXOffset - adds r3, r0, 0 - adds r3, 0x58 - ldrb r0, [r4] - lsls r3, 24 - lsrs r3, 24 - mov r2, r8 - str r2, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - adds r2, r7, 0 - bl PrintTextOnWindow - ldr r7, =gUnknown_085EDFA8 - movs r0, 0x1 - adds r1, r7, 0 - movs r2, 0x26 - bl GetStringRightAlignXOffset - adds r3, r0, 0 - adds r3, 0x7E - ldrb r0, [r4] - lsls r3, 24 - lsrs r3, 24 - mov r1, r8 - str r1, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - adds r2, r7, 0 - bl PrintTextOnWindow - ldr r7, =gUnknown_085EDFAC - movs r0, 0x1 - adds r1, r7, 0 - movs r2, 0x26 - bl GetStringRightAlignXOffset - adds r3, r0, 0 - adds r3, 0xA4 - ldrb r0, [r4] - lsls r3, 24 - lsrs r3, 24 - mov r2, r8 - str r2, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - adds r2, r7, 0 - bl PrintTextOnWindow - ldrb r0, [r4] - ldr r2, =gUnknown_085EB0E8 - movs r1, 0x29 - str r1, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x6 - bl PrintTextOnWindow - ldrb r0, [r4] - ldr r2, =gUnknown_085EB0ED - movs r1, 0x39 - str r1, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x6 - bl PrintTextOnWindow - ldrb r0, [r4] - ldr r2, =gUnknown_085EB0F4 - movs r1, 0x49 - str r1, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x6 - bl PrintTextOnWindow - ldrb r0, [r4] - ldr r2, =gUnknown_085EB0F9 - movs r1, 0x59 - str r1, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x6 - bl PrintTextOnWindow - ldrb r0, [r4] - ldr r2, =gUnknown_085EB0FF - movs r1, 0x69 - str r1, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x6 - bl PrintTextOnWindow - movs r1, 0 -_081A314A: - movs r5, 0 - adds r0, r1, 0x1 - mov r8, r0 - lsls r0, r1, 28 - movs r2, 0xA4 - lsls r2, 22 - adds r0, r2 - lsrs r7, r0, 24 - lsls r4, r1, 3 -_081A315C: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000624 - adds r0, r1 - adds r0, r4 - ldrh r1, [r0] - mov r0, r9 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r6, =gUnknown_0203AB74 - ldrb r0, [r6] - movs r1, 0x26 - adds r3, r5, 0 - muls r3, r1 - adds r3, 0x40 - lsls r3, 24 - lsrs r3, 24 - str r7, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - mov r2, r9 - bl PrintTextOnWindow - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _081A315C - mov r1, r8 - cmp r1, 0x4 - ble _081A314A - ldrb r0, [r6] - bl PutWindowTilemap - ldrb r0, [r6] - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2FF8 - - thumb_func_start sub_81A31FC -sub_81A31FC: @ 81A31FC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r7, r0, 30 - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - cmp r4, 0x6 - bls _081A3232 - b _081A35CE -_081A3232: - lsls r0, r4, 2 - ldr r1, =_081A3250 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A3250: - .4byte _081A326C - .4byte _081A33A8 - .4byte _081A3414 - .4byte _081A347C - .4byte _081A34CC - .4byte _081A354C - .4byte _081A3594 -_081A326C: - ldr r2, =gSaveBlock2Ptr - mov r9, r2 - ldr r0, [r2] - lsls r3, r7, 1 - mov r10, r3 - mov r2, r8 - lsls r1, r2, 2 - add r1, r10 - str r1, [sp, 0x20] - movs r3, 0xCE - lsls r3, 4 - adds r1, r0, r3 - ldr r2, [sp, 0x20] - adds r1, r2 - adds r3, 0x10 - adds r0, r3 - adds r0, r2 - ldrh r1, [r1] - ldrh r2, [r0] - cmp r1, r2 - bhi _081A3298 - b _081A35CE -_081A3298: - strh r1, [r0] - mov r3, r8 - cmp r3, 0x3 - bne _081A32F2 - ldr r6, =gBattleScripting - adds r6, 0x25 - ldrb r0, [r6] - movs r4, 0x1 - eors r0, r4 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - ldr r5, =gLinkPlayers + 8 - adds r1, r5 - mov r0, sp - bl StringCopy - mov r0, sp - bl StripExtCtrlCodes - lsls r1, r7, 3 - ldr r0, =0x00000ee1 - adds r1, r0 - mov r2, r9 - ldr r0, [r2] - adds r0, r1 - mov r1, sp - bl StringCopy - ldrb r0, [r6] - eors r4, r0 - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - subs r5, 0x4 - adds r0, r5 - ldr r0, [r0] - lsls r2, r7, 2 - ldr r1, =0x00000ef1 - adds r2, r1 - mov r3, r9 - ldr r1, [r3] - adds r1, r2 - bl WriteUnalignedWord -_081A32F2: - mov r7, r9 - ldr r0, [r7] - movs r1, 0xCE - lsls r1, 4 - adds r0, r1 - ldr r2, [sp, 0x20] - adds r0, r2 - ldrh r0, [r0] - cmp r0, 0x1 - bhi _081A3308 - b _081A35CE -_081A3308: - bl sub_80EE818 - lsls r0, 24 - cmp r0, 0 - bne _081A3314 - b _081A35CE -_081A3314: - mov r3, r8 - cmp r3, 0x1 - beq _081A335A - cmp r3, 0x1 - bgt _081A3338 - cmp r3, 0 - beq _081A3344 - b _081A35CE - .pool -_081A3338: - mov r7, r8 - cmp r7, 0x2 - beq _081A3374 - cmp r7, 0x3 - beq _081A338E - b _081A35CE -_081A3344: - mov r1, r9 - ldr r0, [r1] - movs r2, 0xCE - lsls r2, 4 - adds r0, r2 - add r0, r10 - ldrh r0, [r0] - movs r1, 0x1 - bl sub_80EE8C8 - b _081A35CE -_081A335A: - mov r3, r9 - ldr r0, [r3] - mov r1, r10 - adds r1, 0x4 - movs r7, 0xCE - lsls r7, 4 - adds r0, r7 - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x2 - bl sub_80EE8C8 - b _081A35CE -_081A3374: - mov r1, r9 - ldr r0, [r1] - mov r1, r10 - adds r1, 0x8 - movs r2, 0xCE - lsls r2, 4 - adds r0, r2 - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x3 - bl sub_80EE8C8 - b _081A35CE -_081A338E: - mov r3, r9 - ldr r0, [r3] - mov r1, r10 - adds r1, 0xC - movs r7, 0xCE - lsls r7, 4 - adds r0, r7 - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x4 - bl sub_80EE8C8 - b _081A35CE -_081A33A8: - ldr r6, =gSaveBlock2Ptr - ldr r0, [r6] - lsls r7, 1 - mov r2, r8 - lsls r1, r2, 2 - adds r4, r7, r1 - ldr r5, =0x00000d0c - adds r1, r0, r5 - adds r1, r4 - ldr r3, =0x00000d14 - adds r0, r3 - adds r0, r4 - ldrh r2, [r1] - ldrh r3, [r0] - cmp r2, r3 - bhi _081A33CA - b _081A35CE -_081A33CA: - strh r2, [r0] - ldrh r0, [r1] - cmp r0, 0x1 - bhi _081A33D4 - b _081A35CE -_081A33D4: - bl sub_80EE818 - lsls r0, 24 - cmp r0, 0 - bne _081A33E0 - b _081A35CE -_081A33E0: - mov r0, r8 - cmp r0, 0 - bne _081A3404 - ldr r0, [r6] - adds r0, r5 - adds r0, r7 - ldrh r0, [r0] - movs r1, 0x5 - bl sub_80EE8C8 - b _081A35CE - .pool -_081A3404: - ldr r0, [r6] - adds r0, r5 - adds r0, r4 - ldrh r0, [r0] - movs r1, 0x6 - bl sub_80EE8C8 - b _081A35CE -_081A3414: - ldr r6, =gSaveBlock2Ptr - ldr r0, [r6] - lsls r7, 1 - mov r2, r8 - lsls r1, r2, 2 - adds r4, r7, r1 - ldr r5, =0x00000dc8 - adds r1, r0, r5 - adds r1, r4 - movs r3, 0xDD - lsls r3, 4 - adds r0, r3 - adds r0, r4 - ldrh r2, [r1] - ldrh r3, [r0] - cmp r2, r3 - bhi _081A3438 - b _081A35CE -_081A3438: - strh r2, [r0] - ldrh r0, [r1] - cmp r0, 0x1 - bhi _081A3442 - b _081A35CE -_081A3442: - bl sub_80EE818 - lsls r0, 24 - cmp r0, 0 - bne _081A344E - b _081A35CE -_081A344E: - mov r0, r8 - cmp r0, 0 - bne _081A346C - ldr r0, [r6] - adds r0, r5 - adds r0, r7 - ldrh r0, [r0] - movs r1, 0xB - bl sub_80EE8C8 - b _081A35CE - .pool -_081A346C: - ldr r0, [r6] - adds r0, r5 - adds r0, r4 - ldrh r0, [r0] - movs r1, 0xC - bl sub_80EE8C8 - b _081A35CE -_081A347C: - ldr r6, =gSaveBlock2Ptr - ldr r1, [r6] - lsls r4, r7, 1 - ldr r5, =0x00000dda - adds r0, r1, r5 - adds r0, r4 - ldr r2, =0x00000dde - adds r1, r2 - adds r1, r4 - ldrh r2, [r0] - ldrh r3, [r1] - cmp r2, r3 - bhi _081A3498 - b _081A35CE -_081A3498: - strh r2, [r1] - ldrh r0, [r0] - cmp r0, 0x1 - bhi _081A34A2 - b _081A35CE -_081A34A2: - bl sub_80EE818 - lsls r0, 24 - cmp r0, 0 - bne _081A34AE - b _081A35CE -_081A34AE: - ldr r0, [r6] - adds r0, r5 - adds r0, r4 - ldrh r0, [r0] - movs r1, 0xA - bl sub_80EE8C8 - b _081A35CE - .pool -_081A34CC: - ldr r6, =gSaveBlock2Ptr - ldr r2, [r6] - lsls r7, 1 - mov r9, r7 - mov r7, r8 - lsls r0, r7, 2 - mov r1, r9 - adds r4, r1, r0 - ldr r5, =0x00000de2 - adds r0, r2, r5 - adds r3, r0, r4 - ldr r7, =0x00000dea - adds r0, r2, r7 - adds r0, r4 - ldrh r1, [r3] - ldrh r7, [r0] - cmp r1, r7 - bls _081A35CE - strh r1, [r0] - ldr r0, =0x00000dfa - adds r1, r2, r0 - adds r1, r4 - ldr r7, =0x00000df2 - adds r0, r2, r7 - adds r0, r4 - ldrh r0, [r0] - strh r0, [r1] - ldrh r0, [r3] - cmp r0, 0x1 - bls _081A35CE - bl sub_80EE818 - lsls r0, 24 - cmp r0, 0 - beq _081A35CE - mov r0, r8 - cmp r0, 0 - bne _081A353C - ldr r0, [r6] - adds r0, r5 - add r0, r9 - ldrh r0, [r0] - movs r1, 0x7 - bl sub_80EE8C8 - b _081A35CE - .pool -_081A353C: - ldr r0, [r6] - adds r0, r5 - adds r0, r4 - ldrh r0, [r0] - movs r1, 0x8 - bl sub_80EE8C8 - b _081A35CE -_081A354C: - ldr r6, =gSaveBlock2Ptr - ldr r1, [r6] - lsls r4, r7, 1 - ldr r5, =0x00000e04 - adds r0, r1, r5 - adds r0, r4 - ldr r2, =0x00000e08 - adds r1, r2 - adds r1, r4 - ldrh r2, [r0] - ldrh r3, [r1] - cmp r2, r3 - bls _081A35CE - strh r2, [r1] - ldrh r0, [r0] - cmp r0, 0x1 - bls _081A35CE - bl sub_80EE818 - lsls r0, 24 - cmp r0, 0 - beq _081A35CE - ldr r0, [r6] - adds r0, r5 - adds r0, r4 - ldrh r0, [r0] - movs r1, 0x9 - bl sub_80EE8C8 - b _081A35CE - .pool -_081A3594: - ldr r6, =gSaveBlock2Ptr - ldr r1, [r6] - lsls r4, r7, 1 - ldr r5, =0x00000e1a - adds r0, r1, r5 - adds r0, r4 - ldr r7, =0x00000e1e - adds r1, r7 - adds r1, r4 - ldrh r2, [r0] - ldrh r3, [r1] - cmp r2, r3 - bls _081A35CE - strh r2, [r1] - ldrh r0, [r0] - cmp r0, 0x1 - bls _081A35CE - bl sub_80EE818 - lsls r0, 24 - cmp r0, 0 - beq _081A35CE - ldr r0, [r6] - adds r0, r5 - adds r0, r4 - ldrh r0, [r0] - movs r1, 0xD - bl sub_80EE8C8 -_081A35CE: - add sp, 0x24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A31FC - - thumb_func_start sub_81A35EC -sub_81A35EC: @ 81A35EC - push {r4,lr} - ldr r0, =0x000040cf - bl VarGet - ldr r4, =gScriptResult - bl sub_81A3610 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A35EC - - thumb_func_start sub_81A3610 -sub_81A3610: @ 81A3610 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r0, 0 - mov r8, r0 - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, =0x000040ce - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - bl sub_81A39C4 - lsls r0, 16 - ldr r1, =gUnknown_08611550 - mov r9, r1 - lsls r7, r6, 2 - adds r1, 0x3 - adds r1, r7, r1 - lsrs r0, 16 - ldrb r1, [r1] - adds r5, r0, r1 - cmp r4, 0 - beq _081A365C - movs r0, 0 - b _081A36C2 - .pool -_081A365C: - lsls r0, r6, 24 - lsrs r0, 24 - bl sub_81A3B30 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - blt _081A3680 - cmp r1, 0x1 - bgt _081A3680 - adds r0, r1, r7 - add r0, r9 - ldrb r0, [r0] - cmp r5, r0 - bne _081A36BC - adds r1, 0x1 - mov r8, r1 - b _081A36BC -_081A3680: - ldr r1, =gUnknown_08611550 - lsls r2, r6, 2 - adds r0, r2, r1 - ldrb r0, [r0] - cmp r5, r0 - bne _081A3694 - movs r0, 0x3 - b _081A36BA - .pool -_081A3694: - adds r0, r1, 0x1 - adds r0, r2, r0 - ldrb r0, [r0] - cmp r5, r0 - bne _081A36A4 - movs r1, 0x4 - mov r8, r1 - b _081A36BC -_081A36A4: - cmp r5, r0 - ble _081A36BC - subs r0, r5, r0 - adds r1, 0x2 - adds r1, r2, r1 - ldrb r1, [r1] - bl __modsi3 - cmp r0, 0 - bne _081A36BC - movs r0, 0x4 -_081A36BA: - mov r8, r0 -_081A36BC: - mov r1, r8 - lsls r0, r1, 24 - lsrs r0, 24 -_081A36C2: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81A3610 - - thumb_func_start sub_81A36D0 -sub_81A36D0: @ 81A36D0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - adds r2, r0, 0 - lsls r1, 16 - lsrs r3, r1, 16 - cmp r0, 0x1 - beq _081A3766 - cmp r0, 0x1 - bgt _081A36EA - cmp r0, 0 - beq _081A36F2 - b _081A38F8 -_081A36EA: - cmp r2, 0x2 - bne _081A36F0 - b _081A3818 -_081A36F0: - b _081A38F8 -_081A36F2: - movs r0, 0xFA - lsls r0, 1 - cmp r3, r0 - bne _081A370C - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000bfc - b _081A38C4 - .pool -_081A370C: - ldr r0, =0x000003fe - cmp r3, r0 - beq _081A3786 - ldr r0, =0x0000012b - cmp r3, r0 - bhi _081A3738 - ldr r2, =gUnknown_0203BC88 - movs r0, 0x34 - adds r1, r3, 0 - muls r1, r0 - ldr r0, [r2] - adds r0, r1 - adds r0, 0xC - bl ConvertBattleFrontierTrainerSpeechToString - b _081A38F8 - .pool -_081A3738: - ldr r0, =0x0000018f - cmp r3, r0 - bhi _081A3758 - ldr r1, =gSaveBlock2Ptr - movs r0, 0xEC - muls r0, r3 - ldr r1, [r1] - adds r0, r1 - ldr r1, =0xfffef2b8 - b _081A38C4 - .pool -_081A3758: - adds r0, r3, 0 - adds r0, 0x70 - lsls r0, 24 - lsrs r0, 24 - bl sub_819F99C - b _081A38F8 -_081A3766: - movs r0, 0xFA - lsls r0, 1 - cmp r3, r0 - bne _081A3780 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000c08 - b _081A38C4 - .pool -_081A3780: - ldr r0, =0x000003fe - cmp r3, r0 - bne _081A3794 -_081A3786: - movs r0, 0 - bl sub_81A51A8 - b _081A38F8 - .pool -_081A3794: - ldr r0, =0x0000012b - cmp r3, r0 - bhi _081A37B8 - ldr r2, =gUnknown_0203BC88 - movs r0, 0x34 - adds r1, r3, 0 - muls r1, r0 - ldr r0, [r2] - adds r0, r1 - adds r0, 0x18 - bl ConvertBattleFrontierTrainerSpeechToString - b _081A38F8 - .pool -_081A37B8: - ldr r0, =0x0000018f - cmp r3, r0 - bhi _081A37EC - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - bne _081A387C - ldr r1, =gSaveBlock2Ptr - movs r0, 0xEC - muls r0, r3 - ldr r1, [r1] - adds r0, r1 - ldr r1, =0xfffef2c4 - b _081A38C4 - .pool -_081A37EC: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - bne _081A387C - ldr r1, =gSaveBlock2Ptr - lsls r0, r3, 4 - adds r0, r3 - lsls r0, 2 - ldr r1, [r1] - adds r0, r1 - ldr r1, =0xffff96c4 - b _081A38C4 - .pool -_081A3818: - movs r0, 0xFA - lsls r0, 1 - cmp r3, r0 - bne _081A3830 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000c14 - b _081A38C4 - .pool -_081A3830: - ldr r0, =0x000003fe - cmp r3, r0 - bne _081A3844 - movs r0, 0x1 - bl sub_81A51A8 - b _081A38F8 - .pool -_081A3844: - ldr r0, =0x0000012b - cmp r3, r0 - bhi _081A3868 - ldr r2, =gUnknown_0203BC88 - movs r0, 0x34 - adds r1, r3, 0 - muls r1, r0 - ldr r0, [r2] - adds r0, r1 - adds r0, 0x24 - bl ConvertBattleFrontierTrainerSpeechToString - b _081A38F8 - .pool -_081A3868: - ldr r0, =0x0000018f - cmp r3, r0 - bhi _081A38A8 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _081A3890 -_081A387C: - bl sub_81864E0 - bl ConvertBattleFrontierTrainerSpeechToString - b _081A38F8 - .pool -_081A3890: - ldr r1, =gSaveBlock2Ptr - movs r0, 0xEC - muls r0, r3 - ldr r1, [r1] - adds r0, r1 - ldr r1, =0xfffef2d0 - b _081A38C4 - .pool -_081A38A8: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _081A38D4 - bl sub_81864A8 - lsls r0, 24 - lsrs r3, r0, 24 - movs r0, 0x58 - muls r0, r3 - ldr r1, =gUnknown_086109BA -_081A38C4: - adds r0, r1 - bl ConvertBattleFrontierTrainerSpeechToString - b _081A38F8 - .pool -_081A38D4: - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r0, =0xfffffe70 - adds r2, r3, r0 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r1, r0 - adds r1, 0xDC - ldrb r0, [r1] - lsls r0, 27 - lsrs r3, r0, 27 - movs r0, 0x58 - muls r0, r3 - ldr r1, =gUnknown_086109BA - adds r0, r1 - bl ConvertBattleFrontierTrainerSpeechToString -_081A38F8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A36D0 - - thumb_func_start sub_81A3908 -sub_81A3908: @ 81A3908 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r2, =0x00000cdc - adds r1, r2 - movs r2, 0 - str r2, [r1] - movs r4, 0 - mov r9, r0 - mov r8, r9 - movs r6, 0 -_081A3926: - movs r5, 0 - lsls r7, r4, 2 - mov r10, r7 - adds r0, r4, 0x1 - mov r12, r0 -_081A3930: - mov r1, r8 - ldr r2, [r1] - lsls r3, r5, 1 - mov r7, r10 - adds r1, r3, r7 - movs r7, 0xCE - lsls r7, 4 - adds r0, r2, r7 - adds r0, r1 - strh r6, [r0] - cmp r4, 0x1 - bgt _081A3960 - adds r7, 0x2C - adds r0, r2, r7 - adds r0, r1 - strh r6, [r0] - adds r7, 0xBC - adds r0, r2, r7 - adds r0, r1 - strh r6, [r0] - adds r7, 0x1A - adds r0, r2, r7 - adds r0, r1 - strh r6, [r0] -_081A3960: - cmp r4, 0 - bne _081A3980 - mov r1, r8 - ldr r0, [r1] - ldr r2, =0x00000dda - adds r1, r0, r2 - adds r1, r3 - strh r4, [r1] - ldr r7, =0x00000e04 - adds r1, r0, r7 - adds r1, r3 - strh r4, [r1] - ldr r1, =0x00000e1a - adds r0, r1 - adds r0, r3 - strh r4, [r0] -_081A3980: - adds r5, 0x1 - cmp r5, 0x1 - ble _081A3930 - mov r4, r12 - cmp r4, 0x3 - ble _081A3926 - mov r2, r9 - ldr r0, [r2] - ldr r7, =0x00000ca8 - adds r1, r0, r7 - ldrb r0, [r1] - cmp r0, 0 - beq _081A399E - movs r0, 0x1 - strb r0, [r1] -_081A399E: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A3908 - - thumb_func_start sub_81A39C4 -sub_81A39C4: @ 81A39C4 - push {r4,r5,lr} - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r4, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x6 - bhi _081A3AC4 - lsls r0, 2 - ldr r1, =_081A3A0C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A3A0C: - .4byte _081A3A28 - .4byte _081A3A3C - .4byte _081A3A54 - .4byte _081A3A6C - .4byte _081A3A80 - .4byte _081A3A98 - .4byte _081A3AAC -_081A3A28: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - lsls r2, r5, 2 - adds r1, r2 - movs r2, 0xCE - lsls r2, 4 - b _081A3AB4 - .pool -_081A3A3C: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - lsls r2, r5, 2 - adds r1, r2 - ldr r2, =0x00000d0c - b _081A3AB4 - .pool -_081A3A54: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - lsls r2, r5, 2 - adds r1, r2 - ldr r2, =0x00000dc8 - b _081A3AB4 - .pool -_081A3A6C: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000dda - b _081A3AB4 - .pool -_081A3A80: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - lsls r2, r5, 2 - adds r1, r2 - ldr r2, =0x00000de2 - b _081A3AB4 - .pool -_081A3A98: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000e04 - b _081A3AB4 - .pool -_081A3AAC: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000e1a -_081A3AB4: - adds r0, r2 - adds r0, r1 - ldrh r0, [r0] - b _081A3AC6 - .pool -_081A3AC4: - movs r0, 0 -_081A3AC6: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81A39C4 - - thumb_func_start sub_81A3ACC -sub_81A3ACC: @ 81A3ACC - push {r4,r5,lr} - movs r2, 0 - ldr r5, =gSaveBlock2Ptr - ldr r4, =0x00000cb4 - ldr r0, =0x0000ffff - adds r3, r0, 0 -_081A3AD8: - ldr r0, [r5] - lsls r1, r2, 1 - adds r0, r4 - adds r0, r1 - ldrh r1, [r0] - orrs r1, r3 - strh r1, [r0] - adds r2, 0x1 - cmp r2, 0x13 - ble _081A3AD8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A3ACC - - thumb_func_start sub_81A3B00 -sub_81A3B00: @ 81A3B00 - push {lr} - ldr r0, =gTrainerBattleOpponent_A - ldrh r1, [r0] - ldr r0, =0x000003fe - cmp r1, r0 - bne _081A3B20 - ldr r1, =gScriptResult - movs r0, 0x1 - b _081A3B24 - .pool -_081A3B20: - ldr r1, =gScriptResult - movs r0, 0 -_081A3B24: - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A3B00 - - thumb_func_start sub_81A3B30 -sub_81A3B30: @ 81A3B30 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 23 - ldr r1, =0x000008c4 - adds r0, r4, r1 - bl FlagGet - adds r5, r0, 0 - ldr r0, =0x000008c5 - adds r4, r0 - adds r0, r4, 0 - bl FlagGet - adds r5, r0 - lsls r5, 24 - lsrs r5, 24 - adds r0, r5, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A3B30 - - thumb_func_start sub_81A3B64 -sub_81A3B64: @ 81A3B64 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r5, 0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r4, r0, 30 - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r7, r0, 16 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r6, r0, 16 - cmp r7, 0x6 - bhi _081A3C78 - lsls r0, r7, 2 - ldr r1, =_081A3BB4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A3BB4: - .4byte _081A3BD0 - .4byte _081A3BE4 - .4byte _081A3C00 - .4byte _081A3C18 - .4byte _081A3C2C - .4byte _081A3C44 - .4byte _081A3C60 -_081A3BD0: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - lsls r2, r6, 2 - adds r1, r2 - movs r2, 0xCE - lsls r2, 4 - b _081A3C68 - .pool -_081A3BE4: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - lsls r2, r6, 2 - adds r1, r2 - ldr r2, =0x00000d0c - adds r0, r2 - adds r0, r1 - ldrh r5, [r0] - b _081A3C78 - .pool -_081A3C00: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - lsls r2, r6, 2 - adds r1, r2 - ldr r2, =0x00000dc8 - b _081A3C68 - .pool -_081A3C18: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000dda - b _081A3C68 - .pool -_081A3C2C: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - lsls r2, r6, 2 - adds r1, r2 - ldr r2, =0x00000de2 - b _081A3C68 - .pool -_081A3C44: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000e04 - adds r0, r2 - adds r0, r1 - ldrh r0, [r0] - movs r1, 0xE - b _081A3C70 - .pool -_081A3C60: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000e1a -_081A3C68: - adds r0, r2 - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x7 -_081A3C70: - bl __udivsi3 - lsls r0, 16 - lsrs r5, r0, 16 -_081A3C78: - cmp r5, 0 - beq _081A3C7E - subs r5, 0x1 -_081A3C7E: - cmp r5, 0x1D - bls _081A3C84 - movs r5, 0x1D -_081A3C84: - ldr r2, =gUnknown_086118B4 - lsls r1, r7, 2 - adds r1, r6, r1 - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - adds r1, r0 - adds r7, r1, r2 - ldrb r5, [r7] - ldr r0, =gTrainerBattleOpponent_A - mov r9, r0 - ldrh r0, [r0] - ldr r1, =0x000003fe - mov r8, r1 - cmp r0, r8 - bne _081A3CA6 - adds r5, 0xA -_081A3CA6: - ldr r6, =gSaveBlock2Ptr - ldr r1, [r6] - ldr r4, =0x00000eb8 - adds r1, r4 - ldrh r0, [r1] - adds r0, r5 - strh r0, [r1] - ldr r0, =gStringVar1 - adds r1, r5, 0 - movs r2, 0 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - ldr r0, [r6] - adds r2, r0, r4 - ldrh r0, [r2] - ldr r1, =0x0000270f - cmp r0, r1 - bls _081A3CCE - strh r1, [r2] -_081A3CCE: - ldr r0, [r6] - ldr r4, =0x00000eba - adds r0, r4 - ldrh r5, [r0] - ldrb r0, [r7] - adds r5, r0 - bl sub_80EED60 - mov r2, r9 - ldrh r0, [r2] - cmp r0, r8 - bne _081A3CEE - adds r5, 0xA - movs r0, 0xA - bl sub_80EED60 -_081A3CEE: - ldr r0, =0x0000ffff - cmp r5, r0 - ble _081A3CF6 - adds r5, r0, 0 -_081A3CF6: - ldr r0, [r6] - adds r0, r4 - strh r5, [r0] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A3B64 - - thumb_func_start sub_81A3D30 -sub_81A3D30: @ 81A3D30 - push {r4,lr} - ldr r0, =0x000040cf - bl VarGet - ldr r4, =gScriptResult - lsls r0, 24 - lsrs r0, 24 - bl sub_81A3B30 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A3D30 - - thumb_func_start sub_81A3D58 -sub_81A3D58: @ 81A3D58 - push {r4,lr} - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r4, r0, 16 - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_81A3B30 - lsls r0, 24 - cmp r0, 0 - bne _081A3D88 - lsls r0, r4, 17 - ldr r1, =0x8C4 << 16 - adds r0, r1 - lsrs r0, 16 - bl FlagSet - b _081A3D94 - .pool -_081A3D88: - lsls r0, r4, 17 - ldr r1, =0x8C5 << 16 - adds r0, r1 - lsrs r0, 16 - bl FlagSet -_081A3D94: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A3D58 - - thumb_func_start sub_81A3DA0 -sub_81A3DA0: @ 81A3DA0 - push {lr} - ldr r0, =gBattleTypeFlags - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - ldr r2, [r0] - ands r2, r1 - cmp r2, 0 - beq _081A3DC4 - ldr r1, =gScriptResult - movs r0, 0x1 - strh r0, [r1] - b _081A3DC8 - .pool -_081A3DC4: - ldr r0, =gScriptResult - strh r2, [r0] -_081A3DC8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A3DA0 - - thumb_func_start sub_81A3DD0 -sub_81A3DD0: @ 81A3DD0 - push {r4-r6,lr} - adds r5, r2, 0 - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, 24 - lsrs r4, r1, 24 - adds r0, r6, 0 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - bl GetSetPokedexFlag - lsls r0, 24 - cmp r0, 0 - beq _081A3ED6 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - subs r0, r4, 0x1 - cmp r0, 0xA - bhi _081A3EA0 - lsls r0, 2 - ldr r1, =_081A3E0C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A3E0C: - .4byte _081A3E38 - .4byte _081A3E68 - .4byte _081A3E38 - .4byte _081A3EA0 - .4byte _081A3E38 - .4byte _081A3EA0 - .4byte _081A3E38 - .4byte _081A3EA0 - .4byte _081A3E38 - .4byte _081A3EA0 - .4byte _081A3E38 -_081A3E38: - cmp r5, r4 - bne _081A3E50 - ldr r0, =gStringVar1 - ldr r1, =gUnknown_085CCB79 - bl StringAppend - b _081A3EC8 - .pool -_081A3E50: - cmp r5, r4 - ble _081A3EC8 - ldr r0, =gStringVar1 - ldr r1, =gUnknown_085CCB7F - bl StringAppend - b _081A3EC8 - .pool -_081A3E68: - cmp r4, r5 - bne _081A3E80 - ldr r0, =gStringVar1 - ldr r1, =gUnknown_085CCB79 - bl StringAppend - b _081A3E88 - .pool -_081A3E80: - ldr r0, =gStringVar1 - ldr r1, =gUnknown_085CCB7F - bl StringAppend -_081A3E88: - ldr r0, =gStringVar1 - ldr r1, =gUnknown_085CCB86 - bl StringAppend - b _081A3EC8 - .pool -_081A3EA0: - cmp r4, r5 - bne _081A3EB8 - ldr r0, =gStringVar1 - ldr r1, =gUnknown_085CCB79 - bl StringAppend - b _081A3EC0 - .pool -_081A3EB8: - ldr r0, =gStringVar1 - ldr r1, =gUnknown_085CCB7F - bl StringAppend -_081A3EC0: - ldr r0, =gStringVar1 - ldr r1, =gUnknown_085CCB84 - bl StringAppend -_081A3EC8: - ldr r0, =gStringVar1 - movs r1, 0xB - muls r1, r6 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringAppend -_081A3ED6: - adds r0, r4, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A3DD0 - - thumb_func_start sub_81A3EF0 -sub_81A3EF0: @ 81A3EF0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r2, [sp, 0x20] - ldr r4, [sp, 0x24] - mov r9, r4 - ldr r4, [sp, 0x28] - mov r10, r4 - ldr r7, [sp, 0x2C] - lsls r0, 16 - lsrs r4, r0, 16 - lsls r1, 16 - lsrs r6, r1, 16 - lsls r3, 24 - lsrs r3, 24 - mov r12, r3 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - movs r2, 0 - movs r0, 0xCE - lsls r0, 1 - cmp r4, r0 - beq _081A3FBE - cmp r4, 0 - beq _081A3FBE - ldr r0, =gUnknown_08611C9A - ldrh r1, [r0] - ldr r5, =0x0000ffff - adds r3, r0, 0 - cmp r1, r5 - beq _081A3F54 - cmp r1, r4 - beq _081A3F48 - adds r1, r3, 0 -_081A3F3A: - adds r1, 0x2 - adds r2, 0x1 - ldrh r0, [r1] - cmp r0, r5 - beq _081A3F54 - cmp r0, r4 - bne _081A3F3A -_081A3F48: - lsls r0, r2, 1 - adds r0, r3 - ldrh r1, [r0] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _081A3FBE -_081A3F54: - mov r0, r12 - cmp r0, 0 - bne _081A3F60 - mov r1, r8 - cmp r1, 0x32 - bhi _081A3FBE -_081A3F60: - movs r2, 0 - ldrb r3, [r7] - cmp r2, r3 - bge _081A3F80 - mov r1, r9 - ldrh r0, [r1] - cmp r0, r4 - beq _081A3F80 - adds r5, r3, 0 -_081A3F72: - adds r1, 0x2 - adds r2, 0x1 - cmp r2, r5 - bge _081A3F80 - ldrh r0, [r1] - cmp r0, r4 - bne _081A3F72 -_081A3F80: - cmp r2, r3 - bne _081A3FBE - cmp r6, 0 - beq _081A3FAA - movs r2, 0 - cmp r2, r3 - bge _081A3FA6 - mov r1, r10 - ldrh r0, [r1] - cmp r0, r6 - beq _081A3FA6 - adds r5, r3, 0 -_081A3F98: - adds r1, 0x2 - adds r2, 0x1 - cmp r2, r5 - bge _081A3FA6 - ldrh r0, [r1] - cmp r0, r6 - bne _081A3F98 -_081A3FA6: - cmp r2, r3 - bne _081A3FBE -_081A3FAA: - lsls r0, r3, 1 - add r0, r9 - strh r4, [r0] - ldrb r0, [r7] - lsls r0, 1 - add r0, r10 - strh r6, [r0] - ldrb r0, [r7] - adds r0, 0x1 - strb r0, [r7] -_081A3FBE: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A3EF0 - - thumb_func_start sub_81A3FD4 -sub_81A3FD4: @ 81A3FD4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x34 - movs r0, 0 - str r0, [sp, 0x2C] - add r4, sp, 0x28 - strb r0, [r4] - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r0, 16 - mov r10, r4 - cmp r0, 0x1 - beq _081A4016 - cmp r0, 0x1 - bgt _081A4008 - cmp r0, 0 - beq _081A4010 - b _081A402A - .pool -_081A4008: - cmp r0, 0x3 - bgt _081A402A - movs r0, 0x2 - b _081A4028 -_081A4010: - movs r1, 0x3 - str r1, [sp, 0x2C] - b _081A402A -_081A4016: - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - movs r1, 0x3 - str r1, [sp, 0x2C] - cmp r0, 0 - bne _081A402A - movs r0, 0x4 -_081A4028: - str r0, [sp, 0x2C] -_081A402A: - movs r1, 0 - mov r9, r1 - b _081A4040 - .pool -_081A4034: - mov r1, r10 - ldrb r0, [r1] - ldr r1, [sp, 0x2C] - cmp r0, r1 - blt _081A4040 - b _081A41E0 -_081A4040: - mov r5, r9 - movs r0, 0 - mov r1, r10 - strb r0, [r1] - mov r0, r9 - adds r0, 0x1 - str r0, [sp, 0x30] -_081A404E: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =gPlayerParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x41 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - adds r0, r4, 0 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r7, r0, 16 - adds r0, r4, 0 - movs r1, 0x38 - bl GetMonData - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r4, 0 - movs r1, 0x39 - bl GetMonData - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x6 - bne _081A40C8 - cmp r7, 0 - bne _081A40E4 - ldr r0, =gScriptResult - ldrb r3, [r0] - str r6, [sp] - add r1, sp, 0x10 - str r1, [sp, 0x4] - add r0, sp, 0x1C - str r0, [sp, 0x8] - mov r0, r10 - str r0, [sp, 0xC] - mov r0, r8 - movs r1, 0 - adds r2, r4, 0 - bl sub_81A3EF0 - b _081A40E4 - .pool -_081A40C8: - ldr r0, =gScriptResult - ldrb r3, [r0] - str r6, [sp] - add r1, sp, 0x10 - str r1, [sp, 0x4] - add r0, sp, 0x1C - str r0, [sp, 0x8] - mov r0, r10 - str r0, [sp, 0xC] - mov r0, r8 - adds r1, r7, 0 - adds r2, r4, 0 - bl sub_81A3EF0 -_081A40E4: - adds r5, 0x1 - cmp r5, 0x5 - ble _081A40EC - movs r5, 0 -_081A40EC: - cmp r5, r9 - bne _081A404E - ldr r1, [sp, 0x30] - mov r9, r1 - cmp r1, 0x5 - ble _081A4034 - mov r1, r10 - ldrb r0, [r1] - ldr r1, [sp, 0x2C] - cmp r0, r1 - bge _081A41E0 - movs r6, 0 - ldr r0, =gUnknown_08611C9A - ldrh r2, [r0] - ldr r1, =0x0000ffff - mov r8, r0 - cmp r2, r1 - beq _081A4134 - mov r4, r8 -_081A4112: - adds r0, r2, 0 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - bl GetSetPokedexFlag - lsls r0, 24 - cmp r0, 0 - beq _081A412A - adds r6, 0x1 -_081A412A: - adds r4, 0x2 - ldrh r2, [r4] - ldr r0, =0x0000ffff - cmp r2, r0 - bne _081A4112 -_081A4134: - ldr r1, =gStringVar1 - movs r0, 0xFF - strb r0, [r1] - ldr r1, =gSpecialVar_0x8004 - movs r0, 0x1 - strh r0, [r1] - movs r0, 0 - mov r1, r10 - strb r0, [r1] - mov r1, r8 - ldrh r0, [r1] - ldr r1, =0x0000ffff - cmp r0, r1 - beq _081A416A - mov r5, r10 - adds r7, r1, 0 - mov r4, r8 -_081A4156: - ldrh r0, [r4] - ldrb r1, [r5] - adds r2, r6, 0 - bl sub_81A3DD0 - strb r0, [r5] - adds r4, 0x2 - ldrh r0, [r4] - cmp r0, r7 - bne _081A4156 -_081A416A: - mov r0, r10 - ldrb r4, [r0] - cmp r4, 0 - bne _081A41A4 - ldr r4, =gStringVar1 - ldr r1, =gUnknown_085CCB82 - adds r0, r4, 0 - bl StringAppend - ldr r1, =gUnknown_085CCB88 - adds r0, r4, 0 - bl StringAppend - b _081A4202 - .pool -_081A41A4: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _081A41C0 - ldr r0, =gStringVar1 - ldr r1, =gUnknown_085CCB84 - bl StringAppend - b _081A41C8 - .pool -_081A41C0: - ldr r0, =gStringVar1 - ldr r1, =gUnknown_085CCB82 - bl StringAppend -_081A41C8: - ldr r0, =gStringVar1 - ldr r1, =gUnknown_085CCB8C - bl StringAppend - b _081A4202 - .pool -_081A41E0: - ldr r1, =gSpecialVar_0x8004 - movs r0, 0 - strh r0, [r1] - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r0, =gScriptResult - ldrb r0, [r0] - ldr r1, =0x00000ca9 - adds r2, r1 - movs r1, 0x3 - ands r1, r0 - ldrb r3, [r2] - movs r0, 0x4 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] -_081A4202: - add sp, 0x34 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A3FD4 - - thumb_func_start sub_81A4224 -sub_81A4224: @ 81A4224 - push {lr} - bl sub_81652B4 - pop {r0} - bx r0 - thumb_func_end sub_81A4224 - - thumb_func_start sub_81A4230 -sub_81A4230: @ 81A4230 - push {r4-r7,lr} - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r4, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x6 - bls _081A425A - b _081A4394 -_081A425A: - lsls r0, 2 - ldr r1, =_081A4278 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A4278: - .4byte _081A4294 - .4byte _081A42DC - .4byte _081A431C - .4byte _081A4338 - .4byte _081A434C - .4byte _081A4368 - .4byte _081A437C -_081A4294: - ldr r7, =gSaveBlock2Ptr - ldr r0, [r7] - lsls r4, 1 - lsls r1, r5, 2 - adds r1, r4, r1 - movs r6, 0xCE - lsls r6, 4 - adds r3, r0, r6 - adds r2, r3, r1 - ldrh r1, [r2] - ldr r0, =0x0000270e - cmp r1, r0 - bhi _081A4394 - adds r0, r1, 0x1 - strh r0, [r2] - cmp r5, 0 - bne _081A4394 - adds r0, r3, r4 - ldrh r1, [r0] - movs r0, 0x20 - bl sav12_xor_set - ldr r1, [r7] - adds r0, r1, r6 - adds r0, r4 - ldrh r0, [r0] - ldr r2, =0x00000d02 - adds r1, r2 - b _081A4392 - .pool -_081A42DC: - ldr r6, =gSaveBlock2Ptr - ldr r0, [r6] - lsls r2, r4, 1 - lsls r1, r5, 2 - adds r1, r2, r1 - ldr r3, =0x00000d0c - adds r0, r3 - adds r3, r0, r1 - ldrh r0, [r3] - ldr r2, =0x0000270e - cmp r0, r2 - bhi _081A42F8 - adds r0, 0x1 - strh r0, [r3] -_081A42F8: - ldr r0, [r6] - ldr r3, =0x00000d1c - adds r0, r3 - adds r1, r0, r1 - ldrh r0, [r1] - cmp r0, r2 - bhi _081A4394 - adds r0, 0x1 - b _081A4392 - .pool -_081A431C: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - lsls r0, r4, 1 - lsls r1, r5, 2 - adds r0, r1 - ldr r1, =0x00000dc8 - adds r2, r1 - adds r1, r2, r0 - b _081A4388 - .pool -_081A4338: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000dda - adds r0, r2 - b _081A4386 - .pool -_081A434C: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - lsls r0, r4, 1 - lsls r1, r5, 2 - adds r0, r1 - ldr r3, =0x00000de2 - adds r2, r3 - adds r1, r2, r0 - b _081A4388 - .pool -_081A4368: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000e04 - adds r0, r2 - b _081A4386 - .pool -_081A437C: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - ldr r3, =0x00000e1a - adds r0, r3 -_081A4386: - adds r1, r0, r1 -_081A4388: - ldrh r3, [r1] - ldr r0, =0x0000270e - cmp r3, r0 - bhi _081A4394 - adds r0, r3, 0x1 -_081A4392: - strh r0, [r1] -_081A4394: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A4230 - - thumb_func_start sub_81A43A8 -sub_81A43A8: @ 81A43A8 - push {r4-r6,lr} - sub sp, 0x4 - movs r4, 0 - ldr r6, =gSaveBlock1Ptr - movs r5, 0x64 -_081A43B2: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000caa - adds r0, r2 - adds r1, r0, r1 - ldrh r0, [r1] - cmp r0, 0 - beq _081A43EE - adds r1, r0, 0 - muls r1, r5 - movs r0, 0xEA - lsls r0, 1 - adds r1, r0 - ldr r0, [r6] - adds r0, r1 - movs r1, 0xC - movs r2, 0 - bl GetMonData - mov r1, sp - strh r0, [r1] - adds r0, r4, 0 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xC - mov r2, sp - bl SetMonData -_081A43EE: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _081A43B2 - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A43A8 - - thumb_func_start sub_81A4410 -sub_81A4410: @ 81A4410 - push {r4,lr} - ldr r4, =gScriptResult - bl sub_8185338 - strh r0, [r4] - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x8 - orrs r0, r2 - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A4410 - - thumb_func_start sub_81A443C -sub_81A443C: @ 81A443C - push {lr} - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0 - beq _081A4450 - cmp r0, 0x1 - beq _081A4464 - b _081A446E - .pool -_081A4450: - ldr r0, =gStringVar1 - ldr r1, =gTrainerBattleOpponent_A - ldrh r1, [r1] - bl GetFrontierTrainerName - b _081A446E - .pool -_081A4464: - ldr r0, =gStringVar2 - ldr r1, =gTrainerBattleOpponent_A - ldrh r1, [r1] - bl GetFrontierTrainerName -_081A446E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A443C - - thumb_func_start sub_81A447C -sub_81A447C: @ 81A447C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - movs r0, 0 - str r0, [sp] -_081A448C: - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r2, [sp] - lsls r1, r2, 1 - ldr r4, =0x00000caa - adds r0, r4 - adds r0, r1 - ldrh r0, [r0] - subs r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - mov r9, r1 - adds r2, 0x1 - str r2, [sp, 0x4] - cmp r0, 0x5 - bhi _081A454E - movs r6, 0 - ldr r0, [sp] - movs r2, 0x64 - adds r1, r0, 0 - muls r1, r2 - ldr r0, =gPlayerParty - adds r7, r1, r0 -_081A44BA: - movs r5, 0 - movs r4, 0xD - adds r4, r6 - mov r8, r4 - adds r0, r6, 0x1 - mov r10, r0 -_081A44C6: - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r2, =0x00000caa - adds r0, r2 - add r0, r9 - ldrh r0, [r0] - movs r4, 0x64 - adds r1, r0, 0 - muls r1, r4 - movs r0, 0xEA - lsls r0, 1 - adds r1, r0 - ldr r2, =gSaveBlock1Ptr - ldr r0, [r2] - adds r0, r1 - adds r1, r5, 0 - adds r1, 0xD - movs r2, 0 - bl GetMonData - adds r4, r0, 0 - adds r0, r7, 0 - mov r1, r8 - movs r2, 0 - bl GetMonData - cmp r4, r0 - beq _081A4508 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _081A44C6 -_081A4508: - cmp r5, 0x4 - bne _081A4516 - adds r0, r7, 0 - movs r1, 0xA6 - adds r2, r6, 0 - bl SetMonMoveSlot -_081A4516: - mov r4, r10 - lsls r0, r4, 24 - lsrs r6, r0, 24 - cmp r6, 0x3 - bls _081A44BA - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =gSaveBlock2Ptr - ldr r1, [r2] - ldr r4, =0x00000caa - adds r1, r4 - add r1, r9 - ldrh r1, [r1] - subs r1, 0x1 - movs r3, 0x64 - muls r1, r3 - adds r0, r1 - movs r1, 0x8E - lsls r1, 2 - adds r0, r1 - ldr r2, =gPlayerParty - ldr r4, [sp] - adds r1, r4, 0 - muls r1, r3 - adds r1, r2 - movs r2, 0x64 - bl memcpy -_081A454E: - ldr r1, [sp, 0x4] - lsls r0, r1, 24 - lsrs r0, 24 - str r0, [sp] - cmp r0, 0x3 - bls _081A448C - 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_81A447C - - thumb_func_start sub_81A457C -sub_81A457C: @ 81A457C - push {lr} - ldr r0, =0x000040cf - bl VarGet - lsls r0, 24 - lsrs r0, 24 - bl sub_81A5030 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A457C - - thumb_func_start sub_81A4594 -sub_81A4594: @ 81A4594 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x2C - mov r8, r1 - adds r6, r3, 0 - ldr r1, =gUnknown_0203AB74 - ldrb r5, [r1] - lsls r4, r0, 1 - adds r4, r0 - ldr r1, =gUnknown_085EE424 - adds r4, r1 - mov r1, r8 - lsls r3, r1, 27 - lsrs r3, 24 - lsls r1, r0, 2 - adds r1, r0 - adds r2, r1 - lsls r2, 3 - adds r2, 0x1 - lsls r2, 24 - lsrs r7, r2, 24 - str r7, [sp] - movs r0, 0xFF - mov r10, r0 - str r0, [sp, 0x4] - movs r1, 0 - mov r9, r1 - str r1, [sp, 0x8] - adds r0, r5, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl PrintTextOnWindow - movs r0, 0xFF - strb r0, [r6, 0xD] - ldrh r0, [r6, 0x4] - cmp r0, 0 - beq _081A465C - adds r1, r6, 0x6 - ldrb r2, [r6, 0xE] - add r0, sp, 0xC - bl sub_81DB5E8 - ldr r1, =gUnknown_0203AB74 - ldrb r0, [r1] - mov r3, r8 - adds r3, 0x2 - lsls r3, 27 - lsrs r3, 24 - str r7, [sp] - mov r1, r10 - str r1, [sp, 0x4] - mov r1, r9 - str r1, [sp, 0x8] - movs r1, 0x1 - add r2, sp, 0xC - bl PrintTextOnWindow - ldrh r1, [r6, 0x4] - ldr r0, =0x0000270f - cmp r1, r0 - bls _081A4618 - adds r1, r0, 0 -_081A4618: - ldr r0, =gStringVar2 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r5, =gStringVar4 - ldr r1, =gUnknown_08611D08 - ldr r0, [sp, 0x4C] - lsls r0, 2 - adds r0, r1 - ldr r4, [r0] - adds r0, r5, 0 - adds r1, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0xC8 - bl GetStringRightAlignXOffset - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - ldr r1, =gUnknown_0203AB74 - ldrb r0, [r1] - str r7, [sp] - mov r1, r10 - str r1, [sp, 0x4] - mov r1, r9 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - bl PrintTextOnWindow -_081A465C: - add sp, 0x2C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A4594 - - thumb_func_start sub_81A4684 -sub_81A4684: @ 81A4684 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x2C - adds r6, r0, 0 - adds r7, r1, 0 - mov r10, r2 - adds r5, r3, 0 - ldr r1, =gUnknown_0203AB74 - ldrb r0, [r1] - lsls r2, r6, 1 - adds r2, r6 - ldr r1, =gUnknown_085EE424 - adds r2, r1 - lsls r3, r7, 27 - lsrs r3, 24 - mov r12, r3 - lsls r1, r6, 2 - adds r1, r6 - mov r3, r10 - adds r4, r3, r1 - lsls r1, r4, 3 - adds r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp] - movs r1, 0xFF - mov r9, r1 - str r1, [sp, 0x4] - movs r3, 0 - mov r8, r3 - str r3, [sp, 0x8] - movs r1, 0x1 - mov r3, r12 - bl PrintTextOnWindow - ldrh r0, [r5, 0x8] - cmp r0, 0 - beq _081A47BC - movs r0, 0xFF - strb r0, [r5, 0x11] - movs r0, 0x1 - negs r0, r0 - strb r0, [r5, 0x19] - adds r1, r5, 0 - adds r1, 0xA - ldrb r2, [r5, 0x1A] - add r0, sp, 0xC - bl sub_81DB5E8 - ldr r1, =gUnknown_0203AB74 - ldrb r0, [r1] - adds r3, r7, 0x2 - lsls r3, 27 - lsrs r3, 24 - subs r1, r4, 0x1 - lsls r1, 3 - adds r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp] - mov r2, r9 - str r2, [sp, 0x4] - mov r1, r8 - str r1, [sp, 0x8] - movs r1, 0x1 - add r2, sp, 0xC - bl PrintTextOnWindow - adds r4, r5, 0 - adds r4, 0x12 - adds r0, r4, 0 - bl sub_8009228 - cmp r0, 0 - beq _081A4734 - add r0, sp, 0xC - adds r1, r4, 0 - movs r2, 0x1 - bl sub_81DB5E8 - b _081A473C - .pool -_081A4734: - add r0, sp, 0xC - adds r1, r4, 0 - bl StringCopy -_081A473C: - ldr r2, =gUnknown_0203AB74 - mov r9, r2 - ldrb r0, [r2] - adds r3, r7, 0x4 - lsls r3, 27 - lsrs r3, 24 - lsls r1, r6, 2 - adds r1, r6 - mov r2, r10 - adds r6, r2, r1 - adds r1, r6, 0x1 - lsls r1, 3 - adds r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp] - movs r1, 0xFF - mov r8, r1 - str r1, [sp, 0x4] - movs r7, 0 - str r7, [sp, 0x8] - movs r1, 0x1 - add r2, sp, 0xC - bl PrintTextOnWindow - ldrh r1, [r5, 0x8] - ldr r0, =0x0000270f - cmp r1, r0 - bls _081A4778 - adds r1, r0, 0 -_081A4778: - ldr r0, =gStringVar2 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r5, =gStringVar4 - ldr r0, =gUnknown_08611D08 - ldr r4, [r0, 0x24] - adds r0, r5, 0 - adds r1, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0xC8 - bl GetStringRightAlignXOffset - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - mov r2, r9 - ldrb r0, [r2] - lsls r1, r6, 3 - adds r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp] - mov r1, r8 - str r1, [sp, 0x4] - str r7, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - bl PrintTextOnWindow -_081A47BC: - add sp, 0x2C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A4684 - - thumb_func_start sub_81A47E0 -sub_81A47E0: @ 81A47E0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x44 - mov r9, r0 - mov r10, r1 - str r2, [sp, 0x40] - movs r0, 0xAC - lsls r0, 1 - bl AllocZeroed - mov r8, r0 - bl sub_80E8260 - add r0, sp, 0x30 - mov r12, r0 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r3, [sp, 0x40] - lsls r1, r3, 1 - adds r1, r3 - lsls r1, 4 - mov r4, r10 - lsls r0, r4, 1 - add r0, r10 - lsls r0, 5 - adds r1, r0 - adds r4, r1, r2 - mov r3, sp - movs r2, 0x2 -_081A4820: - adds r0, r3, 0 - movs r5, 0x87 - lsls r5, 2 - adds r1, r4, r5 - ldm r1!, {r5-r7} - stm r0!, {r5-r7} - ldr r1, [r1] - str r1, [r0] - adds r4, 0x10 - adds r3, 0x10 - subs r2, 0x1 - cmp r2, 0 - bge _081A4820 - ldr r6, [sp, 0x40] - lsls r0, r6, 4 - mov r7, r10 - lsls r1, r7, 5 - adds r0, r1 - mov r1, r12 - add r0, r8 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldr r0, [r0] - str r0, [r1] - movs r2, 0 -_081A4852: - movs r1, 0 - movs r4, 0 - movs r3, 0 - lsls r5, r2, 4 - adds r6, r2, 0x1 - mov r2, sp -_081A485E: - ldrh r0, [r2, 0x4] - cmp r0, r1 - ble _081A4868 - adds r4, r3, 0 - adds r1, r0, 0 -_081A4868: - adds r2, 0x10 - adds r3, 0x1 - cmp r3, 0x3 - ble _081A485E - mov r0, sp - ldrh r0, [r0, 0x34] - cmp r0, r1 - blt _081A487A - movs r4, 0x3 -_081A487A: - lsls r0, r4, 4 - mov r7, sp - adds r2, r7, r0 - mov r0, r9 - adds r1, r5, r0 - adds r0, r2, 0 - ldm r0!, {r3-r5} - stm r1!, {r3-r5} - ldr r0, [r0] - str r0, [r1] - movs r0, 0 - strh r0, [r2, 0x4] - adds r2, r6, 0 - cmp r2, 0x2 - ble _081A4852 - mov r0, r8 - bl Free - add sp, 0x44 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A47E0 - - thumb_func_start sub_81A48B4 -sub_81A48B4: @ 81A48B4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x74 - mov r9, r0 - mov r10, r1 - movs r0, 0xAC - lsls r0, 1 - bl AllocZeroed - mov r8, r0 - bl sub_80E8260 - mov r0, sp - adds r0, 0x54 - str r0, [sp, 0x70] - add r1, sp, 0x5C - mov r12, r1 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - movs r0, 0x54 - mov r2, r10 - muls r2, r0 - adds r0, r2, 0 - adds r3, r0, r1 - mov r2, sp - movs r4, 0x2 -_081A48EE: - adds r0, r2, 0 - ldr r5, =0x0000057c - adds r1, r3, r5 - ldm r1!, {r5-r7} - stm r0!, {r5-r7} - ldm r1!, {r5-r7} - stm r0!, {r5-r7} - ldr r1, [r1] - str r1, [r0] - adds r3, 0x1C - adds r2, 0x1C - subs r4, 0x1 - cmp r4, 0 - bge _081A48EE - mov r6, r10 - lsls r0, r6, 3 - subs r0, r6 - lsls r0, 2 - add r0, r8 - ldr r1, [sp, 0x70] - movs r7, 0x90 - lsls r7, 1 - adds r0, r7 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r5-r7} - stm r1!, {r5-r7} - ldr r0, [r0] - str r0, [r1] - movs r4, 0 -_081A492A: - movs r1, 0 - movs r5, 0 - movs r3, 0 - lsls r6, r4, 3 - adds r7, r4, 0x1 - mov r2, sp -_081A4936: - ldrh r0, [r2, 0x8] - cmp r0, r1 - ble _081A4940 - adds r5, r3, 0 - adds r1, r0, 0 -_081A4940: - adds r2, 0x1C - adds r3, 0x1 - cmp r3, 0x2 - ble _081A4936 - mov r2, r12 - ldrh r0, [r2] - cmp r0, r1 - blt _081A4952 - movs r5, 0x3 -_081A4952: - subs r1, r6, r4 - lsls r1, 2 - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - mov r3, sp - adds r2, r3, r0 - add r1, r9 - adds r0, r2, 0 - ldm r0!, {r4-r6} - stm r1!, {r4-r6} - ldm r0!, {r3-r5} - stm r1!, {r3-r5} - ldr r0, [r0] - str r0, [r1] - movs r0, 0 - strh r0, [r2, 0x8] - adds r4, r7, 0 - cmp r4, 0x2 - ble _081A492A - mov r0, r8 - bl Free - add sp, 0x74 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A48B4 - - thumb_func_start sub_81A4998 -sub_81A4998: @ 81A4998 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x94 - adds r7, r0, 0 - str r1, [sp, 0x90] - ldr r0, =gStringVar1 - ldr r4, =gUnknown_08611CB0 - lsls r5, r7, 3 - adds r1, r5, r4 - ldr r1, [r1] - bl StringCopy - ldr r6, =gStringVar4 - adds r4, 0x4 - adds r5, r4 - ldr r1, [r5] - adds r0, r6, 0 - bl StringExpandPlaceholders - ldr r0, =gUnknown_0203AB74 - mov r8, r0 - ldrb r0, [r0] - movs r1, 0x1 - mov r10, r1 - str r1, [sp] - movs r2, 0xFF - mov r9, r2 - str r2, [sp, 0x4] - movs r5, 0 - str r5, [sp, 0x8] - adds r2, r6, 0 - movs r3, 0 - bl PrintTextOnWindow - ldr r1, =gUnknown_08611D00 - ldr r2, [sp, 0x90] - lsls r0, r2, 2 - adds r0, r1 - ldr r4, [r0] - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0xD0 - bl GetStringRightAlignXOffset - adds r3, r0, 0 - mov r1, r8 - ldrb r0, [r1] - lsls r3, 24 - lsrs r3, 24 - mov r2, r10 - str r2, [sp] - mov r1, r9 - str r1, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - bl PrintTextOnWindow - cmp r7, 0x9 - bne _081A4A6C - ldr r2, =gSaveBlock2Ptr - ldr r0, [r2] - ldr r1, =0x00000ee8 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldr r0, [r2] - movs r2, 0xEF - lsls r2, 4 - adds r0, r2 - movs r1, 0x1 - negs r1, r1 - strb r1, [r0] - add r4, sp, 0x3C - adds r0, r4, 0 - ldr r1, [sp, 0x90] - bl sub_81A48B4 -_081A4A3A: - adds r0, r5, 0 - movs r1, 0x1 - movs r2, 0x4 - adds r3, r4, 0 - bl sub_81A4684 - adds r4, 0x1C - adds r5, 0x1 - cmp r5, 0x2 - ble _081A4A3A - b _081A4A90 - .pool -_081A4A6C: - add r0, sp, 0xC - adds r1, r7, 0 - ldr r2, [sp, 0x90] - bl sub_81A47E0 - movs r5, 0 - add r4, sp, 0xC -_081A4A7A: - str r7, [sp] - adds r0, r5, 0 - movs r1, 0x1 - movs r2, 0x4 - adds r3, r4, 0 - bl sub_81A4594 - adds r4, 0x10 - adds r5, 0x1 - cmp r5, 0x2 - ble _081A4A7A -_081A4A90: - add sp, 0x94 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81A4998 - - thumb_func_start sub_81A4AA0 -sub_81A4AA0: @ 81A4AA0 - push {r4,lr} - ldr r4, =gUnknown_0203AB74 - ldr r0, =gUnknown_08611C84 - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r4] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - movs r1, 0 - bl sub_81A4998 - ldrb r0, [r4] - bl PutWindowTilemap - ldrb r0, [r4] - movs r1, 0x3 - bl CopyWindowToVram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A4AA0 - - thumb_func_start sub_81A4AE8 -sub_81A4AE8: @ 81A4AE8 - push {r4,lr} - ldr r4, =gUnknown_0203AB74 - ldrb r0, [r4] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - movs r1, 0x1 - bl sub_81A4998 - ldrb r0, [r4] - movs r1, 0x2 - bl CopyWindowToVram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A4AE8 - - thumb_func_start sub_81A4B14 -sub_81A4B14: @ 81A4B14 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - movs r1, 0 - ldr r3, =gSaveBlock2Ptr -_081A4B24: - movs r6, 0 - lsls r0, r1, 1 - adds r2, r1, 0x1 - mov r10, r2 - adds r0, r1 - lsls r0, 5 - mov r8, r0 - movs r7, 0 - movs r0, 0x87 - lsls r0, 2 - add r0, r8 - mov r9, r0 -_081A4B3C: - movs r5, 0 - adds r2, r7, 0 - mov r1, r8 - adds r4, r7, r1 -_081A4B44: - ldr r0, [r3] - add r0, r9 - adds r0, r2 - lsls r1, r5, 4 - adds r0, r1 - movs r1, 0 - str r2, [sp] - str r3, [sp, 0x4] - bl CopyUnalignedWord - ldr r3, [sp, 0x4] - ldr r0, [r3] - adds r0, r4 - ldr r1, =0x00000222 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldr r0, [r3] - adds r0, r4 - movs r1, 0x88 - lsls r1, 2 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - adds r4, 0x10 - adds r5, 0x1 - ldr r2, [sp] - cmp r5, 0x2 - ble _081A4B44 - adds r7, 0x30 - adds r6, 0x1 - cmp r6, 0x1 - ble _081A4B3C - mov r1, r10 - cmp r1, 0x8 - ble _081A4B24 - movs r6, 0 - ldr r7, =gSaveBlock2Ptr - movs r2, 0x54 - mov r10, r2 - movs r3, 0xFF - mov r9, r3 -_081A4B98: - adds r0, r6, 0x1 - mov r8, r0 - mov r1, r10 - muls r1, r6 - movs r0, 0x54 - adds r4, r6, 0 - muls r4, r0 - movs r2, 0 - ldr r3, =0x0000057c - adds r6, r1, r3 - movs r5, 0x2 -_081A4BAE: - ldr r0, [r7] - adds r0, r6 - adds r0, r2 - movs r1, 0 - str r2, [sp] - bl CopyUnalignedWord - ldr r0, [r7] - adds r0, r6 - ldr r2, [sp] - adds r0, r2 - adds r0, 0x4 - movs r1, 0 - bl CopyUnalignedWord - ldr r1, [r7] - adds r1, r4 - ldr r0, =0x00000586 - adds r1, r0 - ldrb r0, [r1] - mov r3, r9 - orrs r0, r3 - strb r0, [r1] - ldr r1, [r7] - adds r1, r4 - ldr r0, =0x0000058e - adds r1, r0 - ldrb r0, [r1] - orrs r0, r3 - strb r0, [r1] - ldr r0, [r7] - adds r0, r4 - ldr r1, =0x00000584 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - adds r4, 0x1C - ldr r2, [sp] - adds r2, 0x1C - subs r5, 0x1 - cmp r5, 0 - bge _081A4BAE - mov r6, r8 - cmp r6, 0x1 - ble _081A4B98 - 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_81A4B14 - - thumb_func_start sub_81A4C30 -sub_81A4C30: @ 81A4C30 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r0, 0x96 - lsls r0, 2 - bl AllocZeroed - adds r7, r0, 0 - adds r4, r7, 0 - movs r5, 0 - movs r0, 0xFA - lsls r0, 1 - adds r6, r7, r0 - ldr r0, =gPlayerParty - mov r8, r0 -_081A4C4E: - mov r0, r8 - adds r1, r5, r0 - adds r0, r4, 0 - movs r2, 0x64 - bl memcpy - adds r4, 0x64 - adds r5, 0x64 - cmp r4, r6 - ble _081A4C4E - ldr r4, =gPlayerPartyCount - ldrb r5, [r4] - bl copy_player_party_from_sav1 - bl sub_8076D5C - movs r0, 0x1 - bl TrySavingData - bl sav2_gender2_inplace_and_xFE - strb r5, [r4] - adds r4, r7, 0 - ldr r5, =gPlayerParty - movs r0, 0xFA - lsls r0, 1 - adds r6, r7, r0 -_081A4C84: - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x64 - bl memcpy - adds r4, 0x64 - adds r5, 0x64 - cmp r4, r6 - ble _081A4C84 - adds r0, r7, 0 - bl Free - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A4C30 - - thumb_func_start sub_81A4CB0 -sub_81A4CB0: @ 81A4CB0 - push {lr} - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _081A4CD0 - bl sub_8185EA0 - lsls r0, 24 - lsrs r0, 24 - b _081A4CDA - .pool -_081A4CD0: - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r0, 16 -_081A4CDA: - ldr r2, =gTrainers - ldr r1, =gUnknown_08611D30 - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0, 0x3] - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A4CB0 - - thumb_func_start sub_81A4D00 -sub_81A4D00: @ 81A4D00 - push {lr} - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _081A4D20 - bl sub_8185EA0 - lsls r0, 24 - lsrs r0, 24 - b _081A4D2A - .pool -_081A4D20: - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r0, 16 -_081A4D2A: - ldr r2, =gTrainers - ldr r1, =gUnknown_08611D30 - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0, 0x1] - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A4D00 - - thumb_func_start sub_81A4D50 -sub_81A4D50: @ 81A4D50 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _081A4D70 - bl sub_8185EA0 - lsls r0, 24 - lsrs r0, 24 - b _081A4D7A - .pool -_081A4D70: - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r0, 16 -_081A4D7A: - movs r3, 0 - lsls r0, 1 - ldr r2, =gTrainers - ldr r1, =gUnknown_08611D30 - adds r0, r1 - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r2, 0x4 - adds r2, r0, r2 -_081A4D90: - adds r1, r4, r3 - ldrb r0, [r2] - strb r0, [r1] - adds r2, 0x1 - adds r3, 0x1 - cmp r3, 0x6 - ble _081A4D90 - adds r1, r4, r3 - movs r0, 0xFF - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A4D50 - - thumb_func_start sub_81A4DB8 -sub_81A4DB8: @ 81A4DB8 - push {lr} - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - ldr r1, =gUnknown_08611C8C - lsrs r0, 15 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A4DB8 - - thumb_func_start sub_81A4DD8 -sub_81A4DD8: @ 81A4DD8 - push {lr} - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - ldr r2, =0x00004010 - ldr r1, =gUnknown_08611C8C - lsrs r0, 15 - adds r0, r1 - ldrb r1, [r0] - adds r0, r2, 0 - bl VarSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A4DD8 - - thumb_func_start sub_81A4E04 -sub_81A4E04: @ 81A4E04 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x44 - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x20] - bl sub_81A513C - str r0, [sp, 0x24] - ldr r0, [sp, 0x20] - cmp r0, 0x1 - bne _081A4E44 - ldr r0, =0x000003fe - bl sub_81953A0 - lsls r0, 16 - lsrs r0, 16 - bl sub_818FC78 - adds r4, r0, 0 - b _081A4E46 - .pool -_081A4E44: - movs r4, 0x7 -_081A4E46: - bl ZeroEnemyPartyMons - movs r1, 0 - str r1, [sp, 0x18] - bl sub_8165C40 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x1C] - movs r2, 0 - str r2, [sp, 0x14] -_081A4E5C: - movs r0, 0x1 - ands r0, r4 - asrs r4, 1 - str r4, [sp, 0x30] - ldr r3, [sp, 0x14] - adds r3, 0x1 - str r3, [sp, 0x28] - cmp r0, 0 - bne _081A4E70 - b _081A4FC4 -_081A4E70: - ldr r4, [sp, 0x14] - lsls r4, 2 - mov r9, r4 - ldr r0, [sp, 0x24] - lsls r0, 4 - str r0, [sp, 0x38] - ldr r1, [sp, 0x20] - lsls r1, 4 - str r1, [sp, 0x34] - ldr r2, [sp, 0x1C] - lsls r2, 24 - str r2, [sp, 0x3C] - ldr r3, [sp, 0x18] - adds r3, 0x1 - str r3, [sp, 0x2C] - ldr r0, [sp, 0x14] - add r0, r9 - lsls r0, 2 - mov r8, r0 -_081A4E96: - bl Random - adds r4, r0, 0 - bl Random - lsls r4, 16 - lsrs r7, r4, 16 - lsls r0, 16 - orrs r7, r0 - ldr r0, =0x0000ef2a - adds r1, r7, 0 - bl IsShinyOtIdPersonality - lsls r0, 24 - cmp r0, 0 - bne _081A4E96 - ldr r4, [sp, 0x38] - ldr r1, [sp, 0x24] - subs r0, r4, r1 - lsls r5, r0, 2 - mov r2, r8 - adds r4, r2, r5 - ldr r3, [sp, 0x34] - ldr r1, [sp, 0x20] - subs r0, r3, r1 - lsls r6, r0, 3 - adds r4, r6 - ldr r2, =gUnknown_0861156C - adds r4, r2 - adds r0, r7, 0 - bl GetNatureFromPersonality - ldrb r1, [r4, 0x5] - lsls r0, 24 - lsrs r0, 24 - cmp r1, r0 - bne _081A4E96 - ldr r4, [sp, 0x18] - movs r0, 0x64 - adds r3, r4, 0 - muls r3, r0 - mov r8, r3 - ldr r1, =gEnemyParty - add r1, r8 - mov r10, r1 - ldr r4, [sp, 0x14] - add r4, r9 - lsls r4, 2 - adds r0, r4, r5 - adds r0, r6 - ldr r2, =gUnknown_0861156C - adds r0, r2 - ldrh r1, [r0] - ldr r3, [sp, 0x3C] - lsrs r2, r3, 24 - ldrb r3, [r0, 0x4] - movs r0, 0x1 - str r0, [sp] - str r7, [sp, 0x4] - str r0, [sp, 0x8] - ldr r0, =0x0000ef2a - str r0, [sp, 0xC] - mov r0, r10 - bl CreateMon - ldr r0, =gUnknown_0861156C - adds r5, r0 - adds r5, r6, r5 - adds r4, r5, r4 - adds r4, 0x2 - mov r0, r10 - movs r1, 0xC - adds r2, r4, 0 - bl SetMonData - movs r7, 0 - mov r6, r8 - ldr r3, =gEnemyParty -_081A4F32: - adds r1, r7, 0 - adds r1, 0x1A - ldr r0, [sp, 0x14] - add r0, r9 - lsls r4, r0, 2 - adds r2, r5, r4 - adds r0, r7, 0x6 - adds r2, r0 - adds r0, r6, r3 - str r3, [sp, 0x40] - bl SetMonData - adds r7, 0x1 - ldr r3, [sp, 0x40] - cmp r7, 0x5 - ble _081A4F32 - movs r1, 0xFF - add r0, sp, 0x10 - strb r1, [r0] - movs r7, 0 - ldr r1, [sp, 0x18] - movs r2, 0x64 - adds r6, r1, 0 - muls r6, r2 - ldr r3, =gUnknown_08611578 - mov r8, r3 - ldr r3, =gEnemyParty - adds r5, r4, 0 -_081A4F6A: - ldr r4, [sp, 0x38] - ldr r0, [sp, 0x24] - subs r1, r4, r0 - lsls r1, 2 - adds r1, r5, r1 - ldr r2, [sp, 0x34] - ldr r4, [sp, 0x20] - subs r0, r2, r4 - lsls r0, 3 - adds r1, r0 - add r1, r8 - ldrh r4, [r1] - lsls r2, r7, 24 - lsrs r2, 24 - adds r0, r6, r3 - adds r1, r4, 0 - str r3, [sp, 0x40] - bl SetMonMoveSlot - ldr r3, [sp, 0x40] - cmp r4, 0xDA - bne _081A4F9C - movs r1, 0 - add r0, sp, 0x10 - strb r1, [r0] -_081A4F9C: - adds r5, 0x2 - adds r7, 0x1 - cmp r7, 0x3 - ble _081A4F6A - ldr r0, [sp, 0x18] - movs r1, 0x64 - adds r4, r0, 0 - muls r4, r1 - ldr r0, =gEnemyParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x20 - add r2, sp, 0x10 - bl SetMonData - adds r0, r4, 0 - bl CalculateMonStats - ldr r2, [sp, 0x2C] - str r2, [sp, 0x18] -_081A4FC4: - ldr r4, [sp, 0x30] - ldr r3, [sp, 0x28] - str r3, [sp, 0x14] - cmp r3, 0x2 - bgt _081A4FD0 - b _081A4E5C -_081A4FD0: - add sp, 0x44 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A4E04 - - thumb_func_start sub_81A4FF0 -sub_81A4FF0: @ 81A4FF0 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x000040cf - bl VarGet - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - bl sub_81A513C - ldr r3, =gUnknown_0861156C - lsls r2, r4, 2 - adds r2, r4 - lsls r1, r0, 4 - subs r1, r0 - adds r1, r2 - lsls r1, 2 - lsls r0, r5, 4 - subs r0, r5 - lsls r0, 3 - adds r1, r0 - adds r1, r3 - ldrh r0, [r1] - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A4FF0 - - thumb_func_start sub_81A5030 -sub_81A5030: @ 81A5030 - push {lr} - lsls r0, 24 - ldr r2, =gTrainerBattleOpponent_A - ldr r3, =0x000003fe - adds r1, r3, 0 - strh r1, [r2] - ldr r2, =0x00004010 - ldr r1, =gUnknown_08611C8C - lsrs r0, 23 - adds r0, r1 - ldrb r1, [r0] - adds r0, r2, 0 - bl VarSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5030 - - thumb_func_start sub_81A5060 -sub_81A5060: @ 81A5060 - push {r4-r6,lr} - adds r6, r0, 0 - adds r4, r1, 0 - lsls r6, 24 - lsrs r6, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x000040cf - bl VarGet - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - bl sub_81A513C - ldr r2, =gUnknown_0861156C - lsls r4, 1 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 2 - adds r4, r1 - lsls r1, r0, 4 - subs r1, r0 - lsls r1, 2 - adds r4, r1 - lsls r0, r5, 4 - subs r0, r5 - lsls r0, 3 - adds r4, r0 - adds r2, 0xC - adds r4, r2 - ldrh r0, [r4] - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A5060 - - thumb_func_start sub_81A50B0 -sub_81A50B0: @ 81A50B0 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x000040cf - bl VarGet - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - bl sub_81A513C - ldr r3, =gUnknown_0861156C - lsls r2, r4, 2 - adds r2, r4 - lsls r1, r0, 4 - subs r1, r0 - adds r1, r2 - lsls r1, 2 - lsls r0, r5, 4 - subs r0, r5 - lsls r0, 3 - adds r1, r0 - adds r1, r3 - ldrb r0, [r1, 0x5] - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A50B0 - - thumb_func_start sub_81A50F0 -sub_81A50F0: @ 81A50F0 - push {r4-r6,lr} - adds r6, r0, 0 - adds r4, r1, 0 - lsls r6, 24 - lsrs r6, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x000040cf - bl VarGet - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - bl sub_81A513C - ldr r2, =gUnknown_0861156C - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 2 - adds r4, r1 - lsls r1, r0, 4 - subs r1, r0 - lsls r1, 2 - adds r4, r1 - lsls r0, r5, 4 - subs r0, r5 - lsls r0, 3 - adds r4, r0 - adds r2, 0x6 - adds r4, r2 - ldrb r0, [r4] - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A50F0 - - thumb_func_start sub_81A513C -sub_81A513C: @ 81A513C - push {r4,r5,lr} - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r5, r0, 16 - lsls r0, r5, 24 - lsrs r0, 24 - bl sub_81A3B30 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bne _081A51A0 - bl sub_81A39C4 - lsls r0, 16 - ldr r3, =gUnknown_08611550 - lsls r2, r5, 2 - adds r1, r3, 0x3 - adds r1, r2, r1 - lsrs r0, 16 - ldrb r1, [r1] - adds r1, r0, r1 - adds r0, r2, r3 - ldrb r0, [r0] - cmp r1, r0 - bne _081A5180 - movs r4, 0 - b _081A51A0 - .pool -_081A5180: - adds r0, r3, 0x1 - adds r0, r2, r0 - ldrb r0, [r0] - cmp r1, r0 - beq _081A519E - cmp r1, r0 - ble _081A51A0 - subs r0, r1, r0 - adds r1, r3, 0x2 - adds r1, r2, r1 - ldrb r1, [r1] - bl __modsi3 - cmp r0, 0 - bne _081A51A0 -_081A519E: - movs r4, 0x1 -_081A51A0: - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81A513C - - thumb_func_start sub_81A51A8 -sub_81A51A8: @ 81A51A8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _081A51D4 - bl sub_8185EA0 - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8185EAC - lsls r0, 24 - lsrs r1, r0, 24 - b _081A51E4 - .pool -_081A51D4: - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r4, r0, 16 - bl sub_81A513C - adds r1, r0, 0 -_081A51E4: - cmp r5, 0 - beq _081A51F4 - cmp r5, 0x1 - beq _081A5214 - b _081A5228 - .pool -_081A51F4: - ldr r0, =gStringVar4 - ldr r2, =gUnknown_08611DB0 - lsls r1, 2 - adds r1, r2 - ldr r2, [r1] - lsls r1, r4, 2 - adds r1, r2 - ldr r1, [r1] - bl StringCopy - b _081A5228 - .pool -_081A5214: - ldr r0, =gStringVar4 - ldr r2, =gUnknown_08611DB8 - lsls r1, 2 - adds r1, r2 - ldr r2, [r1] - lsls r1, r4, 2 - adds r1, r2 - ldr r1, [r1] - bl StringCopy -_081A5228: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A51A8 - - thumb_func_start sub_81A5238 -sub_81A5238: @ 81A5238 - push {lr} - ldr r1, =gUnknown_08611F84 - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5238 - - thumb_func_start sub_81A5258 -sub_81A5258: @ 81A5258 - push {r4-r6,lr} - sub sp, 0x4 - adds r5, r0, 0 - movs r6, 0 - ldrb r0, [r5] - cmp r0, 0xA - bls _081A5268 - b _081A5544 -_081A5268: - lsls r0, 2 - ldr r1, =_081A5278 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A5278: - .4byte _081A52A4 - .4byte _081A52F4 - .4byte _081A531C - .4byte _081A53B4 - .4byte _081A540C - .4byte _081A542C - .4byte _081A544C - .4byte _081A5490 - .4byte _081A553E - .4byte _081A54D4 - .4byte _081A5520 -_081A52A4: - ldr r0, =0x7fffff1c - movs r1, 0 - str r1, [sp] - movs r1, 0x4 - movs r2, 0 - movs r3, 0x8 - bl BeginNormalPaletteFade - ldr r1, =0x00003f3e - movs r0, 0x48 - bl SetGpuReg - ldr r0, =gUnknown_08611F74 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_08D855E8 - movs r1, 0xF8 - lsls r1, 1 - movs r2, 0x20 - bl LoadCompressedPalette - ldr r1, =gUnknown_02022E24 - movs r0, 0xFF - strh r0, [r1] - ldr r1, =gUnknown_02022E26 - movs r0, 0x70 - strh r0, [r1] - b _081A553E - .pool -_081A52F4: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _081A5306 - b _081A5544 -_081A5306: - str r0, [sp] - movs r0, 0x5 - movs r1, 0 - movs r2, 0x18 - movs r3, 0xD - bl sub_8056A3C - b _081A553E - .pool -_081A531C: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _081A5328 - b _081A5544 -_081A5328: - ldr r1, =gBattleTextBuff1 - movs r2, 0xA1 - strb r2, [r1] - movs r0, 0xFF - strb r0, [r1, 0x1] - ldr r1, =gBattleTextBuff2 - strb r2, [r1] - movs r0, 0x1 - negs r0, r0 - strb r0, [r1, 0x1] - ldr r0, =gUnknown_085CCDB2 - bl StrCpyDecodeToDisplayedStringBattle - ldr r4, =gDisplayedStringBattle - adds r0, r4, 0 - movs r1, 0xF - bl battle_show_message_maybe - ldr r0, =gUnknown_085CCDB5 - movs r1, 0x10 - bl battle_show_message_maybe - ldr r0, =gUnknown_085CCDB8 - bl StrCpyDecodeToDisplayedStringBattle - adds r0, r4, 0 - movs r1, 0x11 - bl battle_show_message_maybe - ldr r0, =gUnknown_085CCDBB - movs r1, 0x12 - bl battle_show_message_maybe - ldr r0, =gUnknown_085CCDC0 - movs r1, 0x13 - bl battle_show_message_maybe - ldr r0, =gUnknown_085CCDC6 - movs r1, 0x14 - bl battle_show_message_maybe - ldr r0, =gUnknown_085CCDCB - bl StrCpyDecodeToDisplayedStringBattle - adds r0, r4, 0 - movs r1, 0x15 - bl battle_show_message_maybe - b _081A553E - .pool -_081A53B4: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _081A53C0 - b _081A5544 -_081A53C0: - ldr r1, =0x00003f3f - movs r0, 0x48 - bl SetGpuReg - movs r6, 0x80 - lsls r6, 15 - movs r4, 0x7 -_081A53CE: - asrs r1, r6, 16 - ldr r0, =gUnknown_08611F5C - movs r2, 0x54 - movs r3, 0 - bl CreateSprite - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - movs r1, 0x3 - bl StartSpriteAnim - movs r0, 0x80 - lsls r0, 13 - adds r6, r0 - subs r4, 0x1 - cmp r4, 0 - bge _081A53CE - b _081A553C - .pool -_081A540C: - ldr r0, =0x00000109 - bl PlaySE - movs r0, 0x50 - movs r1, 0x28 - movs r2, 0 - movs r3, 0 - bl sub_81A5558 - movs r0, 0xA0 - movs r1, 0x28 - movs r2, 0 - b _081A5464 - .pool -_081A542C: - ldr r0, =0x00000109 - bl PlaySE - movs r0, 0x50 - movs r1, 0x38 - movs r2, 0x1 - movs r3, 0 - bl sub_81A5558 - movs r0, 0xA0 - movs r1, 0x38 - movs r2, 0x1 - b _081A5464 - .pool -_081A544C: - ldr r0, =0x00000109 - bl PlaySE - movs r0, 0x50 - movs r1, 0x48 - movs r2, 0x2 - movs r3, 0 - bl sub_81A5558 - movs r0, 0xA0 - movs r1, 0x48 - movs r2, 0x2 -_081A5464: - movs r3, 0x1 - bl sub_81A5558 - ldr r0, =gUnknown_085CCDCB - bl StrCpyDecodeToDisplayedStringBattle - ldr r0, =gDisplayedStringBattle - movs r1, 0x15 - bl battle_show_message_maybe - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - movs r6, 0x1 - b _081A5544 - .pool -_081A5490: - movs r0, 0x85 - lsls r0, 1 - bl PlaySE - ldr r0, =gBattleTextBuff1 - ldr r1, =gBattleTextBuff2 - ldrb r2, [r0] - ldrb r0, [r1] - cmp r2, r0 - bls _081A54BC - movs r6, 0x2 - ldr r1, =gBattleScripting - movs r0, 0 - strb r0, [r1, 0x17] - b _081A553E - .pool -_081A54BC: - cmp r2, r0 - bcs _081A54D0 - movs r6, 0x3 - ldr r1, =gBattleScripting - movs r0, 0x1 - strb r0, [r1, 0x17] - b _081A553E - .pool -_081A54D0: - movs r6, 0x4 - b _081A553E -_081A54D4: - ldr r1, =0x00003f3e - movs r0, 0x48 - bl SetGpuReg - movs r0, 0x1 - str r0, [sp] - movs r0, 0x5 - movs r1, 0 - movs r2, 0x18 - movs r3, 0xD - bl sub_8056A3C - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r0, =gMPlay_BGM - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl m4aMPlayVolumeControl - ldr r0, =0x7fffff1c - movs r1, 0 - str r1, [sp] - movs r1, 0x4 - movs r2, 0x8 - movs r3, 0 - bl BeginNormalPaletteFade - b _081A553E - .pool -_081A5520: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081A5544 - ldr r1, =0x00003f3f - movs r0, 0x48 - bl SetGpuReg - movs r0, 0xFA - lsls r0, 2 - bl FreeSpriteTilesByTag -_081A553C: - movs r6, 0x1 -_081A553E: - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] -_081A5544: - adds r0, r6, 0 - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A5258 - - thumb_func_start sub_81A5558 -sub_81A5558: @ 81A5558 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - lsls r3, 24 - lsrs r7, r3, 24 - movs r6, 0 - movs r1, 0 - ldr r0, =gBattleStruct - ldr r0, [r0] - movs r3, 0xA6 - lsls r3, 2 - adds r4, r0, r3 - ldr r5, =0x0000029a - adds r3, r0, r5 - adds r5, 0x2 - adds r5, r0 - mov r8, r5 - cmp r2, 0x1 - beq _081A55C4 - cmp r2, 0x1 - bgt _081A55A8 - cmp r2, 0 - beq _081A55B0 - b _081A5612 - .pool -_081A55A8: - mov r0, r9 - cmp r0, 0x2 - beq _081A55D8 - b _081A5612 -_081A55B0: - adds r0, r4, r7 - movs r6, 0 - ldrsb r6, [r0, r6] - movs r1, 0x1 - adds r0, r7, 0 - eors r0, r1 - adds r0, r4, r0 - movs r1, 0 - ldrsb r1, [r0, r1] - b _081A5612 -_081A55C4: - adds r0, r3, r7 - movs r6, 0 - ldrsb r6, [r0, r6] - movs r1, 0x1 - adds r0, r7, 0 - eors r0, r1 - adds r0, r3, r0 - movs r1, 0 - ldrsb r1, [r0, r1] - b _081A5612 -_081A55D8: - ldr r3, =gBattleMons - mov r9, r3 - movs r5, 0x58 - adds r0, r7, 0 - muls r0, r5 - add r0, r9 - ldrh r0, [r0, 0x28] - movs r4, 0x64 - muls r0, r4 - lsls r1, r7, 1 - add r1, r8 - ldrh r1, [r1] - bl __divsi3 - adds r6, r0, 0 - movs r0, 0x1 - adds r1, r7, 0 - eors r1, r0 - adds r0, r1, 0 - muls r0, r5 - add r0, r9 - ldrh r0, [r0, 0x28] - muls r0, r4 - lsls r1, 1 - add r1, r8 - ldrh r1, [r1] - bl __divsi3 - adds r1, r0, 0 -_081A5612: - cmp r6, r1 - ble _081A5638 - movs r4, 0x2 - cmp r7, 0 - beq _081A5628 - ldr r1, =gBattleTextBuff2 - b _081A562A - .pool -_081A5628: - ldr r1, =gBattleTextBuff1 -_081A562A: - ldrb r0, [r1] - adds r0, 0x2 - strb r0, [r1] - b _081A565E - .pool -_081A5638: - cmp r6, r1 - bne _081A565C - movs r4, 0x1 - cmp r7, 0 - beq _081A564C - ldr r1, =gBattleTextBuff2 - b _081A564E - .pool -_081A564C: - ldr r1, =gBattleTextBuff1 -_081A564E: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _081A565E - .pool -_081A565C: - movs r4, 0 -_081A565E: - ldr r0, =gUnknown_08611F5C - ldr r1, [sp] - mov r2, r10 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - adds r1, r4, 0 - bl StartSpriteAnim - 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_81A5558 - - thumb_func_start sub_81A5698 -sub_81A5698: @ 81A5698 - push {lr} - adds r1, r0, 0 - ldr r0, =gBattleCommunication - ldrb r0, [r0] - cmp r0, 0x8 - bls _081A56AA - adds r0, r1, 0 - bl DestroySprite -_081A56AA: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5698 - - thumb_func_start sub_81A56B4 -sub_81A56B4: @ 81A56B4 - ldr r0, =gBattleStruct - ldr r2, [r0] - movs r0, 0xA6 - lsls r0, 2 - adds r1, r2, r0 - adds r0, 0x2 - adds r3, r2, r0 - adds r0, 0x2 - adds r2, r0 - movs r0, 0 - strb r0, [r1] - strb r0, [r1, 0x1] - strb r0, [r3] - strb r0, [r3, 0x1] - ldr r0, =gBattleMons - ldrh r1, [r0, 0x28] - strh r1, [r2] - adds r0, 0x80 - ldrh r0, [r0] - strh r0, [r2, 0x2] - bx lr - .pool - thumb_func_end sub_81A56B4 - - thumb_func_start sub_81A56E8 -sub_81A56E8: @ 81A56E8 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gBattleStruct - ldr r1, [r1] - movs r2, 0xA6 - lsls r2, 2 - adds r1, r2 - adds r1, r0 - ldr r2, =gBattleArenaMoveMindRatings - ldr r0, =gCurrentMove - ldrh r0, [r0] - adds r0, r2 - ldrb r0, [r0] - ldrb r2, [r1] - adds r0, r2 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_81A56E8 - - thumb_func_start sub_81A5718 -sub_81A5718: @ 81A5718 - push {r4-r6,lr} - lsls r0, 24 - lsrs r3, r0, 24 - adds r6, r3, 0 - ldr r0, =gBattleStruct - ldr r2, [r0] - ldr r0, =0x0000029a - adds r5, r2, r0 - ldr r0, =gHitMarker - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 18 - ands r0, r1 - cmp r0, 0 - beq _081A57DA - ldr r0, =0x000002a2 - adds r4, r2, r0 - ldrb r2, [r4] - ldr r0, =gBitTable - lsls r1, r3, 2 - adds r1, r0 - ldr r1, [r1] - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _081A576C - bics r2, r1 - strb r2, [r4] - adds r1, r5, r3 - ldrb r0, [r1] - subs r0, 0x2 - b _081A57D8 - .pool -_081A576C: - ldr r0, =gBattleMoveFlags - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _081A5798 - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081A5788 - ldr r0, =gBattleCommunication - ldrb r0, [r0, 0x6] - cmp r0, 0x1 - beq _081A57DA -_081A5788: - adds r1, r5, r3 - ldrb r0, [r1] - subs r0, 0x2 - b _081A57D8 - .pool -_081A5798: - movs r0, 0x6 - ands r0, r1 - cmp r0, 0x6 - bne _081A57A4 - adds r1, r5, r3 - b _081A57D4 -_081A57A4: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081A57B4 - adds r1, r5, r3 - ldrb r0, [r1] - adds r0, 0x2 - b _081A57D8 -_081A57B4: - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _081A57C4 - adds r1, r5, r3 - ldrb r0, [r1] - subs r0, 0x1 - b _081A57D8 -_081A57C4: - ldr r0, =gProtectStructs - lsls r1, r6, 4 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 31 - cmp r0, 0 - bne _081A57DA - adds r1, r5, r6 -_081A57D4: - ldrb r0, [r1] - adds r0, 0x1 -_081A57D8: - strb r0, [r1] -_081A57DA: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5718 - - thumb_func_start sub_81A57E4 -sub_81A57E4: @ 81A57E4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 16 - lsrs r1, 16 - adds r2, r1, 0 - ldr r0, =gBattleStruct - ldr r0, [r0] - ldr r5, =0x0000029a - adds r3, r0, r5 - movs r0, 0x99 - lsls r0, 1 - cmp r1, r0 - bgt _081A582A - subs r0, 0x1 - cmp r1, r0 - bge _081A585C - cmp r1, 0xC5 - bgt _081A581C - cmp r1, 0xC3 - bge _081A585C - cmp r1, 0x77 - beq _081A585C - b _081A5864 - .pool -_081A581C: - cmp r1, 0xC7 - blt _081A5864 - cmp r1, 0xCC - ble _081A585C - cmp r1, 0xCE - beq _081A585C - b _081A5864 -_081A582A: - ldr r0, =0x00000147 - cmp r1, r0 - beq _081A585C - cmp r1, r0 - bgt _081A5848 - subs r0, 0x12 - cmp r1, r0 - beq _081A585C - adds r0, 0x2 - cmp r1, r0 - beq _081A585C - b _081A5864 - .pool -_081A5848: - movs r0, 0xAD - lsls r0, 1 - cmp r2, r0 - blt _081A5864 - adds r0, 0x1 - cmp r2, r0 - ble _081A585C - adds r0, 0x3 - cmp r2, r0 - bne _081A5864 -_081A585C: - adds r1, r3, r4 - ldrb r0, [r1] - subs r0, 0x3 - strb r0, [r1] -_081A5864: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81A57E4 - - thumb_func_start sub_81A586C -sub_81A586C: @ 81A586C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gBattleStruct - ldr r3, [r1] - movs r1, 0xA7 - lsls r1, 2 - adds r3, r1 - lsls r2, r0, 1 - adds r2, r3 - ldr r5, =gBattleMons - movs r4, 0x58 - adds r1, r0, 0 - muls r1, r4 - adds r1, r5 - ldrh r1, [r1, 0x28] - strh r1, [r2] - movs r1, 0x1 - eors r0, r1 - lsls r1, r0, 1 - adds r1, r3 - muls r0, r4 - adds r0, r5 - ldrh r2, [r0, 0x28] - ldrh r0, [r1] - cmp r0, r2 - bls _081A58A4 - strh r2, [r1] -_081A58A4: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A586C - - thumb_func_start sub_81A58B4 -sub_81A58B4: @ 81A58B4 - push {r4-r6,lr} - ldr r4, =gSaveBlock2Ptr - ldr r1, [r4] - ldr r3, =0x00000ca9 - adds r0, r1, r3 - ldrb r0, [r0] - lsls r0, 30 - lsrs r5, r0, 30 - ldr r0, =0x00000ca8 - adds r1, r0 - movs r2, 0 - strb r2, [r1] - ldr r1, [r4] - ldr r6, =0x00000cb2 - adds r0, r1, r6 - strh r2, [r0] - adds r1, r3 - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r4] - adds r1, r3 - ldrb r2, [r1] - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - cmp r5, 0 - beq _081A5914 - ldr r0, [r4] - ldr r1, =0x00000cdc - adds r0, r1 - ldr r2, [r0] - movs r0, 0x80 - b _081A591E - .pool -_081A5914: - ldr r0, [r4] - ldr r3, =0x00000cdc - adds r0, r3 - ldr r2, [r0] - movs r0, 0x40 -_081A591E: - ands r2, r0 - cmp r2, 0 - bne _081A5930 - ldr r0, [r4] - lsls r1, r5, 1 - ldr r6, =0x00000dda - adds r0, r6 - adds r0, r1 - strh r2, [r0] -_081A5930: - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0x4 - ldrsb r1, [r0, r1] - movs r2, 0x5 - ldrsb r2, [r0, r2] - movs r3, 0x1 - negs r3, r3 - movs r0, 0 - bl saved_warp2_set - ldr r1, =gTrainerBattleOpponent_A - movs r0, 0 - strh r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A58B4 - - thumb_func_start sub_81A5964 -sub_81A5964: @ 81A5964 - push {r4,lr} - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r1, =0x00000ca9 - adds r0, r3, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r1, r0, 30 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x1 - beq _081A59B0 - cmp r0, 0x1 - bgt _081A5994 - cmp r0, 0 - beq _081A599A - b _081A59EE - .pool -_081A5994: - cmp r0, 0x2 - beq _081A59C8 - b _081A59EE -_081A599A: - ldr r0, =gScriptResult - ldr r2, =0x00000dd8 - adds r1, r3, r2 - ldrh r1, [r1] - strh r1, [r0] - b _081A59EE - .pool -_081A59B0: - ldr r2, =gScriptResult - lsls r1, 1 - ldr r4, =0x00000dda - adds r0, r3, r4 - adds r0, r1 - ldrh r0, [r0] - b _081A59EC - .pool -_081A59C8: - cmp r1, 0 - beq _081A59E0 - ldr r2, =gScriptResult - ldr r1, =0x00000cdc - adds r0, r3, r1 - ldr r0, [r0] - movs r1, 0x80 - b _081A59EA - .pool -_081A59E0: - ldr r2, =gScriptResult - ldr r4, =0x00000cdc - adds r0, r3, r4 - ldr r0, [r0] - movs r1, 0x40 -_081A59EA: - ands r0, r1 -_081A59EC: - strh r0, [r2] -_081A59EE: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5964 - - thumb_func_start sub_81A59FC -sub_81A59FC: @ 81A59FC - push {lr} - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r1, =0x00000ca9 - adds r0, r2, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r1, r0, 30 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x1 - beq _081A5A48 - cmp r0, 0x1 - bgt _081A5A2C - cmp r0, 0 - beq _081A5A32 - b _081A5ABA - .pool -_081A5A2C: - cmp r0, 0x2 - beq _081A5A60 - b _081A5ABA -_081A5A32: - ldr r0, =gSpecialVar_0x8006 - ldrh r1, [r0] - ldr r3, =0x00000dd8 - adds r0, r2, r3 - strh r1, [r0] - b _081A5ABA - .pool -_081A5A48: - lsls r1, 1 - ldr r3, =0x00000dda - adds r0, r2, r3 - adds r0, r1 - ldr r1, =gSpecialVar_0x8006 - ldrh r1, [r1] - strh r1, [r0] - b _081A5ABA - .pool -_081A5A60: - cmp r1, 0 - beq _081A5A90 - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - cmp r0, 0 - beq _081A5A80 - ldr r1, =0x00000cdc - adds r0, r2, r1 - ldr r1, [r0] - movs r2, 0x80 - orrs r1, r2 - b _081A5AB8 - .pool -_081A5A80: - ldr r3, =0x00000cdc - adds r0, r2, r3 - ldr r1, [r0] - movs r2, 0x81 - negs r2, r2 - b _081A5AB6 - .pool -_081A5A90: - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - cmp r0, 0 - beq _081A5AAC - ldr r1, =0x00000cdc - adds r0, r2, r1 - ldr r1, [r0] - movs r2, 0x40 - orrs r1, r2 - b _081A5AB8 - .pool -_081A5AAC: - ldr r3, =0x00000cdc - adds r0, r2, r3 - ldr r1, [r0] - movs r2, 0x41 - negs r2, r2 -_081A5AB6: - ands r1, r2 -_081A5AB8: - str r1, [r0] -_081A5ABA: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A59FC - - thumb_func_start sub_81A5AC4 -sub_81A5AC4: @ 81A5AC4 - push {r4,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - strb r1, [r0] - movs r0, 0x80 - lsls r0, 7 - movs r1, 0 - bl VarSet - ldr r1, [r4] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - bl sub_81A4C30 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5AC4 - - thumb_func_start sub_81A5B08 -sub_81A5B08: @ 81A5B08 - push {r4,r5,lr} - ldr r4, =gSaveBlock2Ptr - ldr r1, [r4] - ldr r2, =0x00000ca9 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 29 - ldr r2, =0x00000dda - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0x29 - bls _081A5B58 - bl Random - ldr r4, [r4] - ldr r5, =gUnknown_08611FAC - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x9 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 15 - adds r0, r5 - ldrh r0, [r0] - ldr r1, =0x00000dd8 - adds r4, r1 - b _081A5B76 - .pool -_081A5B58: - bl Random - ldr r4, [r4] - ldr r5, =gUnknown_08611FA0 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x6 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 15 - adds r0, r5 - ldrh r0, [r0] - ldr r2, =0x00000dd8 - adds r4, r2 -_081A5B76: - strh r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5B08 - - thumb_func_start sub_81A5B88 -sub_81A5B88: @ 81A5B88 - push {r4,r5,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000dd8 - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x1 - bl AddBagItem - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bne _081A5BD0 - ldr r0, [r4] - ldr r1, =0x00000dd8 - adds r0, r1 - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r0, [r4] - ldr r1, =0x00000dd8 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - ldr r0, =gScriptResult - strh r5, [r0] - b _081A5BD6 - .pool -_081A5BD0: - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] -_081A5BD6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5B88 - - thumb_func_start sub_81A5BE0 -sub_81A5BE0: @ 81A5BE0 - push {lr} - ldr r0, =gStringVar1 - ldr r1, =gTrainerBattleOpponent_A - ldrh r1, [r1] - bl GetFrontierTrainerName - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5BE0 - - thumb_func_start sub_81A5BF8 -sub_81A5BF8: @ 81A5BF8 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0xC - movs r0, 0x1B - mov r8, r0 - movs r5, 0x7 - movs r4, 0x1 - str r4, [sp] - movs r6, 0x6 - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0xFE - movs r3, 0xE - bl FillBgTilemapBufferRect - str r4, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0x20 - movs r3, 0xE - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x31 - movs r2, 0 - movs r3, 0xE - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x33 - movs r2, 0x1 - movs r3, 0xE - bl FillBgTilemapBufferRect - mov r0, r8 - str r0, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x34 - movs r2, 0x2 - movs r3, 0xE - bl FillBgTilemapBufferRect - movs r0, 0x1C - mov r8, r0 - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x35 - movs r2, 0x1C - movs r3, 0xE - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x36 - movs r2, 0x1D - movs r3, 0xE - bl FillBgTilemapBufferRect - str r4, [sp] - movs r6, 0x5 - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x37 - movs r2, 0 - movs r3, 0xF - bl FillBgTilemapBufferRect - mov r0, r8 - str r0, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x39 - movs r2, 0x1 - movs r3, 0xF - bl FillBgTilemapBufferRect - str r4, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x3A - movs r2, 0x1D - movs r3, 0xF - bl FillBgTilemapBufferRect - ldr r1, =0x00000831 - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r2, 0 - movs r3, 0x13 - bl FillBgTilemapBufferRect - ldr r1, =0x00000833 - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r2, 0x1 - movs r3, 0x13 - bl FillBgTilemapBufferRect - ldr r1, =0x00000834 - movs r0, 0x1A - str r0, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r2, 0x2 - movs r3, 0x13 - bl FillBgTilemapBufferRect - ldr r1, =0x00000835 - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r2, 0x1C - movs r3, 0x13 - bl FillBgTilemapBufferRect - ldr r1, =0x00000836 - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r2, 0x1D - movs r3, 0x13 - bl FillBgTilemapBufferRect - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5BF8 - - thumb_func_start sub_81A5D44 -sub_81A5D44: @ 81A5D44 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0xC - movs r5, 0 - movs r4, 0x1 - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x3 - movs r2, 0 - movs r3, 0xE - bl FillBgTilemapBufferRect - movs r6, 0x4 - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x4 - movs r2, 0x1 - movs r3, 0xE - bl FillBgTilemapBufferRect - movs r0, 0x1B - mov r8, r0 - str r0, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x5 - movs r2, 0x2 - movs r3, 0xE - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x6 - movs r2, 0x1C - movs r3, 0xE - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x7 - movs r2, 0x1D - movs r3, 0xE - bl FillBgTilemapBufferRect - str r4, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x8 - movs r2, 0 - movs r3, 0xF - bl FillBgTilemapBufferRect - str r4, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x9 - movs r2, 0x1 - movs r3, 0xF - bl FillBgTilemapBufferRect - mov r0, r8 - str r0, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0xA - movs r2, 0x2 - movs r3, 0xF - bl FillBgTilemapBufferRect - str r4, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0xB - movs r2, 0x1C - movs r3, 0xF - bl FillBgTilemapBufferRect - str r4, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0xC - movs r2, 0x1D - movs r3, 0xF - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0xD - movs r2, 0 - movs r3, 0x13 - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0xE - movs r2, 0x1 - movs r3, 0x13 - bl FillBgTilemapBufferRect - mov r0, r8 - str r0, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0xF - movs r2, 0x2 - movs r3, 0x13 - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x10 - movs r2, 0x1C - movs r3, 0x13 - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x11 - movs r2, 0x1D - movs r3, 0x13 - bl FillBgTilemapBufferRect - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81A5D44 - - thumb_func_start sub_81A5E74 -sub_81A5E74: @ 81A5E74 - push {lr} - ldr r1, =gUnknown_08612120 - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5E74 - - thumb_func_start sub_81A5E94 -sub_81A5E94: @ 81A5E94 - push {r4-r7,lr} - ldr r5, =gSaveBlock2Ptr - ldr r0, [r5] - ldr r4, =0x00000ca9 - adds r0, r4 - ldrb r0, [r0] - lsls r0, 30 - lsrs r7, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, [r5] - ldr r1, =0x00000ca8 - adds r0, r1 - movs r2, 0 - strb r2, [r0] - ldr r1, [r5] - ldr r3, =0x00000cb2 - adds r0, r1, r3 - strh r2, [r0] - adds r1, r4 - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r5] - adds r1, r4 - ldrb r2, [r1] - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r4, [r5] - ldr r0, =0x00000cdc - adds r3, r4, r0 - ldr r2, =gUnknown_08612164 - lsls r0, r7, 2 - lsls r1, r6, 3 - adds r0, r1 - adds r0, r2 - ldr r3, [r3] - ldr r0, [r0] - ands r3, r0 - cmp r3, 0 - bne _081A5F0A - lsls r1, r7, 1 - lsls r0, r6, 2 - adds r1, r0 - ldr r2, =0x00000de2 - adds r0, r4, r2 - adds r0, r1 - strh r3, [r0] - adds r2, 0x10 - adds r0, r4, r2 - adds r0, r1 - strh r3, [r0] -_081A5F0A: - ldr r1, =gUnknown_03001288 - movs r0, 0 - strb r0, [r1] - movs r2, 0 - ldr r6, =gSaveBlock1Ptr - movs r4, 0xE7 - lsls r4, 4 - ldr r0, =0x0000ffff - adds r3, r0, 0 -_081A5F1C: - ldr r1, [r5] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r1, r0 - adds r1, r4 - ldrh r0, [r1] - orrs r0, r3 - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x5 - bls _081A5F1C - movs r2, 0 - ldr r4, =gUnknown_03006298 - ldr r1, =0x0000ffff - adds r3, r1, 0 -_081A5F40: - lsls r0, r2, 1 - adds r0, r4 - ldrh r1, [r0] - orrs r1, r3 - strh r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x2 - bls _081A5F40 - ldr r0, [r6] - movs r1, 0x4 - ldrsb r1, [r0, r1] - movs r2, 0x5 - ldrsb r2, [r0, r2] - movs r3, 0x1 - negs r3, r3 - movs r0, 0 - bl saved_warp2_set - ldr r1, =gTrainerBattleOpponent_A - movs r0, 0 - strh r0, [r1] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5E94 - - thumb_func_start sub_81A5FA8 -sub_81A5FA8: @ 81A5FA8 - push {r4-r7,lr} - ldr r7, =gSaveBlock2Ptr - ldr r0, [r7] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r6, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x2 - beq _081A6000 - cmp r0, 0x2 - bgt _081A5FE4 - cmp r0, 0x1 - beq _081A5FEA - b _081A6044 - .pool -_081A5FE4: - cmp r0, 0x3 - beq _081A6030 - b _081A6044 -_081A5FEA: - ldr r3, =gScriptResult - ldr r0, [r7] - lsls r1, r6, 1 - lsls r2, r5, 2 - adds r1, r2 - ldr r2, =0x00000de2 - b _081A603C - .pool -_081A6000: - ldr r4, =gScriptResult - ldr r2, [r7] - ldr r0, =0x00000cdc - adds r2, r0 - ldr r3, =gUnknown_08612164 - lsls r0, r6, 2 - lsls r1, r5, 3 - adds r0, r1 - adds r0, r3 - ldr r1, [r2] - ldr r0, [r0] - ands r1, r0 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - strh r0, [r4] - b _081A6044 - .pool -_081A6030: - ldr r3, =gScriptResult - ldr r0, [r7] - lsls r1, r6, 1 - lsls r2, r5, 2 - adds r1, r2 - ldr r2, =0x00000df2 -_081A603C: - adds r0, r2 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r3] -_081A6044: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5FA8 - - thumb_func_start sub_81A6054 -sub_81A6054: @ 81A6054 - push {r4-r6,lr} - ldr r6, =gSaveBlock2Ptr - ldr r0, [r6] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r5, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x2 - beq _081A60B4 - cmp r0, 0x2 - bgt _081A6090 - cmp r0, 0x1 - beq _081A6096 - b _081A6128 - .pool -_081A6090: - cmp r0, 0x3 - beq _081A6108 - b _081A6128 -_081A6096: - ldr r2, [r6] - lsls r0, r5, 1 - lsls r1, r4, 2 - adds r0, r1 - ldr r1, =0x00000de2 - adds r2, r1 - adds r2, r0 - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - strh r0, [r2] - b _081A6128 - .pool -_081A60B4: - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - cmp r0, 0 - beq _081A60E4 - ldr r2, [r6] - ldr r0, =0x00000cdc - adds r2, r0 - ldr r3, =gUnknown_08612164 - lsls r1, r5, 2 - lsls r0, r4, 3 - adds r1, r0 - adds r1, r3 - ldr r0, [r2] - ldr r1, [r1] - orrs r0, r1 - str r0, [r2] - b _081A6128 - .pool -_081A60E4: - ldr r2, [r6] - ldr r1, =0x00000cdc - adds r2, r1 - ldr r3, =gUnknown_08612174 - lsls r1, r5, 2 - lsls r0, r4, 3 - adds r1, r0 - adds r1, r3 - ldr r0, [r2] - ldr r1, [r1] - ands r0, r1 - str r0, [r2] - b _081A6128 - .pool -_081A6108: - ldr r3, =gUnknown_03001288 - ldrb r0, [r3] - cmp r0, 0x1 - bne _081A6128 - ldr r2, [r6] - lsls r0, r5, 1 - lsls r1, r4, 2 - adds r0, r1 - ldr r1, =0x00000df2 - adds r2, r1 - adds r2, r0 - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - movs r1, 0 - strh r0, [r2] - strb r1, [r3] -_081A6128: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A6054 - - thumb_func_start sub_81A613C -sub_81A613C: @ 81A613C - push {r4,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - strb r1, [r0] - movs r0, 0x80 - lsls r0, 7 - movs r1, 0 - bl VarSet - ldr r1, [r4] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - bl sub_81A4C30 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A613C - - thumb_func_start nullsub_75 -nullsub_75: @ 81A6180 - bx lr - thumb_func_end nullsub_75 - - thumb_func_start nullsub_123 -nullsub_123: @ 81A6184 - bx lr - thumb_func_end nullsub_123 - - thumb_func_start sub_81A6188 -sub_81A6188: @ 81A6188 - push {lr} - bl ZeroPlayerPartyMons - bl sub_819A4F8 - pop {r0} - bx r0 - thumb_func_end sub_81A6188 - - thumb_func_start sub_81A6198 -sub_81A6198: @ 81A6198 - push {lr} - bl sub_819DC00 - pop {r0} - bx r0 - thumb_func_end sub_81A6198 - - thumb_func_start sub_81A61A4 -sub_81A61A4: @ 81A61A4 - ldr r1, =gUnknown_03001288 - movs r0, 0x1 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_81A61A4 - - thumb_func_start sub_81A61B0 -sub_81A61B0: @ 81A61B0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x28 - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - str r0, [sp, 0x10] - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - ldr r1, [r4] - ldr r3, [sp, 0x10] - lsls r2, r3, 1 - lsrs r0, 14 - adds r2, r0 - ldr r6, =0x00000de2 - adds r1, r6 - adds r1, r2 - ldrh r0, [r1] - movs r1, 0x7 - bl __udivsi3 - ldr r2, =gUnknown_0203BC88 - ldr r1, =gBattleFrontierTrainers - str r1, [r2] - ldr r5, =0x00000cb2 - lsls r0, 24 - str r0, [sp, 0x20] - mov r8, r0 -_081A61FA: - ldr r0, [r4] - adds r0, r5 - ldrb r1, [r0] - mov r2, r8 - lsrs r0, r2, 24 - bl sub_8162548 - lsls r0, 16 - lsrs r3, r0, 16 - movs r7, 0 - ldr r1, [r4] - adds r0, r1, r5 - ldr r6, [sp, 0x10] - lsls r6, 24 - str r6, [sp, 0x1C] - ldrh r0, [r0] - cmp r7, r0 - bge _081A6244 - ldr r2, =0x00000cb4 - adds r0, r1, r2 - ldrh r0, [r0] - ldr r6, =gSaveBlock2Ptr - cmp r0, r3 - beq _081A6244 - ldr r1, [r6] - ldr r6, =0x00000cb2 - adds r0, r1, r6 - ldrh r2, [r0] - ldr r0, =0x00000cb4 - adds r1, r0 -_081A6236: - adds r1, 0x2 - adds r7, 0x1 - cmp r7, r2 - bge _081A6244 - ldrh r0, [r1] - cmp r0, r3 - bne _081A6236 -_081A6244: - ldr r0, [r4] - ldr r1, =0x00000cb2 - adds r0, r1 - ldr r6, =gSaveBlock2Ptr - ldrh r0, [r0] - cmp r7, r0 - bne _081A61FA - ldr r0, =gTrainerBattleOpponent_A - strh r3, [r0] - ldr r2, [r6] - adds r1, r2, r1 - ldrh r0, [r1] - cmp r0, 0x5 - bhi _081A626C - adds r1, r0, 0 - lsls r1, 1 - ldr r4, =0x00000cb4 - adds r0, r2, r4 - adds r0, r1 - strh r3, [r0] -_081A626C: - movs r7, 0 - mov r10, sp - movs r6, 0 - lsls r6, 1 - str r6, [sp, 0x14] - add r6, sp - str r6, [sp, 0x18] -_081A627A: - ldr r1, [sp, 0x1C] - lsrs r0, r1, 24 - ldr r2, [sp, 0x20] - lsrs r1, r2, 24 - movs r2, 0 - bl sub_81A6EF0 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - ldr r4, =gUnknown_0203BC8C - ldr r2, [r4] - lsls r1, r0, 4 - adds r0, r1, r2 - ldrh r0, [r0] - cmp r0, 0xC9 - beq _081A636E - movs r3, 0 - ldr r6, =gSaveBlock2Ptr - mov r8, r1 - adds r5, r0, 0 - ldr r1, [r6] -_081A62A6: - movs r4, 0xE7 - lsls r4, 4 - adds r0, r1, r4 - ldrh r0, [r0] - lsls r0, 4 - adds r0, r2 - ldrh r0, [r0] - cmp r5, r0 - beq _081A62C0 - adds r1, 0xC - adds r3, 0x1 - cmp r3, 0x5 - ble _081A62A6 -_081A62C0: - cmp r3, 0x6 - bne _081A636E - ldr r6, [sp, 0x10] - cmp r6, 0 - bne _081A62D0 - ldr r0, =0x00000351 - cmp r9, r0 - bhi _081A636E -_081A62D0: - movs r2, 0 - adds r4, r2, r7 - cmp r2, r4 - bge _081A6302 - ldr r1, [sp, 0x18] - ldrh r0, [r1] - cmp r0, r5 - beq _081A6302 - adds r6, r4, 0 - ldr r3, =gUnknown_0203BC8C - mov r12, r3 - mov r5, r8 - ldr r3, [sp, 0x14] - add r3, sp -_081A62EC: - adds r3, 0x2 - adds r2, 0x1 - cmp r2, r6 - bge _081A6302 - mov r1, r12 - ldr r0, [r1] - adds r0, r5, r0 - ldrh r1, [r3] - ldrh r0, [r0] - cmp r1, r0 - bne _081A62EC -_081A6302: - cmp r2, r4 - bne _081A636E - movs r2, 0 - cmp r2, r4 - bge _081A633E - ldr r3, =gBattleFrontierHeldItems - mov r12, r3 - add r0, sp, 0x8 - ldr r6, [sp, 0x14] - adds r3, r0, r6 - mov r0, r8 - str r0, [sp, 0x24] - adds r5, r4, 0 -_081A631C: - ldrh r1, [r3] - cmp r1, 0 - beq _081A6336 - ldr r6, =gUnknown_0203BC8C - ldr r0, [r6] - ldr r6, [sp, 0x24] - adds r0, r6, r0 - ldrb r0, [r0, 0xA] - lsls r0, 1 - add r0, r12 - ldrh r0, [r0] - cmp r1, r0 - beq _081A633E -_081A6336: - adds r3, 0x2 - adds r2, 0x1 - cmp r2, r5 - blt _081A631C -_081A633E: - cmp r2, r4 - bne _081A636E - lsls r4, r7, 1 - ldr r0, =gUnknown_0203BC8C - ldr r1, [r0] - add r1, r8 - ldrh r0, [r1] - mov r2, r10 - strh r0, [r2] - add r2, sp, 0x8 - adds r2, r4 - ldr r3, =gBattleFrontierHeldItems - ldrb r0, [r1, 0xA] - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - strh r0, [r2] - ldr r0, =gUnknown_03006298 - adds r4, r0 - mov r3, r9 - strh r3, [r4] - movs r4, 0x2 - add r10, r4 - adds r7, 0x1 -_081A636E: - cmp r7, 0x3 - bne _081A627A - add sp, 0x28 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A61B0 - - thumb_func_start sub_81A63B8 -sub_81A63B8: @ 81A63B8 - push {lr} - ldr r0, =gTrainerBattleOpponent_A - ldrh r0, [r0] - movs r1, 0 - bl sub_8162614 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A63B8 - - thumb_func_start sub_81A63CC -sub_81A63CC: @ 81A63CC - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x2 - beq _081A63FC - ldr r1, =gUnknown_0203BC8C - ldr r0, =gBattleFrontierMons - b _081A6400 - .pool -_081A63FC: - ldr r1, =gUnknown_0203BC8C - ldr r0, =gSlateportBattleTentMons -_081A6400: - str r0, [r1] - movs r7, 0 - ldr r2, =gSaveBlock2Ptr - mov r8, r2 -_081A6408: - mov r0, r8 - ldr r1, [r0] - adds r0, r7, 0x3 - lsls r4, r0, 1 - adds r4, r0 - lsls r4, 2 - adds r1, r4 - ldr r0, =gUnknown_03006298 - lsls r6, r7, 1 - adds r6, r0 - ldrh r0, [r6] - movs r2, 0xE7 - lsls r2, 4 - adds r1, r2 - strh r0, [r1] - movs r0, 0x64 - adds r5, r7, 0 - muls r5, r0 - ldr r0, =gEnemyParty - adds r5, r0 - adds r0, r5, 0 - movs r1, 0x28 - movs r2, 0 - bl GetBoxMonData - mov r2, r8 - ldr r1, [r2] - adds r1, r4 - ldr r2, =0x00000e78 - adds r1, r2 - strb r0, [r1] - adds r0, r5, 0 - movs r1, 0 - movs r2, 0 - bl GetMonData - mov r2, r8 - ldr r1, [r2] - ldr r2, =0x00000e74 - adds r1, r2 - adds r1, r4 - str r0, [r1] - adds r0, r5, 0 - movs r1, 0x2E - movs r2, 0 - bl GetBoxMonData - mov r2, r8 - ldr r1, [r2] - adds r1, r4 - ldr r2, =0x00000e79 - adds r1, r2 - strb r0, [r1] - ldrh r1, [r6] - ldr r0, =gUnknown_0203BC8C - ldr r0, [r0] - lsls r1, 4 - adds r1, r0 - ldrb r2, [r1, 0xA] - lsls r2, 1 - ldr r0, =gBattleFrontierHeldItems - adds r2, r0 - adds r0, r5, 0 - movs r1, 0xC - bl SetMonData - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x2 - bls _081A6408 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A63CC - - thumb_func_start sub_81A64C4 -sub_81A64C4: @ 81A64C4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r2, r0, r1 - ldrb r1, [r2] - movs r3, 0x3 - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0x2 - bne _081A6500 - ldr r1, =gUnknown_0203BC8C - ldr r0, =gSlateportBattleTentMons - str r0, [r1] - movs r2, 0x1E - str r2, [sp, 0x14] - b _081A6518 - .pool -_081A6500: - ldr r1, =gUnknown_0203BC8C - ldr r0, =gBattleFrontierMons - str r0, [r1] - ldrb r1, [r2] - adds r0, r3, 0 - ands r0, r1 - movs r4, 0x32 - str r4, [sp, 0x14] - cmp r0, 0 - beq _081A6518 - movs r5, 0x64 - str r5, [sp, 0x14] -_081A6518: - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x1 - bls _081A6522 - b _081A666C -_081A6522: - bl ZeroPlayerPartyMons - movs r0, 0 - mov r8, r0 - mov r1, sp - adds r1, 0x12 - str r1, [sp, 0x1C] - ldr r2, =gUnknown_0203BC8C - mov r9, r2 -_081A6534: - ldr r4, =gSaveBlock2Ptr - ldr r2, [r4] - mov r5, r8 - lsls r5, 1 - mov r10, r5 - mov r3, r10 - add r3, r8 - lsls r3, 2 - adds r1, r2, r3 - movs r4, 0xE7 - lsls r4, 4 - adds r0, r1, r4 - ldrh r7, [r0] - ldr r5, =0x00000e78 - adds r1, r5 - ldrb r6, [r1] - movs r1, 0x64 - mov r0, r8 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - mov r4, r9 - ldr r1, [r4] - lsls r4, r7, 4 - adds r1, r4, r1 - ldrh r1, [r1] - movs r5, 0x1 - str r5, [sp] - ldr r5, =0x00000e74 - adds r2, r5 - adds r2, r3 - ldr r2, [r2] - str r2, [sp, 0x4] - movs r2, 0 - str r2, [sp, 0x8] - str r2, [sp, 0xC] - ldr r2, [sp, 0x14] - adds r3, r6, 0 - bl CreateMon - movs r1, 0 - mov r2, r9 - ldr r0, [r2] - adds r4, r0 - ldrb r4, [r4, 0xB] - mov r5, r8 - adds r5, 0x1 - str r5, [sp, 0x18] - movs r5, 0x5 -_081A6596: - adds r0, r4, 0 - movs r2, 0x1 - ands r0, r2 - cmp r0, 0 - beq _081A65A2 - adds r1, 0x1 -_081A65A2: - lsrs r4, 1 - subs r5, 0x1 - cmp r5, 0 - bge _081A6596 - movs r0, 0xFF - lsls r0, 1 - bl __divsi3 - add r1, sp, 0x10 - strh r0, [r1] - movs r4, 0x1 - movs r5, 0 - lsls r7, 4 - movs r0, 0x64 - mov r6, r8 - muls r6, r0 - ldr r3, =gPlayerParty -_081A65C4: - mov r1, r9 - ldr r0, [r1] - adds r0, r7, r0 - ldrb r0, [r0, 0xB] - ands r0, r4 - cmp r0, 0 - beq _081A65E2 - adds r1, r5, 0 - adds r1, 0x1A - adds r0, r6, r3 - add r2, sp, 0x10 - str r3, [sp, 0x20] - bl SetMonData - ldr r3, [sp, 0x20] -_081A65E2: - lsls r0, r4, 25 - lsrs r4, r0, 24 - adds r5, 0x1 - cmp r5, 0x5 - ble _081A65C4 - movs r2, 0x64 - mov r4, r8 - muls r4, r2 - ldr r5, =gPlayerParty - adds r0, r4, r5 - bl CalculateMonStats - movs r0, 0 - ldr r1, [sp, 0x1C] - strb r0, [r1] - movs r6, 0 -_081A6602: - mov r2, r9 - ldr r0, [r2] - adds r0, r7, r0 - lsls r1, r6, 1 - adds r0, 0x2 - adds r0, r1 - ldrh r1, [r0] - lsls r2, r6, 24 - lsrs r2, 24 - adds r0, r4, r5 - bl sub_81A7024 - adds r6, 0x1 - cmp r6, 0x3 - ble _081A6602 - movs r5, 0x64 - mov r4, r8 - muls r4, r5 - ldr r0, =gPlayerParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x20 - ldr r2, [sp, 0x1C] - bl SetMonData - mov r1, r9 - ldr r0, [r1] - adds r0, r7, r0 - ldrb r2, [r0, 0xA] - lsls r2, 1 - ldr r0, =gBattleFrontierHeldItems - adds r2, r0 - adds r0, r4, 0 - movs r1, 0xC - bl SetMonData - mov r2, r10 - add r2, r8 - lsls r2, 2 - ldr r5, =gSaveBlock2Ptr - ldr r0, [r5] - adds r2, r0 - ldr r0, =0x00000e79 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x2E - bl SetMonData - ldr r1, [sp, 0x18] - mov r8, r1 - cmp r1, 0x2 - bgt _081A666C - b _081A6534 -_081A666C: - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0 - beq _081A667A - cmp r0, 0x2 - beq _081A667A - b _081A67AE -_081A667A: - movs r2, 0 - mov r8, r2 - ldr r4, =gUnknown_0203BC8C - mov r9, r4 -_081A6682: - ldr r5, =gSaveBlock2Ptr - ldr r3, [r5] - mov r0, r8 - adds r0, 0x3 - lsls r2, r0, 1 - adds r2, r0 - lsls r2, 2 - adds r1, r3, r2 - movs r4, 0xE7 - lsls r4, 4 - adds r0, r1, r4 - ldrh r7, [r0] - ldr r5, =0x00000e78 - adds r1, r5 - ldrb r6, [r1] - movs r1, 0x64 - mov r0, r8 - muls r0, r1 - ldr r1, =gEnemyParty - adds r0, r1 - mov r4, r9 - ldr r1, [r4] - lsls r4, r7, 4 - adds r1, r4, r1 - ldrh r1, [r1] - movs r5, 0x1 - str r5, [sp] - ldr r5, =0x00000e74 - adds r3, r5 - adds r3, r2 - ldr r2, [r3] - str r2, [sp, 0x4] - movs r2, 0 - str r2, [sp, 0x8] - str r2, [sp, 0xC] - ldr r2, [sp, 0x14] - adds r3, r6, 0 - bl CreateMon - movs r1, 0 - mov r2, r9 - ldr r0, [r2] - adds r4, r0 - ldrb r4, [r4, 0xB] - mov r5, r8 - lsls r5, 1 - mov r10, r5 - mov r0, r8 - adds r0, 0x1 - str r0, [sp, 0x18] - movs r5, 0x5 -_081A66E8: - adds r0, r4, 0 - movs r2, 0x1 - ands r0, r2 - cmp r0, 0 - beq _081A66F4 - adds r1, 0x1 -_081A66F4: - lsrs r4, 1 - subs r5, 0x1 - cmp r5, 0 - bge _081A66E8 - add r4, sp, 0x10 - movs r0, 0xFF - lsls r0, 1 - bl __divsi3 - strh r0, [r4] - movs r4, 0x1 - movs r5, 0 - lsls r7, 4 - movs r0, 0x64 - mov r6, r8 - muls r6, r0 - ldr r3, =gEnemyParty -_081A6716: - mov r1, r9 - ldr r0, [r1] - adds r0, r7, r0 - ldrb r0, [r0, 0xB] - ands r0, r4 - cmp r0, 0 - beq _081A6734 - adds r1, r5, 0 - adds r1, 0x1A - adds r0, r6, r3 - add r2, sp, 0x10 - str r3, [sp, 0x20] - bl SetMonData - ldr r3, [sp, 0x20] -_081A6734: - lsls r0, r4, 25 - lsrs r4, r0, 24 - adds r5, 0x1 - cmp r5, 0x5 - ble _081A6716 - movs r2, 0x64 - mov r4, r8 - muls r4, r2 - ldr r5, =gEnemyParty - adds r0, r4, r5 - bl CalculateMonStats - movs r6, 0 -_081A674E: - mov r1, r9 - ldr r0, [r1] - adds r0, r7, r0 - lsls r1, r6, 1 - adds r0, 0x2 - adds r0, r1 - ldrh r1, [r0] - lsls r2, r6, 24 - lsrs r2, 24 - adds r0, r4, r5 - bl sub_81A7024 - adds r6, 0x1 - cmp r6, 0x3 - ble _081A674E - movs r2, 0x64 - mov r4, r8 - muls r4, r2 - ldr r0, =gEnemyParty - adds r4, r0 - mov r5, r9 - ldr r0, [r5] - adds r0, r7, r0 - ldrb r2, [r0, 0xA] - lsls r2, 1 - ldr r0, =gBattleFrontierHeldItems - adds r2, r0 - adds r0, r4, 0 - movs r1, 0xC - bl SetMonData - mov r2, r10 - add r2, r8 - lsls r2, 2 - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - adds r2, r0 - ldr r5, =0x00000e9d - adds r2, r5 - adds r0, r4, 0 - movs r1, 0x2E - bl SetMonData - ldr r0, [sp, 0x18] - mov r8, r0 - cmp r0, 0x2 - bgt _081A67AE - b _081A6682 -_081A67AE: - add sp, 0x24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A64C4 - - thumb_func_start sub_81A67EC -sub_81A67EC: @ 81A67EC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4C - ldr r1, =gUnknown_0203BC88 - ldr r0, =gBattleFrontierTrainers - str r0, [r1] - mov r0, sp - adds r0, 0xC - str r0, [sp, 0x38] - mov r1, sp - adds r1, 0x18 - str r1, [sp, 0x3C] - ldr r2, =gSaveBlock2Ptr - mov r9, r2 - movs r2, 0 - adds r3, r1, 0 - adds r1, r0, 0 - mov r0, sp - movs r4, 0x5 - mov r8, r4 -_081A681A: - strh r2, [r0] - strh r2, [r1] - strh r2, [r3] - adds r3, 0x2 - adds r1, 0x2 - adds r0, 0x2 - movs r5, 0x1 - negs r5, r5 - add r8, r5 - mov r4, r8 - cmp r4, 0 - bge _081A681A - mov r5, r9 - ldr r0, [r5] - ldr r7, =0x00000ca9 - adds r0, r7 - ldrb r4, [r0] - lsls r4, 30 - lsrs r4, 30 - ldr r6, =0x000040ce - adds r0, r6, 0 - bl VarGet - lsls r0, 24 - ldr r1, [r5] - lsls r4, 1 - lsrs r0, 22 - adds r4, r0 - ldr r5, =0x00000de2 - adds r1, r5 - adds r1, r4 - ldrh r0, [r1] - movs r1, 0x7 - bl __udivsi3 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x24] - adds r0, r6, 0 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - movs r2, 0 - cmp r0, 0x1 - bne _081A6878 - movs r2, 0x1 -_081A6878: - ldr r1, =gUnknown_0203BC8C - ldr r0, =gBattleFrontierMons - str r0, [r1] - mov r1, r9 - ldr r0, [r1] - adds r0, r7 - ldrb r1, [r0] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _081A68B4 - movs r4, 0x1 - str r4, [sp, 0x28] - b _081A68B8 - .pool -_081A68B4: - movs r5, 0 - str r5, [sp, 0x28] -_081A68B8: - adds r0, r2, 0 - ldr r1, [sp, 0x28] - bl sub_81A6F70 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x2C] - movs r0, 0 - mov r10, r0 - mov r8, r0 - ldr r1, [sp, 0x3C] - str r1, [sp, 0x40] - mov r2, sp - str r2, [sp, 0x44] - lsls r4, r0, 1 - str r4, [sp, 0x30] - ldr r5, [sp, 0x38] - adds r5, r4 - str r5, [sp, 0x34] -_081A68DE: - ldr r0, [sp, 0x2C] - cmp r8, r0 - bge _081A68EC - ldr r0, [sp, 0x28] - ldr r1, [sp, 0x24] - movs r2, 0x1 - b _081A68F2 -_081A68EC: - ldr r0, [sp, 0x28] - ldr r1, [sp, 0x24] - movs r2, 0 -_081A68F2: - bl sub_81A6EF0 - lsls r0, 16 - lsrs r7, r0, 16 - ldr r0, =gUnknown_0203BC8C - ldr r1, [r0] - lsls r2, r7, 4 - adds r4, r2, r1 - ldrh r1, [r4] - mov r9, r2 - cmp r1, 0xC9 - beq _081A69E2 - movs r3, 0 - mov r2, r8 - adds r6, r3, r2 - cmp r3, r6 - bge _081A6950 - ldr r5, [sp, 0x34] - ldrh r0, [r5] - cmp r0, r7 - beq _081A6950 - mov r12, r4 - adds r2, r1, 0 - lsls r4, r3, 1 - ldr r1, [sp, 0x30] - add r1, sp - str r6, [sp, 0x48] -_081A6928: - ldrh r0, [r1] - cmp r0, r2 - bne _081A693A - mov r0, r10 - cmp r0, 0 - bne _081A6950 - mov r5, r12 - ldrh r5, [r5] - mov r10, r5 -_081A693A: - adds r4, 0x2 - adds r1, 0x2 - adds r3, 0x1 - ldr r0, [sp, 0x48] - cmp r3, r0 - bge _081A6950 - ldr r5, [sp, 0x38] - adds r0, r5, r4 - ldrh r0, [r0] - cmp r0, r7 - bne _081A6928 -_081A6950: - cmp r3, r6 - bne _081A69E2 - movs r3, 0 - cmp r3, r6 - bge _081A699C - ldr r0, =gBattleFrontierHeldItems - mov r12, r0 - ldr r1, [sp, 0x30] - ldr r2, [sp, 0x3C] - adds r5, r1, r2 -_081A6964: - ldrh r4, [r5] - cmp r4, 0 - beq _081A6994 - ldr r1, =gUnknown_0203BC8C - ldr r0, [r1] - mov r2, r9 - adds r1, r2, r0 - ldrb r0, [r1, 0xA] - lsls r0, 1 - add r0, r12 - ldrh r0, [r0] - cmp r4, r0 - bne _081A6994 - ldrh r0, [r1] - cmp r0, r10 - bne _081A699C - movs r4, 0 - mov r10, r4 - b _081A699C - .pool -_081A6994: - adds r5, 0x2 - adds r3, 0x1 - cmp r3, r6 - blt _081A6964 -_081A699C: - cmp r3, r6 - bne _081A69E2 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - mov r5, r8 - lsls r3, r5, 1 - adds r0, r3, r5 - lsls r0, 2 - adds r1, r0 - movs r0, 0xE7 - lsls r0, 4 - adds r1, r0 - strh r7, [r1] - ldr r2, =gUnknown_0203BC8C - ldr r1, [r2] - add r1, r9 - ldrh r0, [r1] - ldr r4, [sp, 0x44] - strh r0, [r4] - ldr r2, =gBattleFrontierHeldItems - ldrb r0, [r1, 0xA] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - ldr r5, [sp, 0x40] - strh r0, [r5] - ldr r0, [sp, 0x38] - adds r3, r0, r3 - strh r7, [r3] - adds r5, 0x2 - str r5, [sp, 0x40] - adds r4, 0x2 - str r4, [sp, 0x44] - movs r1, 0x1 - add r8, r1 -_081A69E2: - mov r2, r8 - cmp r2, 0x6 - beq _081A69EA - b _081A68DE -_081A69EA: - add sp, 0x4C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A67EC - - thumb_func_start sub_81A6A08 -sub_81A6A08: @ 81A6A08 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x18 - ldr r1, =gUnknown_0203BC8C - ldr r0, =gBattleFrontierMons - str r0, [r1] - movs r4, 0 - add r5, sp, 0x14 - ldr r7, =gScriptResult - movs r1, 0 -_081A6A1E: - mov r2, sp - adds r0, r2, r4 - strb r1, [r0] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x11 - bls _081A6A1E - movs r4, 0 - ldr r0, =gUnknown_03006298 - mov r8, r0 - ldr r0, =gUnknown_0203BC8C - ldr r6, [r0] - ldr r1, =gBaseStats - mov r12, r1 -_081A6A3C: - lsls r0, r4, 1 - add r0, r8 - ldrh r0, [r0] - lsls r0, 4 - adds r0, r6 - ldrh r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - mov r2, r12 - adds r3, r0, r2 - ldrb r2, [r3, 0x6] - mov r0, sp - adds r1, r0, r2 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldrb r1, [r3, 0x7] - cmp r2, r1 - beq _081A6A70 - ldrb r0, [r3, 0x7] - mov r2, sp - adds r1, r2, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_081A6A70: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _081A6A3C - movs r0, 0 - strb r0, [r5] - strb r0, [r5, 0x1] - movs r4, 0x1 - adds r3, r5, 0 -_081A6A84: - ldrb r0, [r3] - add r0, sp - mov r2, sp - adds r1, r2, r4 - ldrb r2, [r0] - ldrb r0, [r1] - cmp r2, r0 - bcs _081A6AAC - strb r4, [r5] - b _081A6AB2 - .pool -_081A6AAC: - cmp r2, r0 - bne _081A6AB2 - strb r4, [r3, 0x1] -_081A6AB2: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x11 - bls _081A6A84 - ldrb r1, [r5] - mov r4, sp - adds r0, r4, r1 - ldrb r2, [r0] - cmp r2, 0 - beq _081A6ADA - ldrb r3, [r5, 0x1] - adds r0, r4, r3 - ldrb r0, [r0] - cmp r2, r0 - bhi _081A6AD6 - cmp r1, r3 - bne _081A6ADA -_081A6AD6: - strh r1, [r7] - b _081A6ADE -_081A6ADA: - movs r0, 0x12 - strh r0, [r7] -_081A6ADE: - add sp, 0x18 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81A6A08 - - thumb_func_start sub_81A6AEC -sub_81A6AEC: @ 81A6AEC - push {r4-r7,lr} - sub sp, 0x8 - movs r7, 0 - ldr r1, =gUnknown_0203BC8C - ldr r0, =gBattleFrontierMons - str r0, [r1] - movs r4, 0 - movs r1, 0 -_081A6AFC: - mov r2, sp - adds r0, r2, r4 - strb r1, [r0] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _081A6AFC - movs r4, 0 -_081A6B0E: - ldr r1, =gUnknown_03006298 - lsls r0, r4, 1 - adds r0, r1 - ldrh r6, [r0] - movs r5, 0 -_081A6B18: - ldr r0, =gUnknown_0203BC8C - ldr r1, [r0] - lsls r0, r6, 4 - adds r0, r1 - lsls r1, r5, 1 - adds r0, 0x2 - adds r0, r1 - ldrh r0, [r0] - bl sub_81A6BA4 - lsls r0, 24 - lsrs r0, 24 - mov r2, sp - adds r1, r2, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _081A6B18 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _081A6B0E - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - movs r4, 0x1 - adds r5, r1, 0 - ldr r3, =gBattleFactoryStyleRequiredMoveCounts - adds r2, r5, 0 -_081A6B5C: - mov r1, sp - adds r0, r1, r4 - subs r1, r4, 0x1 - adds r1, r3 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bcc _081A6B74 - strh r4, [r2] - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 -_081A6B74: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _081A6B5C - cmp r7, 0x2 - bls _081A6B86 - movs r0, 0x8 - strh r0, [r5] -_081A6B86: - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A6AEC - - thumb_func_start sub_81A6BA4 -sub_81A6BA4: @ 81A6BA4 - push {r4-r6,lr} - lsls r0, 16 - lsrs r5, r0, 16 - movs r2, 0 - ldr r6, =gBattleFactoryStyleMoveListPointers -_081A6BAE: - movs r3, 0 - lsls r0, r2, 2 - adds r0, r6 - ldr r1, [r0] - ldrh r0, [r1] - adds r4, r2, 0x1 - cmp r0, 0 - beq _081A6BE4 - lsls r0, r4, 24 - lsrs r2, r0, 24 -_081A6BC2: - lsls r0, r3, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r5 - bne _081A6BD4 - adds r0, r2, 0 - b _081A6BEE - .pool -_081A6BD4: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - lsls r0, r3, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0 - bne _081A6BC2 -_081A6BE4: - lsls r0, r4, 24 - lsrs r2, r0, 24 - cmp r2, 0x6 - bls _081A6BAE - movs r0, 0 -_081A6BEE: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81A6BA4 - - thumb_func_start sub_81A6BF4 -sub_81A6BF4: @ 81A6BF4 - push {lr} - movs r2, 0 - ldr r1, =gMapHeader - ldr r3, =0xfffffea5 - adds r0, r3, 0 - ldrh r1, [r1, 0x12] - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bhi _081A6C0C - movs r2, 0x1 -_081A6C0C: - adds r0, r2, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A6BF4 - - thumb_func_start sub_81A6C1C -sub_81A6C1C: @ 81A6C1C - push {r4,lr} - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x2 - beq _081A6C48 - ldr r1, =gUnknown_0203BC8C - ldr r0, =gBattleFrontierMons - b _081A6C4C - .pool -_081A6C48: - ldr r1, =gUnknown_0203BC8C - ldr r0, =gSlateportBattleTentMons -_081A6C4C: - str r0, [r1] - movs r4, 0 -_081A6C50: - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gSaveBlock2Ptr - ldr r2, [r1] - lsls r1, r4, 1 - adds r1, r4 - lsls r1, 2 - adds r2, r1 - movs r1, 0xE7 - lsls r1, 4 - adds r2, r1 - ldrh r2, [r2] - ldr r1, =gUnknown_0203BC8C - ldr r1, [r1] - lsls r2, 4 - adds r2, r1 - ldrb r2, [r2, 0xA] - lsls r2, 1 - ldr r1, =gBattleFrontierHeldItems - adds r2, r1 - movs r1, 0xC - bl SetMonData - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _081A6C50 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A6C1C - - thumb_func_start sub_81A6CA8 -sub_81A6CA8: @ 81A6CA8 - push {lr} - lsls r0, 24 - lsls r1, 24 - lsrs r1, 24 - negs r2, r1 - orrs r2, r1 - lsrs r2, 31 - lsrs r1, r0, 24 - cmp r1, 0x8 - bls _081A6CBE - movs r1, 0x7 -_081A6CBE: - ldr r0, =gUnknown_08612184 - lsls r1, 1 - adds r1, r2, r1 - adds r1, r0 - ldrb r0, [r1] - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A6CA8 - - thumb_func_start sub_81A6CD0 -sub_81A6CD0: @ 81A6CD0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x34 - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - str r0, [sp, 0x2C] - ldr r0, =0x000040ce - bl VarGet - lsls r0, 24 - ldr r1, [r4] - ldr r3, [sp, 0x2C] - lsls r2, r3, 1 - lsrs r0, 22 - adds r2, r0 - ldr r7, =0x00000de2 - adds r1, r7 - adds r1, r2 - ldrh r0, [r1] - movs r1, 0x7 - bl __udivsi3 - lsls r0, 24 - lsrs r1, r0, 24 - str r1, [sp, 0x30] - movs r2, 0x80 - lsls r2, 18 - adds r0, r2 - lsrs r0, 24 - movs r1, 0 - bl sub_81A6CA8 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x24] - bl sub_8165C40 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x20] - movs r3, 0 - mov r9, r3 - ldr r1, [r4] - ldrb r4, [r1, 0xA] - ldrb r0, [r1, 0xB] - lsls r0, 8 - orrs r4, r0 - ldrb r0, [r1, 0xC] - lsls r0, 16 - orrs r4, r0 - ldrb r0, [r1, 0xD] - lsls r0, 24 - orrs r4, r0 - str r4, [sp, 0x28] -_081A6D4C: - ldr r0, [sp, 0x2C] - ldr r1, [sp, 0x30] - movs r2, 0 - bl sub_81A6EF0 - lsls r0, 16 - lsrs r5, r0, 16 - ldr r7, =gUnknown_0203BC8C - ldr r1, [r7] - lsls r0, r5, 4 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0xC9 - bne _081A6D6A - b _081A6EB8 -_081A6D6A: - ldr r0, [sp, 0x20] - cmp r0, 0x32 - bne _081A6D78 - ldr r0, =0x00000351 - cmp r5, r0 - bls _081A6D78 - b _081A6EB8 -_081A6D78: - movs r2, 0 - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - movs r3, 0xE7 - lsls r3, 4 - adds r0, r3 - ldrh r0, [r0] - cmp r5, r0 - beq _081A6DA2 - adds r4, r1, 0 - movs r1, 0 -_081A6D8E: - adds r1, 0xC - adds r2, 0x1 - cmp r2, 0x5 - bgt _081A6DA2 - ldr r0, [r4] - adds r0, r1 - adds r0, r3 - ldrh r0, [r0] - cmp r5, r0 - bne _081A6D8E -_081A6DA2: - cmp r2, 0x6 - beq _081A6DA8 - b _081A6EB8 -_081A6DA8: - movs r4, 0 - cmp r4, r9 - bge _081A6DDC - add r2, sp, 0xC - ldr r7, =gUnknown_0203BC8C - ldr r0, [r7] - lsls r1, r5, 4 - adds r0, r1, r0 - ldrh r2, [r2] - adds r7, r1, 0 - ldrh r0, [r0] - cmp r2, r0 - beq _081A6DDC - ldr r6, =gUnknown_0203BC8C - adds r3, r7, 0 - add r2, sp, 0xC -_081A6DC8: - adds r2, 0x2 - adds r4, 0x1 - cmp r4, r9 - bge _081A6DDC - ldr r0, [r6] - adds r0, r3, r0 - ldrh r1, [r2] - ldrh r0, [r0] - cmp r1, r0 - bne _081A6DC8 -_081A6DDC: - cmp r4, r9 - bne _081A6EB8 - movs r4, 0 - cmp r4, r9 - bge _081A6E0C - ldr r7, =gBattleFrontierHeldItems - ldr r6, =gUnknown_0203BC8C - add r2, sp, 0x14 - lsls r3, r5, 4 -_081A6DEE: - ldrh r1, [r2] - cmp r1, 0 - beq _081A6E04 - ldr r0, [r6] - adds r0, r3, r0 - ldrb r0, [r0, 0xA] - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - cmp r1, r0 - beq _081A6E0C -_081A6E04: - adds r2, 0x2 - adds r4, 0x1 - cmp r4, r9 - blt _081A6DEE -_081A6E0C: - cmp r4, r9 - bne _081A6EB8 - mov r0, r9 - lsls r2, r0, 1 - mov r1, sp - adds r1, r2 - adds r1, 0xC - ldr r3, =gUnknown_0203BC8C - ldr r4, [r3] - lsls r5, 4 - mov r8, r5 - add r4, r8 - ldrh r0, [r4] - strh r0, [r1] - add r1, sp, 0x14 - adds r1, r2 - ldr r2, =gBattleFrontierHeldItems - ldrb r0, [r4, 0xA] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r1] - movs r0, 0x64 - mov r5, r9 - muls r5, r0 - ldr r6, =gEnemyParty - adds r0, r5, r6 - ldrh r1, [r4] - ldr r7, [sp, 0x20] - lsls r2, r7, 24 - ldrb r3, [r4, 0xC] - ldr r7, [sp, 0x24] - str r7, [sp] - ldrb r4, [r4, 0xB] - str r4, [sp, 0x4] - ldr r4, [sp, 0x28] - str r4, [sp, 0x8] - lsrs r2, 24 - bl sub_8068634 - add r0, sp, 0x1C - movs r7, 0 - strb r7, [r0] - movs r4, 0 - mov r7, r8 - mov r10, r0 - movs r0, 0x1 - add r0, r9 - mov r8, r0 -_081A6E6E: - ldr r1, =gUnknown_0203BC8C - ldr r0, [r1] - adds r0, r7, r0 - lsls r1, r4, 1 - adds r0, 0x2 - adds r0, r1 - ldrh r1, [r0] - lsls r2, r4, 24 - lsrs r2, 24 - adds r0, r5, r6 - bl sub_81A7024 - adds r4, 0x1 - cmp r4, 0x3 - ble _081A6E6E - movs r0, 0x64 - mov r4, r9 - muls r4, r0 - ldr r0, =gEnemyParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x20 - mov r2, r10 - bl SetMonData - ldr r2, =gUnknown_0203BC8C - ldr r0, [r2] - adds r0, r7, r0 - ldrb r2, [r0, 0xA] - lsls r2, 1 - ldr r0, =gBattleFrontierHeldItems - adds r2, r0 - adds r0, r4, 0 - movs r1, 0xC - bl SetMonData - mov r9, r8 -_081A6EB8: - mov r3, r9 - cmp r3, 0x3 - beq _081A6EC0 - b _081A6D4C -_081A6EC0: - add sp, 0x34 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A6CD0 - - thumb_func_start sub_81A6EF0 -sub_81A6EF0: @ 81A6EF0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r3, r1, 24 - lsls r2, 24 - lsrs r2, 24 - movs r4, 0x8 - negs r1, r0 - orrs r1, r0 - asrs r1, 31 - ands r1, r4 - adds r4, r1, 0 - cmp r3, 0x6 - bhi _081A6F2C - cmp r2, 0 - beq _081A6F20 - ldr r2, =gUnknown_08612194 - adds r1, r3 - adds r1, 0x1 - b _081A6F38 - .pool -_081A6F20: - ldr r2, =gUnknown_08612194 - adds r1, r3 - b _081A6F38 - .pool -_081A6F2C: - adds r1, r3, 0 - cmp r1, 0x7 - beq _081A6F34 - movs r1, 0x7 -_081A6F34: - ldr r2, =gUnknown_08612194 - adds r1, r4, r1 -_081A6F38: - lsls r1, 2 - adds r0, r2, 0x2 - adds r0, r1, r0 - adds r1, r2 - ldrh r0, [r0] - ldrh r4, [r1] - subs r0, r4 - adds r0, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - bl Random - lsls r0, 16 - lsrs r0, 16 - adds r1, r5, 0 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - adds r4, r0, r4 - lsls r4, 16 - lsrs r0, r4, 16 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A6EF0 - - thumb_func_start sub_81A6F70 -sub_81A6F70: @ 81A6F70 - push {lr} - lsls r0, 24 - lsls r1, 24 - ldr r2, =gSaveBlock2Ptr - ldr r2, [r2] - lsrs r1, 23 - lsrs r0, 22 - adds r1, r0 - ldr r0, =0x00000df2 - adds r2, r0 - adds r2, r1 - ldrb r1, [r2] - movs r0, 0 - cmp r1, 0xE - bls _081A6FA8 - movs r0, 0x1 - cmp r1, 0x15 - bls _081A6FA8 - movs r0, 0x2 - cmp r1, 0x1C - bls _081A6FA8 - movs r0, 0x3 - cmp r1, 0x23 - bls _081A6FA8 - movs r0, 0x5 - cmp r1, 0x2A - bhi _081A6FA8 - movs r0, 0x4 -_081A6FA8: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A6F70 - - thumb_func_start GetAiScriptsInBattleFactory -GetAiScriptsInBattleFactory: @ 81A6FB4 - push {r4,r5,lr} - ldr r5, =gSaveBlock2Ptr - ldr r0, [r5] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r4, r0, 30 - cmp r4, 0x2 - beq _081A6FF8 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - ldr r1, [r5] - lsls r2, r4, 1 - lsrs r0, 14 - adds r2, r0 - ldr r0, =0x00000de2 - adds r1, r0 - adds r1, r2 - ldrh r0, [r1] - movs r1, 0x7 - bl __udivsi3 - lsls r0, 16 - lsrs r2, r0, 16 - ldr r0, =gTrainerBattleOpponent_A - ldrh r1, [r0] - ldr r0, =0x000003fe - cmp r1, r0 - beq _081A7018 - cmp r2, 0x1 - bgt _081A7014 -_081A6FF8: - movs r0, 0 - b _081A701E - .pool -_081A7014: - cmp r2, 0x3 - ble _081A701C -_081A7018: - movs r0, 0x7 - b _081A701E -_081A701C: - movs r0, 0x1 -_081A701E: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end GetAiScriptsInBattleFactory - - thumb_func_start sub_81A7024 -sub_81A7024: @ 81A7024 - push {lr} - lsls r1, 16 - lsls r2, 24 - lsrs r2, 24 - lsrs r1, 16 - cmp r1, 0xD8 - bne _081A7034 - movs r1, 0xDA -_081A7034: - bl SetMonMoveSlot - pop {r0} - bx r0 - thumb_func_end sub_81A7024 - - thumb_func_start sub_81A703C -sub_81A703C: @ 81A703C - push {lr} - ldr r1, =gUnknown_086125F8 - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A703C - - thumb_func_start sub_81A705C -sub_81A705C: @ 81A705C - push {lr} - bl sub_81A79EC - ldr r1, =gUnknown_0300128C - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A705C - - thumb_func_start sub_81A7070 -sub_81A7070: @ 81A7070 - push {r4-r7,lr} - ldr r0, =0x00004010 - movs r1, 0x1C - bl VarSet - ldr r0, =0x00004011 - movs r1, 0xE2 - bl VarSet - movs r4, 0x1 - movs r6, 0 - movs r5, 0 - movs r7, 0 - ldr r0, =gUnknown_0300128C - ldrb r0, [r0] - cmp r0, 0x8 - bhi _081A7132 - lsls r0, 2 - ldr r1, =_081A70AC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A70AC: - .4byte _081A70D0 - .4byte _081A70DA - .4byte _081A70DE - .4byte _081A70E8 - .4byte _081A70FC - .4byte _081A70D6 - .4byte _081A7100 - .4byte _081A7108 - .4byte _081A710E -_081A70D0: - movs r0, 0 - bl sub_81A82A4 -_081A70D6: - movs r4, 0 - b _081A711A -_081A70DA: - movs r5, 0x1C - b _081A711A -_081A70DE: - bl sub_81A7B58 - lsls r0, 24 - lsrs r5, r0, 24 - b _081A711A -_081A70E8: - movs r5, 0x30 - ldr r0, =gUnknown_0300128D - ldrb r0, [r0] - movs r7, 0xE1 - cmp r0, 0x1 - bne _081A7118 - movs r7, 0xE2 - b _081A7118 - .pool -_081A70FC: - movs r5, 0x30 - b _081A711A -_081A7100: - movs r0, 0x1 - bl sub_81A82A4 - b _081A7114 -_081A7108: - bl sub_81A8374 - b _081A70D6 -_081A710E: - movs r0, 0x5 - bl sub_81A5030 -_081A7114: - movs r7, 0x1C - movs r4, 0 -_081A7118: - movs r6, 0x1 -_081A711A: - cmp r4, 0x1 - bne _081A7126 - ldr r0, =0x00004010 - adds r1, r5, 0 - bl VarSet -_081A7126: - cmp r6, 0x1 - bne _081A7132 - ldr r0, =0x00004011 - adds r1, r7, 0 - bl VarSet -_081A7132: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A7070 - - thumb_func_start sub_81A7140 -sub_81A7140: @ 81A7140 - push {lr} - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r2, =0x00000ca9 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r2, r0, 30 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - adds r3, r1, 0 - cmp r0, 0x4 - bhi _081A723A - lsls r0, 2 - ldr r1, =_081A7174 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A7174: - .4byte _081A7188 - .4byte _081A71A0 - .4byte _081A71C4 - .4byte _081A71E8 - .4byte _081A720C -_081A7188: - ldr r0, =gScriptResult - ldr r1, [r3] - ldr r3, =0x00000e02 - adds r1, r3 - ldrh r1, [r1] - strh r1, [r0] - b _081A723A - .pool -_081A71A0: - ldr r2, =gScriptResult - ldr r1, [r3] - ldr r3, =0x00000ca9 - adds r0, r1, r3 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 29 - ldr r3, =0x00000e04 - adds r1, r3 - adds r1, r0 - ldrh r0, [r1] - b _081A7238 - .pool -_081A71C4: - ldr r2, =gScriptResult - ldr r1, [r3] - ldr r3, =0x00000ca9 - adds r0, r1, r3 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 29 - ldr r3, =0x00000e08 - adds r1, r3 - adds r1, r0 - ldrh r0, [r1] - b _081A7238 - .pool -_081A71E8: - ldr r2, =gScriptResult - ldr r1, [r3] - ldr r3, =0x00000ca9 - adds r0, r1, r3 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 29 - ldr r3, =0x00000e0c - adds r1, r3 - adds r1, r0 - ldrh r0, [r1] - b _081A7238 - .pool -_081A720C: - cmp r2, 0 - beq _081A7228 - ldr r2, =gScriptResult - ldr r0, [r3] - ldr r1, =0x00000cdc - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 4 - b _081A7236 - .pool -_081A7228: - ldr r2, =gScriptResult - ldr r0, [r3] - ldr r3, =0x00000cdc - adds r0, r3 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 3 -_081A7236: - ands r0, r1 -_081A7238: - strh r0, [r2] -_081A723A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A7140 - - thumb_func_start sub_81A7248 -sub_81A7248: @ 81A7248 - push {r4,r5,lr} - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r2, =0x00000ca9 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r3, r0, 30 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - adds r2, r1, 0 - cmp r0, 0x4 - bls _081A7264 - b _081A73AA -_081A7264: - lsls r0, 2 - ldr r1, =_081A7280 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A7280: - .4byte _081A7294 - .4byte _081A72AC - .4byte _081A72D8 - .4byte _081A7314 - .4byte _081A7344 -_081A7294: - ldr r0, [r2] - ldr r1, =gSpecialVar_0x8006 - ldrh r1, [r1] - ldr r5, =0x00000e02 - adds r0, r5 - strh r1, [r0] - b _081A73AA - .pool -_081A72AC: - ldr r0, =gSpecialVar_0x8006 - ldrh r3, [r0] - ldr r0, =0x0000270f - cmp r3, r0 - bls _081A72B8 - b _081A73AA -_081A72B8: - ldr r0, [r2] - ldr r2, =0x00000ca9 - adds r1, r0, r2 - ldrb r1, [r1] - lsls r1, 30 - lsrs r1, 29 - ldr r5, =0x00000e04 - b _081A732C - .pool -_081A72D8: - ldr r0, =gSpecialVar_0x8006 - ldrh r4, [r0] - adds r3, r4, 0 - ldr r0, =0x0000270f - cmp r3, r0 - bhi _081A73AA - ldr r1, [r2] - ldr r2, =0x00000ca9 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r2, r0, 30 - lsrs r0, r2, 29 - ldr r5, =0x00000e08 - adds r1, r5 - adds r0, r1, r0 - ldrh r0, [r0] - cmp r0, r3 - bcs _081A73AA - lsrs r0, r2, 29 - adds r0, r1, r0 - strh r4, [r0] - b _081A73AA - .pool -_081A7314: - ldr r0, =gSpecialVar_0x8006 - ldrh r3, [r0] - ldr r0, =0x0000270f - cmp r3, r0 - bhi _081A73AA - ldr r0, [r2] - ldr r2, =0x00000ca9 - adds r1, r0, r2 - ldrb r1, [r1] - lsls r1, 30 - lsrs r1, 29 - ldr r5, =0x00000e0c -_081A732C: - adds r0, r5 - adds r0, r1 - strh r3, [r0] - b _081A73AA - .pool -_081A7344: - cmp r3, 0 - beq _081A737C - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - cmp r0, 0 - beq _081A7368 - ldr r0, [r2] - ldr r1, =0x00000cdc - adds r0, r1 - ldr r1, [r0] - movs r2, 0x80 - lsls r2, 4 - orrs r1, r2 - b _081A73A8 - .pool -_081A7368: - ldr r0, [r2] - ldr r2, =0x00000cdc - adds r0, r2 - ldr r1, [r0] - ldr r2, =0xfffff7ff - b _081A73A6 - .pool -_081A737C: - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - cmp r0, 0 - beq _081A739C - ldr r0, [r2] - ldr r5, =0x00000cdc - adds r0, r5 - ldr r1, [r0] - movs r2, 0x80 - lsls r2, 3 - orrs r1, r2 - b _081A73A8 - .pool -_081A739C: - ldr r0, [r2] - ldr r1, =0x00000cdc - adds r0, r1 - ldr r1, [r0] - ldr r2, =0xfffffbff -_081A73A6: - ands r1, r2 -_081A73A8: - str r1, [r0] -_081A73AA: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A7248 - - thumb_func_start sub_81A73B8 -sub_81A73B8: @ 81A73B8 - push {lr} - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0xE - bls _081A73DC - ldr r1, =gScriptResult - movs r0, 0x1 - b _081A73E0 - .pool -_081A73DC: - ldr r1, =gScriptResult - movs r0, 0 -_081A73E0: - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A73B8 - - thumb_func_start sub_81A73EC -sub_81A73EC: @ 81A73EC - ldr r0, =gScriptResult - ldr r1, =gUnknown_0300128C - ldrb r1, [r1] - strh r1, [r0] - bx lr - .pool - thumb_func_end sub_81A73EC - - thumb_func_start sub_81A7400 -sub_81A7400: @ 81A7400 - ldr r1, =gUnknown_0300128E - movs r0, 0x1 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_81A7400 - - thumb_func_start sub_81A740C -sub_81A740C: @ 81A740C - ldr r1, =gUnknown_0300128E - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_81A740C - - thumb_func_start sub_81A7418 -sub_81A7418: @ 81A7418 - push {r4,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - strb r1, [r0] - movs r0, 0x80 - lsls r0, 7 - movs r1, 0 - bl VarSet - ldr r1, [r4] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - bl save_serialize_map - movs r0, 0x1 - bl TrySavingData - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A7418 - - thumb_func_start nullsub_76 -nullsub_76: @ 81A7460 - bx lr - thumb_func_end nullsub_76 - - thumb_func_start nullsub_124 -nullsub_124: @ 81A7464 - bx lr - thumb_func_end nullsub_124 - - thumb_func_start sub_81A7468 -sub_81A7468: @ 81A7468 - push {lr} - ldr r0, =gUnknown_03001290 - ldr r0, [r0] - cmp r0, 0x20 - beq _081A748E - cmp r0, 0x20 - bhi _081A7484 - cmp r0, 0x7 - beq _081A74BC - cmp r0, 0x10 - beq _081A7498 - b _081A74C2 - .pool -_081A7484: - cmp r0, 0x40 - beq _081A74B0 - cmp r0, 0x80 - beq _081A74A4 - b _081A74C2 -_081A748E: - ldr r1, =gScriptResult - movs r0, 0 - b _081A74C0 - .pool -_081A7498: - ldr r1, =gScriptResult - movs r0, 0x1 - b _081A74C0 - .pool -_081A74A4: - ldr r1, =gScriptResult - movs r0, 0x2 - b _081A74C0 - .pool -_081A74B0: - ldr r1, =gScriptResult - movs r0, 0x3 - b _081A74C0 - .pool -_081A74BC: - ldr r1, =gScriptResult - movs r0, 0x4 -_081A74C0: - strh r0, [r1] -_081A74C2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A7468 - - thumb_func_start sub_81A74CC -sub_81A74CC: @ 81A74CC - ldr r0, =gScriptResult - ldr r1, =gUnknown_0300128D - ldrb r1, [r1] - strh r1, [r0] - bx lr - .pool - thumb_func_end sub_81A74CC - - thumb_func_start sub_81A74E0 -sub_81A74E0: @ 81A74E0 - push {r4,lr} - bl Random - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - movs r0, 0x1 - ands r4, r0 - adds r4, 0x1 - adds r0, r4, 0 - bl sub_81A7F38 - ldr r0, =gScriptResult - strh r4, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A74E0 - - thumb_func_start sub_81A7508 -sub_81A7508: @ 81A7508 - push {lr} - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0x4 - bhi _081A7538 - ldr r1, =gUnknown_0861231C - ldr r0, =gUnknown_03001294 - ldrb r0, [r0] - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0x2] - b _081A7560 - .pool -_081A7538: - cmp r0, 0xA - bhi _081A7554 - ldr r1, =gUnknown_0861231C - ldr r0, =gUnknown_03001294 - ldrb r0, [r0] - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0x3] - b _081A7560 - .pool -_081A7554: - ldr r1, =gUnknown_0861231C - ldr r0, =gUnknown_03001294 - ldrb r0, [r0] - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0x4] -_081A7560: - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_086123E4 - adds r0, r1 - bl ConvertBattleFrontierTrainerSpeechToString - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A7508 - - thumb_func_start sub_81A7580 -sub_81A7580: @ 81A7580 - push {lr} - ldr r0, =sub_81A7EE4 - movs r1, 0x2 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A7580 - - thumb_func_start sub_81A7594 -sub_81A7594: @ 81A7594 - push {r4-r6,lr} - sub sp, 0x4 - adds r5, r0, 0 - movs r4, 0 - movs r1, 0 -_081A759E: - mov r2, sp - adds r0, r2, r4 - strb r1, [r0] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _081A759E - adds r0, r5, 0 - movs r1, 0x3A - bl GetMonData - lsls r2, r0, 16 - mov r1, sp - strb r0, [r1] - mov r0, sp - lsrs r2, 24 - strb r2, [r0, 0x1] - adds r0, r5, 0 - movs r1, 0x39 - mov r2, sp - bl SetMonData - adds r0, r5, 0 - movs r1, 0x15 - bl GetMonData - lsls r0, 24 - lsrs r6, r0, 24 - movs r4, 0 -_081A75DA: - adds r1, r4, 0 - adds r1, 0xD - adds r0, r5, 0 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - adds r2, r4, 0 - bl CalculatePPWithBonus - mov r1, sp - strb r0, [r1] - adds r1, r4, 0 - adds r1, 0x11 - adds r0, r5, 0 - mov r2, sp - bl SetMonData - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _081A75DA - mov r0, sp - movs r1, 0 - strb r1, [r0] - strb r1, [r0, 0x1] - strb r1, [r0, 0x2] - strb r1, [r0, 0x3] - adds r0, r5, 0 - movs r1, 0x37 - mov r2, sp - bl SetMonData - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81A7594 - - thumb_func_start sub_81A7628 -sub_81A7628: @ 81A7628 - push {r4,lr} - adds r4, r1, 0 - bl GetMonAbility - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - cmp r4, 0x20 - beq _081A7652 - cmp r4, 0x20 - bhi _081A7648 - cmp r4, 0x7 - beq _081A7664 - cmp r4, 0x10 - beq _081A7658 - b _081A7674 -_081A7648: - cmp r4, 0x40 - beq _081A765E - cmp r4, 0x80 - beq _081A766E - b _081A7674 -_081A7652: - cmp r0, 0x28 - bne _081A7674 - b _081A7672 -_081A7658: - cmp r0, 0x29 - bne _081A7674 - b _081A7672 -_081A765E: - cmp r0, 0x7 - bne _081A7674 - b _081A7672 -_081A7664: - cmp r0, 0xF - beq _081A7672 - cmp r0, 0x48 - bne _081A7674 - b _081A7672 -_081A766E: - cmp r0, 0x11 - bne _081A7674 -_081A7672: - movs r1, 0x1 -_081A7674: - adds r0, r1, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81A7628 - - thumb_func_start sub_81A767C -sub_81A767C: @ 81A767C - push {lr} - lsls r0, 16 - lsrs r2, r0, 16 - movs r3, 0 - cmp r1, 0x20 - beq _081A76C4 - cmp r1, 0x20 - bhi _081A7696 - cmp r1, 0x7 - beq _081A771C - cmp r1, 0x10 - beq _081A7704 - b _081A771C -_081A7696: - cmp r1, 0x40 - beq _081A76E0 - cmp r1, 0x80 - bne _081A771C - ldr r1, =gBaseStats - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r2, [r0, 0x6] - cmp r2, 0x8 - beq _081A771A - cmp r2, 0x3 - beq _081A771A - ldrb r0, [r0, 0x7] - cmp r0, 0x8 - beq _081A771A - cmp r0, 0x3 - bne _081A771C - b _081A771A - .pool -_081A76C4: - ldr r0, =gBaseStats - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x6] - cmp r0, 0xF - beq _081A771A - ldrb r0, [r1, 0x7] - cmp r0, 0xF - bne _081A771C - b _081A771A - .pool -_081A76E0: - ldr r1, =gBaseStats - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r2, [r0, 0x6] - cmp r2, 0x4 - beq _081A771A - cmp r2, 0xD - beq _081A771A - ldrb r0, [r0, 0x7] - cmp r0, 0x4 - beq _081A771A - cmp r0, 0xD - bne _081A771C - b _081A771A - .pool -_081A7704: - ldr r0, =gBaseStats - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x6] - cmp r0, 0xA - beq _081A771A - ldrb r0, [r1, 0x7] - cmp r0, 0xA - bne _081A771C -_081A771A: - movs r3, 0x1 -_081A771C: - adds r0, r3, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A767C - - thumb_func_start sub_81A7728 -sub_81A7728: @ 81A7728 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - movs r6, 0 -_081A7736: - mov r1, sp - adds r0, r1, r6 - strb r6, [r0] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x2 - bls _081A7736 - movs r4, 0 - mov r8, r4 -_081A774A: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 24 - lsrs r6, r0, 24 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - mov r1, sp - adds r2, r1, r6 - ldrb r3, [r2] - adds r1, r0 - ldrb r0, [r1] - strb r0, [r2] - strb r3, [r1] - mov r0, r8 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - cmp r0, 0x9 - bls _081A774A - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r4, =0x00000cb2 - adds r0, r4 - ldrh r0, [r0] - movs r1, 0x1 - mov r10, r1 - cmp r0, 0x4 - bls _081A77A8 - movs r4, 0x3 - mov r10, r4 - cmp r0, 0x9 - bhi _081A77A8 - movs r0, 0x2 - mov r10, r0 -_081A77A8: - movs r1, 0 - str r1, [sp, 0x4] - ldr r7, =gUnknown_03001290 -_081A77AE: - movs r4, 0 - mov r9, r4 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - cmp r0, 0x22 - bhi _081A77DC - movs r0, 0x80 - b _081A77FC - .pool -_081A77DC: - cmp r0, 0x3B - bhi _081A77E4 - movs r0, 0x20 - b _081A77FC -_081A77E4: - cmp r0, 0x4F - bhi _081A77EC - movs r0, 0x40 - b _081A77FC -_081A77EC: - cmp r1, 0x59 - bhi _081A77FA - movs r0, 0x7 - b _081A77FC -_081A77F4: - movs r0, 0x1 - mov r9, r0 - b _081A786E -_081A77FA: - movs r0, 0x10 -_081A77FC: - str r0, [r7] - ldr r0, =gUnknown_03001290 - ldr r0, [r0] - ldr r1, [sp, 0x4] - cmp r1, r0 - beq _081A7874 - str r0, [sp, 0x4] - movs r4, 0 - mov r8, r4 - movs r6, 0 -_081A7810: - mov r1, sp - adds r0, r1, r6 - ldrb r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0x37 - bl GetMonData - bl pokemon_ailments_get_primary - lsls r0, 24 - cmp r0, 0 - bne _081A7860 - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - beq _081A7860 - mov r0, r8 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - adds r0, r5, 0 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r4, r0, 16 - ldr r1, [r7] - adds r0, r4, 0 - bl sub_81A767C - lsls r0, 24 - cmp r0, 0 - beq _081A77F4 -_081A7860: - cmp r8, r10 - beq _081A786E - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x2 - bls _081A7810 -_081A786E: - mov r4, r8 - cmp r4, 0 - beq _081A78CC -_081A7874: - mov r0, r9 - cmp r0, 0 - beq _081A77AE - ldr r0, =gUnknown_03001290 - ldr r0, [r0] - cmp r0, 0x20 - beq _081A7898 - cmp r0, 0x20 - bhi _081A78D0 - cmp r0, 0x7 - beq _081A78D0 - cmp r0, 0x10 - beq _081A78A4 - b _081A78D0 - .pool -_081A7898: - ldr r1, =gUnknown_0300128D - movs r0, 0x1 - b _081A78D4 - .pool -_081A78A4: - bl Random - lsls r0, 16 - lsrs r1, r0, 16 - movs r2, 0x1 - ands r1, r2 - cmp r1, 0 - beq _081A78C0 - ldr r0, =gUnknown_0300128D - strb r2, [r0] - b _081A78D6 - .pool -_081A78C0: - ldr r0, =gUnknown_0300128D - strb r1, [r0] - b _081A78D6 - .pool -_081A78CC: - movs r0, 0 - b _081A7956 -_081A78D0: - ldr r1, =gUnknown_0300128D - movs r0, 0 -_081A78D4: - strb r0, [r1] -_081A78D6: - movs r1, 0 - mov r8, r1 - movs r6, 0 -_081A78DC: - mov r4, sp - adds r0, r4, r6 - ldrb r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0x37 - bl GetMonData - bl pokemon_ailments_get_primary - lsls r0, 24 - cmp r0, 0 - bne _081A7946 - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - beq _081A7946 - mov r0, r8 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - adds r0, r5, 0 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r4, r0, 16 - ldr r7, =gUnknown_03001290 - ldr r1, [r7] - adds r0, r5, 0 - bl sub_81A7628 - lsls r0, 24 - cmp r0, 0 - bne _081A7946 - ldr r1, [r7] - adds r0, r4, 0 - bl sub_81A767C - lsls r0, 24 - cmp r0, 0 - bne _081A7946 - adds r0, r5, 0 - movs r1, 0x37 - adds r2, r7, 0 - bl SetMonData -_081A7946: - cmp r8, r10 - beq _081A7954 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x2 - bls _081A78DC -_081A7954: - movs r0, 0x1 -_081A7956: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A7728 - - thumb_func_start sub_81A7974 -sub_81A7974: @ 81A7974 - push {r4-r7,lr} - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - movs r7, 0x1 - cmp r0, 0x4 - bls _081A798E - movs r7, 0x3 - cmp r0, 0x9 - bhi _081A798E - movs r7, 0x2 -_081A798E: - movs r6, 0 - movs r5, 0 - b _081A79A2 - .pool -_081A799C: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_081A79A2: - cmp r5, 0x2 - bhi _081A79D8 - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =gPlayerParty - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x37 - bl GetMonData - bl pokemon_ailments_get_primary - lsls r0, 24 - cmp r0, 0 - bne _081A79D4 - adds r0, r4, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - beq _081A79D4 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_081A79D4: - cmp r6, r7 - bne _081A799C -_081A79D8: - cmp r6, 0 - beq _081A79E4 - movs r0, 0x1 - b _081A79E6 - .pool -_081A79E4: - movs r0, 0 -_081A79E6: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81A7974 - - thumb_func_start sub_81A79EC -sub_81A79EC: @ 81A79EC - push {r4-r6,lr} - sub sp, 0x8 - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - movs r4, 0xE1 - lsls r4, 4 - adds r0, r4 - ldrb r2, [r0] - movs r3, 0x78 - ands r3, r2 - adds r5, r1, 0 - cmp r3, 0x40 - bne _081A7A10 - lsls r0, r2, 25 - lsrs r0, 28 - b _081A7B48 - .pool -_081A7A10: - ldr r0, =gSpecialVar_0x8007 - lsls r1, r2, 29 - ldrh r0, [r0] - lsrs r1, 29 - cmp r0, r1 - bne _081A7A34 - cmp r3, 0x18 - bne _081A7A24 - bl sub_81A7728 -_081A7A24: - ldr r0, [r5] - adds r0, r4 - ldrb r0, [r0] - lsls r0, 25 - lsrs r0, 28 - b _081A7B48 - .pool -_081A7A34: - movs r2, 0 - ldr r3, =gUnknown_0861266C - movs r1, 0 -_081A7A3A: - mov r4, sp - adds r0, r4, r2 - strb r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x7 - bls _081A7A3A - movs r4, 0x8 - ldr r0, [r5] - movs r6, 0xE1 - lsls r6, 4 - adds r0, r6 - ldrb r0, [r0] - lsls r0, 25 - lsrs r0, 28 - adds r0, r3 - ldrb r1, [r0] - movs r2, 0 - adds r5, r3, 0 - movs r3, 0x1 -_081A7A64: - adds r0, r2, r5 - ldrb r0, [r0] - cmp r0, r1 - bne _081A7A78 - mov r6, sp - adds r0, r6, r2 - strb r3, [r0] - subs r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_081A7A78: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x7 - bls _081A7A64 - mov r0, sp - ldrb r0, [r0, 0x7] - cmp r0, 0x1 - beq _081A7AA0 - bl sub_81A8554 - lsls r0, 24 - cmp r0, 0 - bne _081A7AA0 - mov r1, sp - movs r0, 0x1 - strb r0, [r1, 0x7] - subs r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_081A7AA0: - mov r0, sp - ldrb r0, [r0, 0x3] - cmp r0, 0x1 - beq _081A7ABE - bl sub_81A7974 - lsls r0, 24 - cmp r0, 0 - bne _081A7ABE - mov r1, sp - movs r0, 0x1 - strb r0, [r1, 0x3] - subs r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_081A7ABE: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - movs r1, 0xE1 - lsls r1, 4 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081A7AFA - mov r0, sp - ldrb r0, [r0, 0x1] - cmp r0, 0x1 - beq _081A7AE6 - mov r1, sp - movs r0, 0x1 - strb r0, [r1, 0x1] - subs r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_081A7AE6: - mov r0, sp - ldrb r0, [r0, 0x4] - cmp r0, 0x1 - beq _081A7AFA - mov r1, sp - movs r0, 0x1 - strb r0, [r1, 0x4] - subs r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_081A7AFA: - adds r0, r4, 0 - bl AllocZeroed - adds r5, r0, 0 - movs r3, 0 - movs r2, 0 -_081A7B06: - mov r6, sp - adds r0, r6, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _081A7B1C - adds r1, r3, 0 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - adds r1, r5, r1 - strb r2, [r1] -_081A7B1C: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x7 - bls _081A7B06 - bl Random - lsls r0, 16 - lsrs r0, 16 - adds r1, r4, 0 - bl __modsi3 - adds r0, r5, r0 - ldrb r4, [r0] - adds r0, r5, 0 - bl Free - cmp r4, 0x3 - bne _081A7B46 - bl sub_81A7728 -_081A7B46: - adds r0, r4, 0 -_081A7B48: - add sp, 0x8 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A79EC - - thumb_func_start sub_81A7B58 -sub_81A7B58: @ 81A7B58 - push {r4,lr} - ldr r4, =gUnknown_03001294 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x19 - bl __umodsi3 - strb r0, [r4] - ldr r1, =gUnknown_0861231C - ldrb r0, [r4] - lsls r0, 3 - adds r0, r1 - ldrh r0, [r0] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A7B58 - - thumb_func_start sub_81A7B84 -sub_81A7B84: @ 81A7B84 - ldr r0, =gUnknown_0300128E - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_81A7B84 - - thumb_func_start sub_81A7B90 -sub_81A7B90: @ 81A7B90 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - bl sub_81A7D00 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r7, =gSaveBlock2Ptr - ldr r0, [r7] - ldr r4, =0x00000ca9 - adds r0, r4 - ldrb r0, [r0] - lsls r0, 30 - ldr r1, =gUnknown_08612314 - lsrs r0, 28 - adds r0, r1 - ldr r0, [r0] - str r0, [sp, 0x4] - ldr r0, =gEnemyParty - movs r1, 0xB - movs r2, 0 - bl GetMonData - adds r5, r0, 0 - lsls r0, r5, 16 - lsrs r0, 16 - bl sub_81A890C - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, [r7] - adds r0, r4 - ldrb r1, [r0] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _081A7C1C - bl sub_8165CB4 - adds r7, r0, 0 - cmp r7, 0x3B - ble _081A7C08 - lsls r0, r6, 2 - ldr r1, [sp, 0x4] - adds r0, r1 - ldr r1, [r0] - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x2] - subs r7, r0 - cmp r7, 0x3B - bgt _081A7C32 -_081A7C08: - movs r7, 0x3C - b _081A7C32 - .pool -_081A7C1C: - lsls r0, r6, 2 - ldr r2, [sp, 0x4] - adds r0, r2 - ldr r1, [r0] - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x2] - movs r0, 0x32 - subs r7, r0, r1 -_081A7C32: - mov r0, r8 - cmp r0, 0x1 - bne _081A7C4A - lsls r0, r7, 24 - lsrs r0, 24 - bl sub_81A88B0 - lsls r0, 24 - cmp r0, 0 - bne _081A7C4A - movs r0, 0 - b _081A7CE2 -_081A7C4A: - ldr r0, =gEnemyParty - ldr r1, =gBaseStats - mov r8, r1 - lsls r6, 2 - mov r9, r6 - ldr r2, [sp, 0x4] - add r2, r9 - mov r10, r2 - ldr r1, [r2] - lsls r6, r5, 1 - adds r4, r6, r5 - lsls r4, 2 - adds r1, r4, r1 - ldrh r2, [r1] - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - add r1, r8 - ldrb r2, [r1, 0x13] - movs r1, 0xCA - lsls r1, 1 - muls r2, r1 - lsls r1, r7, 2 - ldr r3, =gExperienceTables - adds r1, r3 - adds r2, r1 - movs r1, 0x19 - bl SetMonData - mov r1, r10 - ldr r0, [r1] - adds r4, r0 - ldrh r1, [r4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r8 - ldrb r0, [r0, 0x17] - mov r7, r9 - cmp r0, 0 - beq _081A7CA8 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - ands r0, r1 -_081A7CA8: - str r0, [sp] - ldr r0, =gEnemyParty - movs r1, 0x2E - mov r2, sp - bl SetMonData - movs r4, 0 - adds r0, r6, r5 - lsls r6, r0, 2 -_081A7CBA: - ldr r2, [sp, 0x4] - adds r0, r7, r2 - ldr r0, [r0] - adds r0, r6, r0 - lsls r1, r4, 1 - adds r0, 0x4 - adds r0, r1 - ldrh r1, [r0] - lsls r2, r4, 24 - lsrs r2, 24 - ldr r0, =gEnemyParty - bl SetMonMoveSlot - adds r4, 0x1 - cmp r4, 0x3 - ble _081A7CBA - ldr r0, =gEnemyParty - bl CalculateMonStats - movs r0, 0x1 -_081A7CE2: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A7B90 - - thumb_func_start sub_81A7D00 -sub_81A7D00: @ 81A7D00 - push {lr} - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r2, =0x00000ca9 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 29 - ldr r2, =0x00000e04 - adds r1, r2 - adds r1, r0 - ldrh r1, [r1] - adds r2, r1, 0 - movs r0, 0x8C - lsls r0, 1 - cmp r1, r0 - bhi _081A7D34 - movs r1, 0 - b _081A7D4C - .pool -_081A7D34: - movs r0, 0x8C - lsls r0, 2 - cmp r1, r0 - bhi _081A7D40 - movs r1, 0x1 - b _081A7D4C -_081A7D40: - movs r0, 0xD2 - lsls r0, 2 - movs r1, 0x3 - cmp r2, r0 - bhi _081A7D4C - movs r1, 0x2 -_081A7D4C: - adds r0, r1, 0 - pop {r1} - bx r1 - thumb_func_end sub_81A7D00 - - thumb_func_start sub_81A7D54 -sub_81A7D54: @ 81A7D54 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_08612688 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_081A7D66: - 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 _081A7D66 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A7D54 - - thumb_func_start sub_81A7D8C -sub_81A7D8C: @ 81A7D8C - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x14] - movs r2, 0x14 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _081A7DA4 - subs r0, r1, 0x1 - strh r0, [r4, 0x14] - lsls r0, 16 - cmp r0, 0 - bne _081A7DC8 -_081A7DA4: - ldrh r0, [r4, 0xA] - strh r0, [r4, 0x14] - ldrh r0, [r4, 0x10] - ldrh r1, [r4, 0x16] - adds r0, r1 - strh r0, [r4, 0x16] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x10 - ble _081A7DBC - movs r0, 0x10 - strh r0, [r4, 0x16] -_081A7DBC: - movs r0, 0x1 - negs r0, r0 - ldrb r1, [r4, 0x16] - ldr r2, =0x00002d6b - bl BlendPalettes -_081A7DC8: - movs r2, 0x16 - ldrsh r0, [r4, r2] - cmp r0, 0xF - ble _081A7DDA - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - ldrh r0, [r4, 0xC] - strh r0, [r4, 0x14] -_081A7DDA: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A7D8C - - thumb_func_start sub_81A7DE8 -sub_81A7DE8: @ 81A7DE8 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x14] - movs r2, 0x14 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _081A7E00 - subs r0, r1, 0x1 - strh r0, [r4, 0x14] - lsls r0, 16 - cmp r0, 0 - bne _081A7E22 -_081A7E00: - ldrh r0, [r4, 0xC] - strh r0, [r4, 0x14] - ldrh r0, [r4, 0x16] - ldrh r1, [r4, 0x12] - subs r0, r1 - strh r0, [r4, 0x16] - lsls r0, 16 - cmp r0, 0 - bge _081A7E16 - movs r0, 0 - strh r0, [r4, 0x16] -_081A7E16: - movs r0, 0x1 - negs r0, r0 - ldrb r1, [r4, 0x16] - ldr r2, =0x00002d6b - bl BlendPalettes -_081A7E22: - movs r0, 0x16 - ldrsh r1, [r4, r0] - cmp r1, 0 - bne _081A7E56 - ldrh r0, [r4, 0xE] - subs r0, 0x1 - strh r0, [r4, 0xE] - lsls r0, 16 - cmp r0, 0 - bne _081A7E50 - ldr r0, =sub_81A7D54 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - b _081A7E56 - .pool -_081A7E50: - ldrh r0, [r4, 0xA] - strh r0, [r4, 0x14] - strh r1, [r4, 0x8] -_081A7E56: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81A7DE8 - - thumb_func_start sub_81A7E60 -sub_81A7E60: @ 81A7E60 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x4 - mov r8, r0 - adds r4, r1, 0 - adds r5, r2, 0 - adds r6, r3, 0 - ldr r3, [sp, 0x18] - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - lsls r6, 16 - lsrs r6, 16 - lsls r3, 16 - lsrs r3, 16 - ldr r0, =sub_81A7D54 - movs r1, 0x3 - str r3, [sp] - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - mov r0, r8 - strh r0, [r1, 0xA] - strh r4, [r1, 0xC] - strh r5, [r1, 0xE] - strh r6, [r1, 0x10] - ldr r3, [sp] - strh r3, [r1, 0x12] - strh r0, [r1, 0x14] - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A7E60 - - thumb_func_start sub_81A7EC4 -sub_81A7EC4: @ 81A7EC4 - push {lr} - ldr r0, =sub_81A7D54 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _081A7EDC - movs r0, 0 - b _081A7EDE - .pool -_081A7EDC: - movs r0, 0x1 -_081A7EDE: - pop {r1} - bx r1 - thumb_func_end sub_81A7EC4 - - thumb_func_start sub_81A7EE4 -sub_81A7EE4: @ 81A7EE4 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r1 - ldrh r2, [r1, 0x8] - movs r3, 0x8 - ldrsh r0, [r1, r3] - cmp r0, 0 - bne _081A7F1C - adds r0, r2, 0x1 - strh r0, [r1, 0x8] - movs r0, 0x2 - str r0, [sp] - movs r0, 0 - movs r1, 0 - movs r2, 0x3 - movs r3, 0x2 - bl sub_81A7E60 - b _081A7F30 - .pool -_081A7F1C: - bl sub_81A7EC4 - lsls r0, 24 - cmp r0, 0 - beq _081A7F30 - bl EnableBothScriptContexts - adds r0, r4, 0 - bl DestroyTask -_081A7F30: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81A7EE4 - - thumb_func_start sub_81A7F38 -sub_81A7F38: @ 81A7F38 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - cmp r0, 0 - bne _081A7F50 - b _081A807A -_081A7F50: - movs r0, 0 - mov r8, r0 -_081A7F54: - mov r0, sp - add r0, r8 - mov r1, r8 - strb r1, [r0] - mov r0, r8 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - cmp r0, 0x2 - bls _081A7F54 - movs r5, 0 -_081A7F6C: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 24 - lsrs r4, r0, 24 - mov r2, sp - add r2, r8 - ldrb r3, [r2] - mov r0, sp - adds r1, r0, r4 - ldrb r0, [r1] - strb r0, [r2] - strb r3, [r1] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x9 - bls _081A7F6C - movs r1, 0 - mov r8, r1 -_081A7FB0: - movs r0, 0 - mov r10, r0 - mov r4, sp - add r4, r8 - ldrb r1, [r4] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r7, r1, r0 - adds r0, r7, 0 - movs r1, 0x39 - bl GetMonData - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r7, 0 - movs r1, 0x3A - bl GetMonData - lsls r0, 16 - lsrs r6, r0, 16 - str r4, [sp, 0x8] - cmp r5, r6 - bcc _081A8044 - adds r0, r7, 0 - movs r1, 0x37 - bl GetMonData - bl pokemon_ailments_get_primary - lsls r0, 24 - cmp r0, 0 - beq _081A7FFC - movs r0, 0x1 - mov r10, r0 - b _081A8048 - .pool -_081A7FFC: - adds r0, r7, 0 - movs r1, 0x15 - bl GetMonData - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - movs r4, 0 - b _081A8014 -_081A800E: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_081A8014: - cmp r4, 0x3 - bhi _081A8048 - adds r1, r4, 0 - adds r1, 0xD - adds r0, r7, 0 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - mov r1, r9 - adds r2, r4, 0 - bl CalculatePPWithBonus - lsls r0, 24 - lsrs r6, r0, 24 - adds r1, r4, 0 - adds r1, 0x11 - adds r0, r7, 0 - bl GetMonData - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, r6 - bcs _081A800E -_081A8044: - movs r1, 0x1 - mov r10, r1 -_081A8048: - mov r0, r10 - cmp r0, 0x1 - bne _081A806C - ldr r0, [sp, 0x8] - ldrb r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - bl sub_81A7594 - ldr r0, [sp, 0x4] - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - cmp r0, 0 - beq _081A807A -_081A806C: - mov r0, r8 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - cmp r0, 0x2 - bls _081A7FB0 -_081A807A: - 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_81A7F38 - - thumb_func_start sub_81A8090 -sub_81A8090: @ 81A8090 - push {r4,lr} - ldr r4, =gScriptResult - bl InBattlePike - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A8090 - - thumb_func_start InBattlePike -InBattlePike: @ 81A80A8 - push {lr} - movs r2, 0 - ldr r0, =gMapHeader - ldrh r1, [r0, 0x12] - ldr r3, =0xfffffea1 - adds r0, r1, r3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bls _081A80CA - movs r0, 0xB3 - lsls r0, 1 - cmp r1, r0 - beq _081A80CA - adds r0, 0x1 - cmp r1, r0 - bne _081A80CC -_081A80CA: - movs r2, 0x1 -_081A80CC: - adds r0, r2, 0 - pop {r1} - bx r1 - .pool - thumb_func_end InBattlePike - - thumb_func_start sub_81A80DC -sub_81A80DC: @ 81A80DC - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r4, =gScriptResult - movs r0, 0 - strh r0, [r4] - movs r0, 0x1 - bl sub_81A8590 - lsls r0, 24 - cmp r0, 0 - beq _081A8138 - movs r0, 0x1 - strh r0, [r4] - bl Random - ldr r5, =gSaveBlock2Ptr - ldr r4, [r5] - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x6 - bl __umodsi3 - movs r3, 0xE1 - lsls r3, 4 - adds r4, r3 - movs r1, 0x7 - ands r1, r0 - ldrb r2, [r4] - movs r0, 0x8 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4] - ldr r2, [r5] - adds r2, r3 - ldrb r1, [r2] - movs r0, 0x79 - negs r0, r0 - ands r0, r1 - movs r1, 0x40 - b _081A8248 - .pool -_081A8138: - bl Random - ldr r7, =gSaveBlock2Ptr - ldr r4, [r7] - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - movs r3, 0xE1 - lsls r3, 4 - adds r4, r3 - movs r1, 0x7 - ands r1, r0 - ldrb r2, [r4] - movs r0, 0x8 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4] - ldr r0, [r7] - adds r0, r3 - ldrb r1, [r0] - movs r0, 0x80 - ands r0, r1 - movs r6, 0x8 - cmp r0, 0 - beq _081A8172 - movs r6, 0x6 -_081A8172: - adds r0, r6, 0 - bl AllocZeroed - adds r5, r0, 0 - movs r2, 0 - movs r3, 0 - cmp r2, r6 - bcs _081A81BE - adds r4, r7, 0 -_081A8184: - ldr r0, [r4] - movs r1, 0xE1 - lsls r1, 4 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081A81B0 - cmp r2, 0x1 - beq _081A81B4 - cmp r2, 0x4 - beq _081A81B4 - adds r1, r3, 0 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - adds r1, r5, r1 - strb r2, [r1] - b _081A81B4 - .pool -_081A81B0: - adds r0, r5, r2 - strb r2, [r0] -_081A81B4: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, r6 - bcc _081A8184 -_081A81BE: - bl Random - ldr r7, =gSaveBlock2Ptr - ldr r4, [r7] - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - bl __modsi3 - adds r0, r5, r0 - ldrb r0, [r0] - movs r6, 0xE1 - lsls r6, 4 - adds r4, r6 - movs r1, 0xF - ands r1, r0 - lsls r1, 3 - ldrb r2, [r4] - movs r0, 0x79 - negs r0, r0 - mov r8, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4] - adds r0, r5, 0 - bl Free - ldr r0, [r7] - adds r0, r6 - ldrb r1, [r0] - movs r0, 0x78 - ands r0, r1 - cmp r0, 0x18 - bne _081A821C - bl sub_81A7974 - lsls r0, 24 - cmp r0, 0 - bne _081A821C - ldr r2, [r7] - adds r2, r6 - ldrb r1, [r2] - mov r0, r8 - ands r0, r1 - movs r1, 0x10 - orrs r0, r1 - strb r0, [r2] -_081A821C: - ldr r5, =gSaveBlock2Ptr - ldr r0, [r5] - movs r4, 0xE1 - lsls r4, 4 - adds r0, r4 - ldrb r1, [r0] - movs r0, 0x78 - ands r0, r1 - cmp r0, 0x38 - bne _081A824C - bl sub_81A8554 - lsls r0, 24 - cmp r0, 0 - bne _081A824C - ldr r2, [r5] - adds r2, r4 - ldrb r1, [r2] - movs r0, 0x79 - negs r0, r0 - ands r0, r1 - movs r1, 0x10 -_081A8248: - orrs r0, r1 - strb r0, [r2] -_081A824C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A80DC - - thumb_func_start sub_81A825C -sub_81A825C: @ 81A825C - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - movs r2, 0xE1 - lsls r2, 4 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 29 - lsrs r0, 29 - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_81A825C - - thumb_func_start sub_81A827C -sub_81A827C: @ 81A827C - ldr r2, =gScriptResult - ldr r1, =gUnknown_0861266C - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - movs r3, 0xE1 - lsls r3, 4 - adds r0, r3 - ldrb r0, [r0] - lsls r0, 25 - lsrs r0, 28 - adds r0, r1 - ldrb r0, [r0] - strh r0, [r2] - bx lr - .pool - thumb_func_end sub_81A827C - - thumb_func_start sub_81A82A4 -sub_81A82A4: @ 81A82A4 - push {r4-r7,lr} - lsls r0, 24 - movs r7, 0x6 - cmp r0, 0 - bne _081A82B0 - movs r7, 0x1 -_081A82B0: - ldr r4, =gSaveBlock2Ptr - ldr r1, [r4] - ldr r2, =0x00000ca9 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 29 - ldr r2, =0x00000e04 - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - movs r1, 0xE - bl __udivsi3 - lsls r0, 16 - lsrs r6, r0, 16 - adds r5, r4, 0 -_081A82D2: - lsls r0, r6, 24 - lsrs r0, 24 - adds r1, r7, 0 - bl sub_8162548 - lsls r0, 16 - lsrs r4, r0, 16 - movs r3, 0 - ldr r1, [r5] - ldr r2, =0x00000cb2 - adds r0, r1, r2 - ldrh r0, [r0] - subs r2, r0, 0x1 - cmp r3, r2 - bge _081A831A - ldr r0, =0x00000cb4 - adds r1, r0 - b _081A8314 - .pool -_081A830C: - adds r1, 0x2 - adds r3, 0x1 - cmp r3, r2 - bge _081A831A -_081A8314: - ldrh r0, [r1] - cmp r0, r4 - bne _081A830C -_081A831A: - ldr r0, [r5] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - subs r0, 0x1 - cmp r3, r0 - bne _081A82D2 - ldr r5, =gTrainerBattleOpponent_A - strh r4, [r5] - ldr r1, =gUnknown_0203BC88 - ldr r0, =gBattleFrontierTrainers - str r0, [r1] - ldrh r0, [r5] - movs r1, 0 - bl sub_8162614 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r0, =0x00000cb2 - adds r2, r1, r0 - ldrh r0, [r2] - cmp r0, 0xD - bhi _081A8356 - subs r0, 0x1 - lsls r0, 1 - ldr r2, =0x00000cb4 - adds r1, r2 - adds r1, r0 - ldrh r0, [r5] - strh r0, [r1] -_081A8356: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A82A4 - - thumb_func_start sub_81A8374 -sub_81A8374: @ 81A8374 - push {r4-r7,lr} - ldr r4, =gSaveBlock2Ptr - ldr r1, [r4] - ldr r2, =0x00000ca9 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 29 - ldr r2, =0x00000e04 - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - movs r1, 0xE - bl __udivsi3 - lsls r0, 16 - lsrs r5, r0, 16 - ldr r1, =gUnknown_0203BC88 - ldr r0, =gBattleFrontierTrainers - str r0, [r1] - lsls r7, r5, 24 - adds r6, r4, 0 -_081A83A0: - lsls r0, r5, 24 - lsrs r0, 24 - movs r1, 0x1 - bl sub_8162548 - lsls r0, 16 - lsrs r4, r0, 16 - movs r3, 0 - ldr r1, [r6] - ldr r2, =0x00000cb2 - adds r0, r1, r2 - ldrh r0, [r0] - subs r2, r0, 0x1 - cmp r3, r2 - bge _081A83EE - ldr r0, =0x00000cb4 - adds r1, r0 - b _081A83E8 - .pool -_081A83E0: - adds r1, 0x2 - adds r3, 0x1 - cmp r3, r2 - bge _081A83EE -_081A83E8: - ldrh r0, [r1] - cmp r0, r4 - bne _081A83E0 -_081A83EE: - ldr r0, [r6] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - subs r0, 0x1 - cmp r3, r0 - bne _081A83A0 - ldr r5, =gTrainerBattleOpponent_A - strh r4, [r5] - ldrh r0, [r5] - movs r1, 0 - bl sub_8162614 - ldr r3, =gSaveBlock2Ptr - ldr r1, [r3] - ldr r0, =0x00000cb2 - adds r2, r1, r0 - ldrh r0, [r2] - cmp r0, 0xE - bhi _081A8424 - subs r0, 0x1 - lsls r0, 1 - ldr r2, =0x00000cb4 - adds r1, r2 - adds r1, r0 - ldrh r0, [r5] - strh r0, [r1] -_081A8424: - adds r5, r3, 0 -_081A8426: - lsrs r0, r7, 24 - movs r1, 0x1 - bl sub_8162548 - lsls r0, 16 - lsrs r4, r0, 16 - movs r3, 0 - ldr r1, [r5] - ldr r2, =0x00000cb2 - adds r0, r1, r2 - ldrh r0, [r0] - cmp r3, r0 - bge _081A8466 - adds r2, 0x2 - adds r0, r1, r2 - ldrh r0, [r0] - cmp r0, r4 - beq _081A8466 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - subs r2, 0x2 - adds r0, r1, r2 - ldrh r2, [r0] - ldr r0, =0x00000cb4 - adds r1, r0 -_081A8458: - adds r1, 0x2 - adds r3, 0x1 - cmp r3, r2 - bge _081A8466 - ldrh r0, [r1] - cmp r0, r4 - bne _081A8458 -_081A8466: - ldr r0, [r5] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - cmp r3, r0 - bne _081A8426 - ldr r5, =gTrainerBattleOpponent_B - strh r4, [r5] - ldrh r0, [r5] - movs r1, 0x1 - bl sub_8162614 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r0, =0x00000cb2 - adds r2, r1, r0 - ldrh r0, [r2] - cmp r0, 0xD - bhi _081A849A - subs r0, 0x2 - lsls r0, 1 - ldr r2, =0x00000cb4 - adds r1, r2 - adds r1, r0 - ldrh r0, [r5] - strh r0, [r1] -_081A849A: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A8374 - - thumb_func_start sub_81A84B4 -sub_81A84B4: @ 81A84B4 - push {r4,r5,lr} - movs r2, 0 - ldr r5, =gSaveBlock2Ptr - ldr r4, =0x00000cb4 - ldr r0, =0x0000ffff - adds r3, r0, 0 -_081A84C0: - ldr r1, [r5] - lsls r0, r2, 1 - adds r1, r4 - adds r1, r0 - ldrh r0, [r1] - orrs r0, r3 - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xD - bls _081A84C0 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A84B4 - - thumb_func_start sub_81A84EC -sub_81A84EC: @ 81A84EC - push {lr} - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0 - bne _081A8524 - ldr r3, =gTrainerBattleOpponent_A - ldrh r1, [r3] - ldr r0, =0x0000012b - cmp r1, r0 - bhi _081A8542 - ldr r2, =gUnknown_0203BC88 - movs r0, 0x34 - muls r1, r0 - ldr r0, [r2] - adds r0, r1 - adds r0, 0xC - bl ConvertBattleFrontierTrainerSpeechToString - b _081A8542 - .pool -_081A8524: - cmp r0, 0x1 - bne _081A8542 - ldr r3, =gTrainerBattleOpponent_B - ldrh r1, [r3] - ldr r0, =0x0000012b - cmp r1, r0 - bhi _081A8542 - ldr r2, =gUnknown_0203BC88 - movs r0, 0x34 - muls r1, r0 - ldr r0, [r2] - adds r0, r1 - adds r0, 0xC - bl ConvertBattleFrontierTrainerSpeechToString -_081A8542: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A84EC - - thumb_func_start sub_81A8554 -sub_81A8554: @ 81A8554 - push {r4-r6,lr} - ldr r5, =gPlayerParty - movs r6, 0 - movs r4, 0 -_081A855C: - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - bne _081A856E - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_081A856E: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, 0x64 - cmp r4, 0x2 - bls _081A855C - cmp r6, 0x1 - bhi _081A8588 - movs r0, 0x1 - b _081A858A - .pool -_081A8588: - movs r0, 0 -_081A858A: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81A8554 - - thumb_func_start sub_81A8590 -sub_81A8590: @ 81A8590 - push {r4-r6,lr} - lsls r0, 24 - movs r6, 0 - ldr r1, =gSaveBlock2Ptr - ldr r2, [r1] - ldr r3, =0x00000ca9 - adds r1, r2, r3 - ldrb r1, [r1] - lsls r1, 30 - lsrs r1, 29 - ldr r3, =0x00000e04 - adds r2, r3 - adds r2, r1 - lsrs r4, r0, 24 - ldrh r2, [r2] - adds r0, r4, r2 - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0x5 - bl sub_81A3B30 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - blt _081A85F0 - cmp r2, 0x1 - bgt _081A85F0 - ldr r1, =gUnknown_086125DC - adds r0, r2, 0 - adds r0, 0x14 - adds r0, r1 - ldrb r0, [r0] - ldrb r1, [r1, 0x17] - subs r0, r1 - cmp r4, r0 - bne _081A8634 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - b _081A8634 - .pool -_081A85F0: - ldr r5, =gUnknown_086125DC - movs r0, 0x5 - lsls r3, r0, 2 - adds r0, r3, r5 - ldrb r1, [r0] - adds r0, r5, 0x3 - adds r0, r3, r0 - ldrb r2, [r0] - subs r1, r2 - cmp r4, r1 - bne _081A8610 - movs r6, 0x3 - b _081A8634 - .pool -_081A8610: - adds r0, r5, 0x1 - adds r0, r3, r0 - ldrb r1, [r0] - subs r0, r1, r2 - cmp r4, r0 - beq _081A8632 - cmp r4, r1 - bls _081A8634 - subs r0, r4, r1 - adds r0, r2 - adds r1, r5, 0x2 - adds r1, r3, r1 - ldrb r1, [r1] - bl __modsi3 - cmp r0, 0 - bne _081A8634 -_081A8632: - movs r6, 0x4 -_081A8634: - adds r0, r6, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81A8590 - - thumb_func_start sub_81A863C -sub_81A863C: @ 81A863C - push {r4,lr} - ldr r4, =gScriptResult - movs r0, 0 - bl sub_81A8590 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A863C - - thumb_func_start sub_81A8658 -sub_81A8658: @ 81A8658 - push {r4,lr} - ldr r3, =gUnknown_08612675 - ldr r2, =gSpecialVar_0x8007 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - movs r1, 0xE1 - lsls r1, 4 - adds r0, r1 - ldrb r1, [r0] - lsls r1, 29 - lsrs r1, 29 - lsls r0, r1, 1 - adds r0, r1 - ldrh r2, [r2] - adds r0, r2 - adds r0, r3 - ldrb r4, [r0] - adds r0, r4, 0 - bl sub_81A7F38 - ldr r0, =gScriptResult - strh r4, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A8658 - - thumb_func_start sub_81A869C -sub_81A869C: @ 81A869C - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r0, =gSpecialVar_0x8005 - ldrb r1, [r0] - movs r0, 0xE1 - lsls r0, 4 - adds r2, r0 - lsls r1, 7 - ldrb r3, [r2] - movs r0, 0x7F - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - bx lr - .pool - thumb_func_end sub_81A869C - - thumb_func_start sub_81A86C0 -sub_81A86C0: @ 81A86C0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r1, =gScriptResult - movs r0, 0x1 - strh r0, [r1] - movs r0, 0 - mov r10, r0 -_081A86D4: - movs r0, 0 - mov r9, r0 - movs r0, 0x64 - mov r1, r10 - muls r1, r0 - ldr r0, =gPlayerParty - adds r7, r1, r0 - adds r0, r7, 0 - movs r1, 0x39 - bl GetMonData - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r7, 0 - movs r1, 0x3A - bl GetMonData - lsls r0, 16 - lsrs r5, r0, 16 - cmp r4, r5 - bcc _081A8762 - adds r0, r7, 0 - movs r1, 0x37 - bl GetMonData - bl pokemon_ailments_get_primary - lsls r0, 24 - cmp r0, 0 - bne _081A8762 - adds r0, r7, 0 - movs r1, 0x15 - bl GetMonData - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r6, 0 - b _081A8732 - .pool -_081A872C: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_081A8732: - cmp r6, 0x3 - bhi _081A8766 - adds r1, r6, 0 - adds r1, 0xD - adds r0, r7, 0 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - mov r1, r8 - adds r2, r6, 0 - bl CalculatePPWithBonus - lsls r0, 24 - lsrs r5, r0, 24 - adds r1, r6, 0 - adds r1, 0x11 - adds r0, r7, 0 - bl GetMonData - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, r5 - bcs _081A872C -_081A8762: - movs r0, 0x1 - mov r9, r0 -_081A8766: - mov r0, r9 - cmp r0, 0x1 - bne _081A8778 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - b _081A8786 - .pool -_081A8778: - mov r0, r10 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - cmp r0, 0x2 - bls _081A86D4 -_081A8786: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81A86C0 - - thumb_func_start sub_81A8794 -sub_81A8794: @ 81A8794 - push {r4-r7,lr} - movs r5, 0 - ldr r7, =gSaveBlock1Ptr - ldr r6, =gSaveBlock2Ptr -_081A879C: - ldr r0, [r6] - lsls r4, r5, 1 - ldr r1, =0x00000caa - adds r0, r1 - adds r0, r4 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - movs r2, 0xEA - lsls r2, 1 - adds r1, r2 - ldr r0, [r7] - adds r0, r1 - movs r1, 0xC - bl GetMonData - ldr r1, [r6] - ldr r2, =0x00000e12 - adds r1, r2 - adds r1, r4 - strh r0, [r1] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _081A879C - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A8794 - - thumb_func_start sub_81A87E8 -sub_81A87E8: @ 81A87E8 - push {r4,lr} - movs r4, 0 -_081A87EC: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - lsls r3, r4, 1 - ldr r1, =0x00000caa - adds r0, r2, r1 - adds r0, r3 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gBattleScripting + 0x14 - adds r0, r1 - ldr r1, =0x00000e12 - adds r3, r1 - adds r2, r3 - movs r1, 0xC - bl SetMonData - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _081A87EC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A87E8 - - thumb_func_start sub_81A8830 -sub_81A8830: @ 81A8830 - push {r4-r6,lr} - ldr r3, =gSaveBlock2Ptr - ldr r1, [r3] - ldr r2, =0x00000ca9 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r5, r0, 30 - ldr r0, =0x00000ca8 - adds r1, r0 - movs r4, 0 - strb r4, [r1] - ldr r1, [r3] - ldr r6, =0x00000cb2 - adds r0, r1, r6 - strh r4, [r0] - adds r1, r2 - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r3, [r3] - ldr r0, =0x00000cdc - adds r2, r3, r0 - ldr r1, =gUnknown_08612690 - lsls r0, r5, 2 - adds r0, r1 - ldr r1, [r2] - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _081A887C - lsls r1, r5, 1 - ldr r2, =0x00000e04 - adds r0, r3, r2 - adds r0, r1 - strh r4, [r0] -_081A887C: - ldr r0, =gTrainerBattleOpponent_A - strh r4, [r0] - ldr r1, =gBattleOutcome - movs r0, 0 - strb r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A8830 - - thumb_func_start sub_81A88B0 -sub_81A88B0: @ 81A88B0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =gPlayerParty - adds r0, r4, 0 - movs r1, 0x6 - bl GetMonData - cmp r0, 0 - bne _081A8904 - adds r0, r4, 0 - bl GetMonAbility - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x33 - beq _081A88D6 - cmp r0, 0x16 - bne _081A8904 -_081A88D6: - adds r0, r4, 0 - movs r1, 0x38 - bl GetMonData - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x5 - bls _081A8904 - subs r0, 0x5 - cmp r5, r0 - bgt _081A8904 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081A8904 - movs r0, 0 - b _081A8906 - .pool -_081A8904: - movs r0, 0x1 -_081A8906: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81A88B0 - - thumb_func_start sub_81A890C -sub_81A890C: @ 81A890C - push {lr} - lsls r0, 16 - lsrs r2, r0, 16 - ldr r0, =0x0000017b - cmp r2, r0 - bne _081A8920 - movs r1, 0 - b _081A892A - .pool -_081A8920: - ldr r0, =0x00000149 - movs r1, 0x2 - cmp r2, r0 - bne _081A892A - movs r1, 0x1 -_081A892A: - adds r0, r1, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A890C - - thumb_func_start sub_81A8934 -@ void sub_81A8934(u8) -sub_81A8934: @ 81A8934 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =gUnknown_0203CE50 - ldr r0, [r4] - cmp r0, 0 - bne _081A894A - movs r0, 0x44 - bl AllocZeroed - str r0, [r4] -_081A894A: - ldr r0, [r4] - adds r0, 0x41 - strb r5, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A8934 - - thumb_func_start sub_81A895C -sub_81A895C: @ 81A895C - push {r4,lr} - ldr r4, =gUnknown_0203CE50 - ldr r0, [r4] - cmp r0, 0 - beq _081A896E - bl Free - movs r0, 0 - str r0, [r4] -_081A896E: - movs r0, 0xFF - movs r1, 0 - movs r2, 0 - bl GetFieldObjectIdByLocalIdAndMap - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gMapObjects - adds r0, r1 - bl FieldObjectClearAnimIfSpecialAnimFinished - bl sub_80D338C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A895C - - thumb_func_start sub_81A89A0 -sub_81A89A0: @ 81A89A0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0xC7 - lsls r1, 4 - adds r1, r0 - mov r9, r1 - movs r3, 0 - mov r10, r3 - mov r8, r3 -_081A89C4: - mov r0, r8 - lsls r4, r0, 1 - adds r1, r4, r0 - lsls r1, 3 - add r1, r9 - ldrh r0, [r1, 0x4] - adds r0, 0x7 - ldrh r1, [r1, 0x6] - adds r1, 0x7 - lsls r0, 16 - asrs r0, 16 - lsls r1, 16 - asrs r1, 16 - bl MapGridGetMetatileIdAt - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, =gUnknown_0203CE50 - ldr r0, [r0] - adds r0, 0x41 - ldrb r0, [r0] - movs r2, 0xA6 - lsls r2, 2 - cmp r0, 0 - bne _081A89F8 - subs r2, 0x48 -_081A89F8: - ldr r0, =0x0000024f - cmp r1, r0 - bls _081A8AD4 - subs r1, r2 - adds r0, r1, 0 - cmp r1, 0 - bge _081A8A08 - adds r0, r1, 0x7 -_081A8A08: - asrs r2, r0, 3 - lsls r0, r2, 24 - lsrs r0, 24 - cmp r0, 0x4 - bhi _081A8AD4 - ldr r3, [sp] - cmp r0, r3 - bne _081A8AD4 - lsls r0, r2, 3 - subs r0, r1, r0 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bhi _081A8AD4 - movs r1, 0 - movs r2, 0 - cmp r5, 0x1 - beq _081A8A58 - cmp r5, 0x1 - bgt _081A8A44 - cmp r5, 0 - beq _081A8A4E - b _081A8AD4 - .pool -_081A8A44: - cmp r5, 0x2 - beq _081A8A64 - cmp r5, 0x3 - beq _081A8A70 - b _081A8AD4 -_081A8A4E: - ldr r7, =gUnknown_08612698 - movs r1, 0x1 - b _081A8A74 - .pool -_081A8A58: - ldr r7, =gUnknown_0861269C - movs r2, 0x1 - b _081A8A74 - .pool -_081A8A64: - ldr r7, =gUnknown_086126A0 - movs r1, 0xFF - b _081A8A74 - .pool -_081A8A70: - ldr r7, =gUnknown_086126A4 - movs r2, 0xFF -_081A8A74: - mov r3, r8 - adds r0, r4, r3 - lsls r0, 3 - mov r3, r9 - adds r4, r0, r3 - lsls r0, r1, 24 - asrs r0, 24 - ldrh r1, [r4, 0x4] - adds r0, r1 - strh r0, [r4, 0x4] - lsls r0, r2, 24 - asrs r0, 24 - ldrh r3, [r4, 0x6] - adds r0, r3 - strh r0, [r4, 0x6] - ldrb r0, [r4] - ldr r6, =gSaveBlock1Ptr - ldr r2, [r6] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - bl GetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x10 - beq _081A8ACC - mov r0, r8 - adds r1, r5, 0 - bl sub_81A8D60 - ldrb r4, [r4] - mov r10, r4 - mov r0, r10 - ldr r2, [r6] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - adds r3, r7, 0 - bl exec_movement - b _081A8AD4 - .pool -_081A8ACC: - mov r0, r8 - adds r1, r5, 0 - bl sub_81A8D94 -_081A8AD4: - mov r0, r8 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - cmp r0, 0x3F - bhi _081A8AE4 - b _081A89C4 -_081A8AE4: - mov r0, r10 - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81A89A0 - - thumb_func_start sub_81A8AF8 -sub_81A8AF8: @ 81A8AF8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r1, =gUnknown_0203CE50 - ldr r2, [r1] - cmp r2, 0 - bne _081A8B0C - b _081A8D4A -_081A8B0C: - adds r0, r2, 0 - adds r0, 0x41 - ldrb r0, [r0] - movs r3, 0xA6 - lsls r3, 2 - mov r10, r3 - cmp r0, 0 - bne _081A8B22 - movs r0, 0x94 - lsls r0, 2 - mov r10, r0 -_081A8B22: - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r3, 0xC7 - lsls r3, 4 - adds r7, r0, r3 - movs r0, 0 - mov r9, r0 - adds r0, r2, 0 - adds r0, 0x40 - ldrb r0, [r0] - cmp r9, r0 - bcc _081A8B3C - b _081A8D4A -_081A8B3C: - mov r8, r1 -_081A8B3E: - mov r1, r8 - ldr r0, [r1] - mov r2, r9 - lsls r4, r2, 2 - adds r0, r4 - ldrb r0, [r0, 0x1] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 3 - adds r1, r7 - ldrh r0, [r1, 0x4] - adds r0, 0x7 - ldrh r1, [r1, 0x6] - adds r1, 0x7 - lsls r0, 16 - asrs r0, 16 - lsls r1, 16 - asrs r1, 16 - bl MapGridGetMetatileIdAt - lsls r0, 16 - lsrs r0, 16 - mov r3, r10 - subs r1, r0, r3 - adds r0, r1, 0 - cmp r1, 0 - bge _081A8B76 - adds r0, r1, 0x7 -_081A8B76: - asrs r0, 3 - lsls r0, 3 - subs r0, r1, r0 - lsls r0, 24 - lsrs r0, 24 - mov r2, r8 - ldr r1, [r2] - adds r1, r4 - ldrb r1, [r1] - subs r0, r1 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - blt _081A8B96 - cmp r1, 0x3 - bne _081A8BAC -_081A8B96: - movs r0, 0x3 - negs r0, r0 - movs r6, 0 - cmp r1, r0 - bne _081A8BB4 - b _081A8BB2 - .pool -_081A8BAC: - movs r6, 0x2 - cmp r1, 0 - ble _081A8BB4 -_081A8BB2: - movs r6, 0x1 -_081A8BB4: - ldr r5, =gUnknown_0203CE50 - ldr r0, [r5] - adds r0, r4 - ldrb r1, [r0, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r7 - ldrb r0, [r0] - ldr r1, =gSaveBlock1Ptr - ldr r2, [r1] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - bl GetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x10 - bne _081A8BDC - b _081A8D32 -_081A8BDC: - ldr r0, =gMapObjects - lsls r1, r2, 3 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x18] - lsls r0, 28 - lsrs r0, 28 - adds r1, r0, 0 - cmp r6, 0 - bne _081A8C9C - cmp r0, 0x2 - beq _081A8C60 - cmp r0, 0x2 - bgt _081A8C0C - cmp r0, 0x1 - beq _081A8C30 - b _081A8D32 - .pool -_081A8C0C: - cmp r0, 0x3 - beq _081A8C48 - cmp r0, 0x4 - beq _081A8C16 - b _081A8D32 -_081A8C16: - ldr r3, =gUnknown_086126AE - ldr r0, [r5] - adds r0, r4 - ldrb r1, [r0, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r7 - movs r1, 0x7 - b _081A8C72 - .pool -_081A8C30: - ldr r3, =gUnknown_086126A8 - ldr r0, [r5] - adds r0, r4 - ldrb r1, [r0, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r7 - movs r1, 0xA - b _081A8C72 - .pool -_081A8C48: - ldr r3, =gUnknown_086126AA - ldr r0, [r5] - adds r0, r4 - ldrb r1, [r0, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r7 - movs r1, 0x8 - b _081A8C72 - .pool -_081A8C60: - ldr r3, =gUnknown_086126AC - ldr r0, [r5] - adds r0, r4 - ldrb r1, [r0, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r7 - movs r1, 0x9 -_081A8C72: - strb r1, [r0, 0x9] - mov r1, r8 - ldr r0, [r1] - adds r0, r4 - ldrb r1, [r0, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r7 - ldrb r0, [r0] - ldr r1, =gSaveBlock1Ptr - ldr r2, [r1] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - bl exec_movement - b _081A8D32 - .pool -_081A8C9C: - cmp r6, 0x1 - bne _081A8D32 - cmp r0, 0x2 - beq _081A8D00 - cmp r0, 0x2 - bgt _081A8CAE - cmp r0, 0x1 - beq _081A8CD0 - b _081A8D32 -_081A8CAE: - cmp r1, 0x3 - beq _081A8CE8 - cmp r1, 0x4 - bne _081A8D32 - ldr r3, =gUnknown_086126AA - ldr r0, [r5] - adds r0, r4 - ldrb r1, [r0, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r7 - movs r1, 0x8 - b _081A8D12 - .pool -_081A8CD0: - ldr r3, =gUnknown_086126AC - ldr r0, [r5] - adds r0, r4 - ldrb r1, [r0, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r7 - movs r1, 0x9 - b _081A8D12 - .pool -_081A8CE8: - ldr r3, =gUnknown_086126AE - ldr r0, [r5] - adds r0, r4 - ldrb r1, [r0, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r7 - movs r1, 0x7 - b _081A8D12 - .pool -_081A8D00: - ldr r3, =gUnknown_086126A8 - ldr r0, [r5] - adds r0, r4 - ldrb r1, [r0, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r7 - movs r1, 0xA -_081A8D12: - strb r1, [r0, 0x9] - mov r2, r8 - ldr r0, [r2] - adds r0, r4 - ldrb r1, [r0, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r7 - ldrb r0, [r0] - ldr r1, =gSaveBlock1Ptr - ldr r2, [r1] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - bl exec_movement -_081A8D32: - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - mov r3, r8 - ldr r0, [r3] - adds r0, 0x40 - ldrb r0, [r0] - cmp r9, r0 - bcs _081A8D4A - b _081A8B3E -_081A8D4A: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A8AF8 - - thumb_func_start sub_81A8D60 -sub_81A8D60: @ 81A8D60 - push {r4,lr} - ldr r4, =gUnknown_0203CE50 - ldr r3, [r4] - adds r2, r3, 0 - adds r2, 0x40 - ldrb r2, [r2] - lsls r2, 2 - adds r3, r2 - strb r0, [r3, 0x1] - ldr r2, [r4] - adds r0, r2, 0 - adds r0, 0x40 - ldrb r0, [r0] - lsls r0, 2 - adds r2, r0 - strb r1, [r2] - ldr r1, [r4] - adds r1, 0x40 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A8D60 - - thumb_func_start sub_81A8D94 -sub_81A8D94: @ 81A8D94 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0xC7 - lsls r1, 4 - adds r5, r0, r1 - lsls r1, r4, 1 - adds r1, r4 - lsls r1, 3 - adds r1, r5 - ldrh r0, [r1, 0x4] - adds r0, 0x7 - ldrh r1, [r1, 0x6] - adds r1, 0x7 - lsls r0, 16 - asrs r0, 16 - lsls r1, 16 - asrs r1, 16 - bl MapGridGetMetatileIdAt - lsls r0, 16 - lsrs r2, r0, 16 - ldr r0, =gUnknown_0203CE50 - ldr r0, [r0] - adds r0, 0x41 - ldrb r0, [r0] - movs r1, 0xA6 - lsls r1, 2 - cmp r0, 0 - bne _081A8DDA - subs r1, 0x48 -_081A8DDA: - subs r1, r2, r1 - adds r0, r1, 0 - cmp r1, 0 - bge _081A8DE4 - adds r0, r1, 0x7 -_081A8DE4: - asrs r0, 3 - lsls r0, 3 - subs r0, r1, r0 - lsls r0, 24 - lsrs r0, 24 - subs r0, r6 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - blt _081A8DFC - cmp r1, 0x3 - bne _081A8E08 -_081A8DFC: - movs r2, 0 - b _081A8E1A - .pool -_081A8E08: - cmp r1, 0 - bgt _081A8E14 - movs r0, 0x3 - negs r0, r0 - cmp r1, r0 - bne _081A8E18 -_081A8E14: - movs r2, 0x1 - b _081A8E1A -_081A8E18: - movs r2, 0x2 -_081A8E1A: - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r5 - ldrb r0, [r1, 0x9] - adds r3, r0, 0 - cmp r2, 0 - bne _081A8E4C - cmp r0, 0x8 - beq _081A8E72 - cmp r0, 0x8 - bgt _081A8E38 - cmp r0, 0x7 - beq _081A8E48 - b _081A8E76 -_081A8E38: - cmp r0, 0x9 - beq _081A8E44 - cmp r0, 0xA - bne _081A8E76 - movs r0, 0x7 - b _081A8E74 -_081A8E44: - movs r0, 0x8 - b _081A8E74 -_081A8E48: - movs r0, 0x9 - b _081A8E74 -_081A8E4C: - cmp r2, 0x1 - bne _081A8E76 - cmp r0, 0x8 - beq _081A8E6A - cmp r0, 0x8 - bgt _081A8E5E - cmp r0, 0x7 - beq _081A8E72 - b _081A8E76 -_081A8E5E: - cmp r3, 0x9 - beq _081A8E6E - cmp r3, 0xA - bne _081A8E76 - movs r0, 0x8 - b _081A8E74 -_081A8E6A: - movs r0, 0x9 - b _081A8E74 -_081A8E6E: - movs r0, 0x7 - b _081A8E74 -_081A8E72: - movs r0, 0xA -_081A8E74: - strb r0, [r1, 0x9] -_081A8E76: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81A8D94 - - thumb_func_start sub_81A8E7C -sub_81A8E7C: @ 81A8E7C - push {lr} - ldr r1, =gUnknown_08613EE0 - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A8E7C - - thumb_func_start sub_81A8E9C -sub_81A8E9C: @ 81A8E9C - push {r4-r6,lr} - ldr r3, =gSaveBlock2Ptr - ldr r1, [r3] - ldr r4, =0x00000ca9 - adds r0, r1, r4 - ldrb r0, [r0] - lsls r0, 30 - lsrs r5, r0, 30 - ldr r0, =0x00000ca8 - adds r1, r0 - movs r2, 0 - strb r2, [r1] - ldr r1, [r3] - ldr r6, =0x00000cb2 - adds r0, r1, r6 - strh r2, [r0] - adds r1, r4 - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - cmp r5, 0 - beq _081A8EF0 - ldr r0, [r3] - ldr r1, =0x00000cdc - adds r0, r1 - ldr r2, [r0] - movs r0, 0x80 - lsls r0, 6 - b _081A8EFC - .pool -_081A8EF0: - ldr r0, [r3] - ldr r6, =0x00000cdc - adds r0, r6 - ldr r2, [r0] - movs r0, 0x80 - lsls r0, 5 -_081A8EFC: - ands r2, r0 - cmp r2, 0 - bne _081A8F14 - ldr r0, [r3] - lsls r1, r5, 1 - ldr r3, =0x00000e1a - adds r0, r3 - adds r0, r1 - strh r2, [r0] - adds r0, r5, 0 - bl sub_81AAA7C -_081A8F14: - bl sub_81C4EEC - ldr r0, =gTrainerBattleOpponent_A - movs r1, 0 - strh r1, [r0] - ldr r0, =gBattleOutcome - strb r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A8E9C - - thumb_func_start sub_81A8F38 -sub_81A8F38: @ 81A8F38 - push {r4,lr} - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r2, =0x00000ca9 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r4, r0, 30 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - adds r3, r1, 0 - cmp r0, 0x6 - bls _081A8F54 - b _081A903A -_081A8F54: - lsls r0, 2 - ldr r1, =_081A8F70 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A8F70: - .4byte _081A8F8C - .4byte _081A8F9C - .4byte _081A8FB4 - .4byte _081A8FE4 - .4byte _081A8FF8 - .4byte _081A9010 - .4byte _081A9028 -_081A8F8C: - ldr r0, =gScriptResult - ldr r1, [r3] - ldr r3, =0x00000e18 - b _081A8FFE - .pool -_081A8F9C: - ldr r2, =gScriptResult - ldr r0, [r3] - lsls r1, r4, 1 - ldr r3, =0x00000e1a - adds r0, r3 - adds r0, r1 - ldrh r0, [r0] - b _081A9038 - .pool -_081A8FB4: - cmp r4, 0 - beq _081A8FCC - ldr r2, =gScriptResult - ldr r0, [r3] - ldr r1, =0x00000cdc - adds r0, r1 - b _081A9030 - .pool -_081A8FCC: - ldr r2, =gScriptResult - ldr r0, [r3] - ldr r3, =0x00000cdc - adds r0, r3 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 5 - b _081A9036 - .pool -_081A8FE4: - ldr r0, =gScriptResult - ldr r1, [r3] - ldr r2, =0x00000e1a - adds r1, r2 - b _081A9000 - .pool -_081A8FF8: - ldr r0, =gScriptResult - ldr r1, [r3] - ldr r3, =0x00000e1c -_081A8FFE: - adds r1, r3 -_081A9000: - ldrh r1, [r1] - strh r1, [r0] - b _081A903A - .pool -_081A9010: - ldr r2, =gScriptResult - ldr r0, [r3] - ldr r1, =0x00000cdc - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 5 - b _081A9036 - .pool -_081A9028: - ldr r2, =gScriptResult - ldr r0, [r3] - ldr r3, =0x00000cdc - adds r0, r3 -_081A9030: - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 6 -_081A9036: - ands r0, r1 -_081A9038: - strh r0, [r2] -_081A903A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A8F38 - - thumb_func_start sub_81A9048 -sub_81A9048: @ 81A9048 - push {lr} - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r1, =0x00000ca9 - adds r0, r2, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r1, r0, 30 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x1 - beq _081A9098 - cmp r0, 0x1 - bgt _081A9078 - cmp r0, 0 - beq _081A9082 - b _081A9126 - .pool -_081A9078: - cmp r0, 0x2 - beq _081A90B0 - cmp r0, 0x7 - beq _081A911C - b _081A9126 -_081A9082: - ldr r0, =gSpecialVar_0x8006 - ldrh r1, [r0] - ldr r3, =0x00000e18 - adds r0, r2, r3 - strh r1, [r0] - b _081A9126 - .pool -_081A9098: - lsls r1, 1 - ldr r3, =0x00000e1a - adds r0, r2, r3 - adds r0, r1 - ldr r1, =gSpecialVar_0x8006 - ldrh r1, [r1] - strh r1, [r0] - b _081A9126 - .pool -_081A90B0: - cmp r1, 0 - beq _081A90E4 - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - cmp r0, 0 - beq _081A90D0 - ldr r1, =0x00000cdc - adds r0, r2, r1 - ldr r1, [r0] - movs r2, 0x80 - lsls r2, 6 - b _081A90F6 - .pool -_081A90D0: - ldr r3, =0x00000cdc - adds r0, r2, r3 - ldr r1, [r0] - ldr r2, =0xffffdfff - b _081A910C - .pool -_081A90E4: - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - cmp r0, 0 - beq _081A9104 - ldr r1, =0x00000cdc - adds r0, r2, r1 - ldr r1, [r0] - movs r2, 0x80 - lsls r2, 5 -_081A90F6: - orrs r1, r2 - str r1, [r0] - b _081A9126 - .pool -_081A9104: - ldr r3, =0x00000cdc - adds r0, r2, r3 - ldr r1, [r0] - ldr r2, =0xffffefff -_081A910C: - ands r1, r2 - str r1, [r0] - b _081A9126 - .pool -_081A911C: - ldr r0, =gSpecialVar_0x8006 - ldrh r1, [r0] - ldr r3, =0x00000e2a - adds r0, r2, r3 - strb r1, [r0] -_081A9126: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9048 - - thumb_func_start sub_81A9134 -sub_81A9134: @ 81A9134 - push {r4,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - strb r1, [r0] - movs r0, 0x80 - lsls r0, 7 - movs r1, 0 - bl VarSet - ldr r1, [r4] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - bl save_serialize_map - movs r0, 0x1 - bl TrySavingData - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9134 - - thumb_func_start sub_81A917C -sub_81A917C: @ 81A917C - push {r4,r5,lr} - ldr r4, =gSaveBlock2Ptr - ldr r1, [r4] - ldr r2, =0x00000ca9 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 29 - ldr r2, =0x00000e1a - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0x29 - bls _081A91CC - bl Random - ldr r4, [r4] - ldr r5, =gUnknown_08613F34 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x9 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 15 - adds r0, r5 - ldrh r0, [r0] - ldr r1, =0x00000e18 - adds r4, r1 - b _081A91EA - .pool -_081A91CC: - bl Random - ldr r4, [r4] - ldr r5, =gUnknown_08613F28 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x6 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 15 - adds r0, r5 - ldrh r0, [r0] - ldr r2, =0x00000e18 - adds r4, r2 -_081A91EA: - strh r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A917C - - thumb_func_start sub_81A91FC -sub_81A91FC: @ 81A91FC - push {r4,r5,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000e18 - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x1 - bl AddBagItem - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bne _081A9244 - ldr r0, [r4] - ldr r1, =0x00000e18 - adds r0, r1 - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r0, [r4] - ldr r1, =0x00000e18 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - ldr r0, =gScriptResult - strh r5, [r0] - b _081A924A - .pool -_081A9244: - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] -_081A924A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A91FC - - thumb_func_start sub_81A9254 -sub_81A9254: @ 81A9254 - push {r4,r5,lr} - movs r4, 0 - ldr r5, =gSaveBlock2Ptr -_081A925A: - bl Random - ldr r1, [r5] - lsls r2, r4, 1 - ldr r3, =0x00000e22 - adds r1, r3 - adds r1, r2 - strh r0, [r1] - adds r4, 0x1 - cmp r4, 0x3 - ble _081A925A - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000e2a - adds r0, r1 - movs r1, 0 - strb r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9254 - - thumb_func_start CalculateBattlePyramidItemBallItemId -CalculateBattlePyramidItemBallItemId: @ 81A9290 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - ldr r5, =gSaveBlock2Ptr - ldr r1, [r5] - ldr r2, =0x00000ca9 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - mov r10, r0 - adds r2, 0x9 - adds r0, r1, r2 - ldrh r0, [r0] - str r0, [sp] - mov r2, r10 - lsls r0, r2, 1 - ldr r2, =0x00000e1a - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - movs r1, 0x7 - bl __udivsi3 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x14 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - cmp r0, 0x13 - bls _081A92DE - movs r0, 0x13 - mov r8, r0 -_081A92DE: - bl sub_81AA9E4 - lsls r0, 24 - ldr r1, =gScriptLastTalked - ldrh r4, [r1] - ldr r1, =gUnknown_08613650 - lsrs r0, 20 - adds r0, r1 - ldrb r0, [r0, 0x1] - subs r4, r0 - subs r7, r4, 0x1 - ldr r1, [r5] - lsrs r0, r7, 31 - adds r0, r7, r0 - asrs r0, 1 - lsls r0, 1 - ldr r2, =0x00000e22 - adds r1, r2 - adds r1, r0 - ldrh r6, [r1] - adds r0, r6, 0 - bl SeedRng2 - movs r5, 0 - mov r0, r8 - lsls r0, 2 - mov r9, r0 - cmp r5, r4 - bge _081A9332 -_081A9318: - bl Random2 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r6, r0, 16 - adds r5, 0x1 - adds r0, r7, 0x1 - cmp r5, r0 - blt _081A9318 -_081A9332: - ldr r0, =gUnknown_08613B3A - ldr r1, [sp] - adds r0, r1, r0 - ldrb r5, [r0] - ldr r1, =gUnknown_08613ABC - ldr r3, =gSpecialVar_0x8000 - ldr r4, =gSpecialVar_0x8001 - cmp r5, 0x3E - bhi _081A935E - lsls r2, r5, 1 - adds r0, r2, r1 - ldrb r0, [r0] - cmp r6, r0 - blt _081A935E - adds r0, r2, r1 -_081A9350: - adds r0, 0x2 - adds r5, 0x1 - cmp r5, 0x3E - bhi _081A935E - ldrb r2, [r0] - cmp r6, r2 - bge _081A9350 -_081A935E: - mov r0, r10 - cmp r0, 0 - beq _081A9394 - ldr r2, =gUnknown_0861392C - b _081A9396 - .pool -_081A9394: - ldr r2, =gUnknown_0861379C -_081A9396: - lsls r0, r5, 1 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 1 - mov r1, r9 - add r1, r8 - lsls r1, 2 - adds r0, r1 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r3] - movs r0, 0x1 - strh r0, [r4] - 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 CalculateBattlePyramidItemBallItemId - - thumb_func_start sub_81A93C8 -sub_81A93C8: @ 81A93C8 - push {r4,r5,lr} - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0xC7 - lsls r1, 4 - adds r3, r0, r1 - movs r2, 0 - ldr r4, =gScriptLastTalked - b _081A93F4 - .pool -_081A93E4: - adds r2, 0x1 - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 3 - adds r0, r3 - ldrb r0, [r0] - cmp r0, 0 - beq _081A940A -_081A93F4: - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 3 - adds r1, r0, r3 - ldrb r0, [r1] - ldrh r5, [r4] - cmp r0, r5 - bne _081A93E4 - ldr r0, =0x00007fff - strh r0, [r1, 0x4] - strh r0, [r1, 0x6] -_081A940A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A93C8 - - thumb_func_start sub_81A9414 -sub_81A9414: @ 81A9414 - ldr r1, =gUnknown_0203BC88 - ldr r0, =gBattleFrontierTrainers - str r0, [r1] - bx lr - .pool - thumb_func_end sub_81A9414 - - thumb_func_start sub_81A9424 -sub_81A9424: @ 81A9424 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x8 - movs r0, 0 - mov r9, r0 - movs r7, 0 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0xC7 - lsls r1, 4 - adds r1, r0 - mov r8, r1 - ldr r2, =gMapObjects - ldr r0, =gSelectedMapObject - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x8] - bl sub_81A9AA8 - lsls r0, 16 - lsrs r5, r0, 16 - movs r6, 0 - ldr r2, =gUnknown_08613C1C - ldr r0, =gUnknown_0203BC88 - ldr r1, [r0] - movs r0, 0x34 - muls r0, r5 - adds r0, r1 - ldrb r1, [r2] - ldrb r0, [r0] - cmp r1, r0 - bne _081A9488 - ldrb r2, [r2, 0x1] - mov r9, r2 - b _081A94AE - .pool -_081A9488: - adds r6, 0x1 - cmp r6, 0x31 - bhi _081A94AE - ldr r4, =gUnknown_08613C1C - lsls r3, r6, 1 - adds r2, r3, r4 - ldr r0, =gUnknown_0203BC88 - ldr r1, [r0] - movs r0, 0x34 - muls r0, r5 - adds r0, r1 - ldrb r1, [r2] - ldrb r0, [r0] - cmp r1, r0 - bne _081A9488 - adds r0, r4, 0x1 - adds r0, r3, r0 - ldrb r0, [r0] - mov r9, r0 -_081A94AE: - ldr r3, =gUnknown_08613ED8 - ldr r2, =gMapObjects - ldr r0, =gSelectedMapObject - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x8] - subs r0, 0x1 - adds r0, r3 - ldrb r0, [r0] - str r0, [sp] - movs r6, 0 - mov r3, r9 - lsls r3, 2 - mov r9, r3 -_081A94D0: - ldr r0, [sp] - cmp r0, 0x8 - bls _081A94D8 - b _081A95E8 -_081A94D8: - lsls r0, 2 - ldr r1, =_081A94FC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A94FC: - .4byte _081A9520 - .4byte _081A9530 - .4byte _081A9572 - .4byte _081A95B4 - .4byte _081A95BA - .4byte _081A95C0 - .4byte _081A95C6 - .4byte _081A95D2 - .4byte _081A95DE -_081A9520: - mov r0, sp - movs r1, 0x8 - movs r2, 0 - bl sub_81A9998 - lsls r0, 24 - lsrs r7, r0, 24 - b _081A95EE -_081A9530: - movs r6, 0 - ldr r2, =0x7fff0000 - mov r4, r8 - adds r4, 0x4 - mov r5, r8 - b _081A9560 - .pool -_081A9540: - ldrb r0, [r5, 0x1] - cmp r0, 0x3B - bne _081A955A - movs r1, 0 - ldrsh r0, [r4, r1] - asrs r1, r2, 16 - cmp r0, r1 - beq _081A955A - movs r3, 0x2 - ldrsh r0, [r4, r3] - cmp r0, r1 - beq _081A955A - adds r7, 0x1 -_081A955A: - adds r4, 0x18 - adds r5, 0x18 - adds r6, 0x1 -_081A9560: - str r2, [sp, 0x4] - bl sub_81AAA40 - lsls r0, 24 - lsrs r0, 24 - ldr r2, [sp, 0x4] - cmp r6, r0 - blt _081A9540 - b _081A95EE -_081A9572: - bl sub_81AA9E4 - lsls r0, 24 - ldr r1, =gUnknown_08613650 - lsrs r0, 20 - adds r0, r1 - ldrb r7, [r0, 0x1] - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000e2a - adds r0, r1 - ldrb r2, [r0] - ldr r1, =gBitTable - movs r6, 0x7 -_081A958E: - ldr r0, [r1] - ands r0, r2 - cmp r0, 0 - beq _081A9598 - subs r7, 0x1 -_081A9598: - adds r1, 0x4 - subs r6, 0x1 - cmp r6, 0 - bge _081A958E - b _081A95EE - .pool -_081A95B4: - mov r0, sp - movs r1, 0x8 - b _081A95D6 -_081A95BA: - mov r0, sp - movs r1, 0x8 - b _081A95CA -_081A95C0: - mov r0, sp - movs r1, 0x10 - b _081A95D6 -_081A95C6: - mov r0, sp - movs r1, 0x10 -_081A95CA: - movs r2, 0x1 - bl sub_81A9998 - b _081A95E8 -_081A95D2: - mov r0, sp - movs r1, 0x18 -_081A95D6: - movs r2, 0x2 - bl sub_81A9998 - b _081A95E8 -_081A95DE: - mov r0, sp - movs r1, 0x18 - movs r2, 0x1 - bl sub_81A9998 -_081A95E8: - cmp r6, 0 - bne _081A95EE - b _081A94D0 -_081A95EE: - ldr r1, =gUnknown_08613EC0 - add r1, r9 - ldr r0, [sp] - ldr r1, [r1] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - lsls r0, r7, 2 - adds r0, r1 - ldr r0, [r0] - bl box_related_two__2 - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9424 - - thumb_func_start sub_81A9618 -sub_81A9618: @ 81A9618 - push {r4,r5,lr} - ldr r5, =gSaveBlock2Ptr - ldr r1, [r5] - ldr r2, =0x00000ca9 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r2, r0, 29 - ldr r4, =0x00000e1a - adds r1, r4 - adds r1, r2 - ldrh r3, [r1] - ldr r0, =0x000003e6 - cmp r3, r0 - bhi _081A963A - adds r0, r3, 0x1 - strh r0, [r1] -_081A963A: - ldr r0, [r5] - adds r1, r0, r4 - adds r1, r2 - ldr r3, =0x00000e1e - adds r0, r3 - adds r0, r2 - ldrh r1, [r1] - ldrh r2, [r0] - cmp r1, r2 - bls _081A9650 - strh r1, [r0] -_081A9650: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9618 - - thumb_func_start sub_81A966C -sub_81A966C: @ 81A966C - push {r4,lr} - ldr r4, =gScriptResult - bl InBattlePyramid - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A966C - - thumb_func_start sub_81A9684 -sub_81A9684: @ 81A9684 - push {r4,lr} - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - cmp r0, 0 - beq _081A9698 - cmp r0, 0x1 - beq _081A96B4 - b _081A9754 - .pool -_081A9698: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - ldr r2, =0x00000e68 - adds r0, r2 - strb r1, [r0] - b _081A9754 - .pool -_081A96B4: - ldr r4, =gScriptResult - ldrh r0, [r4] - cmp r0, 0x1 - beq _081A9710 - cmp r0, 0x1 - bgt _081A9754 - cmp r0, 0 - bne _081A9754 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081A9754 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000e68 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0x77 - bls _081A96F4 - movs r0, 0x78 - strb r0, [r1] - b _081A96FC - .pool -_081A96F4: - ldr r0, =gSpecialVar_0x8007 - ldrh r0, [r0] - bl PlaySE -_081A96FC: - ldr r1, =gScriptResult - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _081A9754 - .pool -_081A9710: - ldr r1, =gSpecialVar_0x8005 - ldrh r0, [r1] - cmp r0, 0 - beq _081A9750 - subs r0, 0x1 - strh r0, [r1] - ldr r3, =gSaveBlock2Ptr - ldr r1, [r3] - ldr r2, =0x00000e68 - adds r1, r2 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r3] - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0x78 - bls _081A973E - movs r0, 0x78 - strb r0, [r1] - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_081A973E: - bl door_upload_tiles - b _081A9754 - .pool -_081A9750: - movs r0, 0x2 - strh r0, [r4] -_081A9754: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81A9684 - - thumb_func_start sub_81A975C -sub_81A975C: @ 81A975C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - movs r1, 0 - mov r0, sp - strh r1, [r0] - movs r5, 0 - movs r0, 0x64 - mov r9, r0 - ldr r1, =gPlayerParty - mov r8, r1 -_081A9776: - movs r4, 0 - adds r7, r5, 0x1 - mov r6, r9 - muls r6, r5 -_081A977E: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000caa - adds r0, r2 - adds r1, r0, r1 - ldrh r0, [r1] - cmp r0, 0 - beq _081A97A2 - subs r0, 0x1 - cmp r0, r5 - bne _081A97A2 - mov r1, r8 - adds r0, r6, r1 - movs r1, 0xC - mov r2, sp - bl SetMonData -_081A97A2: - adds r4, 0x1 - cmp r4, 0x3 - ble _081A977E - adds r5, r7, 0 - cmp r5, 0x5 - ble _081A9776 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A975C - - thumb_func_start sub_81A97C8 -sub_81A97C8: @ 81A97C8 - push {lr} - ldr r0, =sub_81A97DC - movs r1, 0 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A97C8 - - thumb_func_start sub_81A97DC -sub_81A97DC: @ 81A97DC - 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 - beq _081A980C - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 5 - ldr r1, =gUnknown_08D856C8 - adds r0, r1 - ldr r1, =gPlttBufferUnfaded + 0xC0 - movs r2, 0x10 - bl CpuSet - adds r0, r4, 0 - bl DestroyTask -_081A980C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A97DC - - thumb_func_start sub_81A9828 -sub_81A9828: @ 81A9828 - push {lr} - bl sub_809FDD4 - pop {r0} - bx r0 - thumb_func_end sub_81A9828 - - thumb_func_start sub_81A9834 -sub_81A9834: @ 81A9834 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - movs r0, 0 - str r0, [sp] -_081A9844: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, [sp] - lsls r1, r2, 1 - ldr r5, =0x00000caa - adds r0, r5 - adds r0, r1 - ldrh r0, [r0] - subs r5, r0, 0x1 - movs r0, 0 - str r0, [sp, 0x4] - movs r2, 0x64 - adds r1, r5, 0 - muls r1, r2 - str r1, [sp, 0x8] - movs r0, 0x8E - lsls r0, 2 - adds r6, r1, r0 - movs r1, 0 - str r1, [sp, 0x10] -_081A986C: - ldr r2, =gSaveBlock1Ptr - ldr r0, [r2] - adds r0, r6 - movs r1, 0xB - movs r2, 0 - bl GetMonData - adds r4, r0, 0 - ldr r3, =gPlayerParty - ldr r1, [sp, 0x10] - adds r0, r1, r3 - movs r1, 0xB - movs r2, 0 - str r3, [sp, 0x14] - bl GetMonData - ldr r3, [sp, 0x14] - cmp r4, r0 - bne _081A993C - movs r6, 0 - adds r2, r5, 0x1 - str r2, [sp, 0xC] - movs r1, 0x64 - adds r0, r5, 0 - muls r0, r1 - movs r5, 0x8E - lsls r5, 2 - adds r5, r0 - mov r9, r5 - ldr r7, [sp, 0x4] - muls r7, r1 - mov r10, r3 -_081A98AC: - movs r5, 0 - adds r0, r6, 0x1 - mov r8, r0 - b _081A98C6 - .pool -_081A98C4: - adds r5, 0x1 -_081A98C6: - cmp r5, 0x3 - bgt _081A98EE - ldr r1, =gSaveBlock1Ptr - ldr r0, [r1] - add r0, r9 - adds r1, r5, 0 - adds r1, 0xD - movs r2, 0 - bl GetMonData - adds r4, r0, 0 - adds r1, r6, 0 - adds r1, 0xD - mov r2, r10 - adds r0, r7, r2 - movs r2, 0 - bl GetMonData - cmp r4, r0 - bne _081A98C4 -_081A98EE: - cmp r5, 0x4 - bne _081A9900 - lsls r2, r6, 24 - lsrs r2, 24 - mov r5, r10 - adds r0, r7, r5 - movs r1, 0xA6 - bl SetMonMoveSlot -_081A9900: - mov r6, r8 - cmp r6, 0x3 - ble _081A98AC - ldr r1, =gSaveBlock1Ptr - ldr r0, [r1] - ldr r2, [sp, 0x8] - adds r0, r2 - movs r5, 0x8E - lsls r5, 2 - adds r0, r5 - ldr r1, =gPlayerParty - ldr r2, [sp, 0x10] - adds r1, r2, r1 - movs r2, 0x64 - bl memcpy - ldr r0, =gUnknown_0203CEF8 - ldr r5, [sp, 0x4] - adds r0, r5, r0 - mov r1, sp - ldrb r1, [r1, 0xC] - strb r1, [r0] - b _081A994C - .pool -_081A993C: - ldr r2, [sp, 0x10] - adds r2, 0x64 - str r2, [sp, 0x10] - ldr r0, [sp, 0x4] - adds r0, 0x1 - str r0, [sp, 0x4] - cmp r0, 0x2 - ble _081A986C -_081A994C: - ldr r1, [sp] - adds r1, 0x1 - str r1, [sp] - cmp r1, 0x2 - bgt _081A9958 - b _081A9844 -_081A9958: - movs r2, 0 - str r2, [sp] - ldr r4, =gSaveBlock2Ptr - ldr r3, =0x00000caa - ldr r2, =gUnknown_0203CEF8 -_081A9962: - ldr r1, [r4] - ldr r5, [sp] - lsls r0, r5, 1 - adds r1, r3 - adds r1, r0 - adds r0, r5, r2 - ldrb r0, [r0] - strh r0, [r1] - adds r5, 0x1 - str r5, [sp] - cmp r5, 0x2 - ble _081A9962 - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9834 - - thumb_func_start sub_81A9998 -sub_81A9998: @ 81A9998 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r10, r0 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r7, r2, 24 - movs r4, 0 - ldr r0, =gUnknown_03005DC0 - ldr r5, [r0, 0x8] - ldr r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 1 - adds r0, 0xE - adds r5, r0 - movs r3, 0 - ldr r0, =0x000003ff - mov r8, r0 - ldr r1, =0x0000028e - mov r12, r1 - ldr r0, =gMapObjects - mov r9, r0 -_081A99CC: - movs r2, 0 -_081A99CE: - lsls r0, r2, 1 - adds r0, r5 - ldrh r1, [r0] - mov r0, r8 - ands r0, r1 - cmp r0, r12 - bne _081A9A8A - adds r2, 0x7 - ldr r0, =gSelectedMapObject - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - add r0, r9 - movs r5, 0xC - ldrsh r1, [r0, r5] - subs r2, r1 - adds r1, r3, 0x7 - movs r3, 0xE - ldrsh r0, [r0, r3] - subs r3, r1, r0 - cmp r2, r6 - bge _081A9A0E - negs r0, r6 - cmp r2, r0 - ble _081A9A0E - cmp r3, r6 - bge _081A9A0E - cmp r3, r0 - ble _081A9A0E - cmp r7, 0 - bne _081A9A84 -_081A9A0E: - cmp r2, 0 - ble _081A9A34 - cmp r3, 0 - ble _081A9A34 - movs r4, 0x3 - cmp r2, r3 - blt _081A9A7C - movs r4, 0x2 - b _081A9A7C - .pool -_081A9A34: - cmp r2, 0 - bge _081A9A46 - cmp r3, 0 - bge _081A9A46 - movs r4, 0x1 - cmp r2, r3 - ble _081A9A7C - movs r4, 0 - b _081A9A7C -_081A9A46: - cmp r2, 0 - bne _081A9A54 - movs r4, 0 - cmp r3, 0 - ble _081A9A7C - movs r4, 0x3 - b _081A9A7C -_081A9A54: - cmp r3, 0 - bne _081A9A62 - movs r4, 0x1 - cmp r2, 0 - ble _081A9A7C - movs r4, 0x2 - b _081A9A7C -_081A9A62: - cmp r2, 0 - bge _081A9A72 - adds r0, r2, r3 - movs r4, 0x1 - cmp r0, 0 - ble _081A9A7C - movs r4, 0x3 - b _081A9A7C -_081A9A72: - adds r0, r2, r3 - mvns r0, r0 - asrs r4, r0, 31 - movs r0, 0x2 - ands r4, r0 -_081A9A7C: - movs r0, 0 - mov r5, r10 - str r0, [r5] - b _081A9A98 -_081A9A84: - mov r0, r10 - str r7, [r0] - b _081A9A98 -_081A9A8A: - adds r2, 0x1 - cmp r2, 0x1F - ble _081A99CE - adds r5, 0x5E - adds r3, 0x1 - cmp r3, 0x1F - ble _081A99CC -_081A9A98: - adds r0, r4, 0 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81A9998 - - thumb_func_start sub_81A9AA8 -sub_81A9AA8: @ 81A9AA8 - lsls r0, 24 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - lsrs r0, 23 - adds r1, r0 - ldr r0, =0x00000cb2 - adds r1, r0 - ldrh r0, [r1] - bx lr - .pool - thumb_func_end sub_81A9AA8 - - thumb_func_start GetBattlePyramidTrainerFlag -GetBattlePyramidTrainerFlag: @ 81A9AC4 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gSaveBlock2Ptr - ldr r2, [r1] - ldr r1, =0x00000e2a - adds r2, r1 - ldr r4, =gBitTable - ldr r3, =gMapObjects - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r0, [r1, 0x8] - subs r0, 0x1 - lsls r0, 2 - adds r0, r4 - ldr r0, [r0] - ldrb r1, [r2] - ands r0, r1 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end GetBattlePyramidTrainerFlag - - thumb_func_start sub_81A9B04 -sub_81A9B04: @ 81A9B04 - push {lr} - ldr r0, =gTrainerBattleOpponent_A - ldrh r0, [r0] - bl sub_81A9B44 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _081A9B2E - movs r0, 0x1 - bl sub_80B47E0 - ldr r1, =gSelectedMapObject - strb r0, [r1] - ldr r0, =gTrainerBattleOpponent_B - ldrh r0, [r0] - bl sub_81A9B44 -_081A9B2E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9B04 - - thumb_func_start sub_81A9B44 -sub_81A9B44: @ 81A9B44 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 16 - lsrs r5, r0, 16 - movs r3, 0 - ldr r0, =gMapObjects - mov r12, r0 - ldr r6, =gSelectedMapObject - ldr r1, =gSaveBlock1Ptr - mov r10, r1 - ldr r7, =gSaveBlock2Ptr - mov r9, r7 - ldr r0, =0x00000cb4 - mov r8, r0 - ldr r4, =gBitTable -_081A9B68: - mov r1, r9 - ldr r2, [r1] - lsls r0, r3, 1 - mov r7, r8 - adds r1, r2, r7 - adds r1, r0 - ldrh r0, [r1] - cmp r0, r5 - bne _081A9B86 - ldr r1, =0x00000e2a - adds r0, r2, r1 - ldr r1, [r4] - ldrb r2, [r0] - orrs r1, r2 - strb r1, [r0] -_081A9B86: - adds r4, 0x4 - adds r3, 0x1 - cmp r3, 0x7 - ble _081A9B68 - ldrb r1, [r6] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - add r0, r12 - movs r3, 0x2 - strb r3, [r0, 0x6] - mov r7, r10 - ldr r2, [r7] - ldr r0, =gScriptLastTalked - ldrh r1, [r0] - subs r1, 0x1 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r2, r0 - ldr r1, =0x00000c79 - adds r2, r1 - strb r3, [r2] - ldrb r1, [r6] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - add r0, r12 - ldrh r1, [r0, 0x10] - strh r1, [r0, 0xC] - ldrb r1, [r6] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - add r0, r12 - ldrh r1, [r0, 0x12] - strh r1, [r0, 0xE] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9B44 - - thumb_func_start sub_81A9C04 -sub_81A9C04: @ 81A9C04 - push {r4-r6,lr} - sub sp, 0x14 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r2, =0x00000ca9 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r5, r0, 30 - lsls r0, r5, 1 - ldr r2, =0x00000e1a - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - movs r1, 0x7 - bl __udivsi3 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x14 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x13 - bls _081A9C3A - movs r0, 0x13 -_081A9C3A: - cmp r5, 0 - beq _081A9C54 - ldr r1, =gBattlePyramidOpenLevelWildMonPointers - b _081A9C56 - .pool -_081A9C54: - ldr r1, =gBattlePyramidLevel50WildMonPointers -_081A9C56: - lsls r0, 2 - adds r0, r1 - ldr r6, [r0] - ldr r4, =gEnemyParty - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - subs r0, 0x1 - str r0, [sp, 0x10] - lsls r2, r0, 1 - adds r2, r0 - lsls r2, 2 - adds r2, r6, r2 - adds r0, r4, 0 - movs r1, 0xB - bl SetMonData - ldr r1, [sp, 0x10] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrh r1, [r0] - mov r0, sp - bl GetSpeciesName - adds r0, r4, 0 - movs r1, 0x2 - mov r2, sp - bl SetMonData - cmp r5, 0 - beq _081A9CD4 - bl sub_8165C40 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, [sp, 0x10] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x2] - subs r5, r0 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xB - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - subs r0, 0x5 - adds r5, r0 - b _081A9CF6 - .pool -_081A9CD4: - bl Random - ldr r2, [sp, 0x10] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r6 - ldrb r4, [r1, 0x2] - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xB - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - subs r0, 0x5 - adds r5, r4, r0 -_081A9CF6: - ldr r4, =gEnemyParty - ldr r2, =gBaseStats - ldr r1, [sp, 0x10] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrh r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x13] - movs r0, 0xCA - lsls r0, 1 - adds r2, r1, 0 - muls r2, r0 - lsls r0, r5, 2 - ldr r1, =gExperienceTables - adds r0, r1 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x19 - bl SetMonData - ldr r1, [sp, 0x10] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r1, [r0, 0x3] - cmp r1, 0 - blt _081A9D4C - cmp r1, 0x1 - bgt _081A9D4C - adds r2, r0, 0x3 - b _081A9D7C - .pool -_081A9D4C: - ldr r2, =gBaseStats - ldr r1, [sp, 0x10] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrh r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x17] - cmp r0, 0 - beq _081A9D90 - ldr r4, =gEnemyParty - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - bl GetMonData - movs r1, 0x1 - ands r1, r0 - str r1, [sp, 0xC] - add r2, sp, 0xC -_081A9D7C: - adds r0, r4, 0 - movs r1, 0x2E - bl SetMonData - b _081A9D9C - .pool -_081A9D90: - str r0, [sp, 0xC] - ldr r0, =gEnemyParty - add r2, sp, 0xC - movs r1, 0x2E - bl SetMonData -_081A9D9C: - movs r0, 0 - str r0, [sp, 0xC] - movs r2, 0 - lsls r4, r5, 1 -_081A9DA4: - ldr r1, [sp, 0x10] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - lsls r1, r2, 1 - adds r0, 0x4 - adds r0, r1 - ldrh r1, [r0] - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gEnemyParty - bl SetMonMoveSlot - ldr r0, [sp, 0xC] - adds r0, 0x1 - str r0, [sp, 0xC] - adds r2, r0, 0 - cmp r2, 0x3 - ble _081A9DA4 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000e1a - adds r0, r1 - adds r0, r4 - ldrh r0, [r0] - cmp r0, 0x8B - bls _081A9E0C - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x11 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - adds r0, 0xF - str r0, [sp, 0x10] - movs r0, 0 - str r0, [sp, 0xC] -_081A9DF6: - adds r1, r0, 0 - adds r1, 0x27 - ldr r0, =gEnemyParty - add r2, sp, 0x10 - bl SetMonData - ldr r0, [sp, 0xC] - adds r0, 0x1 - str r0, [sp, 0xC] - cmp r0, 0x5 - ble _081A9DF6 -_081A9E0C: - ldr r0, =gEnemyParty - bl CalculateMonStats - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9C04 - - thumb_func_start sub_81A9E28 -sub_81A9E28: @ 81A9E28 - push {lr} - bl sub_81AA9E4 - lsls r0, 24 - ldr r1, =gUnknown_08613650 - lsrs r0, 20 - adds r0, r1 - ldrb r0, [r0, 0x4] - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A9E28 - - thumb_func_start InBattlePyramid -InBattlePyramid: @ 81A9E40 - push {lr} - ldr r0, =gMapHeader - ldrh r1, [r0, 0x12] - ldr r0, =0x00000169 - cmp r1, r0 - bne _081A9E58 - movs r0, 0x1 - b _081A9E66 - .pool -_081A9E58: - movs r0, 0xBD - lsls r0, 1 - cmp r1, r0 - beq _081A9E64 - movs r0, 0 - b _081A9E66 -_081A9E64: - movs r0, 0x2 -_081A9E66: - pop {r1} - bx r1 - thumb_func_end InBattlePyramid - - thumb_func_start sub_81A9E6C -sub_81A9E6C: @ 81A9E6C - push {lr} - movs r2, 0 - ldr r0, =gMapHeader - ldrh r1, [r0, 0x12] - ldr r0, =0x00000169 - cmp r1, r0 - beq _081A9E80 - adds r0, 0x11 - cmp r1, r0 - bne _081A9E82 -_081A9E80: - movs r2, 0x1 -_081A9E82: - adds r0, r2, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A9E6C - - thumb_func_start sub_81A9E90 -sub_81A9E90: @ 81A9E90 - push {lr} - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _081A9EB8 - bl sub_81A9834 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca8 - adds r0, r1 - movs r1, 0x2 - strb r1, [r0] - ldr r0, =0x0000400e - movs r1, 0 - bl VarSet - bl copy_player_party_from_sav1 -_081A9EB8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9E90 - - thumb_func_start sub_81A9EC8 -sub_81A9EC8: @ 81A9EC8 - push {lr} - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _081A9ED8 - bl DoSoftReset -_081A9ED8: - pop {r0} - bx r0 - thumb_func_end sub_81A9EC8 - - thumb_func_start sub_81A9EDC -sub_81A9EDC: @ 81A9EDC - push {lr} - lsls r0, 16 - lsrs r0, 16 - ldr r2, =gUnknown_0203BC88 - movs r1, 0x34 - muls r1, r0 - ldr r0, [r2] - adds r0, r1 - adds r0, 0xC - bl ConvertBattleFrontierTrainerSpeechToString - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9EDC - - thumb_func_start sub_81A9EFC -sub_81A9EFC: @ 81A9EFC - push {lr} - lsls r0, 16 - lsrs r0, 16 - ldr r2, =gUnknown_0203BC88 - movs r1, 0x34 - muls r1, r0 - ldr r0, [r2] - adds r0, r1 - adds r0, 0x18 - bl ConvertBattleFrontierTrainerSpeechToString - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9EFC - - thumb_func_start sub_81A9F1C -sub_81A9F1C: @ 81A9F1C - push {lr} - lsls r0, 16 - lsrs r0, 16 - ldr r2, =gUnknown_0203BC88 - movs r1, 0x34 - muls r1, r0 - ldr r0, [r2] - adds r0, r1 - adds r0, 0x24 - bl ConvertBattleFrontierTrainerSpeechToString - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9F1C - - thumb_func_start GetTrainerEncounterMusicIdInBattlePyramind -GetTrainerEncounterMusicIdInBattlePyramind: @ 81A9F3C - push {r4,lr} - lsls r0, 16 - lsrs r0, 16 - movs r4, 0 - ldr r3, =gTrainerClassToNameIndex - ldr r1, =gUnknown_0203BC88 - ldr r2, [r1] - movs r1, 0x34 - muls r0, r1 - adds r0, r2 - ldrb r0, [r0] - adds r0, r3 - ldrb r2, [r0] - ldr r1, =gUnknown_08613B44 -_081A9F58: - ldrb r0, [r1] - cmp r0, r2 - bne _081A9F70 - ldrb r0, [r1, 0x1] - b _081A9F7A - .pool -_081A9F70: - adds r1, 0x4 - adds r4, 0x1 - cmp r4, 0x35 - bls _081A9F58 - movs r0, 0 -_081A9F7A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end GetTrainerEncounterMusicIdInBattlePyramind - - thumb_func_start sub_81A9F80 -sub_81A9F80: @ 81A9F80 - push {lr} - ldr r0, =gUnknown_08252C88 - bl ScriptContext1_SetupScript - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9F80 - - thumb_func_start sub_81A9F90 -sub_81A9F90: @ 81A9F90 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gSaveBlock2Ptr - ldr r4, [r0] - ldr r1, =0x00000ca9 - adds r0, r4, r1 - ldrb r1, [r0] - lsls r1, 30 - lsrs r1, 29 - ldr r2, =0x00000e1a - adds r0, r4, r2 - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x7 - bl __udivsi3 - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x00000cb2 - adds r4, r1 - ldrh r1, [r4] - cmp r1, 0x7 - bne _081AA020 - adds r0, 0x1 - lsls r7, r0, 24 - lsls r1, 24 - mov r8, r1 -_081A9FCC: - lsrs r0, r7, 24 - mov r2, r8 - lsrs r1, r2, 24 - bl sub_8162548 - lsls r0, 16 - lsrs r3, r0, 16 - movs r2, 0 - cmp r2, r5 - bge _081AA004 - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r4, =0x00000cb4 - adds r0, r4 - ldrh r0, [r0] - cmp r0, r3 - beq _081AA004 - adds r6, r1, 0 -_081A9FF0: - adds r2, 0x1 - cmp r2, r5 - bge _081AA004 - ldr r0, [r6] - lsls r1, r2, 1 - adds r0, r4 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r3 - bne _081A9FF0 -_081AA004: - cmp r2, r5 - bne _081A9FCC - b _081AA062 - .pool -_081AA020: - lsls r1, 24 - mov r8, r1 - lsls r7, r0, 24 -_081AA026: - lsrs r0, r7, 24 - mov r2, r8 - lsrs r1, r2, 24 - bl sub_8162548 - lsls r0, 16 - lsrs r3, r0, 16 - movs r2, 0 - cmp r2, r5 - bge _081AA05E - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r4, =0x00000cb4 - adds r0, r4 - ldrh r0, [r0] - cmp r0, r3 - beq _081AA05E - adds r6, r1, 0 -_081AA04A: - adds r2, 0x1 - cmp r2, r5 - bge _081AA05E - ldr r0, [r6] - lsls r1, r2, 1 - adds r0, r4 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r3 - bne _081AA04A -_081AA05E: - cmp r2, r5 - bne _081AA026 -_081AA062: - adds r0, r3, 0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A9F90 - - thumb_func_start sub_81AA078 -sub_81AA078: @ 81AA078 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - str r0, [sp, 0x4] - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x8] - movs r0, 0x10 - bl AllocZeroed - str r0, [sp, 0xC] - bl sub_81AA96C - mov r4, sp - adds r4, 0x1 - mov r0, sp - adds r1, r4, 0 - bl sub_81AA33C - movs r7, 0 -_081AA0A6: - ldr r1, [sp, 0xC] - adds r0, r1, r7 - ldrb r0, [r0] - ldr r2, =0x00000169 - adds r0, r2 - lsls r0, 2 - ldr r1, =gUnknown_08481DD4 - adds r0, r1 - ldr r6, [r0] - ldr r2, [r6, 0xC] - mov r10, r2 - ldr r0, [sp, 0x4] - ldr r1, =gUnknown_03005DC0 - str r0, [r1, 0x8] - ldr r0, [r6] - lsls r0, 2 - adds r2, r0, 0 - adds r2, 0xF - str r2, [r1] - ldr r0, [r6, 0x4] - lsls r0, 2 - adds r0, 0xE - str r0, [r1, 0x4] - ldr r0, [sp, 0x4] - mov r9, r0 - adds r1, r7, 0 - cmp r7, 0 - bge _081AA0E0 - adds r1, r7, 0x3 -_081AA0E0: - asrs r1, 2 - ldr r4, [r6, 0x4] - adds r0, r1, 0 - muls r0, r4 - adds r0, 0x7 - muls r2, r0 - lsls r1, 2 - subs r1, r7, r1 - ldr r3, [r6] - adds r0, r1, 0 - muls r0, r3 - adds r0, 0x7 - adds r2, r0 - lsls r2, 1 - add r9, r2 - movs r1, 0 - mov r8, r1 - adds r2, r7, 0x1 - str r2, [sp, 0x10] - cmp r8, r4 - bge _081AA1B6 -_081AA10A: - movs r0, 0 - mov r12, r0 - mov r1, r8 - adds r1, 0x1 - str r1, [sp, 0x14] - cmp r12, r3 - bge _081AA1A2 - ldr r2, =gSaveBlock1Ptr - str r2, [sp, 0x18] - mov r4, r9 - mov r5, r10 -_081AA120: - ldrh r1, [r5] - ldr r0, =0x000003ff - ands r0, r1 - ldr r2, =0x0000028e - cmp r0, r2 - bne _081AA194 - mov r0, sp - ldrb r0, [r0, 0x1] - cmp r7, r0 - beq _081AA194 - mov r0, sp - ldrb r0, [r0] - cmp r7, r0 - bne _081AA164 - ldr r1, [sp, 0x8] - cmp r1, 0 - bne _081AA164 - ldr r2, [sp, 0x18] - ldr r3, [r2] - adds r2, r7, 0 - cmp r7, 0 - bge _081AA14E - adds r2, r7, 0x3 -_081AA14E: - asrs r2, 2 - lsls r1, r2, 2 - subs r1, r7, r1 - ldr r0, [r6] - muls r0, r1 - add r0, r12 - strh r0, [r3] - ldr r0, [r6, 0x4] - muls r0, r2 - add r0, r8 - strh r0, [r3, 0x2] -_081AA164: - ldrh r0, [r5] - movs r1, 0xFC - lsls r1, 8 - ands r1, r0 - ldr r2, =0x0000028d - adds r0, r2, 0 - orrs r1, r0 - strh r1, [r4] - ldr r3, [r6] - b _081AA196 - .pool -_081AA194: - strh r1, [r4] -_081AA196: - adds r4, 0x2 - adds r5, 0x2 - movs r0, 0x1 - add r12, r0 - cmp r12, r3 - blt _081AA120 -_081AA1A2: - lsls r0, r3, 3 - adds r0, 0x1E - add r9, r0 - lsls r0, r3, 1 - add r10, r0 - ldr r1, [sp, 0x14] - mov r8, r1 - ldr r0, [r6, 0x4] - cmp r8, r0 - blt _081AA10A -_081AA1B6: - ldr r7, [sp, 0x10] - cmp r7, 0xF - bgt _081AA1BE - b _081AA0A6 -_081AA1BE: - bl mapheader_run_script_with_tag_x1 - ldr r0, [sp, 0xC] - bl Free - add sp, 0x1C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81AA078 - - thumb_func_start sub_81AA1D8 -sub_81AA1D8: @ 81AA1D8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - movs r5, 0 - mov r6, sp - adds r6, 0x1 - add r0, sp, 0x4 - mov r8, r0 - ldr r4, =gSaveBlock2Ptr - ldr r3, =0x00000cb4 - ldr r0, =0x0000ffff - adds r2, r0, 0 -_081AA1F2: - ldr r0, [r4] - lsls r1, r5, 1 - adds r0, r3 - adds r0, r1 - ldrh r1, [r0] - orrs r1, r2 - strh r1, [r0] - adds r5, 0x1 - cmp r5, 0x7 - ble _081AA1F2 - bl sub_81AA9E4 - lsls r0, 24 - lsrs r7, r0, 24 - mov r0, sp - adds r1, r6, 0 - bl sub_81AA33C - movs r0, 0 - str r0, [sp, 0x4] - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - movs r0, 0xC7 - lsls r0, 4 - adds r1, r0 - ldr r2, =0x05000180 - mov r0, r8 - bl CpuSet - movs r5, 0 -_081AA22E: - cmp r5, 0 - bne _081AA254 - ldr r1, =gUnknown_08613650 - lsls r0, r7, 4 - adds r0, r1 - ldrb r0, [r0, 0x3] - b _081AA25C - .pool -_081AA254: - ldr r1, =gUnknown_08613650 - lsls r0, r7, 4 - adds r0, r1 - ldrb r0, [r0, 0x2] -_081AA25C: - cmp r0, 0x4 - bhi _081AA2E4 - lsls r0, 2 - ldr r1, =_081AA274 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081AA274: - .4byte _081AA288 - .4byte _081AA292 - .4byte _081AA2A2 - .4byte _081AA2B0 - .4byte _081AA2CC -_081AA288: - lsls r0, r5, 24 - lsrs r0, 24 - bl sub_81AA398 - b _081AA2E4 -_081AA292: - lsls r0, r5, 24 - lsrs r4, r0, 24 - mov r0, sp - ldrb r1, [r0] - adds r0, r4, 0 - bl sub_81AA4D8 - b _081AA2BE -_081AA2A2: - lsls r0, r5, 24 - lsrs r4, r0, 24 - ldrb r1, [r6] - adds r0, r4, 0 - bl sub_81AA4D8 - b _081AA2BE -_081AA2B0: - lsls r0, r5, 24 - lsrs r4, r0, 24 - mov r0, sp - ldrb r1, [r0] - adds r0, r4, 0 - bl sub_81AA648 -_081AA2BE: - lsls r0, 24 - cmp r0, 0 - beq _081AA2E4 - adds r0, r4, 0 - bl sub_81AA398 - b _081AA2E4 -_081AA2CC: - lsls r0, r5, 24 - lsrs r4, r0, 24 - ldrb r1, [r6] - adds r0, r4, 0 - bl sub_81AA648 - lsls r0, 24 - cmp r0, 0 - beq _081AA2E4 - adds r0, r4, 0 - bl sub_81AA398 -_081AA2E4: - adds r5, 0x1 - cmp r5, 0x1 - ble _081AA22E - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81AA1D8 - - thumb_func_start sub_81AA2F8 -sub_81AA2F8: @ 81AA2F8 - push {r4,r5,lr} - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r5, =gUnknown_08252C4F - ldr r4, =gUnknown_08252C6A - movs r2, 0xC8 - lsls r2, 4 - adds r1, r0, r2 - movs r3, 0xC7 - lsls r3, 4 - adds r2, r0, r3 - movs r3, 0x3F -_081AA310: - ldrb r0, [r2, 0x1] - cmp r0, 0x3B - beq _081AA328 - str r5, [r1] - b _081AA32A - .pool -_081AA328: - str r4, [r1] -_081AA32A: - adds r1, 0x18 - adds r2, 0x18 - subs r3, 0x1 - cmp r3, 0 - bge _081AA310 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81AA2F8 - - thumb_func_start sub_81AA33C -sub_81AA33C: @ 81AA33C - push {r4-r7,lr} - adds r4, r0, 0 - adds r6, r1, 0 - ldr r5, =gSaveBlock2Ptr - ldr r1, [r5] - ldr r2, =0x00000e28 - adds r0, r1, r2 - ldrh r2, [r0] - movs r3, 0xF - ands r2, r3 - strb r2, [r4] - ldr r7, =0x00000e22 - adds r1, r7 - ldrh r0, [r1] - ands r0, r3 - strb r0, [r6] - cmp r2, r0 - bne _081AA386 - ldr r1, [r5] - ldr r2, =0x00000e28 - adds r0, r1, r2 - ldrh r2, [r0] - adds r3, r2, 0x1 - adds r0, r3, 0 - asrs r0, 4 - lsls r0, 4 - subs r0, r3, r0 - strb r0, [r4] - adds r0, r1, r7 - ldrh r1, [r0] - adds r2, r1, 0 - adds r2, 0xF - adds r0, r2, 0 - asrs r0, 4 - lsls r0, 4 - subs r0, r2, r0 - strb r0, [r6] -_081AA386: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AA33C - - thumb_func_start sub_81AA398 -sub_81AA398: @ 81AA398 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - movs r5, 0 - bl sub_81AA9E4 - lsls r0, 24 - lsrs r6, r0, 24 - movs r0, 0x10 - bl AllocZeroed - str r0, [sp, 0x8] - bl sub_81AA96C - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000e26 - adds r0, r1 - ldrh r4, [r0] - movs r0, 0xF - ands r4, r0 - ldr r0, [sp] - cmp r0, 0 - bne _081AA3F0 - ldr r1, =gUnknown_08613650 - lsls r0, r6, 4 - adds r0, r1 - ldrb r0, [r0, 0x1] - mov r10, r0 - movs r1, 0 - str r1, [sp, 0x4] - b _081AA3FE - .pool -_081AA3F0: - ldr r1, =gUnknown_08613650 - lsls r0, r6, 4 - adds r0, r1 - ldrb r1, [r0] - mov r10, r1 - ldrb r0, [r0, 0x1] - str r0, [sp, 0x4] -_081AA3FE: - movs r0, 0 - mov r8, r0 - cmp r8, r10 - bge _081AA4C0 -_081AA406: - movs r1, 0x1 - add r1, r8 - mov r9, r1 - b _081AA42E - .pool -_081AA414: - lsls r2, r4, 24 - lsrs r2, 24 - ldr r3, [sp, 0x4] - add r3, r8 - lsls r3, 24 - lsrs r3, 24 - ldr r0, [sp] - ldr r1, [sp, 0x8] - bl sub_81AA760 - lsls r0, 24 - cmp r0, 0 - beq _081AA4B6 -_081AA42E: - ldr r0, =gBitTable - mov r12, r0 - ldr r6, =gSaveBlock2Ptr - ldr r7, =0x00000e28 - movs r3, 0x2 - lsls r0, r4, 2 - mov r1, r12 - adds r2, r0, r1 -_081AA43E: - movs r0, 0x1 - ands r0, r5 - cmp r0, 0 - beq _081AA464 - ldr r0, [r6] - adds r0, r7 - ldrh r1, [r0] - ldr r0, [r2] - ands r0, r1 - cmp r0, 0 - bne _081AA474 - b _081AA472 - .pool -_081AA464: - ldr r0, [r6] - adds r0, r7 - ldrh r1, [r0] - ldr r0, [r2] - ands r0, r1 - cmp r0, 0 - beq _081AA474 -_081AA472: - orrs r5, r3 -_081AA474: - adds r2, 0x4 - adds r4, 0x1 - cmp r4, 0xF - ble _081AA480 - mov r2, r12 - movs r4, 0 -_081AA480: - ldr r0, [r6] - ldr r1, =0x00000e26 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0xF - ands r1, r0 - cmp r4, r1 - bne _081AA4A6 - movs r1, 0x1 - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _081AA4A4 - movs r0, 0x6 - orrs r5, r0 - b _081AA4A6 - .pool -_081AA4A4: - orrs r5, r1 -_081AA4A6: - adds r0, r5, 0 - ands r0, r3 - cmp r0, 0 - beq _081AA43E - movs r0, 0x4 - ands r0, r5 - cmp r0, 0 - beq _081AA414 -_081AA4B6: - movs r0, 0x1 - ands r5, r0 - mov r8, r9 - cmp r8, r10 - blt _081AA406 -_081AA4C0: - ldr r0, [sp, 0x8] - bl Free - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81AA398 - - thumb_func_start sub_81AA4D8 -sub_81AA4D8: @ 81AA4D8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x4] - movs r6, 0 - movs r7, 0 - movs r0, 0 - str r0, [sp, 0xC] - bl sub_81AA9E4 - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x10 - bl AllocZeroed - str r0, [sp, 0x14] - bl sub_81AA96C - ldr r1, [sp] - cmp r1, 0 - bne _081AA524 - ldr r1, =gUnknown_08613650 - lsls r0, r4, 4 - adds r0, r1 - ldrb r0, [r0, 0x1] - str r0, [sp, 0x10] - movs r0, 0 - b _081AA530 - .pool -_081AA524: - ldr r1, =gUnknown_08613650 - lsls r0, r4, 4 - adds r0, r1 - ldrb r2, [r0] - str r2, [sp, 0x10] - ldrb r0, [r0, 0x1] -_081AA530: - movs r3, 0 - str r3, [sp, 0x8] - ldr r1, [sp, 0x10] - asrs r1, 31 - str r1, [sp, 0x18] - ldr r2, [sp, 0x10] - cmp r3, r2 - bge _081AA622 - str r0, [sp, 0x1C] - adds r3, r0, 0 - lsls r3, 24 - mov r9, r3 -_081AA548: - cmp r7, 0 - bne _081AA56E - mov r0, r9 - lsrs r3, r0, 24 - ldr r0, [sp] - ldr r1, [sp, 0x14] - ldr r2, [sp, 0x4] - bl sub_81AA760 - lsls r0, 24 - cmp r0, 0 - beq _081AA568 - movs r7, 0x1 - b _081AA56E - .pool -_081AA568: - ldr r1, [sp, 0xC] - adds r1, 0x1 - str r1, [sp, 0xC] -_081AA56E: - movs r0, 0x1 - ands r0, r7 - cmp r0, 0 - beq _081AA600 - ldr r2, =gUnknown_08613F46 - mov r8, r2 - ldr r3, [sp, 0x4] - lsls r4, r3, 2 - adds r0, r6, r4 - add r0, r8 - ldrb r2, [r0] - mov r0, r9 - lsrs r3, r0, 24 - ldr r0, [sp] - ldr r1, [sp, 0x14] - bl sub_81AA760 - lsls r0, 24 - ldr r1, [sp, 0x1C] - mov r10, r1 - adds r5, r4, 0 - cmp r0, 0 - beq _081AA5E8 - ldr r4, [sp, 0xC] - adds r4, 0x1 - b _081AA5C2 - .pool -_081AA5A8: - adds r0, r6, r5 - adds r0, r2 - ldrb r2, [r0] - mov r0, r10 - lsls r3, r0, 24 - lsrs r3, 24 - ldr r0, [sp] - ldr r1, [sp, 0x14] - bl sub_81AA760 - lsls r0, 24 - cmp r0, 0 - beq _081AA5E0 -_081AA5C2: - adds r6, 0x1 - ldr r0, =gUnknown_08613F46 - adds r1, r6, r5 - adds r1, r0 - ldrb r1, [r1] - adds r2, r0, 0 - cmp r1, 0xFF - beq _081AA5D6 - cmp r6, 0x3 - ble _081AA5D8 -_081AA5D6: - movs r6, 0 -_081AA5D8: - adds r7, 0x2 - asrs r0, r7, 1 - cmp r0, 0x4 - bne _081AA5A8 -_081AA5E0: - str r4, [sp, 0xC] - b _081AA600 - .pool -_081AA5E8: - adds r6, 0x1 - adds r0, r6, r4 - add r0, r8 - ldrb r0, [r0] - cmp r0, 0xFF - beq _081AA5F8 - cmp r6, 0x3 - ble _081AA5FA -_081AA5F8: - movs r6, 0 -_081AA5FA: - ldr r1, [sp, 0xC] - adds r1, 0x1 - str r1, [sp, 0xC] -_081AA600: - asrs r0, r7, 1 - cmp r0, 0x4 - beq _081AA622 - movs r0, 0x1 - ands r7, r0 - ldr r2, [sp, 0x1C] - adds r2, 0x1 - str r2, [sp, 0x1C] - movs r3, 0x80 - lsls r3, 17 - add r9, r3 - ldr r0, [sp, 0x8] - adds r0, 0x1 - str r0, [sp, 0x8] - ldr r1, [sp, 0x10] - cmp r0, r1 - blt _081AA548 -_081AA622: - movs r1, 0 - ldr r2, [sp, 0x10] - ldr r3, [sp, 0x18] - subs r0, r2, r3 - asrs r0, 1 - ldr r2, [sp, 0xC] - cmp r0, r2 - ble _081AA634 - movs r1, 0x1 -_081AA634: - adds r0, r1, 0 - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81AA4D8 - - thumb_func_start sub_81AA648 -sub_81AA648: @ 81AA648 - 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 - str r0, [sp] - lsls r1, 24 - lsrs r6, r1, 24 - movs r4, 0 - movs r7, 0 - movs r0, 0 - mov r8, r0 - bl sub_81AA9E4 - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0x10 - bl AllocZeroed - str r0, [sp, 0x8] - bl sub_81AA96C - ldr r1, [sp] - cmp r1, 0 - bne _081AA694 - ldr r1, =gUnknown_08613650 - lsls r0, r5, 4 - adds r0, r1 - ldrb r0, [r0, 0x1] - mov r10, r0 - movs r0, 0 - b _081AA6A0 - .pool -_081AA694: - ldr r1, =gUnknown_08613650 - lsls r0, r5, 4 - adds r0, r1 - ldrb r2, [r0] - mov r10, r2 - ldrb r0, [r0, 0x1] -_081AA6A0: - movs r3, 0 - str r3, [sp, 0x4] - mov r1, r10 - asrs r1, 31 - str r1, [sp, 0xC] - cmp r3, r10 - bge _081AA73E - ldr r2, =gUnknown_08613F46 - mov r9, r2 - lsls r5, r6, 2 - lsls r6, r0, 24 -_081AA6B6: - adds r0, r4, r5 - add r0, r9 - ldrb r2, [r0] - lsrs r3, r6, 24 - ldr r0, [sp] - ldr r1, [sp, 0x8] - bl sub_81AA760 - lsls r0, 24 - cmp r0, 0 - beq _081AA714 - adds r7, 0x1 - b _081AA6EE - .pool -_081AA6D8: - adds r0, r4, r5 - adds r0, r1 - ldrb r2, [r0] - lsrs r3, r6, 24 - ldr r0, [sp] - ldr r1, [sp, 0x8] - bl sub_81AA760 - lsls r0, 24 - cmp r0, 0 - beq _081AA728 -_081AA6EE: - adds r4, 0x1 - adds r0, r4, r5 - add r0, r9 - ldrb r0, [r0] - ldr r1, =gUnknown_08613F46 - cmp r0, 0xFF - beq _081AA700 - cmp r4, 0x3 - ble _081AA702 -_081AA700: - movs r4, 0 -_081AA702: - movs r3, 0x1 - add r8, r3 - mov r0, r8 - cmp r0, 0x4 - bne _081AA6D8 - b _081AA728 - .pool -_081AA714: - adds r4, 0x1 - adds r0, r4, r5 - add r0, r9 - ldrb r0, [r0] - cmp r0, 0xFF - beq _081AA724 - cmp r4, 0x3 - ble _081AA726 -_081AA724: - movs r4, 0 -_081AA726: - adds r7, 0x1 -_081AA728: - mov r1, r8 - cmp r1, 0x4 - beq _081AA73E - movs r2, 0x80 - lsls r2, 17 - adds r6, r2 - ldr r3, [sp, 0x4] - adds r3, 0x1 - str r3, [sp, 0x4] - cmp r3, r10 - blt _081AA6B6 -_081AA73E: - movs r1, 0 - mov r2, r10 - ldr r3, [sp, 0xC] - subs r0, r2, r3 - asrs r0, 1 - cmp r0, r7 - ble _081AA74E - movs r1, 0x1 -_081AA74E: - adds r0, r1, 0 - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81AA648 - - thumb_func_start sub_81AA760 -sub_81AA760: @ 81AA760 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - mov r10, r1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - lsls r3, 24 - lsrs r7, r3, 24 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000e22 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081AA7D0 - movs r6, 0x7 -_081AA792: - movs r4, 0x7 - lsls r5, r6, 24 -_081AA796: - lsls r1, r4, 24 - lsrs r1, 24 - mov r0, r8 - str r0, [sp] - str r7, [sp, 0x4] - mov r0, r9 - lsrs r2, r5, 24 - mov r3, r10 - bl sub_81AA810 - lsls r0, 24 - cmp r0, 0 - beq _081AA7CC - subs r4, 0x1 - cmp r4, 0 - bge _081AA796 - subs r6, 0x1 - movs r1, 0x1 - negs r1, r1 - cmp r6, r1 - bgt _081AA792 - b _081AA7FC - .pool -_081AA7CC: - movs r0, 0 - b _081AA7FE -_081AA7D0: - movs r6, 0 -_081AA7D2: - movs r4, 0 - lsls r5, r6, 24 -_081AA7D6: - lsls r1, r4, 24 - lsrs r1, 24 - mov r0, r8 - str r0, [sp] - str r7, [sp, 0x4] - mov r0, r9 - lsrs r2, r5, 24 - mov r3, r10 - bl sub_81AA810 - lsls r0, 24 - cmp r0, 0 - beq _081AA7CC - adds r4, 0x1 - cmp r4, 0x7 - ble _081AA7D6 - adds r6, 0x1 - cmp r6, 0x7 - ble _081AA7D2 -_081AA7FC: - movs r0, 0x1 -_081AA7FE: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81AA760 - - thumb_func_start sub_81AA810 -sub_81AA810: @ 81AA810 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - ldr r4, [sp, 0x34] - ldr r5, [sp, 0x38] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x4] - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - lsls r4, 24 - lsrs r4, 24 - mov r10, r4 - lsls r5, 24 - lsrs r6, r5, 24 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0xC7 - lsls r1, 4 - adds r1, r0, r1 - str r1, [sp, 0x8] - add r3, r10 - ldrb r1, [r3] - adds r1, 0x2C - movs r0, 0x19 - bl get_mapheader_by_bank_and_number - adds r5, r0, 0 - movs r7, 0 - ldr r1, [r5, 0x4] - ldrb r2, [r1] - cmp r7, r2 - bge _081AA95A - movs r0, 0x3 - ands r0, r4 - lsls r0, 3 - str r0, [sp, 0xC] -_081AA868: - ldr r1, [r1, 0x4] - lsls r2, r7, 1 - adds r0, r2, r7 - lsls r0, 3 - adds r3, r0, r1 - movs r4, 0x4 - ldrsh r0, [r3, r4] - ldr r1, [r5, 0x4] - mov r12, r1 - mov r9, r2 - ldr r2, [sp, 0x4] - cmp r0, r2 - bne _081AA950 - movs r4, 0x6 - ldrsh r0, [r3, r4] - cmp r0, r8 - bne _081AA950 - ldr r0, [sp] - cmp r0, 0 - bne _081AA896 - ldrb r0, [r3, 0x1] - cmp r0, 0x3B - bne _081AA8A2 -_081AA896: - ldr r1, [sp] - cmp r1, 0x1 - bne _081AA950 - ldrb r0, [r3, 0x1] - cmp r0, 0x3B - bne _081AA950 -_081AA8A2: - movs r3, 0 - ldr r2, [r5, 0x4] - mov r12, r2 - cmp r3, r6 - bge _081AA8DC - ldr r4, [sp, 0x4] - ldr r0, [sp, 0xC] - adds r4, r0 - str r4, [sp, 0x10] - mov r1, r10 - lsrs r0, r1, 2 - lsls r0, 3 - mov r2, r8 - adds r1, r2, r0 - ldr r2, [sp, 0x8] - adds r2, 0x4 -_081AA8C2: - movs r4, 0 - ldrsh r0, [r2, r4] - ldr r4, [sp, 0x10] - cmp r0, r4 - bne _081AA8D4 - movs r4, 0x2 - ldrsh r0, [r2, r4] - cmp r0, r1 - beq _081AA8DC -_081AA8D4: - adds r2, 0x18 - adds r3, 0x1 - cmp r3, r6 - blt _081AA8C2 -_081AA8DC: - cmp r3, r6 - bne _081AA950 - lsls r0, r6, 1 - mov r8, r0 - adds r0, r6 - lsls r0, 3 - ldr r1, [sp, 0x8] - adds r5, r0, r1 - mov r3, r12 - ldr r2, [r3, 0x4] - mov r4, r9 - adds r1, r4, r7 - lsls r1, 3 - adds r0, r5, 0 - adds r1, r2 - ldm r1!, {r2-r4} - stm r0!, {r2-r4} - ldm r1!, {r2-r4} - stm r0!, {r2-r4} - ldrh r0, [r5, 0x4] - ldr r1, [sp, 0xC] - adds r0, r1 - strh r0, [r5, 0x4] - mov r2, r10 - lsrs r0, r2, 2 - lsls r0, 3 - ldrh r3, [r5, 0x6] - adds r0, r3 - strh r0, [r5, 0x6] - adds r0, r6, 0x1 - strb r0, [r5] - ldrb r0, [r5, 0x1] - cmp r0, 0x3B - beq _081AA940 - adds r0, r6, 0 - bl sub_81A9F90 - lsls r0, 16 - lsrs r7, r0, 16 - adds r4, r7, 0 - adds r0, r4, 0 - bl sub_81627A4 - strb r0, [r5, 0x1] - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000cb4 - adds r0, r1 - add r0, r8 - strh r4, [r0] -_081AA940: - movs r0, 0 - b _081AA95C - .pool -_081AA950: - adds r7, 0x1 - mov r1, r12 - ldrb r2, [r1] - cmp r7, r2 - blt _081AA868 -_081AA95A: - movs r0, 0x1 -_081AA95C: - add sp, 0x14 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81AA810 - - thumb_func_start sub_81AA96C -sub_81AA96C: @ 81AA96C - push {r4-r7,lr} - adds r6, r0, 0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000e22 - adds r1, r0, r2 - ldrh r4, [r1] - ldr r1, =0x00000e24 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 16 - orrs r4, r0 - bl sub_81AA9E4 - lsls r0, 24 - lsrs r5, r0, 24 - movs r3, 0 - ldr r2, =gUnknown_08613655 - mov r12, r2 - movs r7, 0x7 -_081AA994: - adds r2, r6, r3 - adds r0, r4, 0 - ands r0, r7 - lsls r1, r5, 4 - adds r0, r1 - add r0, r12 - ldrb r0, [r0] - strb r0, [r2] - asrs r4, 3 - cmp r3, 0x7 - bne _081AA9C0 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r2, =0x00000e26 - adds r0, r1, r2 - ldrh r4, [r0] - ldr r0, =0x00000e28 - adds r1, r0 - ldrh r0, [r1] - lsls r0, 16 - orrs r4, r0 - asrs r4, 8 -_081AA9C0: - adds r3, 0x1 - cmp r3, 0xF - ble _081AA994 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AA96C - - thumb_func_start sub_81AA9E4 -sub_81AA9E4: @ 81AA9E4 - push {r4,lr} - ldr r0, =gSaveBlock2Ptr - ldr r4, [r0] - ldr r1, =0x00000e28 - adds r0, r4, r1 - ldrh r0, [r0] - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r3, r0, 16 - ldr r0, =0x00000cb2 - adds r4, r0 - ldrh r0, [r4] - ldr r1, =gUnknown_08613794 - adds r0, r1 - ldrb r2, [r0] - cmp r2, 0x21 - bhi _081AAA38 - ldr r1, =gUnknown_08613750 - lsls r0, r2, 1 - adds r0, r1 -_081AAA10: - ldrb r1, [r0] - cmp r3, r1 - bge _081AAA30 - ldrb r0, [r0, 0x1] - b _081AAA3A - .pool -_081AAA30: - adds r0, 0x2 - adds r2, 0x1 - cmp r2, 0x21 - bls _081AAA10 -_081AAA38: - movs r0, 0 -_081AAA3A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81AA9E4 - - thumb_func_start sub_81AAA40 -sub_81AAA40: @ 81AAA40 - push {lr} - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0xC7 - lsls r1, 4 - adds r2, r0, r1 - movs r1, 0 - movs r3, 0xC7 - lsls r3, 4 - adds r0, r3 - b _081AAA6E - .pool -_081AAA5C: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xF - bhi _081AAA74 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r2 -_081AAA6E: - ldrb r0, [r0] - cmp r0, 0 - bne _081AAA5C -_081AAA74: - adds r0, r1, 0 - pop {r1} - bx r1 - thumb_func_end sub_81AAA40 - - thumb_func_start sub_81AAA7C -sub_81AAA7C: @ 81AAA7C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - movs r3, 0 - ldr r1, =gSaveBlock2Ptr - mov r8, r1 - lsls r1, r0, 2 - adds r1, r0 - movs r0, 0 - mov r12, r0 - lsls r4, r1, 1 - ldr r7, =0x00000e2c - movs r6, 0 - ldr r5, =0x00000e54 - lsls r2, r1, 2 -_081AAA9E: - mov r1, r8 - ldr r0, [r1] - adds r1, r0, r7 - adds r1, r2 - strh r6, [r1] - adds r1, r3, r4 - adds r0, r5 - adds r0, r1 - mov r1, r12 - strb r1, [r0] - adds r2, 0x2 - adds r3, 0x1 - cmp r3, 0x9 - ble _081AAA9E - movs r0, 0x15 - movs r1, 0x1 - bl AddPyramidBagItem - movs r0, 0x22 - movs r1, 0x1 - bl AddPyramidBagItem - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AAA7C - - thumb_func_start CalculateBattlePyramidPickupItemId -CalculateBattlePyramidPickupItemId: @ 81AAAE0 - push {r4-r6,lr} - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r2, =0x00000ca9 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r6, r0, 30 - lsls r0, r6, 1 - ldr r2, =0x00000e1a - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - movs r1, 0x7 - bl __udivsi3 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x13 - ble _081AAB0A - movs r4, 0x13 -_081AAB0A: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r2, r0, 16 - movs r1, 0 - ldr r3, =gUnknown_08613F86 - ldrb r0, [r3] - lsls r5, r4, 2 - cmp r0, r2 - bgt _081AAB36 -_081AAB28: - adds r1, 0x1 - cmp r1, 0x9 - bhi _081AAB3A - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - ble _081AAB28 -_081AAB36: - cmp r1, 0x9 - bls _081AAB3C -_081AAB3A: - movs r1, 0x9 -_081AAB3C: - cmp r6, 0 - bne _081AAB58 - ldr r2, =gUnknown_0861379C - b _081AAB5A - .pool -_081AAB58: - ldr r2, =gUnknown_0861392C -_081AAB5A: - lsls r1, 1 - adds r0, r5, r4 - lsls r0, 2 - adds r1, r0 - adds r1, r2 - ldrh r0, [r1] - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end CalculateBattlePyramidPickupItemId - - thumb_func_start ResetBagScrollPositions -ResetBagScrollPositions: @ 81AAB70 - push {r4,lr} - ldr r4, =gUnknown_0203CE58 - movs r0, 0 - strb r0, [r4, 0x5] - adds r0, r4, 0 - adds r0, 0x8 - movs r1, 0 - movs r2, 0xA - bl memset - adds r4, 0x12 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0xA - bl memset - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ResetBagScrollPositions - - thumb_func_start CB2_BagMenuFromStartMenu -@ void CB2_BagMenuFromStartMenu() -CB2_BagMenuFromStartMenu: @ 81AAB9C - push {lr} - ldr r2, =sub_8086194 - movs r0, 0 - movs r1, 0x5 - bl GoToBagMenu - pop {r0} - bx r0 - .pool - thumb_func_end CB2_BagMenuFromStartMenu - - thumb_func_start sub_81AABB0 -sub_81AABB0: @ 81AABB0 - push {lr} - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - bne _081AABCC - ldr r2, =sub_8059D50 - movs r0, 0x1 - movs r1, 0x5 - bl GoToBagMenu - b _081AABD4 - .pool -_081AABCC: - ldr r1, =sub_8059D50 - movs r0, 0x1 - bl sub_81C4F98 -_081AABD4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AABB0 - - thumb_func_start CB2_ChooseBerry -CB2_ChooseBerry: @ 81AABDC - push {lr} - ldr r2, =sub_80861B0 - movs r0, 0x4 - movs r1, 0x3 - bl GoToBagMenu - pop {r0} - bx r0 - .pool - thumb_func_end CB2_ChooseBerry - - thumb_func_start sub_81AABF0 -sub_81AABF0: @ 81AABF0 - push {lr} - adds r2, r0, 0 - movs r0, 0x5 - movs r1, 0x3 - bl GoToBagMenu - pop {r0} - bx r0 - thumb_func_end sub_81AABF0 - - thumb_func_start CB2_GoToSellMenu -@ void CB2_GoToSellMenu() -CB2_GoToSellMenu: @ 81AAC00 - push {lr} - ldr r2, =CB2_ExitSellMenu - movs r0, 0x3 - movs r1, 0x5 - bl GoToBagMenu - pop {r0} - bx r0 - .pool - thumb_func_end CB2_GoToSellMenu - - thumb_func_start sub_81AAC14 -sub_81AAC14: @ 81AAC14 - push {lr} - ldr r2, =sub_816B31C - movs r0, 0x6 - movs r1, 0x5 - bl GoToBagMenu - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AAC14 - - thumb_func_start sub_81AAC28 -sub_81AAC28: @ 81AAC28 - push {lr} - ldr r2, =bag_menu_leave_maybe_3 - movs r0, 0x9 - movs r1, 0x5 - bl GoToBagMenu - ldr r0, =gSpecialVar_0x8005 - movs r1, 0 - strh r1, [r0] - ldr r0, =gScriptResult - strh r1, [r0] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AAC28 - - thumb_func_start sub_81AAC50 -sub_81AAC50: @ 81AAC50 - push {lr} - ldr r2, =bag_menu_leave_maybe_2 - movs r0, 0x7 - movs r1, 0x5 - bl GoToBagMenu - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AAC50 - - thumb_func_start sub_81AAC70 -sub_81AAC70: @ 81AAC70 - push {lr} - ldr r2, =bag_menu_leave_maybe - movs r0, 0x8 - movs r1, 0x5 - bl GoToBagMenu - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AAC70 - - thumb_func_start GoToBagMenu -@ void GoToBagMenu(u8 bagMenuType, u8 pocketId, void ( *postExitMenuMainCallback2)()) -GoToBagMenu: @ 81AAC90 - push {r4-r7,lr} - adds r4, r2, 0 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r7, r1, 24 - ldr r6, =gUnknown_0203CE54 - ldr r0, =0x00000c48 - bl AllocZeroed - str r0, [r6] - cmp r0, 0 - bne _081AACBC - adds r0, r4, 0 - bl SetMainCallback2 - b _081AAD3A - .pool -_081AACBC: - ldr r0, =gUnknown_0203CE58 - cmp r5, 0xC - beq _081AACC4 - strb r5, [r0, 0x4] -_081AACC4: - cmp r4, 0 - beq _081AACCA - str r4, [r0] -_081AACCA: - cmp r7, 0x4 - bhi _081AACD0 - strb r7, [r0, 0x5] -_081AACD0: - ldrb r0, [r0, 0x4] - subs r0, 0x4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _081AACF0 - ldr r2, [r6] - ldr r0, =0x0000081b - adds r2, r0 - ldrb r1, [r2] - movs r0, 0x10 - negs r0, r0 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] -_081AACF0: - ldr r0, [r6] - movs r1, 0 - str r1, [r0] - ldr r1, =0x0000081a - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldr r0, [r6] - ldr r1, =0x0000081e - adds r0, r1 - movs r1, 0x1 - negs r1, r1 - strb r1, [r0] - ldr r0, [r6] - ldr r1, =0x0000081f - adds r0, r1 - movs r1, 0x1 - negs r1, r1 - strb r1, [r0] - ldr r0, [r6] - ldr r1, =0x00000804 - adds r0, r1 - movs r1, 0xFF - movs r2, 0xC - bl memset - ldr r0, [r6] - movs r1, 0x81 - lsls r1, 4 - adds r0, r1 - movs r1, 0xFF - movs r2, 0xA - bl memset - ldr r0, =CB2_Bag - bl SetMainCallback2 -_081AAD3A: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end GoToBagMenu - - thumb_func_start c2_bag_3 -c2_bag_3: @ 81AAD5C - push {lr} - bl RunTasks - bl AnimateSprites - bl BuildOamBuffer - bl do_scheduled_bg_tilemap_copies_to_vram - bl UpdatePaletteFade - pop {r0} - bx r0 - thumb_func_end c2_bag_3 - - thumb_func_start vblank_cb_bag_menu -vblank_cb_bag_menu: @ 81AAD78 - push {lr} - bl LoadOam - bl ProcessSpriteCopyRequests - bl TransferPlttBuffer - pop {r0} - bx r0 - thumb_func_end vblank_cb_bag_menu - - thumb_func_start CB2_Bag -CB2_Bag: @ 81AAD8C - push {lr} -_081AAD8E: - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081AADB2 - bl setup_bag_menu - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081AADB2 - bl sub_81221AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081AAD8E -_081AADB2: - pop {r0} - bx r0 - thumb_func_end CB2_Bag - - thumb_func_start setup_bag_menu -setup_bag_menu: @ 81AADB8 - push {r4,r5,lr} - sub sp, 0x4 - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r0, r1, r2 - ldrb r0, [r0] - adds r2, r1, 0 - cmp r0, 0x14 - bls _081AADCE - b _081AB02C -_081AADCE: - lsls r0, 2 - ldr r1, =_081AADE0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081AADE0: - .4byte _081AAE34 - .4byte _081AAE3E - .4byte _081AAE50 - .4byte _081AAE56 - .4byte _081AAE78 - .4byte _081AAE7E - .4byte _081AAE86 - .4byte _081AAEA4 - .4byte _081AAECC - .4byte _081AAEDA - .4byte _081AAEEC - .4byte _081AAEFA - .4byte _081AAF0C - .4byte _081AAF1C - .4byte _081AAF54 - .4byte _081AAFA0 - .4byte _081AAFBC - .4byte _081AAFC2 - .4byte _081AAFD8 - .4byte _081AAFDE - .4byte _081AAFF8 -_081AAE34: - bl SetVBlankHBlankCallbacksToNull - bl clear_scheduled_bg_copies_to_vram - b _081AB012 -_081AAE3E: - bl remove_some_task - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _081AB01A - .pool -_081AAE50: - bl FreeAllSpritePalettes - b _081AB012 -_081AAE56: - bl ResetPaletteFade - ldr r2, =gPaletteFade - ldrb r0, [r2, 0x8] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0x8] - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _081AB01A - .pool -_081AAE78: - bl ResetSpriteData - b _081AB012 -_081AAE7E: - movs r0, 0x87 - lsls r0, 3 - adds r1, r2, r0 - b _081AB01A -_081AAE86: - bl sub_81221AC - lsls r0, 24 - cmp r0, 0 - bne _081AAE94 - bl ResetTasks -_081AAE94: - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _081AB01A - .pool -_081AAEA4: - bl bag_menu_init_bgs - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r1, =0x00000834 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _081AB01A - .pool -_081AAECC: - bl load_bag_menu_graphics - lsls r0, 24 - cmp r0, 0 - bne _081AAED8 - b _081AB044 -_081AAED8: - b _081AB012 -_081AAEDA: - bl setup_bag_menu_textboxes - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _081AB01A - .pool -_081AAEEC: - bl sub_81ABA6C - bl sub_81ABAC4 - bl sub_81ABAE0 - b _081AB012 -_081AAEFA: - bl allocate_bag_item_list_buffers - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _081AB01A - .pool -_081AAF0C: - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - bl load_bag_item_list_buffers - b _081AB012 - .pool -_081AAF1C: - ldr r1, =gPocketNames - ldr r4, =gUnknown_0203CE58 - ldrb r0, [r4, 0x5] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0 - bl bag_menu_print_pocket_names - movs r0, 0 - bl bag_menu_copy_pocket_name_to_window - ldrb r0, [r4, 0x5] - movs r1, 0x1 - bl bag_menu_draw_pocket_indicator_square - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _081AB01A - .pool -_081AAF54: - ldr r4, =gUnknown_0203CE58 - ldrb r0, [r4, 0x4] - bl sub_81AB1F0 - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_03006310 - ldrb r2, [r4, 0x5] - lsls r2, 1 - adds r1, r4, 0 - adds r1, 0x12 - adds r1, r2, r1 - ldrh r1, [r1] - adds r4, 0x8 - adds r2, r4 - ldrh r2, [r2] - bl ListMenuInit - ldr r2, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r2 - lsls r0, 24 - lsrs r0, 24 - movs r2, 0 - strh r0, [r1, 0x8] - strh r2, [r1, 0xE] - strh r2, [r1, 0x18] - b _081AB012 - .pool -_081AAFA0: - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - bl AddBagVisualObject - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _081AB01A - .pool -_081AAFBC: - bl sub_80D4FAC - b _081AB012 -_081AAFC2: - bl bag_menu_add_pocket_scroll_arrow_indicators_maybe - bl bag_menu_add_list_scroll_arrow_indicators_maybe - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _081AB01A - .pool -_081AAFD8: - bl bag_menu_prepare_tmhm_move_window - b _081AB012 -_081AAFDE: - movs r0, 0x1 - negs r0, r0 - movs r1, 0x10 - movs r2, 0 - bl BlendPalettes - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _081AB01A - .pool -_081AAFF8: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - ldr r2, =gPaletteFade - ldrb r1, [r2, 0x8] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2, 0x8] -_081AB012: - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 -_081AB01A: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _081AB044 - .pool -_081AB02C: - ldr r0, =vblank_cb_bag_menu - bl SetVBlankCallback - ldr r0, =c2_bag_3 - bl SetMainCallback2 - movs r0, 0x1 - b _081AB046 - .pool -_081AB044: - movs r0, 0 -_081AB046: - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end setup_bag_menu - - thumb_func_start bag_menu_init_bgs -bag_menu_init_bgs: @ 81AB050 - push {r4,lr} - bl sub_8121DA0 - ldr r4, =gUnknown_0203CE54 - ldr r0, [r4] - adds r0, 0x4 - movs r2, 0x80 - lsls r2, 4 - movs r1, 0 - bl memset - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_08613F90 - movs r0, 0 - movs r2, 0x3 - bl InitBgsFromTemplates - ldr r1, [r4] - adds r1, 0x4 - movs r0, 0x2 - bl SetBgTilemapBuffer - bl sub_8121E10 - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_init_bgs - - thumb_func_start load_bag_menu_graphics -load_bag_menu_graphics: @ 81AB0BC - push {r4,lr} - sub sp, 0x4 - ldr r4, =gUnknown_0203CE54 - ldr r0, [r4] - ldr r1, =0x00000834 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0x4 - bls _081AB0D2 - b _081AB1CC -_081AB0D2: - lsls r0, 2 - ldr r1, =_081AB0E8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081AB0E8: - .4byte _081AB0FC - .4byte _081AB118 - .4byte _081AB13C - .4byte _081AB174 - .4byte _081AB1A8 -_081AB0FC: - bl reset_temp_tile_data_buffers - ldr r1, =gUnknown_08D9A620 - movs r0, 0 - str r0, [sp] - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - b _081AB1AE - .pool -_081AB118: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081AB1E4 - ldr r0, =gUnknown_08D9A88C - ldr r4, =gUnknown_0203CE54 - ldr r1, [r4] - adds r1, 0x4 - bl LZDecompressWram - ldr r1, [r4] - b _081AB1B2 - .pool -_081AB13C: - bl IsWallysBag - lsls r0, 24 - cmp r0, 0 - bne _081AB164 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0 - beq _081AB164 - ldr r0, =gUnknown_08D9A5D4 - movs r1, 0 - movs r2, 0x40 - bl LoadCompressedPalette - b _081AB1AE - .pool -_081AB164: - ldr r0, =gUnknown_08D9A588 - movs r1, 0 - movs r2, 0x40 - bl LoadCompressedPalette - b _081AB1AE - .pool -_081AB174: - bl IsWallysBag - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081AB18A - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0 - bne _081AB19C -_081AB18A: - ldr r0, =gUnknown_0857FB34 - bl LoadCompressedObjectPic - b _081AB1AE - .pool -_081AB19C: - ldr r0, =gUnknown_0857FB3C - bl LoadCompressedObjectPic - b _081AB1AE - .pool -_081AB1A8: - ldr r0, =gUnknown_0857FB44 - bl LoadCompressedObjectPalette -_081AB1AE: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] -_081AB1B2: - ldr r0, =0x00000834 - adds r1, r0 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _081AB1E4 - .pool -_081AB1CC: - bl sub_8122328 - ldr r0, [r4] - ldr r1, =0x00000834 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - movs r0, 0x1 - b _081AB1E6 - .pool -_081AB1E4: - movs r0, 0 -_081AB1E6: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end load_bag_menu_graphics - - thumb_func_start sub_81AB1F0 -sub_81AB1F0: @ 81AB1F0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xA - bne _081AB204 - ldr r0, =Task_WallyTutorialBagMenu - b _081AB206 - .pool -_081AB204: - ldr r0, =Task_BagMenu -_081AB206: - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81AB1F0 - - thumb_func_start allocate_bag_item_list_buffers -allocate_bag_item_list_buffers: @ 81AB218 - push {r4,lr} - ldr r4, =gUnknown_0203CE74 - movs r0, 0x82 - lsls r0, 2 - bl Alloc - str r0, [r4] - ldr r4, =gUnknown_0203CE78 - movs r0, 0xC3 - lsls r0, 3 - bl Alloc - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end allocate_bag_item_list_buffers - - thumb_func_start load_bag_item_list_buffers -@ void load_bag_item_list_buffers(int pocket_id) -load_bag_item_list_buffers: @ 81AB240 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, r7, 3 - ldr r0, =gBagPockets - adds r1, r0 - mov r8, r1 - ldr r0, =gUnknown_0203CE54 - ldr r2, [r0] - ldr r1, =0x0000081b - adds r0, r2, r1 - ldrb r1, [r0] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081AB2FC - movs r6, 0 - ldr r3, =0x00000829 - adds r0, r2, r3 - adds r0, r7 - ldrb r0, [r0] - subs r0, 0x1 - cmp r6, r0 - bge _081AB2B6 - ldr r5, =gUnknown_0203CE78 -_081AB276: - lsls r4, r6, 1 - adds r4, r6 - lsls r4, 3 - ldr r0, [r5] - adds r0, r4 - mov r1, r8 - ldr r2, [r1] - lsls r1, r6, 2 - adds r1, r2 - ldrh r1, [r1] - bl get_name - ldr r0, =gUnknown_0203CE74 - ldr r0, [r0] - lsls r1, r6, 3 - adds r1, r0 - ldr r0, [r5] - adds r0, r4 - str r0, [r1] - str r6, [r1, 0x4] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r3, =0x00000829 - adds r0, r3 - adds r0, r7 - ldrb r0, [r0] - subs r0, 0x1 - cmp r6, r0 - blt _081AB276 -_081AB2B6: - ldr r5, =gUnknown_0203CE78 - lsls r4, r6, 1 - adds r4, r6 - lsls r4, 3 - ldr r0, [r5] - adds r0, r4 - ldr r1, =gText_CloseBag - bl StringCopy - ldr r0, =gUnknown_0203CE74 - ldr r0, [r0] - lsls r1, r6, 3 - adds r1, r0 - ldr r0, [r5] - adds r0, r4 - str r0, [r1] - movs r0, 0x2 - negs r0, r0 - str r0, [r1, 0x4] - b _081AB34A - .pool -_081AB2FC: - movs r6, 0 - ldr r4, =0x00000829 - adds r0, r2, r4 - adds r0, r7 - ldrb r0, [r0] - cmp r6, r0 - bcs _081AB34A - ldr r5, =gUnknown_0203CE78 -_081AB30C: - lsls r4, r6, 1 - adds r4, r6 - lsls r4, 3 - ldr r0, [r5] - adds r0, r4 - mov r1, r8 - ldr r2, [r1] - lsls r1, r6, 2 - adds r1, r2 - ldrh r1, [r1] - bl get_name - ldr r0, =gUnknown_0203CE74 - ldr r0, [r0] - lsls r1, r6, 3 - adds r1, r0 - ldr r0, [r5] - adds r0, r4 - str r0, [r1] - str r6, [r1, 0x4] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r3, =0x00000829 - adds r0, r3 - adds r0, r7 - ldrb r0, [r0] - cmp r6, r0 - bcc _081AB30C -_081AB34A: - ldr r2, =gUnknown_03006310 - adds r1, r2, 0 - ldr r0, =gUnknown_08613F9C - ldm r0!, {r3-r5} - stm r1!, {r3-r5} - ldm r0!, {r3-r5} - stm r1!, {r3-r5} - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - ldr r4, =0x00000829 - adds r0, r1, r4 - adds r0, r7 - ldrb r0, [r0] - strh r0, [r2, 0xC] - ldr r0, =gUnknown_0203CE74 - ldr r0, [r0] - str r0, [r2] - ldr r5, =0x0000082e - adds r1, r5 - adds r1, r7 - ldrb r0, [r1] - strh r0, [r2, 0xE] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end load_bag_item_list_buffers - - thumb_func_start get_name -@ void get_name(char *dest, int name_id) -get_name: @ 81AB39C - push {r4-r6,lr} - adds r6, r0, 0 - lsls r1, 16 - lsrs r5, r1, 16 - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - cmp r0, 0x2 - beq _081AB3C0 - cmp r0, 0x3 - beq _081AB420 - adds r0, r5, 0 - adds r1, r6, 0 - bl CopyItemName - b _081AB43E - .pool -_081AB3C0: - ldr r4, =gStringVar2 - adds r0, r5, 0 - bl ItemIdToBattleMoveId - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xD - muls r1, r0 - ldr r0, =gMoveNames - adds r1, r0 - adds r0, r4, 0 - bl StringCopy - movs r0, 0xA9 - lsls r0, 1 - cmp r5, r0 - bls _081AB408 - ldr r0, =gStringVar1 - ldr r2, =0xfffffeae - adds r1, r5, r2 - movs r2, 0x2 - movs r3, 0x1 - bl ConvertIntToDecimalStringN - ldr r1, =gUnknown_085E921A - b _081AB438 - .pool -_081AB408: - ldr r0, =gStringVar1 - ldr r2, =0xfffffee0 - adds r1, r5, r2 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - b _081AB436 - .pool -_081AB420: - ldr r0, =gStringVar1 - adds r1, r5, 0 - subs r1, 0x84 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - ldr r1, =gStringVar2 - adds r0, r5, 0 - bl CopyItemName -_081AB436: - ldr r1, =gUnknown_085E9210 -_081AB438: - adds r0, r6, 0 - bl StringExpandPlaceholders -_081AB43E: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end get_name - - thumb_func_start bag_menu_change_item_callback -bag_menu_change_item_callback: @ 81AB450 - push {r4-r6,lr} - adds r6, r0, 0 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x1 - beq _081AB466 - movs r0, 0x5 - bl PlaySE - bl ShakeBagVisual -_081AB466: - ldr r4, =gUnknown_0203CE54 - ldr r1, [r4] - ldr r2, =0x0000081a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0xFF - bne _081AB50C - adds r2, 0x1 - adds r0, r1, r2 - ldrb r1, [r0] - lsls r1, 26 - lsrs r1, 30 - movs r0, 0x1 - eors r0, r1 - bl RemoveBagItemIconObject - movs r0, 0x2 - negs r0, r0 - cmp r6, r0 - beq _081AB4C8 - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r6, 16 - lsrs r1, 16 - bl BagGetItemIdByPocketPosition - lsls r0, 16 - lsrs r0, 16 - ldr r1, [r4] - ldr r2, =0x0000081b - adds r1, r2 - ldrb r1, [r1] - lsls r1, 26 - lsrs r1, 30 - bl AddBagItemIconObject - b _081AB4DA - .pool -_081AB4C8: - ldr r0, =0x0000ffff - ldr r1, [r4] - ldr r2, =0x0000081b - adds r1, r2 - ldrb r1, [r1] - lsls r1, 26 - lsrs r1, 30 - bl AddBagItemIconObject -_081AB4DA: - ldr r5, =gUnknown_0203CE54 - ldr r2, [r5] - ldr r4, =0x0000081b - adds r2, r4 - ldrb r3, [r2] - lsls r0, r3, 26 - lsrs r0, 30 - movs r1, 0x1 - eors r1, r0 - lsls r1, 4 - movs r0, 0x31 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - ldr r0, [r5] - adds r0, r4 - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _081AB50C - adds r0, r6, 0 - bl bag_menu_print_description_box_text -_081AB50C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_change_item_callback - - thumb_func_start sub_81AB520 -@ void sub_81AB520(u8 rbox_id, int item_index_in_pocket, int a3) -sub_81AB520: @ 81AB520 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x14 - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r2, 24 - lsrs r7, r2, 24 - movs r0, 0x2 - negs r0, r0 - cmp r4, r0 - bne _081AB540 - b _081AB696 -_081AB540: - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r1, =0x0000081a - adds r0, r1 - ldrb r1, [r0] - cmp r1, 0xFF - beq _081AB570 - lsls r0, r4, 24 - lsrs r0, 24 - cmp r1, r0 - bne _081AB568 - adds r0, r7, 0 - movs r1, 0x2 - bl bag_menu_print_cursor - b _081AB570 - .pool -_081AB568: - adds r0, r7, 0 - movs r1, 0xFF - bl bag_menu_print_cursor -_081AB570: - ldr r5, =gUnknown_0203CE58 - ldrb r0, [r5, 0x5] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - lsls r4, 16 - lsrs r4, 16 - adds r1, r4, 0 - bl BagGetItemIdByPocketPosition - lsls r0, 16 - lsrs r6, r0, 16 - ldrb r0, [r5, 0x5] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - bl BagGetQuantityByPocketPosition - lsls r0, 16 - lsrs r4, r0, 16 - mov r9, r4 - ldr r1, =0xfffffead - adds r0, r6, r1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x7 - bhi _081AB5BE - ldr r1, =gUnknown_08DC6378 - subs r3, r7, 0x1 - lsls r3, 16 - lsrs r3, 16 - movs r0, 0x10 - str r0, [sp] - str r0, [sp, 0x4] - mov r0, r8 - movs r2, 0x8 - bl BlitBitmapToWindow -_081AB5BE: - ldrb r0, [r5, 0x5] - cmp r0, 0x3 - bne _081AB610 - ldr r0, =gStringVar1 - adds r1, r4, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gText_xVar1 - adds r0, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x7 - adds r1, r4, 0 - movs r2, 0x77 - bl GetStringRightAlignXOffset - lsls r3, r0, 24 - lsrs r3, 24 - str r7, [sp] - movs r1, 0 - str r1, [sp, 0x4] - str r1, [sp, 0x8] - movs r0, 0xFF - str r0, [sp, 0xC] - str r1, [sp, 0x10] - b _081AB652 - .pool -_081AB610: - cmp r0, 0x4 - beq _081AB66C - adds r0, r6, 0 - bl itemid_is_unique - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _081AB66C - ldr r0, =gStringVar1 - mov r1, r9 - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gText_xVar1 - adds r0, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x7 - adds r1, r4, 0 - movs r2, 0x77 - bl GetStringRightAlignXOffset - lsls r3, r0, 24 - lsrs r3, 24 - str r7, [sp] - str r5, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0xFF - str r0, [sp, 0xC] - str r5, [sp, 0x10] -_081AB652: - mov r0, r8 - movs r1, 0x7 - adds r2, r4, 0 - bl bag_menu_print - b _081AB696 - .pool -_081AB66C: - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00000496 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0 - beq _081AB696 - cmp r0, r6 - bne _081AB696 - ldr r1, =gUnknown_086140A4 - subs r3, r7, 0x1 - lsls r3, 16 - lsrs r3, 16 - movs r0, 0x18 - str r0, [sp] - movs r0, 0x10 - str r0, [sp, 0x4] - mov r0, r8 - movs r2, 0x60 - bl BlitBitmapToWindow -_081AB696: - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AB520 - - thumb_func_start bag_menu_print_description_box_text -@ void bag_menu_print_description_box_text(int a1) -bag_menu_print_description_box_text: @ 81AB6B0 - push {r4,lr} - sub sp, 0x14 - adds r1, r0, 0 - movs r0, 0x2 - negs r0, r0 - cmp r1, r0 - beq _081AB6E0 - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r1, 16 - bl BagGetItemIdByPocketPosition - lsls r0, 16 - lsrs r0, 16 - bl ItemId_GetDescription - adds r4, r0, 0 - b _081AB6FC - .pool -_081AB6E0: - ldr r0, =gStringVar1 - ldr r2, =gUnknown_085E9180 - ldr r1, =gUnknown_0203CE58 - ldrb r1, [r1, 0x4] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl StringCopy - ldr r4, =gStringVar4 - ldr r1, =gText_ReturnToVar1 - adds r0, r4, 0 - bl StringExpandPlaceholders -_081AB6FC: - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r0, [sp, 0xC] - str r0, [sp, 0x10] - movs r0, 0x1 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0x3 - bl bag_menu_print - add sp, 0x14 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_print_description_box_text - - thumb_func_start bag_menu_print_cursor_ -bag_menu_print_cursor_: @ 81AB73C - push {r4,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsrs r4, 24 - bl ListMenuGetYCoordForPrintingArrowCursor - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - bl bag_menu_print_cursor - pop {r4} - pop {r0} - bx r0 - thumb_func_end bag_menu_print_cursor_ - - thumb_func_start bag_menu_print_cursor -bag_menu_print_cursor: @ 81AB75C - push {r4,r5,lr} - sub sp, 0x14 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0xFF - bne _081AB798 - movs r0, 0x1 - movs r1, 0 - bl GetMenuCursorDimensionByFont - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - movs r1, 0x1 - bl GetMenuCursorDimensionByFont - lsls r0, 24 - lsrs r0, 24 - str r4, [sp] - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - adds r3, r5, 0 - bl FillWindowPixelRect - b _081AB7AE -_081AB798: - ldr r2, =gText_SelectorArrow2 - str r5, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r0, [sp, 0xC] - str r1, [sp, 0x10] - movs r1, 0x1 - movs r3, 0 - bl bag_menu_print -_081AB7AE: - add sp, 0x14 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_print_cursor - - thumb_func_start bag_menu_add_pocket_scroll_arrow_indicators_maybe -bag_menu_add_pocket_scroll_arrow_indicators_maybe: @ 81AB7BC - push {r4-r6,lr} - sub sp, 0x10 - ldr r5, =gUnknown_0203CE54 - ldr r4, [r5] - ldr r1, =0x0000081e - adds r0, r4, r1 - ldrb r0, [r0] - cmp r0, 0xFF - bne _081AB80A - ldr r2, =gUnknown_0203CE58 - ldrb r3, [r2, 0x5] - ldr r6, =0x00000829 - adds r0, r4, r6 - adds r0, r3 - ldrb r1, [r0] - adds r6, 0x5 - adds r0, r4, r6 - adds r0, r3 - ldrb r0, [r0] - subs r1, r0 - str r1, [sp] - movs r0, 0x6E - str r0, [sp, 0x4] - str r0, [sp, 0x8] - ldrb r0, [r2, 0x5] - lsls r0, 1 - adds r2, 0x12 - adds r0, r2 - str r0, [sp, 0xC] - movs r0, 0x2 - movs r1, 0xAC - movs r2, 0xC - movs r3, 0x94 - bl AddScrollIndicatorArrowPairParametrized - ldr r1, [r5] - ldr r2, =0x0000081e - adds r1, r2 - strb r0, [r1] -_081AB80A: - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_add_pocket_scroll_arrow_indicators_maybe - - thumb_func_start sub_81AB824 -sub_81AB824: @ 81AB824 - push {r4,lr} - ldr r4, =gUnknown_0203CE54 - ldr r0, [r4] - ldr r2, =0x0000081e - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0xFF - beq _081AB842 - bl RemoveScrollIndicatorArrowPair - ldr r0, [r4] - ldr r1, =0x0000081e - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] -_081AB842: - bl sub_81AB89C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AB824 - - thumb_func_start bag_menu_add_list_scroll_arrow_indicators_maybe -bag_menu_add_list_scroll_arrow_indicators_maybe: @ 81AB854 - push {r4,lr} - ldr r4, =gUnknown_0203CE54 - ldr r2, [r4] - ldr r1, =0x0000081b - adds r0, r2, r1 - ldrb r1, [r0] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x1 - beq _081AB882 - ldr r1, =0x0000081f - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0xFF - bne _081AB882 - ldr r0, =gUnknown_08614094 - ldr r1, =gUnknown_0203CE5E - bl AddScrollIndicatorArrowPair - ldr r1, [r4] - ldr r2, =0x0000081f - adds r1, r2 - strb r0, [r1] -_081AB882: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_add_list_scroll_arrow_indicators_maybe - - thumb_func_start sub_81AB89C -sub_81AB89C: @ 81AB89C - push {r4,lr} - ldr r4, =gUnknown_0203CE54 - ldr r0, [r4] - ldr r2, =0x0000081f - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0xFF - beq _081AB8BA - bl RemoveScrollIndicatorArrowPair - ldr r0, [r4] - ldr r1, =0x0000081f - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] -_081AB8BA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AB89C - - thumb_func_start free_bag_item_list_buffers -free_bag_item_list_buffers: @ 81AB8C8 - push {lr} - ldr r0, =gUnknown_0203CE78 - ldr r0, [r0] - bl Free - ldr r0, =gUnknown_0203CE74 - ldr r0, [r0] - bl Free - bl FreeAllWindowBuffers - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - bl Free - pop {r0} - bx r0 - .pool - thumb_func_end free_bag_item_list_buffers - - thumb_func_start unknown_ItemMenu_Confirm -unknown_ItemMenu_Confirm: @ 81AB8F8 - 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, =task_close_bag_menu_2 - str r1, [r0] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end unknown_ItemMenu_Confirm - - thumb_func_start task_close_bag_menu_2 -task_close_bag_menu_2: @ 81AB930 - 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 r2, r0, r1 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081AB9A0 - ldrb r0, [r2] - ldr r4, =gUnknown_0203CE58 - ldrb r2, [r4, 0x5] - lsls r2, 1 - adds r1, r4, 0 - adds r1, 0x12 - adds r1, r2, r1 - adds r3, r4, 0 - adds r3, 0x8 - adds r2, r3 - bl sub_81AE6C8 - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r0, [r0] - cmp r0, 0 - beq _081AB984 - bl SetMainCallback2 - b _081AB98A - .pool -_081AB984: - ldr r0, [r4] - bl SetMainCallback2 -_081AB98A: - bl sub_81AB824 - bl ResetSpriteData - bl FreeAllSpritePalettes - bl free_bag_item_list_buffers - adds r0, r5, 0 - bl DestroyTask -_081AB9A0: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end task_close_bag_menu_2 - - thumb_func_start sub_81AB9A8 -sub_81AB9A8: @ 81AB9A8 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, r5, 3 - ldr r0, =gBagPockets - adds r4, r1, r0 - cmp r5, 0x3 - bgt _081AB9C8 - cmp r5, 0x2 - blt _081AB9C8 - adds r0, r4, 0 - bl sub_80D6FB4 - b _081AB9CE - .pool -_081AB9C8: - adds r0, r4, 0 - bl sub_80D6F64 -_081AB9CE: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - ldr r6, =0x00000829 - adds r1, r6 - adds r1, r5 - movs r2, 0 - strb r2, [r1] - adds r3, r0, 0 - ldrb r0, [r4, 0x4] - cmp r2, r0 - bcs _081ABA12 - ldr r0, [r4] - ldrh r0, [r0] - cmp r0, 0 - beq _081ABA12 - adds r7, r3, 0 -_081AB9EE: - ldr r0, [r7] - adds r0, r6 - adds r0, r5 - ldrb r1, [r0] - adds r1, 0x1 - strb r1, [r0] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - ldrb r1, [r4, 0x4] - cmp r2, r1 - bcs _081ABA12 - ldr r0, [r4] - lsls r1, r2, 2 - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0 - bne _081AB9EE -_081ABA12: - ldr r2, [r3] - ldr r1, =0x0000081b - adds r0, r2, r1 - ldrb r1, [r0] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081ABA2E - ldr r0, =0x00000829 - adds r1, r2, r0 - adds r1, r5 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_081ABA2E: - ldr r1, [r3] - ldr r2, =0x00000829 - adds r0, r1, r2 - adds r0, r5 - ldrb r2, [r0] - cmp r2, 0x8 - bls _081ABA58 - ldr r3, =0x0000082e - adds r0, r1, r3 - adds r0, r5 - movs r1, 0x8 - strb r1, [r0] - b _081ABA60 - .pool -_081ABA58: - ldr r3, =0x0000082e - adds r0, r1, r3 - adds r0, r5 - strb r2, [r0] -_081ABA60: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AB9A8 - - thumb_func_start sub_81ABA6C -sub_81ABA6C: @ 81ABA6C - push {r4,lr} - movs r4, 0 -_081ABA70: - adds r0, r4, 0 - bl sub_81AB9A8 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x4 - bls _081ABA70 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81ABA6C - - thumb_func_start sub_81ABA88 -sub_81ABA88: @ 81ABA88 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 1 - ldr r2, =gUnknown_0203CE6A - adds r4, r1, r2 - subs r2, 0xA - adds r1, r2 - ldr r2, =gUnknown_0203CE54 - ldr r3, [r2] - ldr r5, =0x0000082e - adds r2, r3, r5 - adds r2, r0 - ldrb r2, [r2] - subs r5, 0x5 - adds r3, r5 - adds r3, r0 - ldrb r3, [r3] - adds r0, r4, 0 - bl sub_812225C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81ABA88 - - thumb_func_start sub_81ABAC4 -sub_81ABAC4: @ 81ABAC4 - push {r4,lr} - movs r4, 0 -_081ABAC8: - adds r0, r4, 0 - bl sub_81ABA88 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x4 - bls _081ABAC8 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81ABAC4 - - thumb_func_start sub_81ABAE0 -sub_81ABAE0: @ 81ABAE0 - push {r4-r7,lr} - sub sp, 0x4 - movs r5, 0 - ldr r6, =gUnknown_0203CE6A - adds r7, r6, 0 - subs r7, 0xA -_081ABAEC: - lsls r1, r5, 1 - adds r0, r1, r6 - adds r1, r7 - ldr r2, =gUnknown_0203CE54 - ldr r3, [r2] - ldr r4, =0x0000082e - adds r2, r3, r4 - adds r2, r5 - ldrb r2, [r2] - subs r4, 0x5 - adds r3, r4 - adds r3, r5 - ldrb r3, [r3] - movs r4, 0x8 - str r4, [sp] - bl sub_8122298 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x4 - bls _081ABAEC - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81ABAE0 - - thumb_func_start sub_81ABB2C -sub_81ABB2C: @ 81ABB2C - lsls r0, 24 - ldr r1, =gUnknown_0203CE58 - lsrs r0, 23 - adds r2, r1, 0 - adds r2, 0x12 - adds r2, r0, r2 - adds r1, 0x8 - adds r0, r1 - ldrb r0, [r0] - ldrb r2, [r2] - adds r0, r2 - lsls r0, 24 - lsrs r0, 24 - bx lr - .pool - thumb_func_end sub_81ABB2C - - thumb_func_start DisplayItemMessage -@ void DisplayItemMessage(u8 taskId, u8 fontId, u8 *str, void ( *callback)(u8 taskId)) -DisplayItemMessage: @ 81ABB4C - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x10 - adds r5, r0, 0 - adds r6, r1, 0 - mov r8, r2 - mov r9, r3 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - movs r0, 0x4 - bl AddItemMessageWindow - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x14] - movs r1, 0x11 - bl FillWindowPixelBuffer - bl sav2_get_text_speed - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r4, 0x14] - str r6, [sp] - str r0, [sp, 0x4] - mov r0, r8 - str r0, [sp, 0x8] - mov r0, r9 - str r0, [sp, 0xC] - adds r0, r5, 0 - movs r2, 0xA - movs r3, 0xD - bl DisplayMessageAndContinueTask - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end DisplayItemMessage - - thumb_func_start bag_menu_inits_lists_menu -bag_menu_inits_lists_menu: @ 81ABBBC - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - lsls r5, r6, 2 - adds r5, r6 - lsls r5, 3 - ldr r0, =gTasks + 0x8 - adds r5, r0 - ldr r7, =gUnknown_0203CE58 - ldrb r4, [r7, 0x5] - lsls r4, 1 - movs r0, 0x12 - adds r0, r7 - mov r8, r0 - add r8, r4 - adds r0, r7, 0 - adds r0, 0x8 - adds r4, r0 - movs r0, 0x4 - bl bag_menu_RemoveBagItem_message_window - ldrb r0, [r5] - mov r1, r8 - adds r2, r4, 0 - bl sub_81AE6C8 - ldrb r0, [r7, 0x5] - bl sub_81AB9A8 - ldrb r0, [r7, 0x5] - bl sub_81ABA88 - ldrb r0, [r7, 0x5] - bl load_bag_item_list_buffers - ldr r0, =gUnknown_03006310 - mov r2, r8 - ldrh r1, [r2] - ldrh r2, [r4] - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5] - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - adds r0, r6, 0 - bl set_callback3_to_bag - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_inits_lists_menu - - thumb_func_start sub_81ABC3C -sub_81ABC3C: @ 81ABC3C - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl bag_menu_add_window - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl sub_81ABC54 - pop {r0} - bx r0 - thumb_func_end sub_81ABC3C - - thumb_func_start sub_81ABC54 -sub_81ABC54: @ 81ABC54 - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 16 - lsrs r1, 16 - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - movs r3, 0x2 - cmp r0, 0x3 - bne _081ABC6C - movs r3, 0x3 -_081ABC6C: - ldr r0, =gStringVar1 - lsls r1, 16 - asrs r1, 16 - movs r2, 0x2 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gText_xVar1 - adds r0, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x28 - bl GetStringCenterAlignXOffset - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x2 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - adds r0, r5, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl PrintTextOnWindow - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81ABC54 - - thumb_func_start sub_81ABCC0 -sub_81ABCC0: @ 81ABCC0 - push {r4-r7,lr} - sub sp, 0xC - adds r4, r0, 0 - adds r7, r2, 0 - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - movs r3, 0x2 - cmp r0, 0x3 - bne _081ABCD4 - movs r3, 0x3 -_081ABCD4: - ldr r0, =gStringVar1 - movs r2, 0x2 - bl ConvertIntToDecimalStringN - ldr r6, =gStringVar4 - ldr r1, =gText_xVar1 - adds r0, r6, 0 - bl StringExpandPlaceholders - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r5, 0 - str r5, [sp, 0x8] - adds r0, r4, 0 - movs r1, 0x1 - adds r2, r6, 0 - movs r3, 0 - bl PrintTextOnWindow - str r5, [sp] - adds r0, r4, 0 - movs r1, 0x26 - movs r2, 0x1 - adds r3, r7, 0 - bl PrintMoneyAmount - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81ABCC0 - - thumb_func_start Task_BagMenu -Task_BagMenu: @ 81ABD28 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r0, 2 - add r0, r9 - lsls r0, 3 - str r0, [sp] - ldr r1, =gTasks + 0x8 - adds r6, r0, r1 - ldr r5, =gUnknown_0203CE58 - ldrb r0, [r5, 0x5] - lsls r0, 1 - adds r1, r5, 0 - adds r1, 0x12 - adds r7, r0, r1 - subs r1, 0xA - adds r0, r1 - mov r8, r0 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081ABD66 - b _081ABEB2 -_081ABD66: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081ABD74 - b _081ABEB2 -_081ABD74: - bl GetSwitchBagPocketDirection - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081ABDB8 - cmp r0, 0x2 - beq _081ABDC0 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x4 - ands r0, r1 - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - cmp r0, 0 - beq _081ABE10 - bl sub_81AC2C0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081ABDA4 - b _081ABEB2 -_081ABDA4: - b _081ABDCC - .pool -_081ABDB8: - movs r1, 0x1 - negs r1, r1 - mov r0, r9 - b _081ABDC4 -_081ABDC0: - mov r0, r9 - movs r1, 0x1 -_081ABDC4: - movs r2, 0 - bl SwitchBagPocket - b _081ABEB2 -_081ABDCC: - ldrb r0, [r6] - adds r1, r7, 0 - mov r2, r8 - bl get_coro_args_x18_x1A - ldrh r2, [r7] - mov r3, r8 - ldrh r0, [r3] - adds r2, r0 - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r1, =gUnknown_0203CE58 - ldr r3, =0x00000829 - adds r0, r3 - ldrb r1, [r1, 0x5] - adds r0, r1 - ldrb r0, [r0] - subs r0, 0x1 - cmp r2, r0 - beq _081ABEB2 - movs r0, 0x5 - bl PlaySE - mov r0, r9 - bl bag_menu_swap_items - b _081ABEB2 - .pool -_081ABE10: - ldrb r0, [r6] - bl ListMenuHandleInput - adds r4, r0, 0 - ldrb r0, [r6] - adds r1, r7, 0 - mov r2, r8 - bl get_coro_args_x18_x1A - movs r0, 0x2 - negs r0, r0 - cmp r4, r0 - beq _081ABE32 - adds r0, 0x1 - cmp r4, r0 - bne _081ABE68 - b _081ABEB2 -_081ABE32: - ldrb r0, [r5, 0x4] - cmp r0, 0x5 - bne _081ABE40 - movs r0, 0x20 - bl PlaySE - b _081ABEB2 -_081ABE40: - movs r0, 0x5 - bl PlaySE - ldr r0, =gScriptItemId - mov r1, r10 - strh r1, [r0] - ldr r0, =gTasks + 0x8 - subs r0, 0x8 - ldr r3, [sp] - adds r0, r3, r0 - ldr r1, =unknown_ItemMenu_Confirm - str r1, [r0] - b _081ABEB2 - .pool -_081ABE68: - movs r0, 0x5 - bl PlaySE - bl sub_81AB824 - ldrb r0, [r6] - movs r1, 0x2 - bl bag_menu_print_cursor_ - strh r4, [r6, 0x2] - ldrb r0, [r5, 0x5] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - lsls r4, 16 - lsrs r4, 16 - adds r1, r4, 0 - bl BagGetQuantityByPocketPosition - strh r0, [r6, 0x4] - ldrb r0, [r5, 0x5] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - bl BagGetItemIdByPocketPosition - ldr r1, =gScriptItemId - strh r0, [r1] - ldr r1, =gUnknown_08614054 - ldrb r0, [r5, 0x4] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - mov r0, r9 - bl _call_via_r1 -_081ABEB2: - 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 Task_BagMenu - - thumb_func_start set_callback3_to_bag -set_callback3_to_bag: @ 81ABECC - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl bag_menu_add_pocket_scroll_arrow_indicators_maybe - bl bag_menu_add_list_scroll_arrow_indicators_maybe - movs r0, 0x3 - bl ClearWindowTilemap - movs r0, 0x4 - bl ClearWindowTilemap - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0 - 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, =Task_BagMenu - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end set_callback3_to_bag - - thumb_func_start GetSwitchBagPocketDirection -GetSwitchBagPocketDirection: @ 81ABF10 - push {lr} - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r1, =0x0000081b - adds r0, r1 - ldrb r1, [r0] - movs r0, 0xF - ands r0, r1 - cmp r0, 0 - bne _081ABF6A - bl GetLRKeysState - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _081ABF3C - cmp r2, 0x1 - bne _081ABF54 -_081ABF3C: - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - b _081ABF6C - .pool -_081ABF54: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _081ABF60 - cmp r2, 0x2 - bne _081ABF6A -_081ABF60: - movs r0, 0x5 - bl PlaySE - movs r0, 0x2 - b _081ABF6C -_081ABF6A: - movs r0, 0 -_081ABF6C: - pop {r1} - bx r1 - thumb_func_end GetSwitchBagPocketDirection - - thumb_func_start ChangeBagPocketId -@ void ChangeBagPocketId(u8 *bagPocketId, u8 deltaBagPocketId) -ChangeBagPocketId: @ 81ABF70 - push {r4,lr} - adds r2, r0, 0 - lsls r1, 24 - lsrs r4, r1, 24 - asrs r1, 24 - cmp r1, 0x1 - bne _081ABF88 - ldrb r0, [r2] - cmp r0, 0x4 - bne _081ABF88 - movs r0, 0 - b _081ABFA0 -_081ABF88: - lsls r0, r4, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - ldrb r3, [r2] - cmp r0, r1 - bne _081ABF9E - cmp r3, 0 - bne _081ABF9E - movs r0, 0x4 - b _081ABFA0 -_081ABF9E: - adds r0, r3, r4 -_081ABFA0: - strb r0, [r2] - pop {r4} - pop {r0} - bx r0 - thumb_func_end ChangeBagPocketId - - thumb_func_start SwitchBagPocket -@ void SwitchBagPocket(u8 taskId, u16 deltaBagPocketId, u16 a3) -SwitchBagPocket: @ 81ABFA8 - push {r4-r6,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 16 - lsrs r5, r1, 16 - lsls r2, 16 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - movs r0, 0 - strh r0, [r4, 0x1A] - strh r0, [r4, 0x18] - strh r5, [r4, 0x16] - cmp r2, 0 - bne _081AC026 - movs r0, 0 - bl ClearWindowTilemap - movs r0, 0x1 - bl ClearWindowTilemap - ldrb r0, [r4] - ldr r3, =gUnknown_0203CE58 - ldrb r2, [r3, 0x5] - lsls r2, 1 - adds r1, r3, 0 - adds r1, 0x12 - adds r1, r2, r1 - adds r3, 0x8 - adds r2, r3 - bl sub_81AE6C8 - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldr r3, =gSprites - ldr r0, =gUnknown_0203CE54 - ldr r2, [r0] - ldr r1, =0x0000081b - adds r0, r2, r1 - ldrb r1, [r0] - lsls r1, 26 - lsrs r1, 30 - movs r0, 0x1 - eors r0, r1 - adds r2, r0 - ldr r0, =0x00000806 - adds r2, r0 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - bl sub_81AB824 -_081AC026: - ldr r4, =gUnknown_0203CE58 - ldrb r1, [r4, 0x5] - add r0, sp, 0x8 - strb r1, [r0] - lsls r1, r5, 24 - asrs r1, 24 - bl ChangeBagPocketId - lsls r0, r5, 16 - asrs r1, r0, 16 - adds r5, r0, 0 - cmp r1, 0x1 - bne _081AC07C - ldr r2, =gPocketNames - ldrb r0, [r4, 0x5] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - add r1, sp, 0x8 - ldrb r1, [r1] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl bag_menu_print_pocket_names - movs r0, 0 - bl bag_menu_copy_pocket_name_to_window - b _081AC09A - .pool -_081AC07C: - ldr r2, =gPocketNames - add r0, sp, 0x8 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ldrb r1, [r4, 0x5] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl bag_menu_print_pocket_names - movs r0, 0x8 - bl bag_menu_copy_pocket_name_to_window -_081AC09A: - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - movs r1, 0 - bl bag_menu_draw_pocket_indicator_square - add r0, sp, 0x8 - ldrb r0, [r0] - movs r1, 0x1 - bl bag_menu_draw_pocket_indicator_square - movs r0, 0xF - str r0, [sp] - movs r0, 0x10 - str r0, [sp, 0x4] - movs r0, 0x2 - movs r1, 0xB - movs r2, 0xE - movs r3, 0x2 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - add r0, sp, 0x8 - ldrb r0, [r0] - movs r1, 0x1 - bl SetBagVisualPocketId - movs r0, 0x1 - bl RemoveBagObject - asrs r0, r5, 16 - bl AddSwitchPocketRotatingBallObject - ldr r1, =sub_81AC10C - ldr r2, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r2 - ldr r2, [r0] - adds r0, r6, 0 - bl SetTaskFuncWithFollowupFunc - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end SwitchBagPocket - - thumb_func_start sub_81AC10C -sub_81AC10C: @ 81AC10C - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r6, r0, r1 - bl sub_81221AC - lsls r0, 24 - cmp r0, 0 - bne _081AC184 - bl IsWallysBag - lsls r0, 24 - cmp r0, 0 - bne _081AC184 - bl GetSwitchBagPocketDirection - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081AC148 - cmp r0, 0x2 - beq _081AC164 - b _081AC184 - .pool -_081AC148: - ldr r0, =gUnknown_0203CE5D - movs r1, 0x16 - ldrsb r1, [r6, r1] - bl ChangeBagPocketId - adds r0, r7, 0 - bl SwitchTaskToFollowupFunc - movs r1, 0x1 - negs r1, r1 - adds r0, r7, 0 - b _081AC178 - .pool -_081AC164: - ldr r0, =gUnknown_0203CE5D - movs r1, 0x16 - ldrsb r1, [r6, r1] - bl ChangeBagPocketId - adds r0, r7, 0 - bl SwitchTaskToFollowupFunc - adds r0, r7, 0 - movs r1, 0x1 -_081AC178: - movs r2, 0x1 - bl SwitchBagPocket - b _081AC22E - .pool -_081AC184: - movs r1, 0x1A - ldrsh r0, [r6, r1] - cmp r0, 0 - beq _081AC192 - cmp r0, 0x1 - beq _081AC1DC - b _081AC22E -_081AC192: - ldrb r0, [r6, 0x18] - bl sub_81AC23C - ldrh r0, [r6, 0x18] - adds r1, r0, 0x1 - strh r1, [r6, 0x18] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081AC1CC - movs r2, 0x16 - ldrsh r0, [r6, r2] - cmp r0, 0x1 - bne _081AC1BC - lsls r0, r1, 16 - asrs r0, 17 - lsls r0, 24 - lsrs r0, 24 - bl bag_menu_copy_pocket_name_to_window - b _081AC1CC -_081AC1BC: - lsls r1, 16 - asrs r1, 17 - movs r0, 0x8 - subs r0, r1 - lsls r0, 24 - lsrs r0, 24 - bl bag_menu_copy_pocket_name_to_window -_081AC1CC: - movs r1, 0x18 - ldrsh r0, [r6, r1] - cmp r0, 0x10 - bne _081AC22E - ldrh r0, [r6, 0x1A] - adds r0, 0x1 - strh r0, [r6, 0x1A] - b _081AC22E -_081AC1DC: - ldr r4, =gUnknown_0203CE5D - movs r1, 0x16 - ldrsb r1, [r6, r1] - adds r0, r4, 0 - bl ChangeBagPocketId - subs r5, r4, 0x5 - ldrb r0, [r5, 0x5] - bl load_bag_item_list_buffers - ldr r0, =gUnknown_03006310 - ldrb r2, [r5, 0x5] - lsls r2, 1 - adds r1, r4, 0 - adds r1, 0xD - adds r1, r2, r1 - ldrh r1, [r1] - adds r4, 0x3 - adds r2, r4 - ldrh r2, [r2] - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6] - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0x2 - bl PutWindowTilemap - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - bl bag_menu_add_pocket_scroll_arrow_indicators_maybe - bl bag_menu_add_list_scroll_arrow_indicators_maybe - adds r0, r7, 0 - bl SwitchTaskToFollowupFunc -_081AC22E: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AC10C - - thumb_func_start sub_81AC23C -sub_81AC23C: @ 81AC23C - push {lr} - sub sp, 0x8 - adds r3, r0, 0 - lsls r3, 24 - movs r0, 0x80 - lsls r0, 18 - adds r3, r0 - lsrs r3, 24 - movs r0, 0xF - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r0, 0x2 - movs r1, 0x11 - movs r2, 0xE - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0x8 - pop {r0} - bx r0 - thumb_func_end sub_81AC23C - - thumb_func_start bag_menu_draw_pocket_indicator_square -@ void bag_menu_draw_pocket_indicator_square(char x, int is_current_bag) -bag_menu_draw_pocket_indicator_square: @ 81AC26C - push {lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - cmp r1, 0 - bne _081AC298 - ldr r1, =0x00001017 - adds r2, r0, 0x5 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x1 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x2 - movs r3, 0x3 - bl FillBgTilemapBufferRect_Palette0 - b _081AC2AE - .pool -_081AC298: - ldr r1, =0x0000102b - adds r2, r0, 0x5 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x1 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x2 - movs r3, 0x3 - bl FillBgTilemapBufferRect_Palette0 -_081AC2AE: - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_draw_pocket_indicator_square - - thumb_func_start sub_81AC2C0 -sub_81AC2C0: @ 81AC2C0 - push {lr} - ldr r1, =gUnknown_0203CE58 - ldrb r0, [r1, 0x4] - cmp r0, 0x1 - bhi _081AC2E0 - ldrb r0, [r1, 0x5] - subs r0, 0x2 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _081AC2E0 - movs r0, 0x1 - b _081AC2E2 - .pool -_081AC2E0: - movs r0, 0 -_081AC2E2: - pop {r1} - bx r1 - thumb_func_end sub_81AC2C0 - - thumb_func_start bag_menu_swap_items -bag_menu_swap_items: @ 81AC2E8 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x14 - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - mov r9, r0 - adds r6, r4, r0 - ldrb r0, [r6] - movs r1, 0x10 - movs r2, 0x1 - bl sub_81AF15C - ldr r3, =gUnknown_0203CE58 - ldrb r0, [r3, 0x5] - lsls r0, 1 - adds r2, r3, 0 - adds r2, 0x12 - adds r2, r0, r2 - adds r1, r3, 0 - adds r1, 0x8 - adds r0, r1 - ldrh r1, [r0] - ldrh r2, [r2] - adds r1, r2 - strh r1, [r6, 0x2] - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r2, =0x0000081a - adds r0, r2 - movs r5, 0 - strb r1, [r0] - ldrb r0, [r3, 0x5] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r6, 0x2] - bl BagGetItemIdByPocketPosition - lsls r0, 16 - lsrs r0, 16 - ldr r1, =gStringVar1 - bl CopyItemName - ldr r0, =gStringVar4 - mov r8, r0 - ldr r1, =gText_MoveVar1Where - bl StringExpandPlaceholders - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - str r0, [sp] - str r5, [sp, 0x4] - str r5, [sp, 0x8] - str r5, [sp, 0xC] - str r5, [sp, 0x10] - movs r1, 0x1 - mov r2, r8 - movs r3, 0x3 - bl bag_menu_print - ldrb r0, [r6, 0x2] - bl sub_80D4FEC - bl sub_81AB89C - ldrb r0, [r6] - movs r1, 0x2 - bl bag_menu_print_cursor_ - movs r2, 0x8 - negs r2, r2 - add r9, r2 - add r4, r9 - ldr r0, =sub_81AC3C0 - str r0, [r4] - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_swap_items - - thumb_func_start sub_81AC3C0 -@ void sub_81AC3C0(u8 taskId) -sub_81AC3C0: @ 81AC3C0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081AC48E - ldr r0, =gMain - mov r8, r0 - ldrh r1, [r0, 0x2E] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _081AC418 - movs r0, 0x5 - bl PlaySE - ldrb r0, [r4] - ldr r3, =gUnknown_0203CE58 - ldrb r2, [r3, 0x5] - lsls r2, 1 - adds r1, r3, 0 - adds r1, 0x12 - adds r1, r2, r1 - adds r3, 0x8 - adds r2, r3 - bl get_coro_args_x18_x1A - b _081AC472 - .pool -_081AC418: - ldrb r0, [r4] - bl ListMenuHandleInput - adds r7, r0, 0 - ldrb r0, [r4] - ldr r5, =gUnknown_0203CE58 - ldrb r2, [r5, 0x5] - lsls r2, 1 - adds r1, r5, 0 - adds r1, 0x12 - adds r1, r2, r1 - adds r4, r5, 0 - adds r4, 0x8 - adds r2, r4 - bl get_coro_args_x18_x1A - movs r0, 0 - bl sub_80D4FC8 - ldrb r0, [r5, 0x5] - lsls r0, 1 - adds r0, r4 - ldrb r0, [r0] - bl sub_80D4FEC - movs r0, 0x2 - negs r0, r0 - cmp r7, r0 - beq _081AC460 - adds r0, 0x1 - cmp r7, r0 - bne _081AC482 - b _081AC48E - .pool -_081AC460: - movs r0, 0x5 - bl PlaySE - mov r0, r8 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081AC47A -_081AC472: - adds r0, r6, 0 - bl sub_81AC498 - b _081AC48E -_081AC47A: - adds r0, r6, 0 - bl sub_81AC590 - b _081AC48E -_081AC482: - movs r0, 0x5 - bl PlaySE - adds r0, r6, 0 - bl sub_81AC498 -_081AC48E: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81AC3C0 - - thumb_func_start sub_81AC498 -sub_81AC498: @ 81AC498 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 3 - mov r10, r0 - ldr r0, =gTasks + 0x8 - add r0, r10 - mov r9, r0 - ldr r5, =gUnknown_0203CE58 - ldrb r6, [r5, 0x5] - lsls r1, r6, 1 - adds r0, r5, 0 - adds r0, 0x12 - adds r0, r1 - mov r8, r0 - ldr r2, =gUnknown_0203CE60 - adds r7, r1, r2 - ldrh r0, [r7] - mov r1, r8 - ldrh r1, [r1] - adds r0, r1 - lsls r0, 16 - lsrs r4, r0, 16 - mov r0, r9 - movs r1, 0x2 - ldrsh r2, [r0, r1] - cmp r2, r4 - beq _081AC4E2 - subs r0, r4, 0x1 - cmp r2, r0 - bne _081AC4F8 -_081AC4E2: - adds r0, r3, 0 - bl sub_81AC590 - b _081AC566 - .pool -_081AC4F8: - ldr r1, =gBagPockets - lsls r0, r6, 3 - adds r0, r1 - ldr r0, [r0] - adds r1, r2, 0 - adds r2, r4, 0 - bl sub_80D702C - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r2, =0x0000081a - adds r0, r2 - movs r1, 0xFF - strb r1, [r0] - mov r1, r9 - ldrb r0, [r1] - mov r1, r8 - adds r2, r7, 0 - bl sub_81AE6C8 - mov r2, r9 - movs r1, 0x2 - ldrsh r0, [r2, r1] - cmp r0, r4 - bge _081AC538 - ldrb r1, [r5, 0x5] - lsls r1, 1 - ldr r2, =gUnknown_0203CE60 - adds r1, r2 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] -_081AC538: - ldrb r0, [r5, 0x5] - bl load_bag_item_list_buffers - ldr r0, =gUnknown_03006310 - mov r2, r8 - ldrh r1, [r2] - ldrh r2, [r7] - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - mov r1, r9 - strh r0, [r1] - movs r0, 0x1 - bl sub_80D4FC8 - bl bag_menu_add_list_scroll_arrow_indicators_maybe - ldr r0, =gTasks + 0x8 - subs r0, 0x8 - add r0, r10 - ldr r1, =Task_BagMenu - str r1, [r0] -_081AC566: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AC498 - - thumb_func_start sub_81AC590 -sub_81AC590: @ 81AC590 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - mov r9, r1 - ldr r0, =gTasks + 0x8 - mov r10, r0 - mov r7, r9 - add r7, r10 - ldr r4, =gUnknown_0203CE58 - ldrb r0, [r4, 0x5] - lsls r0, 1 - adds r1, r4, 0 - adds r1, 0x12 - adds r6, r0, r1 - movs r1, 0x8 - adds r1, r4 - mov r8, r1 - adds r5, r0, r1 - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r1, =0x0000081a - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldrb r0, [r7] - adds r1, r6, 0 - adds r2, r5, 0 - bl sub_81AE6C8 - movs r0, 0x2 - ldrsh r2, [r7, r0] - ldrh r0, [r6] - ldrh r1, [r5] - adds r0, r1 - cmp r2, r0 - bge _081AC5F2 - ldrb r1, [r4, 0x5] - lsls r1, 1 - add r1, r8 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] -_081AC5F2: - ldrb r0, [r4, 0x5] - bl load_bag_item_list_buffers - ldr r0, =gUnknown_03006310 - ldrh r1, [r6] - ldrh r2, [r5] - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7] - movs r0, 0x1 - bl sub_80D4FC8 - bl bag_menu_add_list_scroll_arrow_indicators_maybe - mov r0, r10 - subs r0, 0x8 - add r0, r9 - ldr r1, =Task_BagMenu - str r1, [r0] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AC590 - - thumb_func_start sub_81AC644 -sub_81AC644: @ 81AC644 - push {r4,r5,lr} - sub sp, 0x14 - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x4] - subs r0, 0x1 - cmp r0, 0x9 - bls _081AC654 - b _081AC82C -_081AC654: - lsls r0, 2 - ldr r1, =_081AC668 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081AC668: - .4byte _081AC690 - .4byte _081AC82C - .4byte _081AC82C - .4byte _081AC82C - .4byte _081AC6E8 - .4byte _081AC82C - .4byte _081AC76C - .4byte _081AC7CC - .4byte _081AC70C - .4byte _081AC690 -_081AC690: - ldr r0, =gScriptItemId - ldrh r0, [r0] - bl ItemId_GetBattleUsage - lsls r0, 24 - cmp r0, 0 - beq _081AC6C4 - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_08614042 - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x2 - b _081ACA10 - .pool -_081AC6C4: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_08614046 - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x1 - b _081ACA10 - .pool -_081AC6E8: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_08614047 - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x4 - b _081ACA10 - .pool -_081AC70C: - ldr r4, =gScriptItemId - ldrh r0, [r4] - bl itemid_is_unique - lsls r0, 24 - cmp r0, 0 - bne _081AC748 - ldrh r0, [r4] - cmp r0, 0xAF - beq _081AC748 - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_0861404B - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x2 - b _081ACA10 - .pool -_081AC748: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_08614046 - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x1 - b _081ACA10 - .pool -_081AC76C: - ldr r4, =gScriptItemId - ldrh r0, [r4] - bl itemid_is_unique - lsls r0, 24 - cmp r0, 0 - bne _081AC7A8 - ldrh r0, [r4] - cmp r0, 0xAF - beq _081AC7A8 - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_0861404D - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x2 - b _081ACA10 - .pool -_081AC7A8: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_08614046 - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x1 - b _081ACA10 - .pool -_081AC7CC: - ldr r4, =gScriptItemId - ldrh r0, [r4] - bl itemid_is_unique - lsls r0, 24 - cmp r0, 0 - bne _081AC808 - ldrh r0, [r4] - cmp r0, 0xAF - beq _081AC808 - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_0861404F - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x2 - b _081ACA10 - .pool -_081AC808: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_08614046 - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x1 - b _081ACA10 - .pool -_081AC82C: - bl sub_81221AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081AC840 - bl InUnionRoom - cmp r0, 0x1 - bne _081AC8A4 -_081AC840: - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - cmp r0, 0x4 - beq _081AC856 - ldr r0, =gScriptItemId - ldrh r0, [r0] - bl sub_8122148 - lsls r0, 24 - cmp r0, 0 - bne _081AC880 -_081AC856: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_08614046 - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x1 - b _081ACA10 - .pool -_081AC880: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_08614044 - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x2 - b _081ACA10 - .pool -_081AC8A4: - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - cmp r0, 0x4 - bls _081AC8AE - b _081ACA12 -_081AC8AE: - lsls r0, 2 - ldr r1, =_081AC8C0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081AC8C0: - .4byte _081AC8D4 - .4byte _081AC9B4 - .4byte _081AC9D8 - .4byte _081AC9FC - .4byte _081AC92C -_081AC8D4: - ldr r4, =gUnknown_0203CE54 - ldr r1, [r4] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r3, =0x00000824 - adds r0, r1, r3 - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x4 - strb r0, [r1] - ldr r0, [r4] - adds r0, r3 - ldr r1, =gUnknown_0861402C - movs r2, 0x4 - bl memcpy - ldr r0, =gScriptItemId - ldrh r0, [r0] - bl itemid_is_mail - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081AC90A - b _081ACA12 -_081AC90A: - ldr r0, [r4] - ldr r1, =0x00000824 - adds r0, r1 - movs r1, 0x6 - strb r1, [r0] - b _081ACA12 - .pool -_081AC92C: - ldr r4, =gUnknown_0203CE54 - ldr r1, [r4] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r5, =0x00000824 - adds r0, r1, r5 - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x4 - strb r0, [r1] - ldr r0, [r4] - adds r0, r5 - ldr r1, =gUnknown_08614030 - movs r2, 0x4 - bl memcpy - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00000496 - adds r0, r1 - ldr r2, =gScriptItemId - ldrh r0, [r0] - ldrh r1, [r2] - cmp r0, r1 - bne _081AC96C - ldr r0, [r4] - ldr r1, =0x00000825 - adds r0, r1 - movs r1, 0x8 - strb r1, [r0] -_081AC96C: - ldrh r1, [r2] - ldr r0, =0x00000103 - cmp r1, r0 - beq _081AC97A - adds r0, 0xD - cmp r1, r0 - bne _081ACA12 -_081AC97A: - movs r0, 0x6 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _081ACA12 - ldr r0, [r4] - adds r0, r5 - movs r1, 0x7 - strb r1, [r0] - b _081ACA12 - .pool -_081AC9B4: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_08614034 - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x4 - b _081ACA10 - .pool -_081AC9D8: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_08614038 - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x4 - b _081ACA10 - .pool -_081AC9FC: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_0861403C - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x6 -_081ACA10: - strb r0, [r1] -_081ACA12: - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - cmp r0, 0x2 - bne _081ACA50 - movs r0, 0x1 - bl ClearWindowTilemap - ldr r0, =gScriptItemId - ldrh r0, [r0] - bl PrintTMHMMoveData - movs r0, 0x3 - bl PutWindowTilemap - movs r0, 0x4 - bl PutWindowTilemap - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - b _081ACA86 - .pool -_081ACA50: - ldr r0, =gScriptItemId - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gText_Var1IsSelected - adds r0, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r0, [sp, 0xC] - str r0, [sp, 0x10] - movs r0, 0x1 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0x3 - bl bag_menu_print -_081ACA86: - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r1, =0x00000828 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _081ACAB0 - movs r0, 0 - b _081ACAB6 - .pool -_081ACAB0: - cmp r0, 0x2 - bne _081ACAC4 - movs r0, 0x1 -_081ACAB6: - bl bag_menu_add_window - lsls r0, 24 - lsrs r0, 24 - bl sub_81ACAF8 - b _081ACAEE -_081ACAC4: - cmp r0, 0x4 - bne _081ACADC - movs r0, 0x2 - bl bag_menu_add_window - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - movs r2, 0x2 - bl sub_81ACB54 - b _081ACAEE -_081ACADC: - movs r0, 0x3 - bl bag_menu_add_window - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - movs r2, 0x3 - bl sub_81ACB54 -_081ACAEE: - add sp, 0x14 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81AC644 - - thumb_func_start sub_81ACAF8 -sub_81ACAF8: @ 81ACAF8 - push {r4-r6,lr} - sub sp, 0x14 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - str r0, [sp] - movs r0, 0x10 - str r0, [sp, 0x4] - ldr r6, =gUnknown_0203CE54 - ldr r1, [r6] - ldr r5, =0x00000828 - adds r0, r1, r5 - ldrb r0, [r0] - str r0, [sp, 0x8] - ldr r0, =gUnknown_08613FB4 - str r0, [sp, 0xC] - movs r0, 0x82 - lsls r0, 4 - adds r1, r0 - ldr r0, [r1] - str r0, [sp, 0x10] - adds r0, r4, 0 - movs r1, 0x7 - movs r2, 0x8 - movs r3, 0x1 - bl AddItemMenuActionTextPrinters - ldr r0, [r6] - adds r0, r5 - ldrb r1, [r0] - adds r0, r4, 0 - movs r2, 0 - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81ACAF8 - - thumb_func_start sub_81ACB54 -sub_81ACB54: @ 81ACB54 - push {r4-r6,lr} - sub sp, 0x14 - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - movs r0, 0x38 - str r0, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - ldr r0, =gUnknown_08613FB4 - str r0, [sp, 0xC] - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - movs r1, 0x82 - lsls r1, 4 - adds r0, r1 - ldr r0, [r0] - str r0, [sp, 0x10] - adds r0, r4, 0 - movs r1, 0x7 - movs r2, 0x8 - movs r3, 0x1 - bl sub_8198DBC - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r1, 0x38 - adds r2, r5, 0 - adds r3, r6, 0 - bl sub_8199944 - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81ACB54 - - thumb_func_start unknown_item_menu_type -unknown_item_menu_type: @ 81ACBB0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_81AC644 - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r1, =0x00000828 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x2 - bhi _081ACBE8 - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =Task_HandleInBattleItemMenuInput - b _081ACBF4 - .pool -_081ACBE8: - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =Task_HandleOutOfBattleItemMenuInput -_081ACBF4: - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end unknown_item_menu_type - - thumb_func_start Task_HandleInBattleItemMenuInput -Task_HandleInBattleItemMenuInput: @ 81ACC04 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081ACC6A - bl ProcessMenuInputNoWrapAround - lsls r0, 24 - asrs r4, r0, 24 - movs r0, 0x2 - negs r0, r0 - cmp r4, r0 - beq _081ACC6A - adds r0, 0x1 - cmp r4, r0 - bne _081ACC44 - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_08613FB4 - ldr r1, [r0, 0x24] - adds r0, r5, 0 - bl _call_via_r1 - b _081ACC6A - .pool -_081ACC44: - movs r0, 0x5 - bl PlaySE - ldr r1, =gUnknown_08613FB4 - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - movs r2, 0x82 - lsls r2, 4 - adds r0, r2 - ldr r0, [r0] - adds r0, r4 - ldrb r0, [r0] - lsls r0, 3 - adds r1, 0x4 - adds r0, r1 - ldr r1, [r0] - adds r0, r6, 0 - bl _call_via_r1 -_081ACC6A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end Task_HandleInBattleItemMenuInput - - thumb_func_start Task_HandleOutOfBattleItemMenuInput -Task_HandleOutOfBattleItemMenuInput: @ 81ACC78 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081ACC8C - b _081ACDF0 -_081ACC8C: - bl GetMenuCursorPos - lsls r0, 24 - lsrs r4, r0, 24 - ldr r5, =gMain - ldrh r1, [r5, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081ACCD4 - lsls r0, r4, 24 - asrs r0, 24 - cmp r0, 0 - bgt _081ACCAA - b _081ACDF0 -_081ACCAA: - subs r0, 0x2 - lsls r0, 24 - asrs r0, 24 - bl sub_81ACDFC - lsls r0, 24 - cmp r0, 0 - bne _081ACCBC - b _081ACDF0 -_081ACCBC: - movs r0, 0x5 - bl PlaySE - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - bl sub_8199134 - b _081ACDF0 - .pool -_081ACCD4: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081ACD1C - lsls r0, r4, 24 - asrs r1, r0, 24 - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r2, =0x00000828 - adds r0, r2 - ldrb r0, [r0] - subs r0, 0x2 - cmp r1, r0 - blt _081ACCF2 - b _081ACDF0 -_081ACCF2: - adds r0, r1, 0x2 - lsls r0, 24 - asrs r0, 24 - bl sub_81ACDFC - lsls r0, 24 - cmp r0, 0 - beq _081ACDF0 - movs r0, 0x5 - bl PlaySE - movs r0, 0 - movs r1, 0x1 - bl sub_8199134 - b _081ACDF0 - .pool -_081ACD1C: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _081ACD30 - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081ACD58 -_081ACD30: - lsls r0, r4, 24 - asrs r1, r0, 24 - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081ACDF0 - subs r0, r1, 0x1 - lsls r0, 24 - asrs r0, 24 - bl sub_81ACDFC - lsls r0, 24 - cmp r0, 0 - beq _081ACDF0 - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - negs r0, r0 - b _081ACD92 -_081ACD58: - ldrh r1, [r5, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _081ACD6E - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _081ACD9A -_081ACD6E: - lsls r0, r4, 24 - asrs r1, r0, 24 - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081ACDF0 - adds r0, r1, 0x1 - lsls r0, 24 - asrs r0, 24 - bl sub_81ACDFC - lsls r0, 24 - cmp r0, 0 - beq _081ACDF0 - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 -_081ACD92: - movs r1, 0 - bl sub_8199134 - b _081ACDF0 -_081ACD9A: - ldrh r1, [r5, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081ACDD8 - movs r0, 0x5 - bl PlaySE - ldr r2, =gUnknown_08613FB4 - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - lsls r1, r4, 24 - asrs r1, 24 - movs r3, 0x82 - lsls r3, 4 - adds r0, r3 - ldr r0, [r0] - adds r0, r1 - ldrb r0, [r0] - lsls r0, 3 - adds r2, 0x4 - adds r0, r2 - ldr r1, [r0] - adds r0, r6, 0 - bl _call_via_r1 - b _081ACDF0 - .pool -_081ACDD8: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081ACDF0 - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_08613FB4 - ldr r1, [r0, 0x24] - adds r0, r6, 0 - bl _call_via_r1 -_081ACDF0: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end Task_HandleOutOfBattleItemMenuInput - - thumb_func_start sub_81ACDFC -sub_81ACDFC: @ 81ACDFC - push {lr} - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - blt _081ACE30 - ldr r0, =gUnknown_0203CE54 - ldr r2, [r0] - ldr r3, =0x00000828 - adds r0, r2, r3 - ldrb r0, [r0] - cmp r1, r0 - bgt _081ACE30 - movs r3, 0x82 - lsls r3, 4 - adds r0, r2, r3 - ldr r0, [r0] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0xE - beq _081ACE30 - movs r0, 0x1 - b _081ACE32 - .pool -_081ACE30: - movs r0, 0 -_081ACE32: - pop {r1} - bx r1 - thumb_func_end sub_81ACDFC - - thumb_func_start bag_menu_remove_some_window -bag_menu_remove_some_window: @ 81ACE38 - push {lr} - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r1, =0x00000828 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _081ACE58 - movs r0, 0 - bl bag_menu_remove_window - b _081ACE76 - .pool -_081ACE58: - cmp r0, 0x2 - bne _081ACE64 - movs r0, 0x1 - bl bag_menu_remove_window - b _081ACE76 -_081ACE64: - cmp r0, 0x4 - bne _081ACE70 - movs r0, 0x2 - bl bag_menu_remove_window - b _081ACE76 -_081ACE70: - movs r0, 0x3 - bl bag_menu_remove_window -_081ACE76: - pop {r0} - bx r0 - thumb_func_end bag_menu_remove_some_window - - thumb_func_start ItemMenu_UseOutOfBattle -@ void ItemMenu_UseOutOfBattle(u8 taskId) -ItemMenu_UseOutOfBattle: @ 81ACE7C - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r5, =gScriptItemId - ldrh r0, [r5] - bl ItemId_GetFieldFunc - cmp r0, 0 - beq _081ACEEE - bl bag_menu_remove_some_window - bl CalculatePlayerPartyCount - lsls r0, 24 - cmp r0, 0 - bne _081ACEB8 - ldrh r0, [r5] - bl ItemId_GetType - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081ACEB8 - adds r0, r4, 0 - bl bag_menu_print_there_is_no_pokemon - b _081ACEEE - .pool -_081ACEB8: - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - cmp r0, 0x3 - beq _081ACEE8 - ldr r0, =gScriptItemId - ldrh r0, [r0] - bl ItemId_GetFieldFunc - adds r1, r0, 0 - adds r0, r4, 0 - bl _call_via_r1 - b _081ACEEE - .pool -_081ACEE8: - adds r0, r4, 0 - bl sub_80FDD10 -_081ACEEE: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end ItemMenu_UseOutOfBattle - - thumb_func_start ItemMenu_Toss -ItemMenu_Toss: @ 81ACEF4 - push {r4-r7,lr} - sub sp, 0x14 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r6, r0, 3 - ldr r7, =gTasks + 0x8 - adds r4, r6, r7 - bl bag_menu_remove_some_window - movs r0, 0x1 - strh r0, [r4, 0x10] - movs r1, 0x4 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - bne _081ACF24 - adds r0, r5, 0 - bl BagMenuConfirmToss - b _081ACF6A - .pool -_081ACF24: - ldr r0, =gScriptItemId - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gText_TossHowManyVar1s - adds r0, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r0, [sp, 0xC] - str r0, [sp, 0x10] - movs r0, 0x1 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0x3 - bl bag_menu_print - movs r0, 0x7 - bl sub_81ABC3C - adds r0, r7, 0 - subs r0, 0x8 - adds r0, r6, r0 - ldr r1, =Task_ChooseHowManyToToss - str r1, [r0] -_081ACF6A: - add sp, 0x14 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end ItemMenu_Toss - - thumb_func_start BagMenuConfirmToss -BagMenuConfirmToss: @ 81ACF88 - push {r4,r5,lr} - sub sp, 0x14 - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - ldr r0, =gScriptItemId - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r0, =gStringVar2 - movs r2, 0x10 - ldrsh r1, [r4, r2] - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gText_ConfirmTossItems - adds r0, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r0, [sp, 0xC] - str r0, [sp, 0x10] - movs r0, 0x1 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0x3 - bl bag_menu_print - ldr r2, =gUnknown_08614084 - adds r0, r5, 0 - movs r1, 0x5 - bl bag_menu_yes_no - add sp, 0x14 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end BagMenuConfirmToss - - thumb_func_start BagMenuCancelToss -BagMenuCancelToss: @ 81AD010 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - movs r1, 0x2 - ldrsh r0, [r4, r1] - bl bag_menu_print_description_box_text - ldrb r0, [r4] - movs r1, 0 - bl bag_menu_print_cursor_ - adds r0, r5, 0 - bl set_callback3_to_bag - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end BagMenuCancelToss - - thumb_func_start Task_ChooseHowManyToToss -Task_ChooseHowManyToToss: @ 81AD044 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - adds r0, r4, 0 - adds r0, 0x10 - ldrh r1, [r4, 0x4] - bl AdjustQuantityAccordingToDPadInput - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081AD088 - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r1, =0x00000817 - adds r0, r1 - ldrb r0, [r0] - movs r2, 0x10 - ldrsh r1, [r4, r2] - bl sub_81ABC54 - b _081AD0C6 - .pool -_081AD088: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081AD0AC - movs r0, 0x5 - bl PlaySE - movs r0, 0x7 - bl bag_menu_remove_window - adds r0, r5, 0 - bl BagMenuConfirmToss - b _081AD0C6 - .pool -_081AD0AC: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081AD0C6 - movs r0, 0x5 - bl PlaySE - movs r0, 0x7 - bl bag_menu_remove_window - adds r0, r6, 0 - bl BagMenuCancelToss -_081AD0C6: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end Task_ChooseHowManyToToss - - thumb_func_start BagMenuActuallyToss -BagMenuActuallyToss: @ 81AD0CC - push {r4-r6,lr} - sub sp, 0x14 - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r5, =gTasks + 0x8 - adds r6, r4, r5 - ldr r0, =gScriptItemId - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r0, =gStringVar2 - movs r2, 0x10 - ldrsh r1, [r6, r2] - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r6, =gStringVar4 - ldr r1, =gText_ThrewAwayVar2Var1s - adds r0, r6, 0 - bl StringExpandPlaceholders - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r0, [sp, 0xC] - str r0, [sp, 0x10] - movs r0, 0x1 - movs r1, 0x1 - adds r2, r6, 0 - movs r3, 0x3 - bl bag_menu_print - subs r5, 0x8 - adds r4, r5 - ldr r0, =Task_ActuallyToss - str r0, [r4] - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end BagMenuActuallyToss - - thumb_func_start Task_ActuallyToss -Task_ActuallyToss: @ 81AD150 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r5, r0, r1 - ldr r4, =gUnknown_0203CE58 - ldrb r0, [r4, 0x5] - lsls r0, 1 - adds r1, r4, 0 - adds r1, 0x12 - adds r1, r0 - mov r8, r1 - adds r1, r4, 0 - adds r1, 0x8 - adds r7, r0, r1 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _081AD1CE - movs r0, 0x5 - bl PlaySE - ldr r0, =gScriptItemId - ldrh r0, [r0] - ldrh r1, [r5, 0x10] - bl RemoveBagItem - ldrb r0, [r5] - mov r1, r8 - adds r2, r7, 0 - bl sub_81AE6C8 - ldrb r0, [r4, 0x5] - bl sub_81AB9A8 - ldrb r0, [r4, 0x5] - bl sub_81ABA88 - ldrb r0, [r4, 0x5] - bl load_bag_item_list_buffers - ldr r0, =gUnknown_03006310 - mov r2, r8 - ldrh r1, [r2] - ldrh r2, [r7] - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5] - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - adds r0, r6, 0 - bl set_callback3_to_bag -_081AD1CE: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end Task_ActuallyToss - - thumb_func_start ItemMenu_Register -ItemMenu_Register: @ 81AD1EC - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r7, r0, r1 - ldr r0, =gUnknown_0203CE58 - ldrb r1, [r0, 0x5] - lsls r1, 1 - adds r2, r0, 0 - adds r2, 0x12 - adds r6, r1, r2 - adds r0, 0x8 - adds r5, r1, r0 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00000496 - adds r1, r0, r2 - ldr r0, =gScriptItemId - ldrh r2, [r0] - ldrh r0, [r1] - cmp r0, r2 - bne _081AD238 - movs r0, 0 - strh r0, [r1] - b _081AD23A - .pool -_081AD238: - strh r2, [r1] -_081AD23A: - ldrb r0, [r7] - adds r1, r6, 0 - adds r2, r5, 0 - bl sub_81AE6C8 - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - bl load_bag_item_list_buffers - ldr r0, =gUnknown_03006310 - ldrh r1, [r6] - ldrh r2, [r5] - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7] - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - adds r0, r4, 0 - bl ItemMenu_Cancel - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end ItemMenu_Register - - thumb_func_start ItemMenu_Give -ItemMenu_Give: @ 81AD278 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r6, r4, 0 - bl bag_menu_remove_some_window - ldr r5, =gScriptItemId - ldrh r0, [r5] - bl itemid_80BF6D8_mail_related - lsls r0, 24 - cmp r0, 0 - bne _081AD2AC - ldr r2, =gText_CantWriteMail - ldr r3, =sub_81AD350 - adds r0, r4, 0 - movs r1, 0x1 - bl DisplayItemMessage - b _081AD2EA - .pool -_081AD2AC: - ldrh r0, [r5] - bl itemid_is_unique - lsls r0, 24 - cmp r0, 0 - bne _081AD2E4 - bl CalculatePlayerPartyCount - lsls r0, 24 - cmp r0, 0 - bne _081AD2CA - adds r0, r4, 0 - bl bag_menu_print_there_is_no_pokemon - b _081AD2EA -_081AD2CA: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - ldr r0, =sub_81B7F60 - str r0, [r1] - adds r0, r4, 0 - bl unknown_ItemMenu_Confirm - b _081AD2EA - .pool -_081AD2E4: - adds r0, r6, 0 - bl bag_menu_print_cant_be_held_msg -_081AD2EA: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end ItemMenu_Give - - thumb_func_start bag_menu_print_there_is_no_pokemon -bag_menu_print_there_is_no_pokemon: @ 81AD2F0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gText_NoPokemon - ldr r3, =sub_81AD350 - movs r1, 0x1 - bl DisplayItemMessage - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_print_there_is_no_pokemon - - thumb_func_start bag_menu_print_cant_be_held_msg -bag_menu_print_cant_be_held_msg: @ 81AD30C - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gScriptItemId - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r5, =gStringVar4 - ldr r1, =gText_Var1CantBeHeld - adds r0, r5, 0 - bl StringExpandPlaceholders - ldr r3, =sub_81AD350 - adds r0, r4, 0 - movs r1, 0x1 - adds r2, r5, 0 - bl DisplayItemMessage - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_print_cant_be_held_msg - - thumb_func_start sub_81AD350 -sub_81AD350: @ 81AD350 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081AD36E - movs r0, 0x5 - bl PlaySE - adds r0, r4, 0 - bl bag_menu_inits_lists_menu -_081AD36E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AD350 - - thumb_func_start ItemMenu_CheckTag -ItemMenu_CheckTag: @ 81AD378 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0203CE54 - ldr r2, [r1] - ldr r1, =sub_8177C14 - str r1, [r2] - bl unknown_ItemMenu_Confirm - pop {r0} - bx r0 - .pool - thumb_func_end ItemMenu_CheckTag - - thumb_func_start ItemMenu_Cancel -ItemMenu_Cancel: @ 81AD398 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - bl bag_menu_remove_some_window - movs r1, 0x2 - ldrsh r0, [r4, r1] - bl bag_menu_print_description_box_text - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - ldrb r0, [r4] - movs r1, 0 - bl bag_menu_print_cursor_ - adds r0, r5, 0 - bl set_callback3_to_bag - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ItemMenu_Cancel - - thumb_func_start ItemMenu_UseInBattle -ItemMenu_UseInBattle: @ 81AD3DC - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =gScriptItemId - ldrh r0, [r4] - bl ItemId_GetBattleFunc - cmp r0, 0 - beq _081AD400 - bl bag_menu_remove_some_window - ldrh r0, [r4] - bl ItemId_GetBattleFunc - adds r1, r0, 0 - adds r0, r5, 0 - bl _call_via_r1 -_081AD400: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ItemMenu_UseInBattle - - thumb_func_start bag_menu_mail_related -bag_menu_mail_related: @ 81AD40C - push {lr} - movs r0, 0xC - movs r1, 0x5 - movs r2, 0 - bl GoToBagMenu - pop {r0} - bx r0 - thumb_func_end bag_menu_mail_related - - thumb_func_start item_menu_type_2 -item_menu_type_2: @ 81AD41C - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =gScriptItemId - ldrh r0, [r4] - bl itemid_80BF6D8_mail_related - lsls r0, 24 - cmp r0, 0 - bne _081AD44C - ldr r2, =gText_CantWriteMail - ldr r3, =sub_81AD350 - adds r0, r5, 0 - movs r1, 0x1 - bl DisplayItemMessage - b _081AD4AE - .pool -_081AD44C: - ldrh r0, [r4] - bl sub_8122148 - lsls r0, 24 - cmp r0, 0 - bne _081AD488 - ldrh r0, [r4] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gText_Var1CantBeHeldHere - adds r0, r4, 0 - bl StringExpandPlaceholders - ldr r3, =sub_81AD350 - adds r0, r5, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl DisplayItemMessage - b _081AD4AE - .pool -_081AD488: - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - cmp r0, 0x4 - beq _081AD4A8 - ldrh r0, [r4] - bl itemid_is_unique - lsls r0, 24 - cmp r0, 0 - bne _081AD4A8 - adds r0, r5, 0 - bl unknown_ItemMenu_Confirm - b _081AD4AE - .pool -_081AD4A8: - adds r0, r5, 0 - bl bag_menu_print_cant_be_held_msg -_081AD4AE: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end item_menu_type_2 - - thumb_func_start item_menu_type_b -item_menu_type_b: @ 81AD4B4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r5, =gScriptItemId - ldrh r0, [r5] - bl itemid_is_mail - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081AD4E4 - ldr r2, =gText_CantWriteMail - ldr r3, =sub_81AD350 - adds r0, r4, 0 - movs r1, 0x1 - bl DisplayItemMessage - b _081AD51A - .pool -_081AD4E4: - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - cmp r0, 0x4 - beq _081AD514 - ldrh r0, [r5] - bl itemid_is_unique - lsls r0, 24 - cmp r0, 0 - bne _081AD514 - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =unknown_ItemMenu_Confirm - str r0, [r1] - b _081AD51A - .pool -_081AD514: - adds r0, r4, 0 - bl bag_menu_print_cant_be_held_msg -_081AD51A: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end item_menu_type_b - - thumb_func_start UseRegisteredKeyItemOnField -@ bool8 UseRegisteredKeyItemOnField() -UseRegisteredKeyItemOnField: @ 81AD520 - push {r4-r7,lr} - bl InUnionRoom - cmp r0, 0x1 - beq _081AD54C - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - bne _081AD54C - bl InBattlePike - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0 - bne _081AD54C - bl InMultiBattleRoom - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081AD550 -_081AD54C: - movs r0, 0 - b _081AD5D2 -_081AD550: - bl HideMapNamePopUpWindow - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY_ScreenOff - ldr r4, =gSaveBlock1Ptr - ldr r0, [r4] - ldr r5, =0x00000496 - adds r1, r0, r5 - ldrh r0, [r1] - cmp r0, 0 - beq _081AD5CA - movs r1, 0x1 - bl CheckBagHasItem - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x1 - bne _081AD5C4 - bl ScriptContext2_Enable - bl player_bitmagic - bl sub_808B864 - bl sub_808BCF4 - ldr r2, =gScriptItemId - ldr r0, [r4] - adds r0, r5 - ldrh r1, [r0] - strh r1, [r2] - ldrh r0, [r0] - bl ItemId_GetFieldFunc - movs r1, 0x8 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r6, [r1, 0xE] - b _081AD5D0 - .pool -_081AD5C4: - ldr r0, [r4] - adds r0, r5 - strh r7, [r0] -_081AD5CA: - ldr r0, =gUnknown_082736B3 - bl ScriptContext1_SetupScript -_081AD5D0: - movs r0, 0x1 -_081AD5D2: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end UseRegisteredKeyItemOnField - - thumb_func_start display_sell_item_ask_str -@ void display_sell_item_ask_str(int a1) -display_sell_item_ask_str: @ 81AD5DC - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r7, r5, 0 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldr r6, =gScriptItemId - ldrh r0, [r6] - bl itemid_get_market_price - lsls r0, 16 - cmp r0, 0 - bne _081AD634 - ldrh r0, [r6] - ldr r1, =gStringVar2 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E960F - adds r0, r4, 0 - bl StringExpandPlaceholders - ldr r3, =bag_menu_inits_lists_menu - adds r0, r5, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl DisplayItemMessage - b _081AD66A - .pool -_081AD634: - movs r0, 0x1 - strh r0, [r4, 0x10] - movs r1, 0x4 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - bne _081AD64C - bl bag_menu_AddMoney_window - adds r0, r5, 0 - bl sub_81AD680 - b _081AD66A -_081AD64C: - ldrh r0, [r6] - ldr r1, =gStringVar2 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E962F - adds r0, r4, 0 - bl StringExpandPlaceholders - ldr r3, =sub_81AD730 - adds r0, r7, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl DisplayItemMessage -_081AD66A: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end display_sell_item_ask_str - - thumb_func_start sub_81AD680 -sub_81AD680: @ 81AD680 - push {r4-r6,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - ldr r6, =gStringVar1 - ldr r0, =gScriptItemId - ldrh r0, [r0] - bl itemid_get_market_price - lsls r0, 16 - lsrs r0, 17 - movs r2, 0x10 - ldrsh r1, [r4, r2] - muls r1, r0 - adds r0, r6, 0 - movs r2, 0 - movs r3, 0x6 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9654 - adds r0, r4, 0 - bl StringExpandPlaceholders - ldr r3, =sub_81AD6E4 - adds r0, r5, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl DisplayItemMessage - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AD680 - - thumb_func_start sub_81AD6E4 -sub_81AD6E4: @ 81AD6E4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_0861408C - movs r1, 0x6 - bl bag_menu_yes_no - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AD6E4 - - thumb_func_start sub_81AD6FC -sub_81AD6FC: @ 81AD6FC - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - bl bag_menu_remove_money_window - movs r0, 0x4 - bl bag_menu_RemoveBagItem_message_window - ldrb r0, [r4] - movs r1, 0 - bl bag_menu_print_cursor_ - adds r0, r5, 0 - bl set_callback3_to_bag - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AD6FC - - thumb_func_start sub_81AD730 -sub_81AD730: @ 81AD730 - push {r4-r6,lr} - mov r6, r8 - push {r6} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r6, =gTasks + 0x8 - adds r0, r4, r6 - mov r8, r0 - movs r0, 0x8 - bl bag_menu_add_window - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gScriptItemId - ldrh r0, [r0] - bl itemid_get_market_price - lsls r0, 16 - lsrs r0, 17 - mov r2, r8 - movs r3, 0x10 - ldrsh r1, [r2, r3] - adds r2, r0, 0 - muls r2, r1 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_81ABCC0 - bl bag_menu_AddMoney_window - subs r6, 0x8 - adds r4, r6 - ldr r0, =sub_81AD794 - str r0, [r4] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AD730 - - thumb_func_start sub_81AD794 -sub_81AD794: @ 81AD794 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r6, r0, r1 - adds r0, r6, 0 - adds r0, 0x10 - ldrh r1, [r6, 0x4] - bl AdjustQuantityAccordingToDPadInput - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081AD7F4 - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r1, =0x00000818 - adds r0, r1 - ldrb r4, [r0] - movs r2, 0x10 - ldrsh r5, [r6, r2] - ldr r0, =gScriptItemId - ldrh r0, [r0] - bl itemid_get_market_price - lsls r0, 16 - lsrs r0, 17 - movs r2, 0x10 - ldrsh r1, [r6, r2] - adds r2, r0, 0 - muls r2, r1 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_81ABCC0 - b _081AD844 - .pool -_081AD7F4: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081AD818 - movs r0, 0x5 - bl PlaySE - movs r0, 0x8 - bl bag_menu_remove_window - adds r0, r4, 0 - bl sub_81AD680 - b _081AD844 - .pool -_081AD818: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081AD844 - movs r0, 0x5 - bl PlaySE - ldrb r0, [r6] - movs r1, 0 - bl bag_menu_print_cursor_ - bl bag_menu_remove_money_window - movs r0, 0x8 - bl bag_menu_remove_window - movs r0, 0x4 - bl bag_menu_RemoveBagItem_message_window - adds r0, r5, 0 - bl set_callback3_to_bag -_081AD844: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81AD794 - - thumb_func_start sub_81AD84C -sub_81AD84C: @ 81AD84C - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - ldr r6, =gScriptItemId - ldrh r0, [r6] - ldr r1, =gStringVar2 - bl CopyItemName - ldr r0, =gStringVar1 - mov r8, r0 - ldrh r0, [r6] - bl itemid_get_market_price - lsls r0, 16 - lsrs r0, 17 - movs r2, 0x10 - ldrsh r1, [r4, r2] - muls r1, r0 - mov r0, r8 - movs r2, 0 - movs r3, 0x6 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9677 - adds r0, r4, 0 - bl StringExpandPlaceholders - ldr r3, =sub_81AD8C8 - adds r0, r5, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl DisplayItemMessage - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AD84C - - thumb_func_start sub_81AD8C8 -sub_81AD8C8: @ 81AD8C8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - lsls r6, r0, 2 - adds r6, r0 - lsls r6, 3 - ldr r0, =gTasks + 0x8 - adds r0, r6 - mov r10, r0 - ldr r7, =gUnknown_0203CE58 - ldrb r5, [r7, 0x5] - lsls r5, 1 - movs r1, 0x12 - adds r1, r7 - mov r9, r1 - add r9, r5 - adds r0, r7, 0 - adds r0, 0x8 - adds r5, r0 - movs r0, 0x5F - bl PlaySE - ldr r2, =gScriptItemId - mov r8, r2 - ldrh r0, [r2] - mov r3, r10 - ldrh r1, [r3, 0x10] - bl RemoveBagItem - ldr r0, =gSaveBlock1Ptr - ldr r4, [r0] - movs r1, 0x92 - lsls r1, 3 - adds r4, r1 - mov r2, r8 - ldrh r0, [r2] - bl itemid_get_market_price - lsls r0, 16 - lsrs r0, 17 - mov r3, r10 - movs r2, 0x10 - ldrsh r1, [r3, r2] - muls r1, r0 - adds r0, r4, 0 - bl AddMoney - mov r3, r10 - ldrb r0, [r3] - mov r1, r9 - adds r2, r5, 0 - bl sub_81AE6C8 - ldrb r0, [r7, 0x5] - bl sub_81AB9A8 - ldrb r0, [r7, 0x5] - bl sub_81ABA88 - ldrb r0, [r7, 0x5] - bl load_bag_item_list_buffers - ldr r0, =gUnknown_03006310 - mov r2, r9 - ldrh r1, [r2] - ldrh r2, [r5] - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - mov r3, r10 - strh r0, [r3] - movs r1, 0x2 - bl bag_menu_print_cursor_ - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r1, =0x00000819 - adds r0, r1 - ldrb r4, [r0] - ldr r2, =gSaveBlock1Ptr - ldr r0, [r2] - movs r3, 0x92 - lsls r3, 3 - adds r0, r3 - bl GetMoney - adds r1, r0, 0 - adds r0, r4, 0 - movs r2, 0 - bl PrintMoneyAmountInMoneyBox - ldr r0, =gTasks + 0x8 - subs r0, 0x8 - adds r6, r0 - ldr r0, =sub_81AD9C0 - str r0, [r6] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AD8C8 - - thumb_func_start sub_81AD9C0 -sub_81AD9C0: @ 81AD9C0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _081AD9E2 - movs r0, 0x5 - bl PlaySE - bl bag_menu_remove_money_window - adds r0, r4, 0 - bl bag_menu_inits_lists_menu -_081AD9E2: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AD9C0 - - thumb_func_start display_deposit_item_ask_str -display_deposit_item_ask_str: @ 81AD9EC - push {r4-r6,lr} - sub sp, 0x14 - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r5, r0, 3 - ldr r6, =gTasks + 0x8 - adds r1, r5, r6 - movs r0, 0x1 - strh r0, [r1, 0x10] - movs r3, 0x4 - ldrsh r0, [r1, r3] - cmp r0, 0x1 - bne _081ADA18 - adds r0, r2, 0 - bl sub_81ADB14 - b _081ADA5E - .pool -_081ADA18: - ldr r0, =gScriptItemId - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gText_DepositHowManyVar1 - adds r0, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r0, [sp, 0xC] - str r0, [sp, 0x10] - movs r0, 0x1 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0x3 - bl bag_menu_print - movs r0, 0x7 - bl sub_81ABC3C - adds r0, r6, 0 - subs r0, 0x8 - adds r0, r5, r0 - ldr r1, =sub_81ADA7C - str r1, [r0] -_081ADA5E: - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end display_deposit_item_ask_str - - thumb_func_start sub_81ADA7C -sub_81ADA7C: @ 81ADA7C - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r6, r4, 0 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r5, r0, r1 - adds r0, r5, 0 - adds r0, 0x10 - ldrh r1, [r5, 0x4] - bl AdjustQuantityAccordingToDPadInput - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081ADAC0 - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r1, =0x00000817 - adds r0, r1 - ldrb r0, [r0] - movs r2, 0x10 - ldrsh r1, [r5, r2] - bl sub_81ABC54 - b _081ADB0E - .pool -_081ADAC0: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081ADAE4 - movs r0, 0x5 - bl PlaySE - movs r0, 0x7 - bl bag_menu_remove_window - adds r0, r4, 0 - bl sub_81ADB14 - b _081ADB0E - .pool -_081ADAE4: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081ADB0E - movs r0, 0x5 - bl PlaySE - movs r1, 0x2 - ldrsh r0, [r5, r1] - bl bag_menu_print_description_box_text - ldrb r0, [r5] - movs r1, 0 - bl bag_menu_print_cursor_ - movs r0, 0x7 - bl bag_menu_remove_window - adds r0, r6, 0 - bl set_callback3_to_bag -_081ADB0E: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81ADA7C - - thumb_func_start sub_81ADB14 -sub_81ADB14: @ 81ADB14 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x14 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r7, r1, 3 - ldr r0, =gTasks + 0x8 - mov r9, r0 - adds r2, r7, 0 - add r2, r9 - mov r8, r2 - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r4, =gScriptItemId - ldrh r0, [r4] - bl itemid_is_unique - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - beq _081ADB6C - ldr r2, =gText_CantStoreImportantItems - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r0, [sp, 0xC] - str r0, [sp, 0x10] - movs r0, 0x1 - b _081ADBE2 - .pool -_081ADB6C: - ldrh r0, [r4] - mov r3, r8 - ldrh r1, [r3, 0x10] - bl sub_80D6D70 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x1 - bne _081ADBD4 - ldrh r0, [r4] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r0, =gStringVar2 - mov r2, r8 - movs r3, 0x10 - ldrsh r1, [r2, r3] - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gText_DepositedVar2Var1s - adds r0, r4, 0 - bl StringExpandPlaceholders - str r6, [sp] - str r5, [sp, 0x4] - str r5, [sp, 0x8] - str r5, [sp, 0xC] - str r5, [sp, 0x10] - movs r0, 0x1 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0x3 - bl bag_menu_print - mov r0, r9 - subs r0, 0x8 - adds r0, r7, r0 - ldr r1, =Task_ActuallyToss - b _081ADBF2 - .pool -_081ADBD4: - ldr r2, =gText_NoRoomForItems - movs r0, 0x1 - str r0, [sp] - str r5, [sp, 0x4] - str r5, [sp, 0x8] - str r5, [sp, 0xC] - str r5, [sp, 0x10] -_081ADBE2: - movs r1, 0x1 - movs r3, 0x3 - bl bag_menu_print - mov r0, r9 - subs r0, 0x8 - adds r0, r7, r0 - ldr r1, =sub_81ADC0C -_081ADBF2: - str r1, [r0] - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81ADB14 - - thumb_func_start sub_81ADC0C -sub_81ADC0C: @ 81ADC0C - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r5, r0, r1 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _081ADC44 - movs r0, 0x5 - bl PlaySE - movs r1, 0x2 - ldrsh r0, [r5, r1] - bl bag_menu_print_description_box_text - ldrb r0, [r5] - movs r1, 0 - bl bag_menu_print_cursor_ - adds r0, r4, 0 - bl set_callback3_to_bag -_081ADC44: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81ADC0C - - thumb_func_start IsWallysBag -@ bool8 IsWallysBag() -IsWallysBag: @ 81ADC54 - push {lr} - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x4] - cmp r0, 0xA - beq _081ADC68 - movs r0, 0 - b _081ADC6A - .pool -_081ADC68: - movs r0, 0x1 -_081ADC6A: - pop {r1} - bx r1 - thumb_func_end IsWallysBag - - thumb_func_start PrepareBagForWallyTutorial -@ void PrepareBagForWallyTutorial() -PrepareBagForWallyTutorial: @ 81ADC70 - push {r4-r6,lr} - ldr r4, =gUnknown_0203CE80 - movs r0, 0xD0 - bl AllocZeroed - str r0, [r4] - ldr r5, =gSaveBlock1Ptr - ldr r1, [r5] - movs r2, 0xAC - lsls r2, 3 - adds r1, r2 - movs r2, 0x78 - bl memcpy - ldr r0, [r4] - ldr r1, [r5] - movs r2, 0xCA - lsls r2, 3 - adds r1, r2 - adds r0, 0x78 - movs r2, 0x40 - bl memcpy - ldr r0, [r4] - ldr r2, =gUnknown_0203CE58 - ldrb r1, [r2, 0x5] - adds r0, 0xCE - strh r1, [r0] - movs r6, 0 - adds r5, r2, 0 - adds r5, 0x8 -_081ADCAE: - ldr r2, [r4] - lsls r3, r6, 1 - adds r0, r2, 0 - adds r0, 0xB8 - adds r0, r3 - ldrh r1, [r5] - strh r1, [r0] - adds r2, 0xC2 - adds r2, r3 - ldrh r0, [r5, 0xA] - strh r0, [r2] - adds r5, 0x2 - adds r6, 0x1 - cmp r6, 0x4 - bls _081ADCAE - ldr r4, =gSaveBlock1Ptr - ldr r0, [r4] - movs r1, 0xAC - lsls r1, 3 - adds r0, r1 - movs r1, 0x1E - bl ClearItemSlots - ldr r0, [r4] - movs r2, 0xCA - lsls r2, 3 - adds r0, r2 - movs r1, 0x10 - bl ClearItemSlots - bl ResetBagScrollPositions - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end PrepareBagForWallyTutorial - - thumb_func_start RestoreBagAfterWallyTutorial -@ void RestoreBagAfterWallyTutorial() -RestoreBagAfterWallyTutorial: @ 81ADD00 - push {r4-r6,lr} - ldr r5, =gSaveBlock1Ptr - ldr r0, [r5] - movs r1, 0xAC - lsls r1, 3 - adds r0, r1 - ldr r4, =gUnknown_0203CE80 - ldr r1, [r4] - movs r2, 0x78 - bl memcpy - ldr r0, [r5] - movs r1, 0xCA - lsls r1, 3 - adds r0, r1 - ldr r1, [r4] - adds r1, 0x78 - movs r2, 0x40 - bl memcpy - ldr r1, =gUnknown_0203CE58 - ldr r0, [r4] - adds r0, 0xCE - ldrh r0, [r0] - strb r0, [r1, 0x5] - movs r5, 0 - adds r6, r4, 0 - adds r3, r1, 0 - adds r3, 0x8 -_081ADD3A: - lsls r2, r5, 1 - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0xB8 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r3] - adds r1, 0xC2 - adds r1, r2 - ldrh r0, [r1] - strh r0, [r3, 0xA] - adds r3, 0x2 - adds r5, 0x1 - cmp r5, 0x4 - bls _081ADD3A - ldr r0, [r6] - bl Free - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end RestoreBagAfterWallyTutorial - - thumb_func_start DoWallyTutorialBagMenu -@ void DoWallyTutorialBagMenu() -DoWallyTutorialBagMenu: @ 81ADD70 - push {lr} - bl PrepareBagForWallyTutorial - movs r0, 0xD - movs r1, 0x1 - bl AddBagItem - movs r0, 0x4 - movs r1, 0x1 - bl AddBagItem - ldr r2, =sub_8059D50 - movs r0, 0xA - movs r1, 0 - bl GoToBagMenu - pop {r0} - bx r0 - .pool - thumb_func_end DoWallyTutorialBagMenu - - thumb_func_start Task_WallyTutorialBagMenu -@ void Task_WallyTutorialBagMenu(u8 taskId) -Task_WallyTutorialBagMenu: @ 81ADD98 - 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 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081ADE32 - movs r0, 0x10 - ldrsh r1, [r4, r0] - cmp r1, 0xCC - beq _081ADDEC - cmp r1, 0xCC - bgt _081ADDD0 - cmp r1, 0x66 - beq _081ADDDA - b _081ADE2C - .pool -_081ADDD0: - movs r0, 0x99 - lsls r0, 1 - cmp r1, r0 - beq _081ADE0C - b _081ADE2C -_081ADDDA: - movs r0, 0x5 - bl PlaySE - adds r0, r5, 0 - movs r1, 0x1 - movs r2, 0 - bl SwitchBagPocket - b _081ADE2C -_081ADDEC: - movs r0, 0x5 - bl PlaySE - ldrb r0, [r4] - movs r1, 0x2 - bl bag_menu_print_cursor_ - ldr r1, =gScriptItemId - movs r0, 0x4 - strh r0, [r1] - adds r0, r5, 0 - bl sub_81AC644 - b _081ADE2C - .pool -_081ADE0C: - movs r0, 0x5 - bl PlaySE - bl bag_menu_remove_some_window - ldrb r0, [r4] - movs r1, 0 - movs r2, 0 - bl sub_81AE6C8 - bl RestoreBagAfterWallyTutorial - adds r0, r5, 0 - bl unknown_ItemMenu_Confirm - b _081ADE32 -_081ADE2C: - ldrh r0, [r4, 0x10] - adds r0, 0x1 - strh r0, [r4, 0x10] -_081ADE32: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end Task_WallyTutorialBagMenu - - thumb_func_start unknown_ItemMenu_Show -unknown_ItemMenu_Show: @ 81ADE38 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =gSpecialVar_0x8005 - ldr r0, =gScriptItemId - ldrh r0, [r0] - strh r0, [r1] - ldr r1, =gScriptResult - movs r0, 0x1 - strh r0, [r1] - bl bag_menu_remove_some_window - adds r0, r4, 0 - bl unknown_ItemMenu_Confirm - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end unknown_ItemMenu_Show - - thumb_func_start bag_menu_leave_maybe_3 -bag_menu_leave_maybe_3: @ 81ADE6C - push {lr} - ldr r0, =gUnknown_03005DAC - ldr r1, =sub_819FA50 - str r1, [r0] - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_leave_maybe_3 - - thumb_func_start unknown_ItemMenu_Give2 -unknown_ItemMenu_Give2: @ 81ADE8C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gScriptItemId - ldrh r0, [r0] - movs r1, 0x1 - bl RemoveBagItem - ldr r1, =gScriptResult - movs r0, 0x1 - strh r0, [r1] - bl bag_menu_remove_some_window - adds r0, r4, 0 - bl unknown_ItemMenu_Confirm - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end unknown_ItemMenu_Give2 - - thumb_func_start bag_menu_leave_maybe_2 -bag_menu_leave_maybe_2: @ 81ADEBC - push {lr} - ldr r0, =gUnknown_03005DAC - ldr r1, =sub_818DEF4 - str r1, [r0] - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_leave_maybe_2 - - thumb_func_start unknown_ItemMenu_Confirm2 -unknown_ItemMenu_Confirm2: @ 81ADEDC - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =gScriptResult - movs r0, 0x1 - strh r0, [r1] - bl bag_menu_remove_some_window - adds r0, r4, 0 - bl unknown_ItemMenu_Confirm - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end unknown_ItemMenu_Confirm2 - - thumb_func_start bag_menu_leave_maybe -bag_menu_leave_maybe: @ 81ADF00 - push {lr} - ldr r0, =gUnknown_03005DAC - ldr r1, =sub_818E564 - str r1, [r0] - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_leave_maybe - - thumb_func_start bag_menu_print_pocket_names -bag_menu_print_pocket_names: @ 81ADF20 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x1C - adds r4, r0, 0 - mov r8, r1 - movs r0, 0 - movs r1, 0 - str r0, [sp, 0x14] - str r1, [sp, 0x18] - ldr r1, =0x00ffffff - ldr r0, [sp, 0x14] - ands r0, r1 - movs r1, 0x80 - lsls r1, 21 - orrs r0, r1 - str r0, [sp, 0x14] - ldr r1, =0xffffff00 - ldr r0, [sp, 0x18] - ands r0, r1 - movs r1, 0x2 - orrs r0, r1 - str r0, [sp, 0x18] - add r0, sp, 0x14 - bl AddWindow - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r6, 0 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x40 - bl GetStringCenterAlignXOffset - lsls r3, r0, 24 - lsrs r3, 24 - movs r7, 0x1 - str r7, [sp] - movs r5, 0 - str r5, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0xFF - mov r9, r0 - str r0, [sp, 0xC] - str r7, [sp, 0x10] - adds r0, r6, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl bag_menu_print - mov r2, r8 - cmp r2, 0 - beq _081ADFBA - movs r0, 0x1 - mov r1, r8 - movs r2, 0x40 - bl GetStringCenterAlignXOffset - adds r3, r0, 0 - adds r3, 0x40 - lsls r3, 24 - lsrs r3, 24 - str r7, [sp] - str r5, [sp, 0x4] - str r5, [sp, 0x8] - mov r0, r9 - str r0, [sp, 0xC] - str r7, [sp, 0x10] - adds r0, r6, 0 - movs r1, 0x1 - mov r2, r8 - bl bag_menu_print -_081ADFBA: - adds r0, r6, 0 - movs r1, 0x7 - bl GetWindowAttribute - ldr r1, =gUnknown_0203CE54 - ldr r1, [r1] - ldr r2, =0x00000844 - adds r1, r2 - ldr r2, =0x04000100 - bl CpuSet - adds r0, r6, 0 - bl RemoveWindow - add sp, 0x1C - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_print_pocket_names - - thumb_func_start bag_menu_copy_pocket_name_to_window -bag_menu_copy_pocket_name_to_window: @ 81ADFF8 - push {r4-r7,lr} - adds r7, r0, 0 - cmp r7, 0x8 - bls _081AE002 - movs r7, 0x8 -_081AE002: - ldr r0, =gUnknown_0203CE54 - ldr r4, [r0] - ldr r0, =0x00000844 - adds r4, r0 - movs r0, 0x2 - movs r1, 0x7 - bl GetWindowAttribute - adds r5, r0, 0 - lsls r0, r7, 5 - adds r0, r4, r0 - ldr r6, =0x04000040 - adds r1, r5, 0 - adds r2, r6, 0 - bl CpuSet - adds r0, r7, 0 - adds r0, 0x10 - lsls r0, 5 - adds r4, r0 - movs r0, 0x80 - lsls r0, 1 - adds r5, r0 - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - bl CpuSet - movs r0, 0x2 - movs r1, 0x2 - bl CopyWindowToVram - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_copy_pocket_name_to_window - - thumb_func_start setup_bag_menu_textboxes -setup_bag_menu_textboxes: @ 81AE054 - push {r4,lr} - ldr r0, =gUnknown_08614174 - bl InitWindows - bl DeactivateAllTextPrinters - movs r0, 0 - movs r1, 0x1 - movs r2, 0xE0 - bl sub_809882C - movs r0, 0 - movs r1, 0xA - movs r2, 0xD0 - bl copy_textbox_border_tile_patterns_to_vram - movs r0, 0xC0 - movs r1, 0x1 - bl sub_819A2BC - ldr r0, =gUnknown_0860F074 - movs r1, 0xF0 - movs r2, 0x20 - bl LoadPalette - movs r4, 0 -_081AE088: - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _081AE088 - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end setup_bag_menu_textboxes - - thumb_func_start bag_menu_print -bag_menu_print: @ 81AE0BC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x14 - mov r9, r3 - ldr r3, [sp, 0x30] - ldr r4, [sp, 0x34] - ldr r6, [sp, 0x38] - ldr r5, [sp, 0x3C] - mov r8, r5 - ldr r5, [sp, 0x40] - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - mov r7, r9 - lsls r7, 24 - lsrs r7, 24 - mov r9, r7 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r5, 24 - lsrs r5, 24 - str r4, [sp] - str r6, [sp, 0x4] - lsls r4, r5, 1 - adds r4, r5 - ldr r5, =gUnknown_08614164 - adds r4, r5 - str r4, [sp, 0x8] - mov r4, r8 - lsls r4, 24 - asrs r4, 24 - str r4, [sp, 0xC] - str r2, [sp, 0x10] - mov r2, r9 - bl AddTextPrinterParametrized2 - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_print - - thumb_func_start sub_81AE124 -sub_81AE124: @ 81AE124 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0203CE54 - ldr r1, [r1] - movs r2, 0x81 - lsls r2, 4 - adds r1, r2 - adds r1, r0 - ldrb r0, [r1] - bx lr - .pool - thumb_func_end sub_81AE124 - - thumb_func_start bag_menu_add_window -bag_menu_add_window: @ 81AE13C - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gUnknown_0203CE54 - movs r3, 0x81 - lsls r3, 4 - adds r1, r2, r3 - ldr r0, [r0] - adds r4, r0, r1 - ldrb r0, [r4] - cmp r0, 0xFF - bne _081AE172 - lsls r0, r2, 3 - ldr r1, =gUnknown_086141AC - adds r0, r1 - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - movs r1, 0 - movs r2, 0x1 - movs r3, 0xE - bl SetWindowBorderStyle - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram -_081AE172: - ldrb r0, [r4] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end bag_menu_add_window - - thumb_func_start bag_menu_remove_window -bag_menu_remove_window: @ 81AE184 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0203CE54 - movs r2, 0x81 - lsls r2, 4 - adds r0, r2 - ldr r1, [r1] - adds r4, r1, r0 - ldrb r0, [r4] - cmp r0, 0xFF - beq _081AE1B8 - movs r1, 0 - bl sub_8198070 - ldrb r0, [r4] - bl ClearWindowTilemap - ldrb r0, [r4] - bl RemoveWindow - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0xFF - strb r0, [r4] -_081AE1B8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_remove_window - - thumb_func_start AddItemMessageWindow -@ u8 AddItemMessageWindow(u8 a1) -AddItemMessageWindow: @ 81AE1C4 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gUnknown_0203CE54 - movs r3, 0x81 - lsls r3, 4 - adds r1, r2, r3 - ldr r0, [r0] - adds r4, r0, r1 - ldrb r0, [r4] - cmp r0, 0xFF - bne _081AE1E8 - lsls r0, r2, 3 - ldr r1, =gUnknown_086141AC - adds r0, r1 - bl AddWindow - strb r0, [r4] -_081AE1E8: - ldrb r0, [r4] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end AddItemMessageWindow - - thumb_func_start bag_menu_RemoveBagItem_message_window -bag_menu_RemoveBagItem_message_window: @ 81AE1F8 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0203CE54 - movs r2, 0x81 - lsls r2, 4 - adds r0, r2 - ldr r1, [r1] - adds r4, r1, r0 - ldrb r0, [r4] - cmp r0, 0xFF - beq _081AE22C - movs r1, 0 - bl sub_8197DF8 - ldrb r0, [r4] - bl ClearWindowTilemap - ldrb r0, [r4] - bl RemoveWindow - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0xFF - strb r0, [r4] -_081AE22C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_RemoveBagItem_message_window - - thumb_func_start bag_menu_yes_no -bag_menu_yes_no: @ 81AE238 - push {lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 21 - ldr r3, =gUnknown_086141AC - adds r1, r3 - movs r3, 0x2 - str r3, [sp] - movs r3, 0x1 - str r3, [sp, 0x4] - movs r3, 0xE - str r3, [sp, 0x8] - str r2, [sp, 0xC] - movs r2, 0x1 - movs r3, 0 - bl CreateYesNoMenuWithCallbacks - add sp, 0x10 - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_yes_no - - thumb_func_start bag_menu_AddMoney_window -bag_menu_AddMoney_window: @ 81AE268 - push {r4,lr} - movs r0, 0x9 - bl bag_menu_add_window - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0x92 - lsls r1, 3 - adds r0, r1 - bl GetMoney - adds r3, r0, 0 - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0xE - bl set_window_border_style_and_print_money_box - movs r0, 0x13 - movs r1, 0xB - bl AddMoneyLabelObject - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_AddMoney_window - - thumb_func_start bag_menu_remove_money_window -bag_menu_remove_money_window: @ 81AE2A4 - push {lr} - movs r0, 0x9 - bl bag_menu_remove_window - bl RemoveMoneyLabelObject - pop {r0} - bx r0 - thumb_func_end bag_menu_remove_money_window - - thumb_func_start bag_menu_prepare_tmhm_move_window -bag_menu_prepare_tmhm_move_window: @ 81AE2B4 - push {lr} - movs r0, 0x3 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x3 - movs r1, 0x13 - movs r2, 0 - movs r3, 0 - bl blit_move_info_icon - movs r0, 0x3 - movs r1, 0x14 - movs r2, 0 - movs r3, 0xC - bl blit_move_info_icon - movs r0, 0x3 - movs r1, 0x15 - movs r2, 0 - movs r3, 0x18 - bl blit_move_info_icon - movs r0, 0x3 - movs r1, 0x16 - movs r2, 0 - movs r3, 0x24 - bl blit_move_info_icon - movs r0, 0x3 - movs r1, 0x2 - bl CopyWindowToVram - pop {r0} - bx r0 - thumb_func_end bag_menu_prepare_tmhm_move_window - - thumb_func_start PrintTMHMMoveData -PrintTMHMMoveData: @ 81AE2FC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x14 - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0x4 - movs r1, 0 - bl FillWindowPixelBuffer - cmp r4, 0 - bne _081AE354 - movs r4, 0 - movs r5, 0 -_081AE31A: - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 26 - lsrs r0, 24 - str r0, [sp] - str r5, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0xFF - str r0, [sp, 0xC] - movs r0, 0x4 - str r0, [sp, 0x10] - movs r1, 0x1 - ldr r2, =gText_ThreeDashes - movs r3, 0x7 - bl bag_menu_print - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _081AE31A - movs r0, 0x4 - movs r1, 0x2 - bl CopyWindowToVram - b _081AE440 - .pool -_081AE354: - adds r0, r4, 0 - bl ItemIdToBattleMoveId - lsls r0, 16 - lsrs r7, r0, 16 - ldr r1, =gBattleMoves - lsls r0, r7, 1 - adds r0, r7 - lsls r0, 2 - adds r5, r0, r1 - ldrb r1, [r5, 0x2] - adds r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x4 - movs r2, 0 - movs r3, 0 - bl blit_move_info_icon - ldrb r0, [r5, 0x1] - cmp r0, 0x1 - bhi _081AE38C - ldr r2, =gText_ThreeDashes - b _081AE39C - .pool -_081AE38C: - ldr r4, =gStringVar1 - ldrb r1, [r5, 0x1] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - adds r2, r4, 0 -_081AE39C: - movs r0, 0xC - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0xFF - str r0, [sp, 0xC] - movs r0, 0x4 - str r0, [sp, 0x10] - movs r1, 0x1 - movs r3, 0x7 - bl bag_menu_print - ldr r2, =gBattleMoves - lsls r1, r7, 1 - adds r0, r1, r7 - lsls r0, 2 - adds r2, r0, r2 - ldrb r0, [r2, 0x3] - adds r6, r1, 0 - cmp r0, 0 - bne _081AE3D8 - ldr r2, =gText_ThreeDashes - b _081AE3E8 - .pool -_081AE3D8: - ldr r4, =gStringVar1 - ldrb r1, [r2, 0x3] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - adds r2, r4, 0 -_081AE3E8: - movs r0, 0x18 - str r0, [sp] - movs r4, 0 - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0xFF - mov r8, r0 - str r0, [sp, 0xC] - movs r0, 0x4 - mov r9, r0 - str r0, [sp, 0x10] - movs r1, 0x1 - movs r3, 0x7 - bl bag_menu_print - ldr r5, =gStringVar1 - ldr r1, =gBattleMoves - adds r0, r6, r7 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x4] - adds r0, r5, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - movs r0, 0x24 - str r0, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - mov r0, r8 - str r0, [sp, 0xC] - mov r0, r9 - str r0, [sp, 0x10] - movs r0, 0x4 - movs r1, 0x1 - adds r2, r5, 0 - movs r3, 0x7 - bl bag_menu_print - movs r0, 0x4 - movs r1, 0x2 - bl CopyWindowToVram -_081AE440: - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end PrintTMHMMoveData - - thumb_func_start ListMenuDummyTask -@ void ListMenuDummyTask(u8 taskId) -ListMenuDummyTask: @ 81AE458 - bx lr - thumb_func_end ListMenuDummyTask - - thumb_func_start DoMysteryGiftListMenu -@ int DoMysteryGiftListMenu(struct WindowTemplate *windowTemplate, struct ListMenuTemplate *listMenuTemplate, int a3, int a4, int a5) -DoMysteryGiftListMenu: @ 81AE45C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - mov r12, r0 - str r1, [sp] - ldr r0, [sp, 0x28] - lsls r2, 24 - lsrs r6, r2, 24 - mov r10, r6 - lsls r3, 16 - lsrs r7, r3, 16 - str r7, [sp, 0x4] - lsls r0, 16 - mov r8, r0 - lsrs r0, 16 - mov r9, r0 - ldr r5, =gUnknown_0203CE84 - ldrb r4, [r5, 0x4] - cmp r4, 0x1 - beq _081AE4F4 - cmp r4, 0x1 - ble _081AE492 - cmp r4, 0x2 - beq _081AE558 -_081AE492: - mov r0, r12 - bl AddWindow - strb r0, [r5, 0x5] - cmp r6, 0x1 - beq _081AE4B0 - cmp r6, 0x2 - bne _081AE4C0 - ldrb r0, [r5, 0x5] - mov r1, r9 - lsls r2, r1, 24 - lsrs r2, 24 - adds r1, r7, 0 - bl sub_809882C -_081AE4B0: - ldrb r0, [r5, 0x5] - mov r3, r8 - lsrs r2, r3, 20 - lsls r2, 24 - lsrs r2, 24 - ldr r1, [sp, 0x4] - bl sub_8098858 -_081AE4C0: - ldr r0, =gUnknown_03006310 - adds r2, r0, 0 - ldr r1, [sp] - ldm r1!, {r3-r5} - stm r2!, {r3-r5} - ldm r1!, {r3-r5} - stm r2!, {r3-r5} - ldr r4, =gUnknown_0203CE84 - ldrb r1, [r4, 0x5] - strb r1, [r0, 0x10] - movs r1, 0 - movs r2, 0 - bl ListMenuInit - strb r0, [r4, 0x6] - ldrb r0, [r4, 0x5] - movs r1, 0x1 - bl CopyWindowToVram - movs r0, 0x1 - strb r0, [r4, 0x4] - b _081AE570 - .pool -_081AE4F4: - ldrb r0, [r5, 0x6] - bl ListMenuHandleInput - str r0, [r5] - ldr r1, =gMain - ldrh r0, [r1, 0x2E] - ands r4, r0 - cmp r4, 0 - beq _081AE50A - movs r0, 0x2 - strb r0, [r5, 0x4] -_081AE50A: - ldrh r1, [r1, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081AE51E - movs r0, 0x2 - negs r0, r0 - str r0, [r5] - movs r0, 0x2 - strb r0, [r5, 0x4] -_081AE51E: - ldrb r0, [r5, 0x4] - cmp r0, 0x2 - bne _081AE570 - cmp r6, 0 - bne _081AE534 - ldrb r0, [r5, 0x5] - bl ClearWindowTilemap - b _081AE546 - .pool -_081AE534: - mov r4, r10 - cmp r4, 0 - blt _081AE546 - cmp r4, 0x2 - bgt _081AE546 - ldrb r0, [r5, 0x5] - movs r1, 0 - bl sub_819746C -_081AE546: - ldr r0, =gUnknown_0203CE84 - ldrb r0, [r0, 0x5] - movs r1, 0x1 - bl CopyWindowToVram - b _081AE570 - .pool -_081AE558: - ldrb r0, [r5, 0x6] - movs r1, 0 - movs r2, 0 - bl sub_81AE6C8 - ldrb r0, [r5, 0x5] - bl RemoveWindow - movs r0, 0 - strb r0, [r5, 0x4] - ldr r0, [r5] - b _081AE574 -_081AE570: - movs r0, 0x1 - negs r0, r0 -_081AE574: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end DoMysteryGiftListMenu - - thumb_func_start ListMenuInit -@ u8 ListMenuInit(struct ListMenuTemplate *listMenuTemplate, u16 scrollOffset, u16 selectedRow) -ListMenuInit: @ 81AE584 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 16 - lsrs r2, 16 - bl ListMenuInitInternal - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldrb r0, [r5, 0x10] - bl PutWindowTilemap - ldrb r0, [r5, 0x10] - movs r1, 0x2 - bl CopyWindowToVram - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end ListMenuInit - - thumb_func_start Unused_ListMenuInit2 -@ u8 Unused_ListMenuInit2(struct ListMenuTemplate *listMenuTemplate, int a2, u16 scrollOffset, u16 selectedRow) -Unused_ListMenuInit2: @ 81AE5B0 - push {r4-r7,lr} - sub sp, 0x8 - adds r6, r0, 0 - adds r4, r1, 0 - adds r1, r2, 0 - adds r2, r3, 0 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 16 - lsrs r2, 16 - bl ListMenuInitInternal - lsls r0, 24 - lsrs r7, r0, 24 - ldrb r0, [r4, 0x4] - cmp r0, 0xFF - beq _081AE5F0 - adds r5, r4, 0 -_081AE5D4: - ldrb r0, [r6, 0x10] - ldrb r1, [r5] - ldrb r2, [r5, 0x1] - ldrb r3, [r5, 0x2] - ldrb r4, [r5, 0x3] - str r4, [sp] - ldrb r4, [r5, 0x4] - str r4, [sp, 0x4] - bl PutWindowRectTilemapOverridePalette - adds r5, 0x8 - ldrb r0, [r5, 0x4] - cmp r0, 0xFF - bne _081AE5D4 -_081AE5F0: - ldrb r0, [r6, 0x10] - movs r1, 0x2 - bl CopyWindowToVram - adds r0, r7, 0 - add sp, 0x8 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end Unused_ListMenuInit2 - - thumb_func_start ListMenuHandleInput -@ int ListMenuHandleInput(u8 taskId) -ListMenuHandleInput: @ 81AE604 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r3, r1, r0 - ldr r2, =gMain - ldrh r1, [r2, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081AE638 - ldrh r0, [r3, 0x18] - ldrh r1, [r3, 0x1A] - adds r0, r1 - ldr r1, [r3] - lsls r0, 3 - adds r0, r1 - ldr r0, [r0, 0x4] - b _081AE6C2 - .pool -_081AE638: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081AE646 - movs r0, 0x2 - negs r0, r0 - b _081AE6C2 -_081AE646: - ldrh r1, [r2, 0x30] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081AE65A - adds r0, r3, 0 - movs r1, 0x1 - movs r2, 0x1 - movs r3, 0 - b _081AE6BA -_081AE65A: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081AE66A - adds r0, r3, 0 - movs r1, 0x1 - movs r2, 0x1 - b _081AE6B8 -_081AE66A: - ldrb r0, [r3, 0x16] - lsrs r0, 6 - cmp r0, 0x1 - beq _081AE680 - cmp r0, 0x1 - ble _081AE67A - cmp r0, 0x2 - beq _081AE68C -_081AE67A: - movs r2, 0 - movs r0, 0 - b _081AE6A0 -_081AE680: - movs r0, 0x20 - ands r0, r1 - lsls r0, 16 - lsrs r2, r0, 16 - movs r0, 0x10 - b _081AE69A -_081AE68C: - movs r0, 0x80 - lsls r0, 2 - ands r0, r1 - lsls r0, 16 - lsrs r2, r0, 16 - movs r0, 0x80 - lsls r0, 1 -_081AE69A: - ands r0, r1 - lsls r0, 16 - lsrs r0, 16 -_081AE6A0: - cmp r2, 0 - beq _081AE6AE - ldrb r2, [r3, 0xE] - adds r0, r3, 0 - movs r1, 0x1 - movs r3, 0 - b _081AE6BA -_081AE6AE: - cmp r0, 0 - beq _081AE6BE - ldrb r2, [r3, 0xE] - adds r0, r3, 0 - movs r1, 0x1 -_081AE6B8: - movs r3, 0x1 -_081AE6BA: - bl ListMenuChangeSelection -_081AE6BE: - movs r0, 0x1 - negs r0, r0 -_081AE6C2: - pop {r1} - bx r1 - thumb_func_end ListMenuHandleInput - - thumb_func_start sub_81AE6C8 -sub_81AE6C8: @ 81AE6C8 - push {r4,lr} - adds r3, r1, 0 - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r1, r0, r1 - cmp r3, 0 - beq _081AE6E4 - ldrh r0, [r1, 0x18] - strh r0, [r3] -_081AE6E4: - cmp r2, 0 - beq _081AE6EC - ldrh r0, [r1, 0x1A] - strh r0, [r2] -_081AE6EC: - ldrb r0, [r1, 0x1E] - cmp r0, 0xFF - beq _081AE6FC - ldrb r1, [r1, 0x17] - lsrs r1, 6 - subs r1, 0x2 - bl ListMenuRemoveCursorObject -_081AE6FC: - adds r0, r4, 0 - bl DestroyTask - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AE6C8 - - thumb_func_start sub_81AE70C -sub_81AE70C: @ 81AE70C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - ldrb r0, [r4, 0x10] - ldrb r2, [r4, 0x15] - lsls r2, 28 - lsrs r1, r2, 4 - orrs r1, r2 - lsrs r1, 24 - bl FillWindowPixelBuffer - ldrh r1, [r4, 0x18] - ldrh r3, [r4, 0xE] - adds r0, r4, 0 - movs r2, 0 - bl ListMenuPrintEntries - adds r0, r4, 0 - bl ListMenuDrawCursor - ldrb r0, [r4, 0x10] - movs r1, 0x2 - bl CopyWindowToVram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AE70C - - thumb_func_start sub_81AE750 -sub_81AE750: @ 81AE750 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - lsrs r1, 20 - ldrb r6, [r4, 0x14] - movs r5, 0xF - adds r0, r5, 0 - ands r0, r6 - orrs r0, r1 - strb r0, [r4, 0x14] - ands r2, r5 - ldrb r1, [r4, 0x15] - movs r0, 0x10 - negs r0, r0 - ands r0, r1 - orrs r0, r2 - lsrs r3, 20 - ands r0, r5 - orrs r0, r3 - strb r0, [r4, 0x15] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AE750 - - thumb_func_start sub_81AE794 -sub_81AE794: @ 81AE794 - push {r4,r5,lr} - adds r3, r1, 0 - adds r5, r2, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - ldrb r0, [r4, 0x10] - movs r1, 0x1 - adds r2, r3, 0 - bl SetWindowAttribute - ldrb r0, [r4, 0x10] - movs r1, 0x2 - adds r2, r5, 0 - bl SetWindowAttribute - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AE794 - - thumb_func_start sub_81AE7D0 -sub_81AE7D0: @ 81AE7D0 - push {r4-r7,lr} - sub sp, 0x20 - mov r12, r2 - ldr r5, [sp, 0x34] - lsls r3, 16 - lsrs r3, 16 - adds r4, r3, 0 - mov r3, sp - ldm r0!, {r2,r6,r7} - stm r3!, {r2,r6,r7} - ldm r0!, {r2,r6,r7} - stm r3!, {r2,r6,r7} - mov r0, sp - movs r3, 0 - strh r1, [r0, 0x18] - mov r1, r12 - strh r1, [r0, 0x1A] - strb r3, [r0, 0x1C] - strb r3, [r0, 0x1D] - cmp r4, 0x40 - bne _081AE804 - movs r1, 0 - movs r2, 0x1 - movs r3, 0 - bl ListMenuChangeSelection -_081AE804: - cmp r4, 0x80 - bne _081AE814 - mov r0, sp - movs r1, 0 - movs r2, 0x1 - movs r3, 0x1 - bl ListMenuChangeSelection -_081AE814: - cmp r5, 0 - beq _081AE81E - mov r0, sp - ldrh r0, [r0, 0x18] - strh r0, [r5] -_081AE81E: - ldr r2, [sp, 0x38] - cmp r2, 0 - beq _081AE82A - mov r0, sp - ldrh r0, [r0, 0x1A] - strh r0, [r2] -_081AE82A: - movs r0, 0x1 - negs r0, r0 - add sp, 0x20 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81AE7D0 - - thumb_func_start sub_81AE838 -sub_81AE838: @ 81AE838 - push {lr} - adds r2, r1, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r1, r0 - cmp r2, 0 - beq _081AE856 - ldrh r0, [r1, 0x1A] - ldrh r1, [r1, 0x18] - adds r0, r1 - strh r0, [r2] -_081AE856: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AE838 - - thumb_func_start get_coro_args_x18_x1A -get_coro_args_x18_x1A: @ 81AE860 - push {lr} - adds r3, r1, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r1, r0 - cmp r3, 0 - beq _081AE87A - ldrh r0, [r1, 0x18] - strh r0, [r3] -_081AE87A: - cmp r2, 0 - beq _081AE882 - ldrh r0, [r1, 0x1A] - strh r0, [r2] -_081AE882: - pop {r0} - bx r0 - .pool - thumb_func_end get_coro_args_x18_x1A - - thumb_func_start ListMenuGetYCoordForPrintingArrowCursor -@ u8 ListMenuGetYCoordForPrintingArrowCursor(u8 taskId) -ListMenuGetYCoordForPrintingArrowCursor: @ 81AE88C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - ldrb r0, [r4, 0x17] - lsls r0, 26 - lsrs r0, 26 - movs r1, 0x1 - bl GetFontAttribute - ldrb r1, [r4, 0x16] - lsls r1, 26 - lsrs r1, 29 - adds r0, r1 - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x1A] - adds r2, r1, 0 - muls r2, r0 - adds r1, r2, 0 - ldrb r0, [r4, 0x14] - lsls r0, 28 - lsrs r0, 28 - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end ListMenuGetYCoordForPrintingArrowCursor - - thumb_func_start ListMenuInitInternal -@ u8 ListMenuInitInternal(struct ListMenuTemplate *listMenuTemplate, u16 scrollOffset, u16 selectedRow) -ListMenuInitInternal: @ 81AE8D4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - lsls r5, 16 - lsrs r5, 16 - lsls r6, 16 - lsrs r6, 16 - ldr r0, =ListMenuDummyTask - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r0, 2 - add r0, r8 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r7, r0, r1 - adds r0, r7, 0 - ldm r4!, {r1-r3} - stm r0!, {r1-r3} - ldm r4!, {r1-r3} - stm r0!, {r1-r3} - movs r1, 0 - strh r5, [r7, 0x18] - strh r6, [r7, 0x1A] - strb r1, [r7, 0x1C] - strb r1, [r7, 0x1D] - movs r0, 0xFF - strb r0, [r7, 0x1E] - strb r1, [r7, 0x1F] - ldr r3, =gUnknown_03006300 - ldrb r1, [r7, 0x14] - movs r5, 0xF - lsrs r1, 4 - ldrb r4, [r3] - movs r2, 0x10 - negs r2, r2 - adds r0, r2, 0 - ands r0, r4 - orrs r0, r1 - strb r0, [r3] - ldrb r1, [r7, 0x15] - lsls r1, 28 - lsrs r1, 24 - ands r0, r5 - orrs r0, r1 - strb r0, [r3] - ldrb r0, [r7, 0x15] - lsrs r0, 4 - ands r5, r0 - ldrb r0, [r3, 0x1] - ands r2, r0 - orrs r2, r5 - strb r2, [r3, 0x1] - ldrb r1, [r7, 0x16] - lsls r1, 29 - lsrs r1, 17 - ldr r0, [r3] - ldr r2, =0xfffc0fff - ands r0, r2 - orrs r0, r1 - str r0, [r3] - ldrb r0, [r7, 0x17] - lsls r0, 26 - lsrs r0, 26 - strb r0, [r3, 0x3] - ldrh r0, [r7, 0xC] - ldrh r1, [r7, 0xE] - cmp r0, r1 - bcs _081AE96C - strh r0, [r7, 0xE] -_081AE96C: - ldrb r0, [r7, 0x10] - ldrb r2, [r7, 0x15] - lsls r2, 28 - lsrs r1, r2, 4 - orrs r1, r2 - lsrs r1, 24 - bl FillWindowPixelBuffer - ldrh r1, [r7, 0x18] - ldrh r3, [r7, 0xE] - adds r0, r7, 0 - movs r2, 0 - bl ListMenuPrintEntries - adds r0, r7, 0 - bl ListMenuDrawCursor - adds r0, r7, 0 - movs r1, 0x1 - bl ListMenuCallSelectionChangedCallback - mov r0, r8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end ListMenuInitInternal - - thumb_func_start ListMenuPrint -@ void ListMenuPrint(struct ListMenu *listMenu, u8 *str, u8 x, u8 y) -ListMenuPrint: @ 81AE9B4 - push {r4-r7,lr} - sub sp, 0x18 - adds r4, r0, 0 - adds r6, r1, 0 - lsls r2, 24 - lsrs r7, r2, 24 - lsls r3, 24 - lsrs r3, 24 - mov r12, r3 - ldr r5, =gUnknown_03006300 - ldrb r1, [r5, 0x3] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - beq _081AEA20 - add r1, sp, 0x14 - ldr r2, [r5] - lsls r0, r2, 24 - lsrs r0, 28 - movs r3, 0 - strb r0, [r1] - lsls r0, r2, 28 - lsrs r0, 28 - strb r0, [r1, 0x1] - lsls r0, r2, 20 - lsrs r0, 28 - strb r0, [r1, 0x2] - ldrb r0, [r4, 0x10] - lsls r1, r2, 1 - lsrs r1, 25 - lsls r2, 14 - lsrs r2, 26 - str r2, [sp] - str r3, [sp, 0x4] - add r2, sp, 0x14 - str r2, [sp, 0x8] - movs r2, 0x1 - negs r2, r2 - str r2, [sp, 0xC] - str r6, [sp, 0x10] - adds r2, r7, 0 - mov r3, r12 - bl AddTextPrinterParametrized2 - ldrb r1, [r5, 0x3] - movs r0, 0x7F - ands r0, r1 - strb r0, [r5, 0x3] - b _081AEA5E - .pool -_081AEA20: - add r2, sp, 0x14 - ldrb r1, [r4, 0x15] - lsls r0, r1, 28 - lsrs r0, 28 - strb r0, [r2] - ldrb r0, [r4, 0x14] - lsrs r0, 4 - strb r0, [r2, 0x1] - adds r0, r2, 0 - lsls r1, 24 - lsrs r1, 28 - strb r1, [r0, 0x2] - ldrb r0, [r4, 0x10] - ldrb r1, [r4, 0x17] - lsls r1, 26 - lsrs r1, 26 - ldrb r2, [r4, 0x16] - lsls r2, 29 - lsrs r2, 29 - str r2, [sp] - str r3, [sp, 0x4] - add r2, sp, 0x14 - str r2, [sp, 0x8] - movs r2, 0x1 - negs r2, r2 - str r2, [sp, 0xC] - str r6, [sp, 0x10] - adds r2, r7, 0 - mov r3, r12 - bl AddTextPrinterParametrized2 -_081AEA5E: - add sp, 0x18 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end ListMenuPrint - - thumb_func_start ListMenuPrintEntries -@ void ListMenuPrintEntries(struct ListMenu *listMenu, u16 startIndex, u16 yOffset, u16 count) -ListMenuPrintEntries: @ 81AEA68 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - adds r4, r0, 0 - lsls r1, 16 - lsrs r1, 16 - mov r9, r1 - lsls r2, 16 - lsrs r2, 16 - str r2, [sp] - lsls r3, 16 - lsrs r3, 16 - mov r10, r3 - ldrb r0, [r4, 0x17] - lsls r0, 26 - lsrs r0, 26 - movs r1, 0x1 - bl GetFontAttribute - ldrb r1, [r4, 0x16] - lsls r1, 26 - lsrs r1, 29 - adds r0, r1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - movs r0, 0 - mov r8, r0 - cmp r8, r10 - bge _081AEB10 -_081AEAAA: - ldr r0, [r4] - mov r2, r9 - lsls r1, r2, 3 - adds r0, r1, r0 - ldr r2, [r0, 0x4] - movs r0, 0x3 - negs r0, r0 - adds r5, r1, 0 - cmp r2, r0 - beq _081AEAC2 - ldrb r6, [r4, 0x12] - b _081AEAC4 -_081AEAC2: - ldrb r6, [r4, 0x11] -_081AEAC4: - ldr r0, [sp] - add r0, r8 - ldr r2, [sp, 0x4] - adds r1, r0, 0 - muls r1, r2 - ldrb r0, [r4, 0x14] - lsls r0, 28 - lsrs r0, 28 - adds r0, r1 - lsls r0, 24 - lsrs r2, r0, 24 - adds r7, r2, 0 - ldr r3, [r4, 0x8] - cmp r3, 0 - beq _081AEAEE - ldrb r0, [r4, 0x10] - ldr r1, [r4] - adds r1, r5, r1 - ldr r1, [r1, 0x4] - bl _call_via_r3 -_081AEAEE: - ldr r0, [r4] - adds r0, r5, r0 - ldr r1, [r0] - adds r0, r4, 0 - adds r2, r6, 0 - adds r3, r7, 0 - bl ListMenuPrint - mov r0, r9 - adds r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - movs r0, 0x1 - add r8, r0 - cmp r8, r10 - blt _081AEAAA -_081AEB10: - 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 ListMenuPrintEntries - - thumb_func_start ListMenuDrawCursor -@ void ListMenuDrawCursor(struct ListMenu *listMenu) -ListMenuDrawCursor: @ 81AEB20 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - ldrb r0, [r6, 0x17] - lsls r0, 26 - lsrs r0, 26 - movs r1, 0x1 - bl GetFontAttribute - ldrb r1, [r6, 0x16] - lsls r1, 26 - lsrs r1, 29 - adds r0, r1 - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r6, 0x13] - mov r8, r1 - ldrh r1, [r6, 0x1A] - muls r1, r0 - ldrb r0, [r6, 0x14] - lsls r0, 28 - lsrs r0, 28 - adds r0, r1 - lsls r0, 24 - lsrs r7, r0, 24 - ldrb r0, [r6, 0x17] - lsrs r0, 6 - cmp r0, 0x1 - beq _081AEC0C - cmp r0, 0x1 - bgt _081AEB66 - cmp r0, 0 - beq _081AEB70 - b _081AEC0C -_081AEB66: - cmp r0, 0x2 - beq _081AEB84 - cmp r0, 0x3 - beq _081AEBCC - b _081AEC0C -_081AEB70: - ldr r1, =gText_SelectorArrow2 - adds r0, r6, 0 - mov r2, r8 - adds r3, r7, 0 - bl ListMenuPrint - b _081AEC0C - .pool -_081AEB84: - ldrb r0, [r6, 0x1E] - cmp r0, 0xFF - bne _081AEB94 - adds r0, r6, 0 - movs r1, 0 - bl ListMenuAddCursorObject - strb r0, [r6, 0x1E] -_081AEB94: - ldrb r5, [r6, 0x1E] - ldrb r0, [r6, 0x10] - movs r1, 0x1 - bl GetWindowAttribute - adds r4, r0, 0 - lsls r4, 19 - ldr r0, =0xffff0000 - adds r4, r0 - lsrs r4, 16 - ldrb r0, [r6, 0x10] - movs r1, 0x2 - bl GetWindowAttribute - adds r2, r0, 0 - lsls r2, 3 - adds r2, r7 - subs r2, 0x1 - lsls r2, 16 - lsrs r2, 16 - adds r0, r5, 0 - adds r1, r4, 0 - movs r3, 0 - bl ListMenuUpdateCursorObject - b _081AEC0C - .pool -_081AEBCC: - ldrb r0, [r6, 0x1E] - cmp r0, 0xFF - bne _081AEBDC - adds r0, r6, 0 - movs r1, 0x1 - bl ListMenuAddCursorObject - strb r0, [r6, 0x1E] -_081AEBDC: - ldrb r5, [r6, 0x1E] - ldrb r0, [r6, 0x10] - movs r1, 0x1 - bl GetWindowAttribute - adds r4, r0, 0 - lsls r4, 3 - add r4, r8 - lsls r4, 16 - lsrs r4, 16 - ldrb r0, [r6, 0x10] - movs r1, 0x2 - bl GetWindowAttribute - adds r2, r0, 0 - lsls r2, 3 - adds r2, r7 - lsls r2, 16 - lsrs r2, 16 - adds r0, r5, 0 - adds r1, r4, 0 - movs r3, 0x1 - bl ListMenuUpdateCursorObject -_081AEC0C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end ListMenuDrawCursor - - thumb_func_start ListMenuAddCursorObject -ListMenuAddCursorObject: @ 81AEC18 - push {r4,r5,lr} - sub sp, 0xC - adds r4, r0, 0 - adds r5, r1, 0 - mov r1, sp - movs r0, 0 - strb r0, [r1] - movs r0, 0xA0 - strb r0, [r1, 0x1] - ldrb r0, [r4, 0x10] - movs r1, 0x3 - bl GetWindowAttribute - mov r1, sp - lsls r0, 3 - adds r0, 0x2 - strh r0, [r1, 0x2] - ldrb r0, [r4, 0x17] - lsls r0, 26 - lsrs r0, 26 - movs r1, 0x1 - bl GetFontAttribute - mov r1, sp - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x2 - strh r0, [r1, 0x4] - movs r0, 0x80 - lsls r0, 7 - strh r0, [r1, 0x6] - ldr r0, =0x0000ffff - strh r0, [r1, 0x8] - movs r0, 0xF - strb r0, [r1, 0xA] - mov r0, sp - adds r1, r5, 0 - bl ListMenuAddCursorObjectInternal - lsls r0, 24 - lsrs r0, 24 - add sp, 0xC - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end ListMenuAddCursorObject - - thumb_func_start ListMenuErasePrintedCursor -ListMenuErasePrintedCursor: @ 81AEC78 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - adds r7, r0, 0 - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - ldrb r1, [r7, 0x17] - lsrs r0, r1, 6 - cmp r0, 0 - bne _081AECF4 - lsls r0, r1, 26 - lsrs r0, 26 - movs r1, 0x1 - bl GetFontAttribute - adds r4, r0, 0 - ldrb r0, [r7, 0x16] - lsls r0, 26 - lsrs r0, 29 - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - ldrb r0, [r7, 0x17] - lsls r0, 26 - lsrs r0, 26 - movs r1, 0 - bl GetMenuCursorDimensionByFont - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldrb r0, [r7, 0x17] - lsls r0, 26 - lsrs r0, 26 - movs r1, 0x1 - bl GetMenuCursorDimensionByFont - lsls r0, 24 - lsrs r0, 24 - ldrb r6, [r7, 0x10] - ldrb r2, [r7, 0x15] - lsls r2, 28 - lsrs r1, r2, 4 - orrs r1, r2 - lsrs r1, 24 - ldrb r2, [r7, 0x13] - mov r3, r8 - muls r3, r4 - adds r4, r3, 0 - ldrb r3, [r7, 0x14] - lsls r3, 28 - lsrs r3, 28 - adds r3, r4 - lsls r3, 16 - lsrs r3, 16 - str r5, [sp] - str r0, [sp, 0x4] - adds r0, r6, 0 - bl FillWindowPixelRect -_081AECF4: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end ListMenuErasePrintedCursor - - thumb_func_start ListMenuUpdateSelectedRowIndexAndScrollOffset -@ u8 ListMenuUpdateSelectedRowIndexAndScrollOffset(int, bool8 movingDown) -ListMenuUpdateSelectedRowIndexAndScrollOffset: @ 81AED00 - push {r4-r6,lr} - adds r4, r0, 0 - lsls r1, 24 - ldrh r3, [r4, 0x1A] - ldrh r5, [r4, 0x18] - cmp r1, 0 - bne _081AED74 - ldrh r0, [r4, 0xE] - cmp r0, 0x1 - bne _081AED18 - movs r2, 0 - b _081AED2A -_081AED18: - ldrh r0, [r4, 0xE] - lsrs r2, r0, 1 - movs r1, 0x1 - ands r1, r0 - adds r2, r1 - subs r0, r2 - subs r0, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 -_081AED2A: - cmp r5, 0 - bne _081AED50 - cmp r3, 0 - beq _081AEDB6 - ldr r1, [r4] - movs r2, 0x3 - negs r2, r2 -_081AED38: - subs r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - adds r0, r5, r3 - lsls r0, 3 - adds r0, r1 - ldr r0, [r0, 0x4] - cmp r0, r2 - bne _081AEDBA - cmp r3, 0 - bne _081AED38 - b _081AEDB6 -_081AED50: - cmp r3, r2 - bls _081AED70 - ldr r1, [r4] - movs r6, 0x3 - negs r6, r6 -_081AED5A: - subs r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - adds r0, r5, r3 - lsls r0, 3 - adds r0, r1 - ldr r0, [r0, 0x4] - cmp r0, r6 - bne _081AEDBA - cmp r3, r2 - bhi _081AED5A -_081AED70: - subs r0, r5, 0x1 - b _081AEDE2 -_081AED74: - ldrh r0, [r4, 0xE] - cmp r0, 0x1 - bne _081AED7E - movs r2, 0 - b _081AED88 -_081AED7E: - ldrh r0, [r4, 0xE] - lsrs r2, r0, 1 - movs r1, 0x1 - ands r1, r0 - adds r2, r1 -_081AED88: - adds r1, r0, 0 - ldrh r0, [r4, 0xC] - subs r0, r1 - cmp r5, r0 - bne _081AEDC0 - subs r0, r1, 0x1 - cmp r3, r0 - bge _081AEDB6 - ldr r2, [r4] - movs r6, 0x3 - negs r6, r6 - adds r1, r0, 0 -_081AEDA0: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - adds r0, r5, r3 - lsls r0, 3 - adds r0, r2 - ldr r0, [r0, 0x4] - cmp r0, r6 - bne _081AEDBA - cmp r3, r1 - blt _081AEDA0 -_081AEDB6: - movs r0, 0 - b _081AEDE8 -_081AEDBA: - strh r3, [r4, 0x1A] - movs r0, 0x1 - b _081AEDE8 -_081AEDC0: - cmp r3, r2 - bcs _081AEDE0 - ldr r1, [r4] - movs r6, 0x3 - negs r6, r6 -_081AEDCA: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - adds r0, r5, r3 - lsls r0, 3 - adds r0, r1 - ldr r0, [r0, 0x4] - cmp r0, r6 - bne _081AEDBA - cmp r3, r2 - bcc _081AEDCA -_081AEDE0: - adds r0, r5, 0x1 -_081AEDE2: - strh r2, [r4, 0x1A] - strh r0, [r4, 0x18] - movs r0, 0x2 -_081AEDE8: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end ListMenuUpdateSelectedRowIndexAndScrollOffset - - thumb_func_start ListMenuScroll -@ void ListMenuScroll(struct ListMenu *listMenu, int a2, bool8 movingDown) -ListMenuScroll: @ 81AEDF0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - adds r6, r0, 0 - lsls r1, 24 - lsrs r5, r1, 24 - adds r7, r5, 0 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - ldrh r0, [r6, 0xE] - cmp r5, r0 - bcc _081AEE2A - ldrb r0, [r6, 0x10] - ldrb r2, [r6, 0x15] - lsls r2, 28 - lsrs r1, r2, 4 - orrs r1, r2 - lsrs r1, 24 - bl FillWindowPixelBuffer - ldrh r1, [r6, 0x18] - ldrh r3, [r6, 0xE] - adds r0, r6, 0 - movs r2, 0 - bl ListMenuPrintEntries - b _081AEF1A -_081AEE2A: - ldrb r0, [r6, 0x17] - lsls r0, 26 - lsrs r0, 26 - movs r1, 0x1 - bl GetFontAttribute - ldrb r1, [r6, 0x16] - lsls r1, 26 - lsrs r1, 29 - adds r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - mov r1, r8 - cmp r1, 0 - bne _081AEEBC - ldrb r0, [r6, 0x10] - adds r2, r5, 0 - muls r2, r4 - lsls r2, 24 - lsrs r2, 24 - ldrb r1, [r6, 0x15] - lsls r1, 28 - lsrs r3, r1, 4 - orrs r3, r1 - lsrs r3, 24 - movs r1, 0x1 - bl ScrollWindow - ldrh r1, [r6, 0x18] - adds r0, r6, 0 - movs r2, 0 - adds r3, r5, 0 - bl ListMenuPrintEntries - ldrh r0, [r6, 0xE] - adds r1, r0, 0 - muls r1, r4 - adds r0, r1, 0 - ldrb r4, [r6, 0x14] - lsls r4, 28 - lsrs r4, 28 - adds r4, r0 - lsls r4, 16 - lsrs r4, 16 - ldrb r0, [r6, 0x10] - movs r1, 0x3 - bl GetWindowAttribute - adds r5, r0, 0 - lsls r5, 19 - lsrs r5, 16 - ldrb r0, [r6, 0x10] - movs r1, 0x4 - bl GetWindowAttribute - lsls r0, 3 - subs r0, r4 - lsls r0, 16 - lsrs r0, 16 - ldrb r3, [r6, 0x10] - ldrb r2, [r6, 0x15] - lsls r2, 28 - lsrs r1, r2, 4 - orrs r1, r2 - lsrs r1, 24 - str r5, [sp] - str r0, [sp, 0x4] - adds r0, r3, 0 - movs r2, 0 - adds r3, r4, 0 - bl FillWindowPixelRect - b _081AEF1A -_081AEEBC: - ldrb r0, [r6, 0x10] - adds r2, r7, 0 - muls r2, r4 - lsls r2, 24 - lsrs r2, 24 - ldrb r1, [r6, 0x15] - lsls r1, 28 - lsrs r3, r1, 4 - orrs r3, r1 - lsrs r3, 24 - movs r1, 0 - bl ScrollWindow - ldrh r2, [r6, 0xE] - subs r2, r7 - ldrh r1, [r6, 0x18] - adds r1, r2 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 16 - lsrs r2, 16 - adds r0, r6, 0 - adds r3, r7, 0 - bl ListMenuPrintEntries - ldrb r0, [r6, 0x10] - movs r1, 0x3 - bl GetWindowAttribute - lsls r0, 19 - lsrs r0, 16 - ldrb r3, [r6, 0x10] - ldrb r2, [r6, 0x15] - lsls r2, 28 - lsrs r1, r2, 4 - orrs r1, r2 - lsrs r1, 24 - str r0, [sp] - ldrb r0, [r6, 0x14] - lsls r0, 28 - lsrs r0, 28 - str r0, [sp, 0x4] - adds r0, r3, 0 - movs r2, 0 - movs r3, 0 - bl FillWindowPixelRect -_081AEF1A: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end ListMenuScroll - - thumb_func_start ListMenuChangeSelection -@ bool8 ListMenuChangeSelection(struct ListMenu *listMenu, bool8 updateCursorAndCallCallback, u8 count, bool8 movingDown) -ListMenuChangeSelection: @ 81AEF28 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r4, r0, 0 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp] - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - lsls r3, 24 - lsrs r3, 24 - mov r9, r3 - ldrh r0, [r4, 0x1A] - mov r10, r0 - movs r7, 0 - movs r5, 0 - movs r0, 0 - cmp r7, r8 - bcs _081AEF90 -_081AEF56: - adds r6, r0, 0x1 - b _081AEF76 -_081AEF5A: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - ldrh r0, [r4, 0x18] - ldrh r1, [r4, 0x1A] - adds r0, r1 - ldr r1, [r4] - lsls r0, 3 - adds r0, r1 - ldr r1, [r0, 0x4] - movs r0, 0x3 - negs r0, r0 - cmp r1, r0 - bne _081AEF88 -_081AEF76: - adds r0, r4, 0 - mov r1, r9 - bl ListMenuUpdateSelectedRowIndexAndScrollOffset - lsls r0, 24 - lsrs r0, 24 - orrs r5, r0 - cmp r0, 0x2 - beq _081AEF5A -_081AEF88: - lsls r0, r6, 24 - lsrs r0, 24 - cmp r0, r8 - bcc _081AEF56 -_081AEF90: - ldr r0, [sp] - cmp r0, 0 - beq _081AEFEE - cmp r5, 0x1 - beq _081AEFA6 - cmp r5, 0x1 - ble _081AEFA2 - cmp r5, 0x3 - ble _081AEFC6 -_081AEFA2: - movs r0, 0x1 - b _081AEFF0 -_081AEFA6: - adds r0, r4, 0 - mov r1, r10 - bl ListMenuErasePrintedCursor - adds r0, r4, 0 - bl ListMenuDrawCursor - adds r0, r4, 0 - movs r1, 0 - bl ListMenuCallSelectionChangedCallback - ldrb r0, [r4, 0x10] - movs r1, 0x2 - bl CopyWindowToVram - b _081AEFEE -_081AEFC6: - adds r0, r4, 0 - mov r1, r10 - bl ListMenuErasePrintedCursor - adds r0, r4, 0 - adds r1, r7, 0 - mov r2, r9 - bl ListMenuScroll - adds r0, r4, 0 - bl ListMenuDrawCursor - adds r0, r4, 0 - movs r1, 0 - bl ListMenuCallSelectionChangedCallback - ldrb r0, [r4, 0x10] - movs r1, 0x2 - bl CopyWindowToVram -_081AEFEE: - movs r0, 0 -_081AEFF0: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end ListMenuChangeSelection - - thumb_func_start ListMenuCallSelectionChangedCallback -@ void ListMenuCallSelectionChangedCallback(struct ListMenu *listMenu, u8 a2) -ListMenuCallSelectionChangedCallback: @ 81AF000 - push {r4,lr} - adds r2, r0, 0 - lsls r1, 24 - lsrs r4, r1, 24 - ldr r3, [r2, 0x4] - cmp r3, 0 - beq _081AF022 - ldrh r0, [r2, 0x18] - ldrh r1, [r2, 0x1A] - adds r0, r1 - ldr r1, [r2] - lsls r0, 3 - adds r0, r1 - ldr r0, [r0, 0x4] - adds r1, r4, 0 - bl _call_via_r3 -_081AF022: - pop {r4} - pop {r0} - bx r0 - thumb_func_end ListMenuCallSelectionChangedCallback - - thumb_func_start sub_81AF028 -sub_81AF028: @ 81AF028 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsls r2, 24 - lsrs r2, 24 - ldr r6, =gUnknown_03006300 - movs r5, 0xF - ands r0, r5 - ldrb r3, [r6] - mov r8, r3 - movs r4, 0x10 - negs r4, r4 - adds r3, r4, 0 - mov r7, r8 - ands r3, r7 - orrs r3, r0 - lsrs r1, 20 - ands r3, r5 - orrs r3, r1 - strb r3, [r6] - ands r2, r5 - ldrb r0, [r6, 0x1] - ands r4, r0 - orrs r4, r2 - strb r4, [r6, 0x1] - ldrb r0, [r6, 0x3] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r6, 0x3] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AF028 - - thumb_func_start sub_81AF078 -sub_81AF078: @ 81AF078 - push {lr} - lsls r1, 24 - cmp r1, 0 - bne _081AF086 - movs r0, 0x5 - bl PlaySE -_081AF086: - pop {r0} - bx r0 - thumb_func_end sub_81AF078 - - thumb_func_start sub_81AF08C -sub_81AF08C: @ 81AF08C - 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 r2, r1, r0 - cmp r3, 0x10 - bhi _081AF154 - lsls r0, r3, 2 - ldr r1, =_081AF0B8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081AF0B8: - .4byte _081AF0FC - .4byte _081AF0FC - .4byte _081AF100 - .4byte _081AF104 - .4byte _081AF108 - .4byte _081AF10C - .4byte _081AF110 - .4byte _081AF114 - .4byte _081AF118 - .4byte _081AF11C - .4byte _081AF122 - .4byte _081AF12A - .4byte _081AF130 - .4byte _081AF138 - .4byte _081AF140 - .4byte _081AF146 - .4byte _081AF14E -_081AF0FC: - ldr r0, [r2, 0x4] - b _081AF158 -_081AF100: - ldrh r0, [r2, 0xC] - b _081AF158 -_081AF104: - ldrh r0, [r2, 0xE] - b _081AF158 -_081AF108: - ldrb r0, [r2, 0x10] - b _081AF158 -_081AF10C: - ldrb r0, [r2, 0x11] - b _081AF158 -_081AF110: - ldrb r0, [r2, 0x12] - b _081AF158 -_081AF114: - ldrb r0, [r2, 0x13] - b _081AF158 -_081AF118: - ldrb r0, [r2, 0x14] - b _081AF124 -_081AF11C: - ldrb r0, [r2, 0x14] - lsrs r0, 4 - b _081AF158 -_081AF122: - ldrb r0, [r2, 0x15] -_081AF124: - lsls r0, 28 - lsrs r0, 28 - b _081AF158 -_081AF12A: - ldrb r0, [r2, 0x15] - lsrs r0, 4 - b _081AF158 -_081AF130: - ldrb r0, [r2, 0x16] - lsls r0, 29 - lsrs r0, 29 - b _081AF158 -_081AF138: - ldrb r0, [r2, 0x16] - lsls r0, 26 - lsrs r0, 29 - b _081AF158 -_081AF140: - ldrb r0, [r2, 0x16] - lsrs r0, 6 - b _081AF158 -_081AF146: - ldrb r0, [r2, 0x17] - lsls r0, 26 - lsrs r0, 26 - b _081AF158 -_081AF14E: - ldrb r0, [r2, 0x17] - lsrs r0, 6 - b _081AF158 -_081AF154: - movs r0, 0x1 - negs r0, r0 -_081AF158: - pop {r1} - bx r1 - thumb_func_end sub_81AF08C - - thumb_func_start sub_81AF15C -sub_81AF15C: @ 81AF15C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r3, r1, r0 - cmp r4, 0x10 - bhi _081AF25C - lsls r0, r4, 2 - ldr r1, =_081AF188 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081AF188: - .4byte _081AF1CC - .4byte _081AF1CC - .4byte _081AF1D0 - .4byte _081AF1D4 - .4byte _081AF1D8 - .4byte _081AF1DC - .4byte _081AF1E0 - .4byte _081AF1E4 - .4byte _081AF1E8 - .4byte _081AF1F4 - .4byte _081AF202 - .4byte _081AF20E - .4byte _081AF21C - .4byte _081AF228 - .4byte _081AF236 - .4byte _081AF244 - .4byte _081AF250 -_081AF1CC: - str r2, [r3, 0x4] - b _081AF25C -_081AF1D0: - strh r2, [r3, 0xC] - b _081AF25C -_081AF1D4: - strh r2, [r3, 0xE] - b _081AF25C -_081AF1D8: - strb r2, [r3, 0x10] - b _081AF25C -_081AF1DC: - strb r2, [r3, 0x11] - b _081AF25C -_081AF1E0: - strb r2, [r3, 0x12] - b _081AF25C -_081AF1E4: - strb r2, [r3, 0x13] - b _081AF25C -_081AF1E8: - movs r0, 0xF - ands r2, r0 - ldrb r1, [r3, 0x14] - movs r0, 0x10 - negs r0, r0 - b _081AF1FA -_081AF1F4: - lsls r2, 4 - ldrb r1, [r3, 0x14] - movs r0, 0xF -_081AF1FA: - ands r0, r1 - orrs r0, r2 - strb r0, [r3, 0x14] - b _081AF25C -_081AF202: - movs r0, 0xF - ands r2, r0 - ldrb r1, [r3, 0x15] - movs r0, 0x10 - negs r0, r0 - b _081AF214 -_081AF20E: - lsls r2, 4 - ldrb r1, [r3, 0x15] - movs r0, 0xF -_081AF214: - ands r0, r1 - orrs r0, r2 - strb r0, [r3, 0x15] - b _081AF25C -_081AF21C: - movs r0, 0x7 - ands r2, r0 - ldrb r1, [r3, 0x16] - movs r0, 0x8 - negs r0, r0 - b _081AF23C -_081AF228: - movs r0, 0x7 - ands r2, r0 - lsls r2, 3 - ldrb r1, [r3, 0x16] - movs r0, 0x39 - negs r0, r0 - b _081AF23C -_081AF236: - lsls r2, 6 - ldrb r1, [r3, 0x16] - movs r0, 0x3F -_081AF23C: - ands r0, r1 - orrs r0, r2 - strb r0, [r3, 0x16] - b _081AF25C -_081AF244: - movs r0, 0x3F - ands r2, r0 - ldrb r1, [r3, 0x17] - movs r0, 0x40 - negs r0, r0 - b _081AF256 -_081AF250: - lsls r2, 6 - ldrb r1, [r3, 0x17] - movs r0, 0x3F -_081AF256: - ands r0, r1 - orrs r0, r2 - strb r0, [r3, 0x17] -_081AF25C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81AF15C - - thumb_func_start sub_81AF264 -sub_81AF264: @ 81AF264 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _081AF276 - cmp r0, 0x1 - beq _081AF28A - b _081AF2E4 -_081AF276: - ldrh r1, [r4, 0x30] - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartSpriteAnim - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _081AF2E4 -_081AF28A: - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _081AF29A - cmp r0, 0x1 - beq _081AF2C0 - ldrh r2, [r4, 0x38] - b _081AF2DE -_081AF29A: - movs r0, 0x34 - ldrsh r3, [r4, r0] - ldr r1, =gSineTable - ldrh r2, [r4, 0x38] - lsls r0, r2, 24 - lsrs r0, 23 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - muls r0, r3 - cmp r0, 0 - bge _081AF2B4 - adds r0, 0xFF -_081AF2B4: - asrs r0, 8 - strh r0, [r4, 0x24] - b _081AF2DE - .pool -_081AF2C0: - movs r0, 0x34 - ldrsh r3, [r4, r0] - ldr r1, =gSineTable - ldrh r2, [r4, 0x38] - lsls r0, r2, 24 - lsrs r0, 23 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - muls r0, r3 - cmp r0, 0 - bge _081AF2DA - adds r0, 0xFF -_081AF2DA: - asrs r0, 8 - strh r0, [r4, 0x26] -_081AF2DE: - ldrh r0, [r4, 0x36] - adds r0, r2, r0 - strh r0, [r4, 0x38] -_081AF2E4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AF264 - - thumb_func_start AddScrollIndicatorArrowObject -AddScrollIndicatorArrowObject: @ 81AF2F0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x18 - adds r6, r0, 0 - ldr r5, [sp, 0x30] - lsls r6, 24 - lsrs r6, 24 - mov r8, r6 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r5, 16 - lsrs r5, 16 - mov r12, r5 - mov r4, sp - ldr r0, =gUnknown_08614244 - ldm r0!, {r5-r7} - stm r4!, {r5-r7} - ldm r0!, {r5-r7} - stm r4!, {r5-r7} - mov r0, sp - movs r4, 0 - strh r3, [r0] - mov r3, r12 - strh r3, [r0, 0x2] - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gSprites - lsls r3, r0, 4 - adds r3, r0 - lsls r3, 2 - adds r3, r1 - adds r5, r3, 0 - adds r5, 0x3E - ldrb r1, [r5] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r5] - strh r4, [r3, 0x2E] - ldr r1, =gUnknown_086141FC - mov r5, r8 - lsls r6, r5, 2 - adds r6, r1 - ldrb r2, [r6] - lsls r1, r2, 28 - lsrs r1, 28 - strh r1, [r3, 0x30] - lsrs r2, 4 - strh r2, [r3, 0x32] - ldrb r1, [r6, 0x1] - strh r1, [r3, 0x34] - ldrh r1, [r6, 0x2] - strh r1, [r3, 0x36] - strh r4, [r3, 0x38] - add sp, 0x18 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end AddScrollIndicatorArrowObject - - thumb_func_start AddScrollIndicatorArrowPair -AddScrollIndicatorArrowPair: @ 81AF380 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x14 - adds r6, r0, 0 - mov r9, r1 - ldr r0, =gUnknown_086142C8 - str r0, [sp, 0x4] - ldr r5, =0xffff0000 - ldr r0, [sp, 0x8] - ands r0, r5 - movs r1, 0x80 - lsls r1, 1 - orrs r0, r1 - ldrh r1, [r6, 0xA] - lsls r1, 16 - ldr r4, =0x0000ffff - ands r0, r4 - orrs r0, r1 - str r0, [sp, 0x8] - add r0, sp, 0x4 - bl LoadCompressedObjectPic - ldrh r2, [r6, 0xC] - cmp r2, r4 - bne _081AF3DC - ldr r0, =gUnknown_086142A8 - ldrb r1, [r6, 0xE] - lsls r1, 20 - movs r2, 0x80 - lsls r2, 17 - adds r1, r2 - lsrs r1, 16 - movs r2, 0x20 - bl LoadPalette - b _081AF3EE - .pool -_081AF3DC: - ldr r0, =gUnknown_086142A8 - str r0, [sp, 0xC] - add r0, sp, 0xC - ldr r1, [r0, 0x4] - ands r1, r5 - orrs r1, r2 - str r1, [r0, 0x4] - bl LoadSpritePalette -_081AF3EE: - ldr r0, =Task_ScrollIndicatorArrowPair - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r0, 2 - add r0, r8 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r7, r0, r1 - movs r0, 0 - strb r0, [r7] - mov r0, r9 - str r0, [r7, 0x4] - ldrh r0, [r6, 0x6] - strh r0, [r7, 0x8] - ldrh r0, [r6, 0x8] - strh r0, [r7, 0xA] - ldrh r0, [r6, 0xA] - strh r0, [r7, 0xE] - ldrh r0, [r6, 0xC] - strh r0, [r7, 0x10] - ldrb r0, [r6] - ldrb r1, [r6, 0x1] - ldrb r2, [r6, 0x2] - ldrh r3, [r6, 0xA] - ldrh r4, [r6, 0xC] - str r4, [sp] - bl AddScrollIndicatorArrowObject - strb r0, [r7, 0xC] - ldrb r0, [r6, 0x3] - ldrb r1, [r6, 0x4] - ldrb r2, [r6, 0x5] - ldrh r3, [r6, 0xA] - ldrh r4, [r6, 0xC] - str r4, [sp] - bl AddScrollIndicatorArrowObject - strb r0, [r7, 0xD] - ldrh r1, [r6, 0xC] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _081AF47C - ldr r5, =gSprites - ldrb r0, [r7, 0xC] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r3, [r6, 0xE] - lsls r3, 4 - ldrb r4, [r1, 0x5] - movs r2, 0xF - adds r0, r2, 0 - ands r0, r4 - orrs r0, r3 - strb r0, [r1, 0x5] - ldrb r1, [r7, 0xD] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r1, [r6, 0xE] - lsls r1, 4 - ldrb r3, [r0, 0x5] - ands r2, r3 - orrs r2, r1 - strb r2, [r0, 0x5] -_081AF47C: - mov r0, r8 - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end AddScrollIndicatorArrowPair - - thumb_func_start AddScrollIndicatorArrowPairParametrized -AddScrollIndicatorArrowPairParametrized: @ 81AF4A0 - push {r4,lr} - adds r4, r1, 0 - subs r0, 0x2 - cmp r0, 0x1 - bhi _081AF4C4 - ldr r0, =gUnknown_0203CE8C - movs r1, 0x2 - strb r1, [r0] - strb r4, [r0, 0x1] - strb r2, [r0, 0x2] - movs r1, 0x3 - strb r1, [r0, 0x3] - strb r4, [r0, 0x4] - strb r3, [r0, 0x5] - b _081AF4D6 - .pool -_081AF4C4: - ldr r0, =gUnknown_0203CE8C - movs r1, 0 - strb r1, [r0] - strb r2, [r0, 0x1] - strb r4, [r0, 0x2] - movs r1, 0x1 - strb r1, [r0, 0x3] - strb r3, [r0, 0x4] - strb r4, [r0, 0x5] -_081AF4D6: - adds r2, r0, 0 - movs r1, 0 - movs r0, 0 - strh r0, [r2, 0x6] - ldr r0, [sp, 0x8] - strh r0, [r2, 0x8] - ldr r0, [sp, 0xC] - strh r0, [r2, 0xA] - ldr r0, [sp, 0x10] - strh r0, [r2, 0xC] - strb r1, [r2, 0xE] - adds r0, r2, 0 - ldr r1, [sp, 0x14] - bl AddScrollIndicatorArrowPair - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end AddScrollIndicatorArrowPairParametrized - - thumb_func_start Task_ScrollIndicatorArrowPair -Task_ScrollIndicatorArrowPair: @ 81AF504 - 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 r4, r1, r0 - ldr r0, [r4, 0x4] - ldrh r5, [r0] - ldrh r0, [r4, 0x8] - cmp r5, r0 - bne _081AF548 - ldr r0, =0x0000ffff - cmp r5, r0 - beq _081AF548 - ldr r3, =gSprites - ldrb r1, [r4, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - b _081AF55E - .pool -_081AF548: - ldr r3, =gSprites - ldrb r1, [r4, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 -_081AF55E: - strb r1, [r0] - ldrh r0, [r4, 0xA] - cmp r5, r0 - bne _081AF580 - ldrb r1, [r4, 0xD] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - b _081AF594 - .pool -_081AF580: - ldrb r1, [r4, 0xD] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 -_081AF594: - strb r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end Task_ScrollIndicatorArrowPair - - thumb_func_start Task_ScrollIndicatorArrowPairOnMainMenu -Task_ScrollIndicatorArrowPairOnMainMenu: @ 81AF59C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r4, r1, r0 - movs r1, 0x1E - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _081AF5E8 - ldr r3, =gSprites - ldrb r1, [r4, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - ldrb r1, [r4, 0xD] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - b _081AF612 - .pool -_081AF5E8: - ldr r3, =gSprites - ldrb r1, [r4, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldrb r1, [r4, 0xD] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 -_081AF612: - strb r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end Task_ScrollIndicatorArrowPairOnMainMenu - - thumb_func_start RemoveScrollIndicatorArrowPair -RemoveScrollIndicatorArrowPair: @ 81AF620 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r5, r0, r1 - ldrh r0, [r5, 0xE] - ldr r4, =0x0000ffff - cmp r0, r4 - beq _081AF63E - bl FreeSpriteTilesByTag -_081AF63E: - ldrh r0, [r5, 0x10] - cmp r0, r4 - beq _081AF648 - bl FreeSpritePaletteByTag -_081AF648: - ldrb r1, [r5, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =gSprites - adds r0, r4 - bl DestroySprite - ldrb r1, [r5, 0xD] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl DestroySprite - adds r0, r6, 0 - bl DestroyTask - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end RemoveScrollIndicatorArrowPair - - thumb_func_start ListMenuAddCursorObjectInternal -ListMenuAddCursorObjectInternal: @ 81AF680 - push {lr} - cmp r1, 0 - beq _081AF68A - cmp r1, 0x1 - beq _081AF690 -_081AF68A: - bl ListMenuAddRedOutlineCursorObject - b _081AF694 -_081AF690: - bl ListMenuAddRedArrowCursorObject -_081AF694: - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end ListMenuAddCursorObjectInternal - - thumb_func_start ListMenuUpdateCursorObject -@ void ListMenuUpdateCursorObject(u8 taskId, u16 x, u16 y, u32 a4) -ListMenuUpdateCursorObject: @ 81AF69C - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 16 - lsrs r2, 16 - cmp r3, 0 - beq _081AF6B4 - cmp r3, 0x1 - beq _081AF6BA - b _081AF6BE -_081AF6B4: - bl ListMenuUpdateRedOutlineCursorObject - b _081AF6BE -_081AF6BA: - bl ListMenuUpdateRedArrowCursorObject -_081AF6BE: - pop {r0} - bx r0 - thumb_func_end ListMenuUpdateCursorObject - - thumb_func_start ListMenuRemoveCursorObject -ListMenuRemoveCursorObject: @ 81AF6C4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r1, 0 - beq _081AF6D4 - cmp r1, 0x1 - beq _081AF6DA - b _081AF6DE -_081AF6D4: - bl ListMenuRemoveRedOutlineCursorObject - b _081AF6DE -_081AF6DA: - bl ListMenuRemoveRedArrowCursorObject -_081AF6DE: - pop {r0} - bx r0 - thumb_func_end ListMenuRemoveCursorObject - - thumb_func_start Task_RedOutlineCursor -Task_RedOutlineCursor: @ 81AF6E4 - bx lr - thumb_func_end Task_RedOutlineCursor - - thumb_func_start ListMenuGetRedOutlineCursorSpriteCount -ListMenuGetRedOutlineCursorSpriteCount: @ 81AF6E8 - push {lr} - lsls r0, 16 - lsrs r0, 16 - lsls r1, 16 - lsrs r1, 16 - movs r3, 0x4 - cmp r0, 0x10 - bls _081AF708 - movs r2, 0x8 - subs r0, 0x8 - cmp r2, r0 - bge _081AF708 -_081AF700: - adds r3, 0x2 - adds r2, 0x8 - cmp r2, r0 - blt _081AF700 -_081AF708: - cmp r1, 0x10 - bls _081AF71C - movs r2, 0x8 - subs r1, 0x8 - cmp r2, r1 - bge _081AF71C -_081AF714: - adds r3, 0x2 - adds r2, 0x8 - cmp r2, r1 - blt _081AF714 -_081AF71C: - lsls r0, r3, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end ListMenuGetRedOutlineCursorSpriteCount - - thumb_func_start ListMenuSetUpRedOutlineCursorSpriteOamTable -ListMenuSetUpRedOutlineCursorSpriteOamTable: @ 81AF724 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r3, r2, 0 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r1, 16 - lsrs r1, 16 - mov r9, r1 - ldr r0, =gUnknown_0861425C - ldr r0, [r0] - str r0, [r3] - movs r1, 0x88 - strb r1, [r3] - strb r1, [r3, 0x1] - ldr r0, =gUnknown_08614260 - ldr r0, [r0] - str r0, [r3, 0x4] - mov r2, r8 - adds r2, 0x80 - strb r2, [r3, 0x4] - strb r1, [r3, 0x5] - ldr r0, =gUnknown_08614274 - ldr r0, [r0] - str r0, [r3, 0x8] - strb r1, [r3, 0x8] - mov r4, r9 - adds r4, 0x80 - strb r4, [r3, 0x9] - ldr r0, =gUnknown_08614278 - ldr r0, [r0] - str r0, [r3, 0xC] - strb r2, [r3, 0xC] - strb r4, [r3, 0xD] - movs r0, 0x4 - mov r12, r0 - mov r2, r8 - cmp r2, 0x10 - bls _081AF7B8 - movs r2, 0x8 - mov r5, r8 - subs r5, 0x8 - cmp r2, r5 - bge _081AF7B8 - ldr r0, =gUnknown_08614264 - ldr r0, [r0] - str r0, [sp] - ldr r0, =gUnknown_08614270 - ldr r6, [r0] - adds r1, r3, 0 - adds r1, 0x10 - movs r7, 0x88 - mov r10, r7 -_081AF796: - ldr r0, [sp] - str r0, [r1] - adds r0, r2, 0 - subs r0, 0x78 - strb r0, [r1] - mov r7, r10 - strb r7, [r1, 0x1] - adds r1, 0x4 - str r6, [r1] - strb r0, [r1] - strb r4, [r1, 0x1] - adds r1, 0x4 - movs r0, 0x2 - add r12, r0 - adds r2, 0x8 - cmp r2, r5 - blt _081AF796 -_081AF7B8: - mov r2, r9 - cmp r2, 0x10 - bls _081AF7F6 - movs r1, 0x8 - mov r4, r9 - subs r4, 0x8 - cmp r1, r4 - bge _081AF7F6 - ldr r0, =gUnknown_08614268 - ldr r6, [r0] - ldr r0, =gUnknown_0861426C - ldr r5, [r0] - mov r7, r12 - lsls r0, r7, 2 - adds r2, r0, r3 - movs r7, 0x88 - mov r3, r8 - adds r3, 0x80 -_081AF7DC: - str r6, [r2] - strb r7, [r2] - adds r0, r1, 0 - subs r0, 0x78 - strb r0, [r2, 0x1] - adds r2, 0x4 - str r5, [r2] - strb r3, [r2] - strb r0, [r2, 0x1] - adds r2, 0x4 - adds r1, 0x8 - cmp r1, r4 - blt _081AF7DC -_081AF7F6: - 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 ListMenuSetUpRedOutlineCursorSpriteOamTable - - thumb_func_start ListMenuAddRedOutlineCursorObject -ListMenuAddRedOutlineCursorObject: @ 81AF828 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x28 - adds r6, r0, 0 - ldr r0, =gUnknown_08614338 - str r0, [sp, 0x18] - ldr r5, =0xffff0000 - add r0, sp, 0x18 - ldr r1, [r0, 0x4] - ands r1, r5 - movs r2, 0x80 - lsls r2, 1 - orrs r1, r2 - ldrh r2, [r6, 0x6] - lsls r2, 16 - ldr r3, =0x0000ffff - ands r1, r3 - orrs r1, r2 - str r1, [r0, 0x4] - bl LoadCompressedObjectPic - ldrh r2, [r6, 0x8] - ldr r7, =0x0000ffff - cmp r2, r7 - bne _081AF884 - ldr r0, =gUnknown_086142A8 - ldrb r1, [r6, 0xA] - lsls r1, 20 - movs r2, 0x80 - lsls r2, 17 - adds r1, r2 - lsrs r1, 16 - movs r2, 0x20 - bl LoadPalette - b _081AF896 - .pool -_081AF884: - ldr r0, =gUnknown_086142A8 - str r0, [sp, 0x20] - add r0, sp, 0x20 - ldr r1, [r0, 0x4] - ands r1, r5 - orrs r1, r2 - str r1, [r0, 0x4] - bl LoadSpritePalette -_081AF896: - ldr r0, =Task_RedOutlineCursor - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r5, r0, r1 - ldrh r0, [r6, 0x6] - movs r3, 0 - mov r8, r3 - strh r0, [r5, 0xE] - ldrh r0, [r6, 0x8] - strh r0, [r5, 0x10] - ldrh r0, [r6, 0x2] - ldrh r1, [r6, 0x4] - bl ListMenuGetRedOutlineCursorSpriteCount - strb r0, [r5] - ldrb r0, [r5] - lsls r0, 2 - bl Alloc - adds r2, r0, 0 - str r2, [r5, 0x8] - str r2, [r5, 0x4] - ldrh r0, [r6, 0x2] - ldrh r1, [r6, 0x4] - bl ListMenuSetUpRedOutlineCursorSpriteOamTable - mov r1, sp - ldr r0, =gDummySpriteTemplate - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - mov r1, sp - ldrh r0, [r6, 0x6] - strh r0, [r1] - ldrh r0, [r6, 0x8] - strh r0, [r1, 0x2] - ldrb r1, [r6] - adds r1, 0x78 - ldrb r2, [r6, 0x1] - adds r2, 0x78 - mov r0, sp - movs r3, 0 - bl CreateSprite - strb r0, [r5, 0xC] - ldrb r1, [r5, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r7, =gSprites - adds r0, r7 - adds r1, r5, 0 - bl SetSubspriteTables - ldrb r0, [r5, 0xC] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r7 - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x5] - ldrb r1, [r5, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - adds r0, 0x43 - mov r1, r8 - strb r1, [r0] - ldrb r1, [r5, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - adds r0, 0x42 - ldrb r2, [r0] - movs r1, 0x40 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - ldrh r1, [r6, 0x8] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _081AF96E - ldrb r0, [r5, 0xC] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r7 - ldrb r2, [r6, 0xA] - lsls r2, 4 - ldrb r3, [r1, 0x5] - movs r0, 0xF - ands r0, r3 - orrs r0, r2 - strb r0, [r1, 0x5] -_081AF96E: - adds r0, r4, 0 - add sp, 0x28 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end ListMenuAddRedOutlineCursorObject - - thumb_func_start ListMenuUpdateRedOutlineCursorObject -@ void ListMenuUpdateRedOutlineCursorObject(u8 taskId, u16 x, u16 y) -ListMenuUpdateRedOutlineCursorObject: @ 81AF994 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 16 - lsrs r2, 16 - lsls r3, r0, 2 - adds r3, r0 - lsls r3, 3 - ldr r0, =gTasks + 0x8 - adds r3, r0 - ldr r5, =gSprites - ldrb r4, [r3, 0xC] - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r5 - adds r1, 0x78 - strh r1, [r0, 0x20] - ldrb r1, [r3, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r2, 0x78 - strh r2, [r0, 0x22] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ListMenuUpdateRedOutlineCursorObject - - thumb_func_start ListMenuRemoveRedOutlineCursorObject -ListMenuRemoveRedOutlineCursorObject: @ 81AF9D8 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldr r0, [r4, 0x8] - bl Free - ldrh r0, [r4, 0xE] - ldr r6, =0x0000ffff - cmp r0, r6 - beq _081AF9FC - bl FreeSpriteTilesByTag -_081AF9FC: - ldrh r0, [r4, 0x10] - cmp r0, r6 - beq _081AFA06 - bl FreeSpritePaletteByTag -_081AFA06: - ldrb r1, [r4, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySprite - adds r0, r5, 0 - bl DestroyTask - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end ListMenuRemoveRedOutlineCursorObject - - thumb_func_start ObjectCB_RedArrowCursor -ObjectCB_RedArrowCursor: @ 81AFA30 - push {lr} - adds r2, r0, 0 - ldr r1, =gSineTable - ldrh r3, [r2, 0x2E] - lsls r0, r3, 24 - lsrs r0, 23 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bge _081AFA48 - adds r0, 0x3F -_081AFA48: - asrs r0, 6 - strh r0, [r2, 0x24] - adds r0, r3, 0 - adds r0, 0x8 - strh r0, [r2, 0x2E] - pop {r0} - bx r0 - .pool - thumb_func_end ObjectCB_RedArrowCursor - - thumb_func_start Task_RedArrowCursor -Task_RedArrowCursor: @ 81AFA5C - bx lr - thumb_func_end Task_RedArrowCursor - - thumb_func_start ListMenuAddRedArrowCursorObject -ListMenuAddRedArrowCursorObject: @ 81AFA60 - push {r4-r7,lr} - sub sp, 0x28 - adds r5, r0, 0 - ldr r0, =gUnknown_08614378 - str r0, [sp, 0x18] - ldr r6, =0xffff0000 - add r0, sp, 0x18 - ldr r1, [r0, 0x4] - ands r1, r6 - movs r2, 0x80 - orrs r1, r2 - ldrh r2, [r5, 0x6] - lsls r2, 16 - ldr r4, =0x0000ffff - ands r1, r4 - orrs r1, r2 - str r1, [r0, 0x4] - bl LoadCompressedObjectPic - ldrh r2, [r5, 0x8] - cmp r2, r4 - bne _081AFAB4 - ldr r0, =gUnknown_086142A8 - ldrb r1, [r5, 0xA] - lsls r1, 20 - movs r2, 0x80 - lsls r2, 17 - adds r1, r2 - lsrs r1, 16 - movs r2, 0x20 - bl LoadPalette - b _081AFAC6 - .pool -_081AFAB4: - ldr r0, =gUnknown_086142A8 - str r0, [sp, 0x20] - add r0, sp, 0x20 - ldr r1, [r0, 0x4] - ands r1, r6 - orrs r1, r2 - str r1, [r0, 0x4] - bl LoadSpritePalette -_081AFAC6: - ldr r0, =Task_RedArrowCursor - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldrh r0, [r5, 0x6] - strh r0, [r4, 0x2] - ldrh r0, [r5, 0x8] - strh r0, [r4, 0x4] - mov r1, sp - ldr r0, =gUnknown_08614290 - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - mov r1, sp - ldrh r0, [r5, 0x6] - strh r0, [r1] - ldrh r0, [r5, 0x8] - strh r0, [r1, 0x2] - ldrb r1, [r5] - ldrb r2, [r5, 0x1] - mov r0, sp - movs r3, 0 - bl CreateSprite - strb r0, [r4] - ldr r3, =gSprites - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r2, 0x8 - strh r2, [r0, 0x24] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r2, [r0, 0x26] - ldrh r1, [r5, 0x8] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _081AFB46 - ldrb r0, [r4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r2, [r5, 0xA] - lsls r2, 4 - ldrb r3, [r1, 0x5] - movs r0, 0xF - ands r0, r3 - orrs r0, r2 - strb r0, [r1, 0x5] -_081AFB46: - adds r0, r6, 0 - add sp, 0x28 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end ListMenuAddRedArrowCursorObject - - thumb_func_start ListMenuUpdateRedArrowCursorObject -@ void ListMenuUpdateRedArrowCursorObject(u8 taskId, u16 x, u16 y) -ListMenuUpdateRedArrowCursorObject: @ 81AFB68 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r3, r0, 2 - adds r3, r0 - lsls r3, 3 - ldr r0, =gTasks + 0x8 - adds r3, r0 - ldr r5, =gSprites - ldrb r4, [r3] - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r5 - strh r1, [r0, 0x20] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r2, [r0, 0x22] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ListMenuUpdateRedArrowCursorObject - - thumb_func_start ListMenuRemoveRedArrowCursorObject -ListMenuRemoveRedArrowCursorObject: @ 81AFBA0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldrh r0, [r4, 0x2] - ldr r6, =0x0000ffff - cmp r0, r6 - beq _081AFBBE - bl FreeSpriteTilesByTag -_081AFBBE: - ldrh r0, [r4, 0x4] - cmp r0, r6 - beq _081AFBC8 - bl FreeSpritePaletteByTag -_081AFBC8: - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySprite - adds r0, r5, 0 - bl DestroyTask - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end ListMenuRemoveRedArrowCursorObject - - 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 - - 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 - - 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 - - thumb_func_start sub_81B01B0 -sub_81B01B0: @ 81B01B0 - push {lr} - bl RunTasks - bl AnimateSprites - bl BuildOamBuffer - bl do_scheduled_bg_tilemap_copies_to_vram - bl UpdatePaletteFade - pop {r0} - bx r0 - thumb_func_end sub_81B01B0 - - thumb_func_start sub_81B01CC -sub_81B01CC: @ 81B01CC - push {lr} - bl LoadOam - bl ProcessSpriteCopyRequests - bl TransferPlttBuffer - pop {r0} - bx r0 - thumb_func_end sub_81B01CC - - thumb_func_start c2_811EBD0 -c2_811EBD0: @ 81B01E0 - push {lr} -_081B01E2: - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B0206 - bl sub_81B020C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B0206 - bl sub_81221AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B01E2 -_081B0206: - pop {r0} - bx r0 - thumb_func_end c2_811EBD0 - - thumb_func_start sub_81B020C -sub_81B020C: @ 81B020C - push {r4,lr} - sub sp, 0x4 - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r0, r1, r2 - ldrb r0, [r0] - adds r2, r1, 0 - cmp r0, 0x16 - bls _081B0222 - b _081B0498 -_081B0222: - lsls r0, 2 - ldr r1, =_081B0234 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081B0234: - .4byte _081B0290 - .4byte _081B02AC - .4byte _081B02B2 - .4byte _081B02D4 - .4byte _081B02DA - .4byte _081B02EC - .4byte _081B02FE - .4byte _081B0310 - .4byte _081B0338 - .4byte _081B0354 - .4byte _081B0368 - .4byte _081B038C - .4byte _081B03A0 - .4byte _081B03A6 - .4byte _081B03B8 - .4byte _081B03BE - .4byte _081B03E0 - .4byte _081B0400 - .4byte _081B0414 - .4byte _081B0428 - .4byte _081B0430 - .4byte _081B044C - .4byte _081B0474 -_081B0290: - bl SetVBlankHBlankCallbacksToNull - bl sub_8121DA0 - bl clear_scheduled_bg_copies_to_vram - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081B048C - .pool -_081B02AC: - bl remove_some_task - b _081B0484 -_081B02B2: - bl ResetPaletteFade - ldr r2, =gPaletteFade - ldrb r0, [r2, 0x8] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0x8] - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081B048C - .pool -_081B02D4: - bl ResetSpriteData - b _081B0484 -_081B02DA: - bl FreeAllSpritePalettes - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081B048C - .pool -_081B02EC: - bl sub_81221AC - lsls r0, 24 - cmp r0, 0 - beq _081B02F8 - b _081B0484 -_081B02F8: - bl ResetTasks - b _081B0484 -_081B02FE: - bl sub_81B209C - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081B048C - .pool -_081B0310: - bl sub_81B0550 - lsls r0, 24 - cmp r0, 0 - bne _081B0322 - bl sub_81B04BC - movs r0, 0x1 - b _081B04B2 -_081B0322: - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - movs r1, 0x86 - lsls r1, 2 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - b _081B0484 - .pool -_081B0338: - bl sub_81B05C8 - lsls r0, 24 - cmp r0, 0 - bne _081B0344 - b _081B04B0 -_081B0344: - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081B048C - .pool -_081B0354: - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0x8] - lsls r0, 26 - lsrs r0, 30 - bl sub_81B239C - b _081B0484 - .pool -_081B0368: - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0x8] - lsls r0, 26 - lsrs r0, 30 - bl sub_81B0740 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - movs r1, 0x86 - lsls r1, 2 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - b _081B0484 - .pool -_081B038C: - bl sub_81B5D30 - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081B048C - .pool -_081B03A0: - bl sub_81B6040 - b _081B0484 -_081B03A6: - bl sub_81B6160 - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081B048C - .pool -_081B03B8: - bl sub_80D2F04 - b _081B0484 -_081B03BE: - bl party_menu_add_per_mon_objects - lsls r0, 24 - cmp r0, 0 - bne _081B03CA - b _081B04B0 -_081B03CA: - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - movs r1, 0x86 - lsls r1, 2 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - b _081B0484 - .pool -_081B03E0: - bl sub_81B0DA0 - lsls r0, 24 - cmp r0, 0 - beq _081B04B0 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - movs r1, 0x86 - lsls r1, 2 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - b _081B0484 - .pool -_081B0400: - bl sub_81B0F28 - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081B048C - .pool -_081B0414: - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 31 - lsrs r0, 31 - bl sub_81B2428 - b _081B0484 - .pool -_081B0428: - movs r0, 0x87 - lsls r0, 3 - adds r1, r2, r0 - b _081B048C -_081B0430: - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - ldr r0, [r0] - movs r1, 0 - bl CreateTask - ldr r0, [r4] - ldrh r0, [r0, 0xA] - lsrs r0, 2 - bl display_pokemon_menu_message - b _081B0484 - .pool -_081B044C: - movs r0, 0x1 - negs r0, r0 - movs r1, 0x10 - movs r2, 0 - bl BlendPalettes - ldr r2, =gPaletteFade - ldrb r1, [r2, 0x8] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2, 0x8] - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081B048C - .pool -_081B0474: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade -_081B0484: - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 -_081B048C: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _081B04B0 - .pool -_081B0498: - ldr r0, =sub_81B01CC - bl SetVBlankCallback - ldr r0, =sub_81B01B0 - bl SetMainCallback2 - movs r0, 0x1 - b _081B04B2 - .pool -_081B04B0: - movs r0, 0 -_081B04B2: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81B020C - - thumb_func_start sub_81B04BC -sub_81B04BC: @ 81B04BC - push {lr} - sub sp, 0x4 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r0, =sub_81B04F8 - movs r1, 0 - bl CreateTask - ldr r0, =sub_81B01CC - bl SetVBlankCallback - ldr r0, =sub_81B01B0 - bl SetMainCallback2 - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B04BC - - thumb_func_start sub_81B04F8 -sub_81B04F8: @ 81B04F8 - 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 _081B051C - ldr r0, =gUnknown_0203CEC8 - ldr r0, [r0] - bl SetMainCallback2 - bl sub_81B06F4 - adds r0, r4, 0 - bl DestroyTask -_081B051C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B04F8 - - thumb_func_start reset_brm -reset_brm: @ 81B052C - ldr r0, =gUnknown_0203CEC4 - movs r1, 0 - str r1, [r0] - ldr r0, =gUnknown_0203CEE4 - str r1, [r0] - ldr r0, =gUnknown_0203CEDC - str r1, [r0] - ldr r0, =gUnknown_0203CEE0 - str r1, [r0] - bx lr - .pool - thumb_func_end reset_brm - - thumb_func_start sub_81B0550 -sub_81B0550: @ 81B0550 - push {r4,r5,lr} - ldr r5, =gUnknown_0203CEE4 - movs r4, 0x80 - lsls r4, 4 - adds r0, r4, 0 - bl Alloc - str r0, [r5] - cmp r0, 0 - beq _081B05C0 - movs r1, 0 - adds r2, r4, 0 - bl memset - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_086156B8 - movs r0, 0 - movs r2, 0x3 - bl InitBgsFromTemplates - ldr r1, [r5] - movs r0, 0x1 - bl SetBgTilemapBuffer - bl sub_8121E10 - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x1 - b _081B05C2 - .pool -_081B05C0: - movs r0, 0 -_081B05C2: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81B0550 - - thumb_func_start sub_81B05C8 -sub_81B05C8: @ 81B05C8 - push {r4,lr} - sub sp, 0x4 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - movs r1, 0x86 - lsls r1, 2 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0x7 - bhi _081B06B0 - lsls r0, 2 - ldr r1, =_081B05F0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081B05F0: - .4byte _081B0610 - .4byte _081B0638 - .4byte _081B0658 - .4byte _081B0684 - .4byte _081B0688 - .4byte _081B068C - .4byte _081B0690 - .4byte _081B0694 -_081B0610: - ldr r4, =gUnknown_0203CEE0 - ldr r0, =gUnknown_08D967EC - mov r1, sp - bl malloc_and_decompress - adds r1, r0, 0 - str r1, [r4] - ldr r2, [sp] - lsls r2, 16 - lsrs r2, 16 - movs r0, 0x1 - movs r3, 0 - bl LoadBgTiles - b _081B069A - .pool -_081B0638: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _081B06B4 - ldr r0, =gUnknown_08D96BA0 - ldr r1, =gUnknown_0203CEE4 - ldr r1, [r1] - bl LZDecompressWram - b _081B069A - .pool -_081B0658: - ldr r0, =gUnknown_08D96AB4 - movs r2, 0xB0 - lsls r2, 1 - movs r1, 0 - bl LoadCompressedPalette - ldr r0, =gPlttBufferUnfaded - ldr r4, =gUnknown_0203CEC4 - ldr r1, [r4] - adds r1, 0x18 - movs r2, 0xB0 - bl CpuSet - ldr r1, [r4] - b _081B069E - .pool -_081B0684: - movs r0, 0x4 - b _081B0696 -_081B0688: - movs r0, 0x5 - b _081B0696 -_081B068C: - movs r0, 0x6 - b _081B0696 -_081B0690: - movs r0, 0x7 - b _081B0696 -_081B0694: - movs r0, 0x8 -_081B0696: - bl sub_81B06C0 -_081B069A: - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] -_081B069E: - movs r0, 0x86 - lsls r0, 2 - adds r1, r0 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _081B06B4 - .pool -_081B06B0: - movs r0, 0x1 - b _081B06B6 -_081B06B4: - movs r0, 0 -_081B06B6: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81B05C8 - - thumb_func_start sub_81B06C0 -sub_81B06C0: @ 81B06C0 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 28 - ldr r5, =gPlttBufferUnfaded + 0x60 - lsrs r4, 23 - adds r1, r5, 0 - subs r1, 0x60 - adds r1, r4, r1 - adds r0, r5, 0 - movs r2, 0x10 - bl CpuSet - ldr r0, =gPlttBufferFaded - adds r4, r0 - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x10 - bl CpuSet - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B06C0 - - thumb_func_start sub_81B06F4 -sub_81B06F4: @ 81B06F4 - push {lr} - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - cmp r0, 0 - beq _081B0702 - bl Free -_081B0702: - ldr r0, =gUnknown_0203CEE4 - ldr r0, [r0] - cmp r0, 0 - beq _081B070E - bl Free -_081B070E: - ldr r0, =gUnknown_0203CEE0 - ldr r0, [r0] - cmp r0, 0 - beq _081B071A - bl Free -_081B071A: - ldr r0, =gUnknown_0203CEDC - ldr r0, [r0] - cmp r0, 0 - beq _081B0726 - bl Free -_081B0726: - bl FreeAllWindowBuffers - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B06F4 - - thumb_func_start sub_81B0740 -sub_81B0740: @ 81B0740 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r4, =gUnknown_0203CEDC - movs r0, 0x60 - bl Alloc - str r0, [r4] - movs r5, 0 - lsls r0, r7, 1 - adds r0, r7 - lsls r0, 4 - mov r8, r0 - movs r6, 0xFF - mov r9, r4 -_081B0764: - ldr r2, [r4] - lsls r3, r5, 4 - adds r2, r3, r2 - ldr r0, =gUnknown_086156E4 - mov r12, r0 - str r0, [r2] - lsls r0, r5, 3 - ldr r1, =gUnknown_08615704 - adds r0, r1 - add r0, r8 - str r0, [r2, 0x4] - strb r5, [r2, 0x8] - ldr r1, [r4] - adds r1, r3, r1 - ldrb r0, [r1, 0x9] - orrs r0, r6 - strb r0, [r1, 0x9] - ldr r1, [r4] - adds r1, r3, r1 - ldrb r0, [r1, 0xA] - orrs r0, r6 - strb r0, [r1, 0xA] - ldr r1, [r4] - adds r1, r3, r1 - ldrb r0, [r1, 0xB] - orrs r0, r6 - strb r0, [r1, 0xB] - ldr r0, [r4] - adds r3, r0 - ldrb r0, [r3, 0xC] - orrs r0, r6 - strb r0, [r3, 0xC] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _081B0764 - mov r1, r9 - ldr r0, [r1] - mov r1, r12 - subs r1, 0x20 - str r1, [r0] - cmp r7, 0x3 - bne _081B07CC - str r1, [r0, 0x30] - b _081B07D2 - .pool -_081B07CC: - cmp r7, 0 - beq _081B07D2 - str r1, [r0, 0x10] -_081B07D2: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81B0740 - - thumb_func_start sub_81B07E0 -sub_81B07E0: @ 81B07E0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gUnknown_0203CEC8 - ldrb r1, [r0, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x5 - bne _081B085C - cmp r5, 0x2 - bls _081B085C - adds r0, r5, 0 - bl sub_81B0CEC - ldr r0, =gUnknown_02022FF8 - subs r1, r5, 0x3 - lsls r1, 5 - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0 - bne _081B0828 - ldr r0, =gUnknown_0203CEDC - lsls r4, r5, 4 - ldr r0, [r0] - adds r0, r4 - movs r1, 0x40 - bl sub_81B2748 - b _081B0836 - .pool -_081B0828: - ldr r0, =gUnknown_0203CEDC - lsls r4, r5, 4 - ldr r0, [r0] - adds r0, r4 - movs r1, 0x8 - bl sub_81B2748 -_081B0836: - adds r5, r4, 0 - ldr r4, =gUnknown_0203CEDC - ldr r0, [r4] - adds r0, r5, r0 - ldrb r0, [r0, 0x8] - movs r1, 0x2 - bl CopyWindowToVram - ldr r0, [r4] - adds r0, r5, r0 - ldrb r0, [r0, 0x8] - bl PutWindowTilemap - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - b _081B093E - .pool -_081B085C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - bne _081B089C - ldr r4, =gUnknown_0203CEDC - ldr r0, [r4] - lsls r5, 4 - adds r0, r5, r0 - ldrb r0, [r0, 0x8] - bl sub_81B2720 - ldr r0, [r4] - adds r0, r5 - movs r1, 0x40 - bl sub_81B2748 - ldr r0, [r4] - adds r0, r5, r0 - ldrb r0, [r0, 0x8] - movs r1, 0x2 - bl CopyWindowToVram - b _081B092C - .pool -_081B089C: - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0x8] - movs r1, 0xF - ands r1, r0 - cmp r1, 0x7 - bne _081B08B4 - adds r0, r5, 0 - bl sub_81B0B60 - b _081B08F6 - .pool -_081B08B4: - cmp r1, 0x2 - bne _081B08C0 - adds r0, r5, 0 - bl sub_81B0B08 - b _081B08F6 -_081B08C0: - cmp r1, 0x4 - bne _081B08CC - adds r0, r5, 0 - bl sub_81B0A9C - b _081B08F6 -_081B08CC: - cmp r1, 0xB - bne _081B08D8 - adds r0, r5, 0 - bl sub_81B0B98 - b _081B08F6 -_081B08D8: - cmp r1, 0xC - bne _081B08E4 - adds r0, r5, 0 - bl sub_81B0BC4 - b _081B08F6 -_081B08E4: - adds r0, r5, 0 - bl sub_81B0BFC - lsls r0, 24 - cmp r0, 0 - bne _081B08F6 - adds r0, r5, 0 - bl sub_81B0948 -_081B08F6: - ldr r2, =gUnknown_0203CEC8 - ldrb r1, [r2, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x5 - bne _081B0910 - adds r0, r5, 0 - movs r1, 0 - bl sub_81B0FCC - b _081B092A - .pool -_081B0910: - movs r0, 0x9 - ldrsb r0, [r2, r0] - cmp r0, r5 - bne _081B0922 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_81B0FCC - b _081B092A -_081B0922: - adds r0, r5, 0 - movs r1, 0 - bl sub_81B0FCC -_081B092A: - lsls r5, 4 -_081B092C: - ldr r0, =gUnknown_0203CEDC - ldr r0, [r0] - adds r0, r5, r0 - ldrb r0, [r0, 0x8] - bl PutWindowTilemap - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram -_081B093E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B07E0 - - thumb_func_start sub_81B0948 -sub_81B0948: @ 81B0948 - push {r4-r7,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x64 - adds r1, r4, 0 - muls r1, r0 - ldr r0, =gPlayerParty - adds r7, r1, r0 - adds r0, r7, 0 - movs r1, 0x2D - bl GetMonData - adds r2, r0, 0 - cmp r2, 0 - beq _081B09A0 - ldr r6, =gUnknown_0203CEDC - ldr r0, [r6] - lsls r5, r4, 4 - adds r0, r5, r0 - ldr r2, [r0] - ldrb r0, [r0, 0x8] - movs r1, 0 - str r1, [sp] - movs r1, 0x1 - str r1, [sp, 0x4] - ldr r4, [r2] - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl _call_via_r4 - ldr r1, [r6] - adds r1, r5 - adds r0, r7, 0 - movs r2, 0 - bl sub_81B2A70 - b _081B0A02 - .pool -_081B09A0: - ldr r5, =gUnknown_0203CEDC - ldr r0, [r5] - lsls r4, 4 - adds r0, r4, r0 - ldr r1, [r0] - ldrb r0, [r0, 0x8] - str r2, [sp] - str r2, [sp, 0x4] - ldr r6, [r1] - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl _call_via_r6 - ldr r1, [r5] - adds r1, r4 - adds r0, r7, 0 - movs r2, 0 - bl sub_81B2A70 - ldr r1, [r5] - adds r1, r4 - adds r0, r7, 0 - movs r2, 0 - bl sub_81B2AC8 - ldr r1, [r5] - adds r1, r4 - adds r0, r7, 0 - movs r2, 0 - bl sub_81B2B8C - ldr r1, [r5] - adds r1, r4 - adds r0, r7, 0 - movs r2, 0 - bl sub_81B2CD4 - ldr r1, [r5] - adds r1, r4 - adds r0, r7, 0 - movs r2, 0 - bl sub_81B2D74 - ldr r1, [r5] - adds r1, r4 - adds r0, r7, 0 - bl sub_81B2E28 -_081B0A02: - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B0948 - - thumb_func_start sub_81B0A10 -sub_81B0A10: @ 81B0A10 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - movs r1, 0x64 - adds r2, r0, 0 - muls r2, r1 - ldr r1, =gPlayerParty - adds r6, r2, r1 - ldr r7, =gUnknown_0203CEDC - ldr r1, [r7] - lsls r5, r0, 4 - adds r1, r5, r1 - ldr r2, [r1] - ldrb r0, [r1, 0x8] - movs r1, 0 - str r1, [sp] - movs r1, 0x1 - str r1, [sp, 0x4] - ldr r4, [r2] - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl _call_via_r4 - ldr r1, [r7] - adds r1, r5 - adds r0, r6, 0 - movs r2, 0 - bl sub_81B2A70 - adds r0, r6, 0 - movs r1, 0x2D - bl GetMonData - cmp r0, 0 - bne _081B0A7C - ldr r1, [r7] - adds r1, r5 - adds r0, r6, 0 - movs r2, 0 - bl sub_81B2AC8 - ldr r1, [r7] - adds r1, r5 - adds r0, r6, 0 - movs r2, 0 - bl sub_81B2B8C -_081B0A7C: - ldr r1, [r7] - adds r1, r5 - mov r0, r8 - movs r2, 0 - bl sub_81B2FA8 - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B0A10 - - thumb_func_start sub_81B0A9C -sub_81B0A9C: @ 81B0A9C - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r6, =gUnknown_0203CEF8 - bl sub_81B85AC - lsls r0, 24 - cmp r0, 0 - bne _081B0AD6 - adds r0, r5, 0 - movs r1, 0x7 - bl sub_81B0A10 - b _081B0B02 - .pool -_081B0AC8: - adds r1, r4, 0x2 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl sub_81B0A10 - b _081B0B02 -_081B0AD6: - movs r4, 0 - b _081B0AEE -_081B0ADA: - adds r1, r6, r4 - ldrb r0, [r1] - cmp r0, 0 - beq _081B0AE8 - subs r0, 0x1 - cmp r0, r5 - beq _081B0AC8 -_081B0AE8: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_081B0AEE: - bl sub_81B8830 - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bcc _081B0ADA - adds r0, r5, 0 - movs r1, 0x1 - bl sub_81B0A10 -_081B0B02: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81B0A9C - - thumb_func_start sub_81B0B08 -sub_81B0B08: @ 81B0B08 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - bl sub_80DAE0C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bhi _081B0B5A - lsls r0, 2 - ldr r1, =_081B0B34 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081B0B34: - .4byte _081B0B48 - .4byte _081B0B52 - .4byte _081B0B52 - .4byte _081B0B48 - .4byte _081B0B48 -_081B0B48: - adds r0, r4, 0 - movs r1, 0x7 - bl sub_81B0A10 - b _081B0B5A -_081B0B52: - adds r0, r4, 0 - movs r1, 0x6 - bl sub_81B0A10 -_081B0B5A: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B0B08 - - thumb_func_start sub_81B0B60 -sub_81B0B60: @ 81B0B60 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - bl GetNumberOfRelearnableMoves - lsls r0, 24 - cmp r0, 0 - bne _081B0B88 - adds r0, r4, 0 - movs r1, 0x9 - bl sub_81B0A10 - b _081B0B90 - .pool -_081B0B88: - adds r0, r4, 0 - movs r1, 0x8 - bl sub_81B0A10 -_081B0B90: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B0B60 - - thumb_func_start sub_81B0B98 -sub_81B0B98: @ 81B0B98 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_81B218C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B0BB6 - adds r0, r4, 0 - movs r1, 0x6 - bl sub_81B0A10 - b _081B0BBE -_081B0BB6: - adds r0, r4, 0 - movs r1, 0x7 - bl sub_81B0A10 -_081B0BBE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B0B98 - - thumb_func_start sub_81B0BC4 -sub_81B0BC4: @ 81B0BC4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xC - bl GetMonData - cmp r0, 0 - beq _081B0BEC - adds r0, r4, 0 - movs r1, 0xB - bl sub_81B0A10 - b _081B0BF4 - .pool -_081B0BEC: - adds r0, r4, 0 - movs r1, 0xC - bl sub_81B0A10 -_081B0BF4: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B0BC4 - - thumb_func_start sub_81B0BFC -sub_81B0BFC: @ 81B0BFC - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =gPlayerParty - adds r6, r1, r0 - ldr r0, =gScriptItemId - ldrh r4, [r0] - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0xB] - cmp r0, 0xC - bne _081B0C40 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - ldr r0, =gSpecialVar_0x8005 - ldrb r2, [r0] - adds r0, r5, 0 - movs r1, 0 - bl sub_81B0C94 - b _081B0C8A - .pool -_081B0C40: - cmp r0, 0x3 - bne _081B0C56 - adds r0, r4, 0 - bl CheckIfItemIsTMHMOrEvolutionStone - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B0C5A - cmp r0, 0x2 - beq _081B0C66 -_081B0C56: - movs r0, 0 - b _081B0C8C -_081B0C5A: - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0 - bl sub_81B0C94 - b _081B0C8A -_081B0C66: - adds r0, r6, 0 - movs r1, 0x2D - bl GetMonData - cmp r0, 0 - bne _081B0C82 - adds r0, r6, 0 - movs r1, 0x3 - adds r2, r4, 0 - bl GetEvolutionTargetSpecies - lsls r0, 16 - cmp r0, 0 - bne _081B0C56 -_081B0C82: - adds r0, r5, 0 - movs r1, 0 - bl sub_81B0A10 -_081B0C8A: - movs r0, 0x1 -_081B0C8C: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81B0BFC - - thumb_func_start sub_81B0C94 -sub_81B0C94: @ 81B0C94 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x64 - muls r0, r4 - ldr r3, =gPlayerParty - adds r0, r3 - bl sub_81B22D8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - beq _081B0CD2 - cmp r0, 0x2 - bgt _081B0CC4 - cmp r0, 0x1 - beq _081B0CC8 - b _081B0CDC - .pool -_081B0CC4: - cmp r0, 0x3 - bne _081B0CDC -_081B0CC8: - adds r0, r4, 0 - movs r1, 0x9 - bl sub_81B0A10 - b _081B0CE4 -_081B0CD2: - adds r0, r4, 0 - movs r1, 0xA - bl sub_81B0A10 - b _081B0CE4 -_081B0CDC: - adds r0, r4, 0 - movs r1, 0x8 - bl sub_81B0A10 -_081B0CE4: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B0C94 - - thumb_func_start sub_81B0CEC -sub_81B0CEC: @ 81B0CEC - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0203CEDC - lsls r2, r0, 4 - ldr r1, [r1] - adds r6, r1, r2 - subs r0, 0x3 - lsls r0, 24 - ldr r5, =gUnknown_02022FF8 - lsrs r0, 19 - mov r8, r0 - adds r7, r0, r5 - ldrh r0, [r7] - cmp r0, 0 - bne _081B0D24 - ldrb r0, [r6, 0x8] - bl sub_81B2720 - b _081B0D8E - .pool -_081B0D24: - ldr r2, [r6] - ldrb r0, [r6, 0x8] - movs r1, 0 - str r1, [sp] - str r1, [sp, 0x4] - ldr r4, [r2] - movs r2, 0 - movs r3, 0 - bl _call_via_r4 - ldr r4, =gStringVar1 - adds r5, 0x4 - add r5, r8 - adds r0, r4, 0 - adds r1, r5, 0 - bl StringCopy - adds r0, r4, 0 - bl StringGetEnd10 - adds r0, r4, 0 - bl sub_81DB52C - ldrb r0, [r6, 0x8] - ldr r3, [r6] - adds r3, 0x4 - adds r1, r4, 0 - movs r2, 0 - bl sub_81B2A3C - ldrb r0, [r7, 0xF] - adds r1, r6, 0 - bl sub_81B2B40 - ldrb r0, [r7, 0x1C] - ldrh r1, [r7] - adds r2, r5, 0 - adds r3, r6, 0 - bl sub_81B2BF4 - ldrh r0, [r7, 0x10] - adds r1, r6, 0 - bl sub_81B2D3C - ldrh r0, [r7, 0x12] - adds r1, r6, 0 - bl sub_81B2DDC - ldrh r0, [r7, 0x10] - ldrh r1, [r7, 0x12] - adds r2, r6, 0 - bl sub_81B2E64 -_081B0D8E: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B0CEC - - thumb_func_start sub_81B0DA0 -sub_81B0DA0: @ 81B0DA0 - push {r4,r5,lr} - ldr r5, =gUnknown_0203CEC4 - ldr r0, [r5] - movs r4, 0x86 - lsls r4, 2 - adds r0, r4 - ldrb r0, [r0] - bl sub_81B07E0 - ldr r1, [r5] - adds r1, r4 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - beq _081B0DCC - movs r0, 0 - b _081B0DCE - .pool -_081B0DCC: - movs r0, 0x1 -_081B0DCE: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81B0DA0 - - thumb_func_start sub_81B0DD4 -sub_81B0DD4: @ 81B0DD4 - lsls r0, 16 - ldr r1, =gUnknown_0203CEE0 - lsrs r0, 11 - ldr r1, [r1] - adds r1, r0 - adds r0, r1, 0 - bx lr - .pool - thumb_func_end sub_81B0DD4 - - thumb_func_start party_menu_add_per_mon_objects_internal -party_menu_add_per_mon_objects_internal: @ 81B0DE8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =gUnknown_0203CEC8 - ldrb r1, [r0, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x5 - bne _081B0E98 - cmp r7, 0x2 - bls _081B0E98 - subs r0, r7, 0x3 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldr r0, =gUnknown_02022FF8 - mov r9, r0 - mov r2, r10 - lsls r2, 5 - mov r8, r2 - mov r6, r8 - add r6, r9 - ldrh r0, [r6] - cmp r0, 0 - beq _081B0EDC - mov r1, r9 - adds r1, 0x18 - add r1, r8 - ldr r1, [r1] - ldr r4, =gUnknown_0203CEDC - lsls r5, r7, 4 - ldr r2, [r4] - adds r2, r5 - movs r3, 0 - str r3, [sp] - bl party_menu_link_mon_icon_anim - ldrh r0, [r6] - ldrh r1, [r6, 0x2] - ldr r2, [r4] - adds r2, r5 - bl party_menu_link_mon_held_item_object - ldrh r0, [r6] - ldr r1, [r4] - adds r1, r5 - bl party_menu_link_mon_pokeball_object - ldrh r0, [r6, 0x10] - cmp r0, 0 - bne _081B0E68 - movs r3, 0x7 - b _081B0E78 - .pool -_081B0E68: - mov r0, r9 - adds r0, 0x14 - add r0, r8 - ldr r0, [r0] - bl pokemon_ailments_get_primary - lsls r0, 24 - lsrs r3, r0, 24 -_081B0E78: - ldr r1, =gUnknown_02022FF8 - mov r2, r10 - lsls r0, r2, 5 - adds r0, r1 - ldrh r0, [r0] - ldr r1, =gUnknown_0203CEDC - ldr r2, [r1] - adds r2, r5 - adds r1, r3, 0 - bl party_menu_link_mon_status_condition_object - b _081B0EDC - .pool -_081B0E98: - movs r0, 0x64 - adds r1, r7, 0 - muls r1, r0 - ldr r0, =gPlayerParty - adds r6, r1, r0 - adds r0, r6, 0 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B0EDC - ldr r4, =gUnknown_0203CEDC - lsls r5, r7, 4 - ldr r1, [r4] - adds r1, r5 - adds r0, r6, 0 - adds r2, r7, 0 - bl party_menu_icon_anim - ldr r1, [r4] - adds r1, r5 - adds r0, r6, 0 - bl party_menu_held_item_object - ldr r1, [r4] - adds r1, r5 - adds r0, r6, 0 - bl party_menu_pokeball_object - ldr r1, [r4] - adds r1, r5 - adds r0, r6, 0 - bl party_menu_status_condition_object -_081B0EDC: - 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 party_menu_add_per_mon_objects_internal - - thumb_func_start party_menu_add_per_mon_objects -party_menu_add_per_mon_objects: @ 81B0EF4 - push {r4,r5,lr} - ldr r5, =gUnknown_0203CEC4 - ldr r0, [r5] - movs r4, 0x86 - lsls r4, 2 - adds r0, r4 - ldrb r0, [r0] - bl party_menu_add_per_mon_objects_internal - ldr r1, [r5] - adds r1, r4 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - beq _081B0F20 - movs r0, 0 - b _081B0F22 - .pool -_081B0F20: - movs r0, 0x1 -_081B0F22: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end party_menu_add_per_mon_objects - - thumb_func_start sub_81B0F28 -sub_81B0F28: @ 81B0F28 - push {r4,lr} - sub sp, 0xC - ldr r0, =gUnknown_0203CEC8 - ldrb r1, [r0, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x5 - bne _081B0F54 - movs r0, 0x7 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x1 - str r0, [sp, 0x8] - movs r1, 0xE - movs r2, 0x17 - movs r3, 0x11 - bl FillBgTilemapBufferRect - b _081B0FBC - .pool -_081B0F54: - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - ldrb r0, [r0, 0x8] - lsls r0, 31 - cmp r0, 0 - beq _081B0F94 - movs r0, 0xBF - movs r1, 0x88 - bl sub_81B5F74 - ldr r3, [r4] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x7F - ands r0, r1 - lsls r0, 4 - ldrh r2, [r3, 0x8] - ldr r1, =0xfffff80f - ands r1, r2 - orrs r1, r0 - strh r1, [r3, 0x8] - bl sub_81B120C - movs r0, 0xBF - movs r1, 0x98 - bl sub_81B5F74 - b _081B0F9C - .pool -_081B0F94: - movs r0, 0xC6 - movs r1, 0x94 - bl sub_81B5F34 -_081B0F9C: - ldr r3, [r4] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x7F - ands r0, r1 - lsls r0, 11 - ldr r1, [r3, 0x8] - ldr r2, =0xfffc07ff - ands r1, r2 - orrs r1, r0 - str r1, [r3, 0x8] - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0x9] - movs r1, 0x1 - bl sub_81B0FCC -_081B0FBC: - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B0F28 - - thumb_func_start sub_81B0FCC -sub_81B0FCC: @ 81B0FCC - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - cmp r7, 0x6 - beq _081B1038 - cmp r7, 0x7 - beq _081B1074 - movs r0, 0x64 - muls r0, r7 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B10E8 - ldr r6, =gUnknown_0203CEDC - lsls r5, r7, 4 - ldr r4, [r6] - adds r4, r5 - adds r0, r7, 0 - mov r1, r8 - bl sub_81B10F8 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_81B2748 - ldr r0, [r6] - adds r0, r5, r0 - ldrb r0, [r0, 0x9] - mov r1, r8 - bl sub_81B5B6C - ldr r0, [r6] - adds r5, r0 - ldrb r0, [r5, 0xB] - mov r1, r8 - bl sub_81B5F98 - b _081B10E8 - .pool -_081B1038: - mov r0, r8 - cmp r0, 0 - bne _081B1052 - movs r0, 0x2 - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r1, 0x17 - movs r2, 0x10 - movs r3, 0x7 - bl sub_8199C30 - b _081B1064 -_081B1052: - movs r0, 0x2 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x1 - movs r1, 0x17 - movs r2, 0x10 - movs r3, 0x7 - bl sub_8199C30 -_081B1064: - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrh r0, [r0, 0x8] - lsls r0, 21 - b _081B10DA - .pool -_081B1074: - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 31 - cmp r0, 0 - bne _081B10A6 - mov r0, r8 - cmp r0, 0 - bne _081B1098 - movs r0, 0x2 - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r1, 0x17 - movs r2, 0x11 - b _081B10B8 - .pool -_081B1098: - movs r0, 0x2 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x1 - movs r1, 0x17 - movs r2, 0x11 - b _081B10B8 -_081B10A6: - mov r0, r8 - cmp r0, 0 - bne _081B10C0 - movs r0, 0x2 - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r1, 0x17 - movs r2, 0x12 -_081B10B8: - movs r3, 0x7 - bl sub_8199C30 - b _081B10D2 -_081B10C0: - movs r0, 0x2 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x1 - movs r1, 0x17 - movs r2, 0x12 - movs r3, 0x7 - bl sub_8199C30 -_081B10D2: - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldr r0, [r0, 0x8] - lsls r0, 14 -_081B10DA: - lsrs r0, 25 - mov r1, r8 - bl sub_81B5F98 - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram -_081B10E8: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B0FCC - - thumb_func_start sub_81B10F8 -sub_81B10F8: @ 81B10F8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r1, 24 - movs r4, 0 - cmp r1, 0x1 - bne _081B110A - movs r4, 0x1 -_081B110A: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - bne _081B1120 - movs r0, 0x2 - orrs r4, r0 -_081B1120: - adds r0, r5, 0 - bl sub_81B118C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B1136 - movs r0, 0x8 - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_081B1136: - ldr r0, =gUnknown_0203CEC8 - ldrb r1, [r0, 0xB] - adds r2, r0, 0 - cmp r1, 0x9 - bne _081B1148 - movs r0, 0x10 - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_081B1148: - cmp r1, 0x8 - bne _081B1164 - movs r0, 0x9 - ldrsb r0, [r2, r0] - cmp r5, r0 - beq _081B115C - movs r0, 0xA - ldrsb r0, [r2, r0] - cmp r5, r0 - bne _081B1164 -_081B115C: - movs r0, 0x4 - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_081B1164: - ldrb r0, [r2, 0xB] - cmp r0, 0xA - bne _081B117A - movs r0, 0x9 - ldrsb r0, [r2, r0] - cmp r5, r0 - bne _081B117A - movs r0, 0x20 - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_081B117A: - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B10F8 - - thumb_func_start sub_81B118C -sub_81B118C: @ 81B118C - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gUnknown_0203CEC8 - ldrb r1, [r0, 0x8] - movs r0, 0x30 - ands r0, r1 - cmp r0, 0x20 - bne _081B11B4 - cmp r2, 0x1 - beq _081B11AA - cmp r2, 0x4 - beq _081B11AA - cmp r2, 0x5 - bne _081B11B4 -_081B11AA: - movs r0, 0x1 - b _081B11F8 - .pool -_081B11B4: - cmp r2, 0x2 - bhi _081B11F6 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - beq _081B11F6 - ldr r0, =gMain - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081B11F6 - adds r0, r2, 0 - bl sub_81B8F38 - ldr r1, =gBattleStruct - ldr r1, [r1] - movs r2, 0xA8 - lsls r2, 2 - adds r1, r2 - ldrb r1, [r1] - lsls r0, 24 - lsrs r0, 24 - asrs r1, r0 - movs r0, 0x1 - ands r1, r0 - cmp r1, 0 - bne _081B11F8 -_081B11F6: - movs r0, 0 -_081B11F8: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B118C - - thumb_func_start sub_81B120C -sub_81B120C: @ 81B120C - push {r4-r6,lr} - sub sp, 0xC - ldr r1, =gUnknown_086157C4 - movs r6, 0x7 - str r6, [sp] - movs r5, 0x2 - str r5, [sp, 0x4] - movs r4, 0x11 - str r4, [sp, 0x8] - movs r0, 0x1 - movs r2, 0x17 - movs r3, 0x10 - bl CopyToBgTilemapBufferRect_ChangePalette - ldr r1, =gUnknown_086157E0 - str r6, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x1 - movs r2, 0x17 - movs r3, 0x12 - bl CopyToBgTilemapBufferRect_ChangePalette - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B120C - - thumb_func_start sub_81B1250 -sub_81B1250: @ 81B1250 - push {lr} - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x49 - ands r0, r1 - cmp r0, 0x49 - bne _081B1280 - ldr r0, =gMain - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081B1280 - movs r0, 0x1 - b _081B1282 - .pool -_081B1280: - movs r0, 0 -_081B1282: - pop {r1} - bx r1 - thumb_func_end sub_81B1250 - - thumb_func_start sub_81B1288 -sub_81B1288: @ 81B1288 - push {r4-r6,lr} - adds r4, r0, 0 - adds r6, r1, 0 - movs r0, 0x64 - bl Alloc - adds r5, r0, 0 - adds r1, r4, 0 - movs r2, 0x64 - bl memcpy - adds r0, r4, 0 - adds r1, r6, 0 - movs r2, 0x64 - bl memcpy - adds r0, r6, 0 - adds r1, r5, 0 - movs r2, 0x64 - bl memcpy - adds r0, r5, 0 - bl Free - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81B1288 - - thumb_func_start sub_81B12C0 -sub_81B12C0: @ 81B12C0 - 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, =c3_0811FAB4 - str r1, [r0] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B12C0 - - thumb_func_start c3_0811FAB4 -c3_0811FAB4: @ 81B12F8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B134C - ldr r4, =gUnknown_0203CEC8 - ldrb r1, [r4, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x1 - bne _081B131A - bl sub_81B9080 -_081B131A: - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldr r0, [r0, 0x4] - cmp r0, 0 - beq _081B1338 - bl SetMainCallback2 - b _081B133E - .pool -_081B1338: - ldr r0, [r4] - bl SetMainCallback2 -_081B133E: - bl ResetSpriteData - bl sub_81B06F4 - adds r0, r5, 0 - bl DestroyTask -_081B134C: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end c3_0811FAB4 - - thumb_func_start brm_get_pokemon_selection -brm_get_pokemon_selection: @ 81B1354 - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0x9] - bx lr - .pool - thumb_func_end brm_get_pokemon_selection - - thumb_func_start sub_81B1360 -sub_81B1360: @ 81B1360 - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0x8] - lsls r0, 28 - lsrs r0, 28 - bx lr - .pool - thumb_func_end sub_81B1360 - - thumb_func_start sub_81B1370 -sub_81B1370: @ 81B1370 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B13E0 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B13E0 - bl sub_81B13EC - adds r4, r0, 0 - bl sub_81B1760 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - beq _081B13C0 - cmp r0, 0x2 - bgt _081B13B0 - cmp r0, 0x1 - beq _081B13B6 - b _081B13E0 - .pool -_081B13B0: - cmp r0, 0x8 - beq _081B13CA - b _081B13E0 -_081B13B6: - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_81B140C - b _081B13E0 -_081B13C0: - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_81B15D0 - b _081B13E0 -_081B13CA: - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 31 - cmp r0, 0 - beq _081B13E0 - movs r0, 0x5 - bl PlaySE - bl sub_81B4F88 -_081B13E0: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B1370 - - thumb_func_start sub_81B13EC -sub_81B13EC: @ 81B13EC - push {lr} - ldr r0, =gUnknown_0203CEC8 - ldrb r1, [r0, 0xB] - cmp r1, 0x8 - beq _081B13FA - cmp r1, 0xA - bne _081B1404 -_081B13FA: - adds r0, 0xA - b _081B1406 - .pool -_081B1404: - adds r0, 0x9 -_081B1406: - pop {r1} - bx r1 - thumb_func_end sub_81B13EC - - thumb_func_start sub_81B140C -sub_81B140C: @ 81B140C - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0x6 - bne _081B142C - ldr r0, =gUnknown_0203CEC8 - ldr r1, [r0, 0x4] - adds r0, r5, 0 - bl _call_via_r1 - b _081B159E - .pool -_081B142C: - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0xB] - subs r0, 0x3 - cmp r0, 0xA - bls _081B1438 - b _081B1592 -_081B1438: - lsls r0, 2 - ldr r1, =_081B144C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081B144C: - .4byte _081B149C - .4byte _081B1592 - .4byte _081B1538 - .4byte _081B1538 - .4byte _081B1510 - .4byte _081B1560 - .4byte _081B1592 - .4byte _081B1478 - .4byte _081B156E - .4byte _081B14E8 - .4byte _081B157C -_081B1478: - adds r0, r4, 0 - bl sub_81B15A4 - lsls r0, 24 - cmp r0, 0 - bne _081B1486 - b _081B159E -_081B1486: - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - adds r0, 0xD - bl sub_81B302C - adds r0, r5, 0 - bl sub_81615A8 - b _081B159E - .pool -_081B149C: - adds r0, r4, 0 - bl sub_81B15A4 - lsls r0, 24 - cmp r0, 0 - bne _081B14AA - b _081B159E -_081B14AA: - ldr r0, =gUnknown_0203CEC8 - ldrb r1, [r0, 0x8] - movs r0, 0xF - ands r0, r1 - ldr r2, =gUnknown_0203CEC4 - cmp r0, 0x1 - bne _081B14BE - ldr r1, [r2] - ldr r0, =sub_81B9140 - str r0, [r1, 0x4] -_081B14BE: - ldr r0, [r2] - adds r0, 0xD - bl sub_81B302C - ldr r0, =gUnknown_03006328 - ldr r1, =sub_81B6794 - ldr r2, [r0] - adds r0, r5, 0 - bl _call_via_r2 - b _081B159E - .pool -_081B14E8: - adds r0, r4, 0 - bl sub_81B15A4 - lsls r0, 24 - cmp r0, 0 - beq _081B159E - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - adds r0, 0xD - bl sub_81B302C - adds r0, r5, 0 - bl sub_81B7E4C - b _081B159E - .pool -_081B1510: - adds r0, r4, 0 - bl sub_81B15A4 - lsls r0, 24 - cmp r0, 0 - beq _081B159E - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - adds r0, 0xD - bl sub_81B302C - adds r0, r5, 0 - bl sub_81B8474 - b _081B159E - .pool -_081B1538: - adds r0, r4, 0 - bl sub_81B15A4 - lsls r0, 24 - cmp r0, 0 - beq _081B159E - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - adds r0, 0xD - bl sub_81B302C - adds r0, r5, 0 - bl sub_81B7FAC - b _081B159E - .pool -_081B1560: - movs r0, 0x5 - bl PlaySE - adds r0, r5, 0 - bl sub_81B3938 - b _081B159E -_081B156E: - movs r0, 0x5 - bl PlaySE - adds r0, r5, 0 - bl sub_81B12C0 - b _081B159E -_081B157C: - adds r0, r4, 0 - bl sub_81B15A4 - lsls r0, 24 - cmp r0, 0 - beq _081B159E - ldrb r1, [r4] - adds r0, r5, 0 - bl sub_81B21AC - b _081B159E -_081B1592: - movs r0, 0x5 - bl PlaySE - adds r0, r5, 0 - bl sub_81B36FC -_081B159E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81B140C - - thumb_func_start sub_81B15A4 -sub_81B15A4: @ 81B15A4 - push {lr} - ldrb r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x2D - bl GetMonData - cmp r0, 0x1 - beq _081B15C4 - movs r0, 0x1 - b _081B15CC - .pool -_081B15C4: - movs r0, 0x20 - bl PlaySE - movs r0, 0 -_081B15CC: - pop {r1} - bx r1 - thumb_func_end sub_81B15A4 - - thumb_func_start sub_81B15D0 -sub_81B15D0: @ 81B15D0 - push {r4,r5,lr} - adds r5, r1, 0 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0xB] - cmp r0, 0x8 - beq _081B1602 - cmp r0, 0x8 - bgt _081B15F0 - cmp r0, 0x1 - beq _081B15FA - b _081B161E - .pool -_081B15F0: - cmp r0, 0xA - beq _081B1602 - cmp r0, 0xD - beq _081B1610 - b _081B161E -_081B15FA: - movs r0, 0x20 - bl PlaySE - b _081B1652 -_081B1602: - movs r0, 0x5 - bl PlaySE - adds r0, r4, 0 - bl sub_81B407C - b _081B1652 -_081B1610: - movs r0, 0x5 - bl PlaySE - adds r0, r4, 0 - bl sub_81B2210 - b _081B1652 -_081B161E: - movs r0, 0x5 - bl PlaySE - adds r0, r4, 0 - bl sub_81B1660 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B1652 - bl sub_81221AC - lsls r0, 24 - cmp r0, 0 - bne _081B1642 - ldr r1, =gSpecialVar_0x8004 - movs r0, 0x7 - strh r0, [r1] -_081B1642: - ldr r0, =gUnknown_0203CEE8 - movs r1, 0 - strb r1, [r0] - movs r0, 0x7 - strb r0, [r5] - adds r0, r4, 0 - bl sub_81B12C0 -_081B1652: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B15D0 - - thumb_func_start sub_81B1660 -sub_81B1660: @ 81B1660 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - movs r5, 0 - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0x8] - movs r1, 0xF - ands r1, r0 - cmp r1, 0x2 - bne _081B1680 - ldr r5, =gUnknown_085EA110 - b _081B168A - .pool -_081B1680: - cmp r1, 0x4 - bne _081B168A - bl sub_81B88BC - adds r5, r0, 0 -_081B168A: - cmp r5, 0 - beq _081B16CC - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - adds r0, 0xD - bl sub_81B302C - ldr r4, =gStringVar4 - adds r0, r4, 0 - adds r1, r5, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B16D4 - str r1, [r0] - movs r0, 0x1 - b _081B16CE - .pool -_081B16CC: - movs r0, 0 -_081B16CE: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81B1660 - - thumb_func_start sub_81B16D4 -sub_81B16D4: @ 81B16D4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B16F8 - bl sub_81B334C - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B1708 - str r0, [r1] -_081B16F8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B16D4 - - thumb_func_start sub_81B1708 -sub_81B1708: @ 81B1708 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _081B172E - cmp r1, 0 - bgt _081B1728 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _081B174C - b _081B1758 -_081B1728: - cmp r1, 0x1 - beq _081B1752 - b _081B1758 -_081B172E: - ldr r0, =gUnknown_0203CEE8 - strb r1, [r0] - ldr r1, =gUnknown_0203CEC8 - movs r0, 0x7 - strb r0, [r1, 0x9] - bl sub_81B8558 - adds r0, r4, 0 - bl sub_81B12C0 - b _081B1758 - .pool -_081B174C: - movs r0, 0x5 - bl PlaySE -_081B1752: - adds r0, r4, 0 - bl sub_81B1C1C -_081B1758: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B1708 - - thumb_func_start sub_81B1760 -sub_81B1760: @ 81B1760 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gMain - ldrh r1, [r0, 0x30] - adds r3, r0, 0 - cmp r1, 0x20 - beq _081B178E - cmp r1, 0x20 - bgt _081B177C - cmp r1, 0x10 - beq _081B1792 - b _081B1796 - .pool -_081B177C: - cmp r1, 0x40 - beq _081B1786 - cmp r1, 0x80 - beq _081B178A - b _081B1796 -_081B1786: - movs r1, 0xFF - b _081B17B2 -_081B178A: - movs r1, 0x1 - b _081B17B2 -_081B178E: - movs r1, 0xFE - b _081B17B2 -_081B1792: - movs r1, 0x2 - b _081B17B2 -_081B1796: - bl sub_812210C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B17AA - cmp r0, 0x2 - beq _081B17AE - movs r1, 0 - b _081B17B0 -_081B17AA: - movs r1, 0xFF - b _081B17B0 -_081B17AE: - movs r1, 0x1 -_081B17B0: - ldr r3, =gMain -_081B17B2: - ldrh r2, [r3, 0x2E] - movs r0, 0x8 - ands r0, r2 - cmp r0, 0 - beq _081B17C4 - movs r0, 0x8 - b _081B17F0 - .pool -_081B17C4: - lsls r0, r1, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _081B17D6 - adds r0, r4, 0 - bl sub_81B17F8 - movs r0, 0 - b _081B17F0 -_081B17D6: - movs r0, 0x1 - ands r0, r2 - cmp r0, 0 - beq _081B17EA - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0x7 - bne _081B17EA - movs r0, 0x2 - b _081B17F0 -_081B17EA: - ldrh r1, [r3, 0x2E] - movs r0, 0x3 - ands r0, r1 -_081B17F0: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81B1760 - - thumb_func_start sub_81B17F8 -sub_81B17F8: @ 81B17F8 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldrb r4, [r5] - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0x8] - lsls r0, 26 - lsrs r0, 30 - cmp r0, 0 - bne _081B1820 - lsls r1, 24 - asrs r1, 24 - adds r0, r5, 0 - bl sub_81B1854 - b _081B182A - .pool -_081B1820: - lsls r1, 24 - asrs r1, 24 - adds r0, r5, 0 - bl sub_81B195C -_081B182A: - movs r1, 0 - ldrsb r1, [r5, r1] - lsls r4, 24 - asrs r0, r4, 24 - cmp r1, r0 - beq _081B184C - movs r0, 0x5 - bl PlaySE - lsrs r0, r4, 24 - movs r1, 0 - bl sub_81B0FCC - ldrb r0, [r5] - movs r1, 0x1 - bl sub_81B0FCC -_081B184C: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81B17F8 - - thumb_func_start sub_81B1854 -sub_81B1854: @ 81B1854 - push {r4,lr} - adds r4, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _081B187A - cmp r1, r0 - bgt _081B1870 - subs r0, 0x1 - cmp r1, r0 - beq _081B1924 - b _081B1952 -_081B1870: - cmp r1, 0x1 - beq _081B18C0 - cmp r1, 0x2 - beq _081B18F8 - b _081B1952 -_081B187A: - ldrb r0, [r4] - movs r1, 0 - ldrsb r1, [r4, r1] - cmp r1, 0 - bne _081B1888 - movs r0, 0x7 - b _081B1950 -_081B1888: - cmp r1, 0x6 - bne _081B1898 - ldr r0, =gPlayerPartyCount - ldrb r0, [r0] - subs r0, 0x1 - b _081B1950 - .pool -_081B1898: - cmp r1, 0x7 - bne _081B18BC - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 31 - cmp r0, 0 - beq _081B18B0 - movs r0, 0x6 - b _081B1950 - .pool -_081B18B0: - ldr r0, =gPlayerPartyCount - ldrb r0, [r0] - subs r0, 0x1 - b _081B1950 - .pool -_081B18BC: - subs r0, 0x1 - b _081B1950 -_081B18C0: - ldrb r2, [r4] - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0x7 - beq _081B194E - movs r1, 0 - ldrsb r1, [r4, r1] - ldr r0, =gPlayerPartyCount - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - bne _081B18F4 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 31 - cmp r0, 0 - beq _081B18F0 - movs r0, 0x6 - b _081B1950 - .pool -_081B18F0: - movs r0, 0x7 - b _081B1950 -_081B18F4: - adds r0, r2, 0x1 - b _081B1950 -_081B18F8: - ldr r0, =gPlayerPartyCount - ldrb r0, [r0] - cmp r0, 0x1 - beq _081B1952 - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0 - bne _081B1952 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 28 - lsrs r0, 29 - cmp r0, 0 - bne _081B1950 - movs r0, 0x1 - b _081B1950 - .pool -_081B1924: - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0 - beq _081B1952 - cmp r0, 0x6 - beq _081B1952 - cmp r0, 0x7 - beq _081B1952 - ldr r0, =gUnknown_0203CEC4 - ldr r3, [r0] - movs r1, 0 - ldrsb r1, [r4, r1] - movs r0, 0x7 - ands r1, r0 - lsls r1, 1 - ldrb r2, [r3, 0x8] - movs r0, 0xF - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x8] -_081B194E: - movs r0, 0 -_081B1950: - strb r0, [r4] -_081B1952: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B1854 - - thumb_func_start sub_81B195C -sub_81B195C: @ 81B195C - push {r4-r6,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r2, r1, 24 - asrs r5, r1, 24 - movs r6, 0x1 - negs r6, r6 - cmp r5, r6 - beq _081B1988 - cmp r5, r6 - bgt _081B197E - movs r0, 0x2 - negs r0, r0 - cmp r5, r0 - bne _081B197C - b _081B1A9C -_081B197C: - b _081B1AF4 -_081B197E: - cmp r5, 0x1 - beq _081B19E4 - cmp r5, 0x2 - beq _081B1A24 - b _081B1AF4 -_081B1988: - ldrb r1, [r4] - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0 - bne _081B1996 - movs r0, 0x7 - b _081B1AF2 -_081B1996: - cmp r0, 0x6 - bne _081B19A8 - ldr r0, =gPlayerPartyCount - ldrb r0, [r0] - subs r0, 0x1 - b _081B1AF2 - .pool -_081B19A8: - cmp r0, 0x7 - bne _081B19C4 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 31 - cmp r0, 0 - beq _081B19C0 - movs r0, 0x6 - b _081B1AF2 - .pool -_081B19C0: - subs r0, r1, 0x1 - strb r0, [r4] -_081B19C4: - movs r0, 0 - ldrsb r0, [r4, r0] - lsls r1, r2, 24 - asrs r1, 24 - bl sub_81B1B00 - lsls r0, 24 - lsrs r2, r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _081B19E0 - b _081B1AF4 -_081B19E0: - strb r2, [r4] - b _081B1AF4 -_081B19E4: - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0x6 - bne _081B19F0 - movs r0, 0x7 - b _081B1AF2 -_081B19F0: - cmp r0, 0x7 - bne _081B19F8 - movs r0, 0 - b _081B1AF2 -_081B19F8: - movs r0, 0 - ldrsb r0, [r4, r0] - movs r1, 0x1 - bl sub_81B1B00 - lsls r0, 24 - lsrs r2, r0, 24 - asrs r0, 24 - cmp r0, r6 - bne _081B19E0 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 31 - cmp r0, 0 - beq _081B1A20 - movs r0, 0x6 - b _081B1AF2 - .pool -_081B1A20: - movs r0, 0x7 - b _081B1AF2 -_081B1A24: - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0 - bne _081B1A5C - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 28 - lsrs r6, r0, 29 - cmp r6, 0x3 - bne _081B1A54 - ldr r0, =gPlayerParty + 300 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B1AF4 - strb r6, [r4] - b _081B1AF4 - .pool -_081B1A54: - ldr r0, =gPlayerParty + 200 - b _081B1A70 - .pool -_081B1A5C: - cmp r0, 0x1 - bne _081B1AF4 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 28 - lsrs r5, r0, 29 - cmp r5, 0x5 - bne _081B1A88 - ldr r0, =gPlayerParty + 500 -_081B1A70: - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B1AF4 - strb r5, [r4] - b _081B1AF4 - .pool -_081B1A88: - ldr r0, =gPlayerParty + 400 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B1AF4 - movs r0, 0x4 - b _081B1AF2 - .pool -_081B1A9C: - ldrb r1, [r4] - subs r0, r1, 0x2 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _081B1ACC - ldr r0, =gUnknown_0203CEC4 - ldr r3, [r0] - movs r1, 0 - ldrsb r1, [r4, r1] - movs r0, 0x7 - ands r1, r0 - lsls r1, 1 - ldrb r2, [r3, 0x8] - movs r0, 0xF - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x8] - movs r0, 0 - b _081B1AF2 - .pool -_081B1ACC: - subs r0, r1, 0x4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _081B1AF4 - ldr r0, =gUnknown_0203CEC4 - ldr r3, [r0] - movs r1, 0 - ldrsb r1, [r4, r1] - movs r0, 0x7 - ands r1, r0 - lsls r1, 1 - ldrb r2, [r3, 0x8] - movs r0, 0xF - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x8] - movs r0, 0x1 -_081B1AF2: - strb r0, [r4] -_081B1AF4: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B195C - - thumb_func_start sub_81B1B00 -sub_81B1B00: @ 81B1B00 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - asrs r6, r1, 24 -_081B1B0A: - lsls r0, r5, 24 - asrs r0, 24 - adds r0, r6 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, r5, 24 - lsrs r0, r1, 24 - cmp r0, 0x5 - bhi _081B1B38 - asrs r4, r1, 24 - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B1B0A - adds r0, r4, 0 - b _081B1B3C - .pool -_081B1B38: - movs r0, 0x1 - negs r0, r0 -_081B1B3C: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81B1B00 - - thumb_func_start GetMonNickname -@ u8 *GetMonNickname(struct pokemon *mon, u8 *dest) -GetMonNickname: @ 81B1B44 - push {r4,lr} - adds r4, r1, 0 - movs r1, 0x2 - adds r2, r4, 0 - bl GetMonData - adds r0, r4, 0 - bl StringGetEnd10 - pop {r4} - pop {r1} - bx r1 - thumb_func_end GetMonNickname - - thumb_func_start sub_81B1B5C -sub_81B1B5C: @ 81B1B5C - push {r4,lr} - lsls r4, r1, 24 - lsrs r4, 24 - bl sub_81B3300 - ldr r0, =sub_81B1B8C - movs r1, 0x1 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x8] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B1B5C - - thumb_func_start sub_81B1B8C -sub_81B1B8C: @ 81B1B8C - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - movs r0, 0x6 - bl sub_8121F20 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - beq _081B1BC8 - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - movs r2, 0x8 - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _081B1BC2 - movs r0, 0x6 - movs r1, 0 - bl sub_8198070 - movs r0, 0x6 - bl ClearWindowTilemap -_081B1BC2: - adds r0, r5, 0 - bl DestroyTask -_081B1BC8: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B1B8C - - thumb_func_start sub_81B1BD4 -sub_81B1BD4: @ 81B1BD4 - push {lr} - ldr r0, =sub_81B1B8C - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B1BD4 - - thumb_func_start sub_81B1BE8 -sub_81B1BE8: @ 81B1BE8 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B1C0E - movs r0, 0 - 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] -_081B1C0E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B1BE8 - - thumb_func_start sub_81B1C1C -sub_81B1C1C: @ 81B1C1C - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B1C74 - movs r0, 0x6 - movs r1, 0 - bl sub_8198070 - movs r0, 0x6 - bl ClearWindowTilemap - bl sub_81221AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B1C60 - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B1BE8 - b _081B1C72 - .pool -_081B1C60: - movs r0, 0 - bl display_pokemon_menu_message - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B1370 -_081B1C72: - str r0, [r1] -_081B1C74: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B1C1C - - thumb_func_start sub_81B1C84 -sub_81B1C84: @ 81B1C84 - push {r4,r5,lr} - adds r4, r1, 0 - adds r5, r2, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 24 - lsrs r5, 24 - ldr r1, =gStringVar1 - bl GetMonNickname - ldr r1, =gStringVar2 - adds r0, r4, 0 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E991B - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B1C84 - - thumb_func_start sub_81B1CD0 -sub_81B1CD0: @ 81B1CD0 - push {r4,r5,lr} - adds r4, r1, 0 - adds r5, r2, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 24 - lsrs r5, 24 - ldr r1, =gStringVar1 - bl GetMonNickname - ldr r1, =gStringVar2 - adds r0, r4, 0 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E999D - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B1CD0 - - thumb_func_start sub_81B1D1C -sub_81B1D1C: @ 81B1D1C - push {r4,r5,lr} - adds r4, r1, 0 - adds r5, r2, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 24 - lsrs r5, 24 - ldr r1, =gStringVar1 - bl GetMonNickname - ldr r1, =gStringVar2 - adds r0, r4, 0 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E993A - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B1D1C - - thumb_func_start sub_81B1D68 -sub_81B1D68: @ 81B1D68 - push {r4,r5,lr} - adds r4, r1, 0 - adds r5, r2, 0 - lsls r0, 16 - lsrs r0, 16 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 24 - lsrs r5, 24 - ldr r1, =gStringVar1 - bl CopyItemName - ldr r1, =gStringVar2 - adds r0, r4, 0 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E99DB - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B1D68 - - thumb_func_start sub_81B1DB8 -sub_81B1DB8: @ 81B1DB8 - push {r4-r7,lr} - sub sp, 0x4 - adds r6, r0, 0 - lsls r5, r1, 16 - lsrs r4, r5, 16 - adds r7, r4, 0 - adds r0, r4, 0 - bl itemid_is_mail - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B1DE2 - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_80D4420 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _081B1DF6 -_081B1DE2: - mov r0, sp - strb r7, [r0] - mov r1, sp - lsrs r0, r5, 24 - strb r0, [r1, 0x1] - adds r0, r6, 0 - movs r1, 0xC - mov r2, sp - bl SetMonData -_081B1DF6: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81B1DB8 - - thumb_func_start sub_81B1E00 -sub_81B1E00: @ 81B1E00 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - mov r1, sp - strh r0, [r1] - cmp r0, 0 - bne _081B1E1C - movs r0, 0 - b _081B1E3E -_081B1E1C: - movs r1, 0x1 - bl AddBagItem - lsls r0, 24 - cmp r0, 0 - beq _081B1E3C - movs r1, 0 - mov r0, sp - strh r1, [r0] - adds r0, r4, 0 - movs r1, 0xC - mov r2, sp - bl SetMonData - movs r0, 0x2 - b _081B1E3E -_081B1E3C: - movs r0, 0x1 -_081B1E3E: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81B1E00 - - thumb_func_start pokemon_item_not_removed -pokemon_item_not_removed: @ 81B1E48 - push {lr} - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9A69 - bl StringExpandPlaceholders - pop {r0} - bx r0 - .pool - thumb_func_end pokemon_item_not_removed - - thumb_func_start sub_81B1E60 -sub_81B1E60: @ 81B1E60 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r0, 2 - add r0, r8 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r7, r0, r1 - ldrh r0, [r7, 0x4] - ldrh r1, [r7] - adds r0, r1 - strh r0, [r7] - ldrh r0, [r7, 0x6] - subs r0, 0x1 - strh r0, [r7, 0x6] - movs r2, 0x8 - ldrsh r0, [r7, r2] - movs r5, 0x64 - muls r0, r5 - ldr r4, =gPlayerParty - adds r0, r4 - movs r1, 0x39 - adds r2, r7, 0 - bl SetMonData - movs r3, 0x8 - ldrsh r2, [r7, r3] - adds r0, r2, 0 - muls r0, r5 - adds r0, r4 - ldr r6, =gUnknown_0203CEDC - lsls r2, 4 - ldr r1, [r6] - adds r1, r2 - movs r2, 0x1 - bl sub_81B2CD4 - movs r0, 0x8 - ldrsh r2, [r7, r0] - adds r0, r2, 0 - muls r0, r5 - adds r0, r4 - lsls r2, 4 - ldr r1, [r6] - adds r1, r2 - bl sub_81B2E28 - movs r1, 0x6 - ldrsh r0, [r7, r1] - cmp r0, 0 - beq _081B1EDC - movs r2, 0 - ldrsh r1, [r7, r2] - cmp r1, 0 - beq _081B1EDC - movs r3, 0x2 - ldrsh r0, [r7, r3] - cmp r1, r0 - bne _081B1EFE -_081B1EDC: - movs r0, 0 - ldrsh r1, [r7, r0] - movs r2, 0xA - ldrsh r0, [r7, r2] - cmp r1, r0 - ble _081B1EF8 - ldr r0, =gStringVar2 - movs r3, 0xA - ldrsh r2, [r7, r3] - subs r1, r2 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN -_081B1EF8: - mov r0, r8 - bl SwitchTaskToFollowupFunc -_081B1EFE: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B1E60 - - thumb_func_start sub_81B1F18 -sub_81B1F18: @ 81B1F18 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r8, r0 - mov r9, r1 - adds r5, r2, 0 - mov r10, r3 - ldr r7, [sp, 0x20] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - mov r0, r9 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r5, 24 - lsrs r5, 24 - mov r0, r10 - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - movs r0, 0x64 - mov r6, r9 - muls r6, r0 - ldr r0, =gPlayerParty - adds r6, r0 - mov r0, r8 - lsls r4, r0, 2 - add r4, r8 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - adds r0, r6, 0 - movs r1, 0x39 - bl GetMonData - strh r0, [r4] - adds r0, r6, 0 - movs r1, 0x3A - bl GetMonData - strh r0, [r4, 0x2] - lsls r5, 24 - asrs r5, 24 - strh r5, [r4, 0x4] - mov r0, r10 - strh r0, [r4, 0x6] - mov r0, r9 - strh r0, [r4, 0x8] - ldrh r0, [r4] - strh r0, [r4, 0xA] - ldr r1, =sub_81B1E60 - mov r0, r8 - adds r2, r7, 0 - bl SetTaskFuncWithFollowupFunc - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B1F18 - - thumb_func_start sub_81B1FA8 -sub_81B1FA8: @ 81B1FA8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r3, r0, r1 - cmp r5, 0x5 - bhi _081B200A - lsls r0, r5, 2 - ldr r1, =_081B1FD4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081B1FD4: - .4byte _081B1FEC - .4byte _081B1FF2 - .4byte _081B1FF6 - .4byte _081B1FFA - .4byte _081B1FFE - .4byte _081B2002 -_081B1FEC: - strh r2, [r3] - strh r2, [r3, 0xA] - b _081B200A -_081B1FF2: - strh r2, [r3, 0x2] - b _081B200A -_081B1FF6: - strh r2, [r3, 0x4] - b _081B200A -_081B1FFA: - strh r2, [r3, 0x6] - b _081B200A -_081B1FFE: - strh r2, [r3, 0x8] - b _081B200A -_081B2002: - ldr r1, =sub_81B1E60 - adds r0, r4, 0 - bl SetTaskFuncWithFollowupFunc -_081B200A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B1FA8 - - thumb_func_start pokemon_ailments_get_primary -pokemon_ailments_get_primary: @ 81B2014 - push {lr} - adds r1, r0, 0 - movs r0, 0x88 - ands r0, r1 - cmp r0, 0 - beq _081B2024 - movs r0, 0x1 - b _081B2056 -_081B2024: - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081B2030 - movs r0, 0x2 - b _081B2056 -_081B2030: - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - beq _081B203C - movs r0, 0x3 - b _081B2056 -_081B203C: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _081B2048 - movs r0, 0x4 - b _081B2056 -_081B2048: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _081B2054 - movs r0, 0 - b _081B2056 -_081B2054: - movs r0, 0x5 -_081B2056: - pop {r1} - bx r1 - thumb_func_end pokemon_ailments_get_primary - - thumb_func_start sub_81B205C -@ u8 sub_81B205C(struct pokemon *mon, int a2, void *a3) -sub_81B205C: @ 81B205C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - bne _081B206E - movs r0, 0x7 - b _081B2096 -_081B206E: - adds r0, r4, 0 - movs r1, 0x37 - bl GetMonData - bl pokemon_ailments_get_primary - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _081B2096 - adds r0, r4, 0 - movs r1, 0 - bl CheckPartyPokerus - lsls r0, 24 - cmp r0, 0 - bne _081B2094 - movs r0, 0 - b _081B2096 -_081B2094: - movs r0, 0x6 -_081B2096: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81B205C - - thumb_func_start sub_81B209C -sub_81B209C: @ 81B209C - push {r4,r5,lr} - ldr r2, =gUnknown_0203CEC8 - ldrb r1, [r2, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0xB - bne _081B2126 - adds r5, r2, 0 - adds r5, 0xE - movs r0, 0 - strh r0, [r2, 0xE] - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0 - bne _081B20FC - movs r4, 0 - ldr r0, =gPlayerPartyCount - ldrb r0, [r0] - cmp r4, r0 - bcs _081B2126 -_081B20C4: - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - bl sub_81B2134 - lsls r0, 16 - lsrs r0, 16 - lsls r0, r4 - ldrh r1, [r5] - adds r0, r1 - strh r0, [r5] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gPlayerPartyCount - ldrb r0, [r0] - cmp r4, r0 - bcc _081B20C4 - b _081B2126 - .pool -_081B20FC: - movs r4, 0 - b _081B211E -_081B2100: - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - bl sub_81B2164 - lsls r0, 16 - lsrs r0, 16 - lsls r0, r4 - ldrh r1, [r5] - adds r0, r1 - strh r0, [r5] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_081B211E: - ldr r0, =gPlayerPartyCount - ldrb r0, [r0] - cmp r4, r0 - bcc _081B2100 -_081B2126: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B209C - - thumb_func_start sub_81B2134 -sub_81B2134: @ 81B2134 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2D - bl GetMonData - cmp r0, 0x1 - beq _081B215A - adds r0, r4, 0 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - bl sub_802C908 - cmp r0, 0 - beq _081B215A - movs r0, 0x1 - b _081B215C -_081B215A: - movs r0, 0 -_081B215C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81B2134 - - thumb_func_start sub_81B2164 -sub_81B2164: @ 81B2164 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2D - bl GetMonData - cmp r0, 0x1 - beq _081B2182 - adds r0, r4, 0 - movs r1, 0xB - bl GetMonData - cmp r0, 0x55 - bne _081B2182 - movs r0, 0x1 - b _081B2184 -_081B2182: - movs r0, 0 -_081B2184: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81B2164 - - thumb_func_start sub_81B218C -sub_81B218C: @ 81B218C - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0203CEC8 - movs r2, 0xE - ldrsh r1, [r1, r2] - asrs r1, r0 - movs r0, 0x1 - ands r1, r0 - cmp r1, 0 - bne _081B21A4 - movs r0, 0 -_081B21A4: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B218C - - thumb_func_start sub_81B21AC -sub_81B21AC: @ 81B21AC - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - adds r0, r5, 0 - bl sub_81B218C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B21DC - movs r0, 0x5 - bl PlaySE - ldr r0, =gSpecialVar_0x8004 - strh r5, [r0] - adds r0, r4, 0 - bl sub_81B12C0 - b _081B21FE - .pool -_081B21DC: - movs r0, 0x20 - bl PlaySE - ldr r0, =gUnknown_085EA0EE - 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_81B1C1C - str r1, [r0] -_081B21FE: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B21AC - - thumb_func_start sub_81B2210 -sub_81B2210: @ 81B2210 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_085EA110 - movs r1, 0x1 - 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_81B2248 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2210 - - thumb_func_start sub_81B2248 -sub_81B2248: @ 81B2248 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B226C - bl sub_81B334C - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B227C - str r0, [r1] -_081B226C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2248 - - thumb_func_start sub_81B227C -sub_81B227C: @ 81B227C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _081B22A2 - cmp r1, 0 - bgt _081B229C - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _081B22B4 - b _081B22C8 -_081B229C: - cmp r1, 0x1 - beq _081B22BA - b _081B22C8 -_081B22A2: - ldr r1, =gSpecialVar_0x8004 - movs r0, 0x7 - strh r0, [r1] - adds r0, r4, 0 - bl sub_81B12C0 - b _081B22C8 - .pool -_081B22B4: - movs r0, 0x5 - bl PlaySE -_081B22BA: - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B1C1C - str r0, [r1] -_081B22C8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B227C - - thumb_func_start sub_81B22D8 -sub_81B22D8: @ 81B22D8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - lsls r1, 16 - lsrs r4, r1, 16 - adds r7, r4, 0 - lsls r2, 24 - lsrs r6, r2, 24 - mov r8, r6 - movs r1, 0x2D - bl GetMonData - cmp r0, 0 - beq _081B22FA - movs r0, 0x3 - b _081B2356 -_081B22FA: - movs r0, 0x90 - lsls r0, 1 - cmp r4, r0 - bls _081B231C - adds r1, r4, 0 - subs r1, 0x21 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl CanMonLearnTMHM - cmp r0, 0 - beq _081B2334 - adds r0, r7, 0 - bl ItemIdToBattleMoveId - b _081B233E -_081B231C: - adds r0, r5, 0 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - bl sub_81B2370 - lsls r0, 24 - cmp r0, 0 - bne _081B2338 -_081B2334: - movs r0, 0x1 - b _081B2356 -_081B2338: - mov r0, r8 - bl sub_81B2360 -_081B233E: - lsls r0, 16 - lsrs r1, r0, 16 - adds r0, r5, 0 - bl pokemon_has_move - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B2354 - movs r0, 0 - b _081B2356 -_081B2354: - movs r0, 0x2 -_081B2356: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81B22D8 - - thumb_func_start sub_81B2360 -sub_81B2360: @ 81B2360 - lsls r0, 24 - ldr r1, =gUnknown_0861500C - lsrs r0, 23 - adds r0, r1 - ldrh r0, [r0] - bx lr - .pool - thumb_func_end sub_81B2360 - - thumb_func_start sub_81B2370 -sub_81B2370: @ 81B2370 - push {lr} - lsls r0, 16 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_08615048 - lsrs r0, 14 - adds r0, r2 - movs r2, 0x1 - lsls r2, r1 - ldr r0, [r0] - ands r0, r2 - cmp r0, 0 - bne _081B2394 - movs r0, 0 - b _081B2396 - .pool -_081B2394: - movs r0, 0x1 -_081B2396: - pop {r1} - bx r1 - thumb_func_end sub_81B2370 - - thumb_func_start sub_81B239C -sub_81B239C: @ 81B239C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - cmp r0, 0x1 - beq _081B23C4 - cmp r0, 0x1 - bgt _081B23B2 - cmp r0, 0 - beq _081B23B8 - b _081B23DC -_081B23B2: - cmp r1, 0x2 - beq _081B23D0 - b _081B23DC -_081B23B8: - ldr r0, =gUnknown_08615810 - bl InitWindows - b _081B23E2 - .pool -_081B23C4: - ldr r0, =gUnknown_08615850 - bl InitWindows - b _081B23E2 - .pool -_081B23D0: - ldr r0, =gUnknown_08615890 - bl InitWindows - b _081B23E2 - .pool -_081B23DC: - ldr r0, =gUnknown_086158D0 - bl InitWindows -_081B23E2: - bl DeactivateAllTextPrinters - movs r4, 0 -_081B23E8: - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _081B23E8 - movs r0, 0 - movs r1, 0x4F - movs r2, 0xD0 - bl sub_809882C - bl sub_8098C64 - movs r1, 0xE0 - movs r2, 0x20 - bl LoadPalette - ldr r0, =gUnknown_0860F074 - movs r1, 0xF0 - movs r2, 0x20 - bl LoadPalette - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B239C - - thumb_func_start sub_81B2428 -sub_81B2428: @ 81B2428 - push {r4-r6,lr} - sub sp, 0x14 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gUnknown_0203CEC8 - ldrb r1, [r0, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x5 - bne _081B243E - b _081B2554 -_081B243E: - cmp r2, 0x1 - bne _081B24B4 - ldr r0, =gUnknown_08615918 - bl AddWindow - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r5, =gText_Confirm - movs r0, 0 - adds r1, r5, 0 - movs r2, 0x30 - bl GetStringCenterAlignXOffset - lsls r0, 24 - lsrs r2, r0, 24 - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - ldr r0, =gUnknown_086157FC - str r0, [sp, 0x8] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0xC] - str r5, [sp, 0x10] - adds r0, r4, 0 - movs r1, 0 - movs r3, 0x1 - bl AddTextPrinterParametrized2 - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x2 - bl CopyWindowToVram - ldr r0, =gUnknown_08615910 - bl AddWindow - lsls r0, 24 - lsrs r5, r0, 24 - movs r6, 0 - b _081B24C0 - .pool -_081B24B4: - ldr r0, =gUnknown_08615908 - bl AddWindow - lsls r0, 24 - lsrs r5, r0, 24 - movs r6, 0x3 -_081B24C0: - adds r0, r5, 0 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r0, =gUnknown_0203CEC8 - ldrb r1, [r0, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0xA - beq _081B2514 - ldr r4, =gText_Cancel - movs r0, 0 - adds r1, r4, 0 - movs r2, 0x30 - bl GetStringCenterAlignXOffset - lsls r0, 24 - lsrs r2, r0, 24 - adds r2, r6 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_086157FC - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - adds r0, r5, 0 - movs r1, 0 - movs r3, 0x1 - bl box_print - b _081B2540 - .pool -_081B2514: - ldr r4, =gText_Cancel2 - movs r0, 0 - adds r1, r4, 0 - movs r2, 0x30 - bl GetStringCenterAlignXOffset - lsls r0, 24 - lsrs r2, r0, 24 - adds r2, r6 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_086157FC - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - adds r0, r5, 0 - movs r1, 0 - movs r3, 0x1 - bl box_print -_081B2540: - adds r0, r5, 0 - bl PutWindowTilemap - adds r0, r5, 0 - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram -_081B2554: - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2428 - - thumb_func_start sub_81B2564 -sub_81B2564: @ 81B2564 - lsls r0, 24 - ldr r1, =gUnknown_0203CEC4 - lsrs r0, 23 - adds r0, 0x18 - ldr r1, [r1] - adds r1, r0 - adds r0, r1, 0 - bx lr - .pool - thumb_func_end sub_81B2564 - - thumb_func_start sub_81B2578 -sub_81B2578: @ 81B2578 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x2C - str r1, [sp, 0xC] - ldr r1, [sp, 0x4C] - ldr r4, [sp, 0x50] - ldr r5, [sp, 0x54] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x8] - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x10] - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x14] - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x18] - lsls r4, 24 - lsrs r6, r4, 24 - lsls r5, 24 - lsrs r5, 24 - mov r10, r5 - mov r0, r10 - muls r0, r6 - lsls r0, 5 - bl AllocZeroed - mov r9, r0 - cmp r0, 0 - beq _081B2646 - movs r5, 0 - ldr r0, [sp, 0x14] - lsls r0, 19 - str r0, [sp, 0x1C] - ldr r1, [sp, 0x18] - lsls r1, 19 - str r1, [sp, 0x20] - lsls r2, r6, 19 - str r2, [sp, 0x24] - mov r0, r10 - lsls r0, 19 - str r0, [sp, 0x28] - cmp r5, r10 - bcs _081B2624 -_081B25DA: - movs r4, 0 - adds r1, r5, 0x1 - mov r8, r1 - cmp r4, r6 - bcs _081B261A - ldr r2, [sp, 0x18] - adds r0, r2, r5 - ldr r2, [sp, 0x10] - adds r1, r0, 0 - muls r1, r2 - adds r7, r1, 0 -_081B25F0: - ldr r1, [sp, 0x14] - adds r0, r1, r4 - adds r0, r7 - ldr r2, [sp, 0xC] - adds r0, r2, r0 - ldrb r0, [r0] - bl sub_81B0DD4 - adds r1, r5, 0 - muls r1, r6 - adds r1, r4 - lsls r1, 5 - add r1, r9 - movs r2, 0x10 - bl CpuSet - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r6 - bcc _081B25F0 -_081B261A: - mov r1, r8 - lsls r0, r1, 24 - lsrs r5, r0, 24 - cmp r5, r10 - bcc _081B25DA -_081B2624: - ldr r0, [sp, 0x1C] - lsrs r2, r0, 16 - ldr r1, [sp, 0x20] - lsrs r3, r1, 16 - ldr r1, [sp, 0x24] - lsrs r0, r1, 16 - str r0, [sp] - ldr r1, [sp, 0x28] - lsrs r0, r1, 16 - str r0, [sp, 0x4] - ldr r0, [sp, 0x8] - mov r1, r9 - bl BlitBitmapToWindow - mov r0, r9 - bl Free -_081B2646: - add sp, 0x2C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81B2578 - - thumb_func_start sub_81B2658 -sub_81B2658: @ 81B2658 - push {r4-r6,lr} - sub sp, 0xC - ldr r4, [sp, 0x1C] - ldr r5, [sp, 0x20] - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - cmp r3, 0 - bne _081B2684 - cmp r4, 0 - bne _081B2684 - movs r3, 0xA - movs r4, 0x7 -_081B2684: - cmp r5, 0 - bne _081B26A0 - ldr r1, =gUnknown_08615988 - str r2, [sp] - str r3, [sp, 0x4] - str r4, [sp, 0x8] - movs r2, 0xA - adds r3, r6, 0 - bl sub_81B2578 - b _081B26B0 - .pool -_081B26A0: - ldr r1, =gUnknown_086159CE - str r2, [sp] - str r3, [sp, 0x4] - str r4, [sp, 0x8] - movs r2, 0xA - adds r3, r6, 0 - bl sub_81B2578 -_081B26B0: - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2658 - - thumb_func_start sub_81B26BC -sub_81B26BC: @ 81B26BC - push {r4-r6,lr} - sub sp, 0xC - ldr r4, [sp, 0x1C] - ldr r5, [sp, 0x20] - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - cmp r3, 0 - bne _081B26E8 - cmp r4, 0 - bne _081B26E8 - movs r3, 0x12 - movs r4, 0x3 -_081B26E8: - cmp r5, 0 - bne _081B2704 - ldr r1, =gUnknown_08615A14 - str r2, [sp] - str r3, [sp, 0x4] - str r4, [sp, 0x8] - movs r2, 0x12 - adds r3, r6, 0 - bl sub_81B2578 - b _081B2714 - .pool -_081B2704: - ldr r1, =gUnknown_08615A4A - str r2, [sp] - str r3, [sp, 0x4] - str r4, [sp, 0x8] - movs r2, 0x12 - adds r3, r6, 0 - bl sub_81B2578 -_081B2714: - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B26BC - - thumb_func_start sub_81B2720 -sub_81B2720: @ 81B2720 - push {lr} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_08615A80 - movs r2, 0 - str r2, [sp] - movs r2, 0x12 - str r2, [sp, 0x4] - movs r2, 0x3 - str r2, [sp, 0x8] - movs r2, 0x12 - movs r3, 0 - bl sub_81B2578 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2720 - - thumb_func_start sub_81B2748 -sub_81B2748: @ 81B2748 - push {r4-r7,lr} - lsls r1, 24 - lsrs r4, r1, 24 - adds r5, r4, 0 - ldrb r0, [r0, 0x8] - movs r1, 0x5 - bl GetWindowAttribute - lsls r0, 28 - lsrs r6, r0, 24 - adds r7, r6, 0 - movs r0, 0x40 - ands r0, r4 - cmp r0, 0 - beq _081B277C - ldr r5, =gUnknown_08615AF1 - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615AC0 - b _081B297E - .pool -_081B277C: - movs r0, 0x20 - ands r0, r4 - cmp r0, 0 - beq _081B27D8 - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _081B2794 - ldr r5, =gUnknown_08615ADF - b _081B2942 - .pool -_081B2794: - ldr r5, =gUnknown_08615ADF - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615ABA - ldrb r1, [r4] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x2] - bl sub_81B2564 - ldrb r1, [r4, 0x2] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldr r5, =gUnknown_08615AEE - b _081B2976 - .pool -_081B27D8: - movs r0, 0x10 - ands r0, r4 - cmp r0, 0 - beq _081B2824 - ldr r5, =gUnknown_08615ADF - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615ABA - ldrb r1, [r4] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x2] - bl sub_81B2564 - ldrb r1, [r4, 0x2] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldr r5, =gUnknown_08615AEE - b _081B2976 - .pool -_081B2824: - movs r0, 0x4 - ands r0, r4 - cmp r0, 0 - beq _081B2880 - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _081B283C - ldr r5, =gUnknown_08615ADF - b _081B2942 - .pool -_081B283C: - ldr r5, =gUnknown_08615ADF - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615ABA - ldrb r1, [r4] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x2] - bl sub_81B2564 - ldrb r1, [r4, 0x2] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldr r5, =gUnknown_08615AEE - b _081B2976 - .pool -_081B2880: - movs r0, 0x2 - ands r0, r4 - cmp r0, 0 - beq _081B28DC - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _081B2898 - ldr r5, =gUnknown_08615ADC - b _081B2942 - .pool -_081B2898: - ldr r5, =gUnknown_08615AD3 - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615ABA - ldrb r1, [r4] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x2] - bl sub_81B2564 - ldrb r1, [r4, 0x2] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldr r5, =gUnknown_08615AE8 - b _081B2976 - .pool -_081B28DC: - movs r0, 0x8 - ands r0, r4 - cmp r0, 0 - beq _081B2938 - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _081B28F4 - ldr r5, =gUnknown_08615AD9 - b _081B2942 - .pool -_081B28F4: - ldr r5, =gUnknown_08615AD0 - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615ABA - ldrb r1, [r4] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x2] - bl sub_81B2564 - ldrb r1, [r4, 0x2] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldr r5, =gUnknown_08615AE5 - b _081B2976 - .pool -_081B2938: - movs r0, 0x1 - ands r5, r0 - cmp r5, 0 - beq _081B29BC - ldr r5, =gUnknown_08615AD6 -_081B2942: - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615ABA - ldrb r1, [r4] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x2] - bl sub_81B2564 - ldrb r1, [r4, 0x2] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldr r5, =gUnknown_08615AEB -_081B2976: - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615ABD -_081B297E: - ldrb r1, [r4] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x2] - bl sub_81B2564 - ldrb r1, [r4, 0x2] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - b _081B2A24 - .pool -_081B29BC: - ldr r5, =gUnknown_08615ACD - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615ABA - ldrb r1, [r4] - adds r1, r7 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r7 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x2] - bl sub_81B2564 - ldrb r1, [r4, 0x2] - adds r1, r7 - movs r2, 0x2 - bl LoadPalette - ldr r5, =gUnknown_08615AE2 - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615ABD - ldrb r1, [r4] - adds r1, r7 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r7 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x2] - bl sub_81B2564 - ldrb r1, [r4, 0x2] - adds r1, r7 - movs r2, 0x2 - bl LoadPalette -_081B2A24: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2748 - - thumb_func_start sub_81B2A3C -sub_81B2A3C: @ 81B2A3C - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - lsls r2, 24 - lsrs r2, 24 - ldrb r5, [r3] - ldrb r3, [r3, 0x1] - lsls r4, r2, 1 - adds r4, r2 - ldr r2, =gUnknown_086157FC - adds r4, r2 - str r4, [sp] - movs r2, 0 - str r2, [sp, 0x4] - str r1, [sp, 0x8] - movs r1, 0 - adds r2, r5, 0 - bl box_print - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2A3C - - thumb_func_start sub_81B2A70 -sub_81B2A70: @ 81B2A70 - push {r4-r7,lr} - sub sp, 0x14 - adds r7, r0, 0 - adds r6, r1, 0 - lsls r2, 24 - lsrs r4, r2, 24 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B2AC0 - cmp r4, 0x1 - bne _081B2AAA - ldr r5, [r6] - ldrb r0, [r6, 0x8] - ldrb r1, [r5, 0x4] - lsrs r1, 3 - ldrb r2, [r5, 0x5] - lsrs r2, 3 - ldrb r3, [r5, 0x6] - lsrs r3, 3 - ldrb r4, [r5, 0x7] - lsrs r4, 3 - str r4, [sp] - movs r4, 0 - str r4, [sp, 0x4] - ldr r4, [r5] - bl _call_via_r4 -_081B2AAA: - adds r0, r7, 0 - add r1, sp, 0x8 - bl GetMonNickname - ldrb r0, [r6, 0x8] - ldr r3, [r6] - adds r3, 0x4 - add r1, sp, 0x8 - movs r2, 0 - bl sub_81B2A3C -_081B2AC0: - add sp, 0x14 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81B2A70 - - thumb_func_start sub_81B2AC8 -sub_81B2AC8: @ 81B2AC8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - adds r6, r0, 0 - adds r7, r1, 0 - lsls r2, 24 - lsrs r4, r2, 24 - mov r8, r4 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B2B34 - adds r0, r6, 0 - bl sub_81B205C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _081B2AF6 - cmp r0, 0x6 - bne _081B2B34 -_081B2AF6: - cmp r4, 0 - beq _081B2B1C - ldr r5, [r7] - ldrb r0, [r7, 0x8] - ldrb r1, [r5, 0x8] - lsrs r1, 3 - ldrb r2, [r5, 0x9] - lsrs r2, 3 - adds r2, 0x1 - ldrb r3, [r5, 0xA] - lsrs r3, 3 - ldrb r4, [r5, 0xB] - lsrs r4, 3 - str r4, [sp] - movs r4, 0 - str r4, [sp, 0x4] - ldr r4, [r5] - bl _call_via_r4 -_081B2B1C: - mov r0, r8 - cmp r0, 0x2 - beq _081B2B34 - adds r0, r6, 0 - movs r1, 0x38 - bl GetMonData - lsls r0, 24 - lsrs r0, 24 - adds r1, r7, 0 - bl sub_81B2B40 -_081B2B34: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81B2AC8 - - thumb_func_start sub_81B2B40 -sub_81B2B40: @ 81B2B40 - push {r4-r6,lr} - adds r2, r0, 0 - adds r6, r1, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r5, =gStringVar2 - adds r0, r5, 0 - adds r1, r2, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar1 - ldr r1, =gText_LevelSymbol - adds r0, r4, 0 - bl StringCopy - adds r0, r4, 0 - adds r1, r5, 0 - bl StringAppend - ldrb r0, [r6, 0x8] - ldr r3, [r6] - adds r3, 0x8 - adds r1, r4, 0 - movs r2, 0 - bl sub_81B2A3C - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2B40 - - thumb_func_start sub_81B2B8C -sub_81B2B8C: @ 81B2B8C - push {r4-r7,lr} - sub sp, 0x14 - adds r6, r0, 0 - adds r7, r1, 0 - lsls r2, 24 - lsrs r2, 24 - cmp r2, 0x1 - bne _081B2BBE - ldr r5, [r7] - ldrb r0, [r7, 0x8] - ldrb r1, [r5, 0xC] - lsrs r1, 3 - ldrb r2, [r5, 0xD] - lsrs r2, 3 - adds r2, 0x1 - ldrb r3, [r5, 0xE] - lsrs r3, 3 - ldrb r4, [r5, 0xF] - lsrs r4, 3 - str r4, [sp] - movs r4, 0 - str r4, [sp, 0x4] - ldr r4, [r5] - bl _call_via_r4 -_081B2BBE: - adds r0, r6, 0 - add r1, sp, 0x8 - bl GetMonNickname - adds r0, r6, 0 - bl GetMonGender - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r6, 0 - movs r1, 0xB - bl GetMonData - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - add r2, sp, 0x8 - adds r3, r7, 0 - bl sub_81B2BF4 - add sp, 0x14 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81B2B8C - - thumb_func_start sub_81B2BF4 -sub_81B2BF4: @ 81B2BF4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - mov r9, r2 - adds r7, r3, 0 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r1, 16 - lsrs r4, r1, 16 - adds r5, r4, 0 - ldrb r0, [r7, 0x8] - movs r1, 0x5 - bl GetWindowAttribute - lsls r0, 28 - lsrs r6, r0, 24 - cmp r4, 0 - beq _081B2CBA - cmp r4, 0x20 - beq _081B2C24 - cmp r4, 0x1D - bne _081B2C38 -_081B2C24: - movs r0, 0xB - adds r1, r5, 0 - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - mov r0, r9 - bl StringCompare - cmp r0, 0 - beq _081B2CBA -_081B2C38: - mov r0, r8 - cmp r0, 0 - beq _081B2C48 - cmp r0, 0xFE - beq _081B2C88 - b _081B2CBA - .pool -_081B2C48: - ldr r5, =gUnknown_08615AC3 - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615AB6 - ldrb r1, [r4] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r7, 0x8] - ldr r1, =gText_MaleSymbol - ldr r3, [r7] - adds r3, 0xC - movs r2, 0x2 - bl sub_81B2A3C - b _081B2CBA - .pool -_081B2C88: - ldr r5, =gUnknown_08615AC5 - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615AB6 - ldrb r1, [r4] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r7, 0x8] - ldr r1, =gText_FemaleSymbol - ldr r3, [r7] - adds r3, 0xC - movs r2, 0x2 - bl sub_81B2A3C -_081B2CBA: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2BF4 - - thumb_func_start sub_81B2CD4 -sub_81B2CD4: @ 81B2CD4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - adds r7, r0, 0 - adds r6, r1, 0 - lsls r2, 24 - lsrs r4, r2, 24 - mov r8, r4 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B2D2E - cmp r4, 0 - beq _081B2D16 - ldr r5, [r6] - ldrb r0, [r6, 0x8] - ldrb r1, [r5, 0x10] - lsrs r1, 3 - ldrb r2, [r5, 0x11] - lsrs r2, 3 - adds r2, 0x1 - ldrb r3, [r5, 0x12] - lsrs r3, 3 - ldrb r4, [r5, 0x13] - lsrs r4, 3 - str r4, [sp] - movs r4, 0 - str r4, [sp, 0x4] - ldr r4, [r5] - bl _call_via_r4 -_081B2D16: - mov r0, r8 - cmp r0, 0x2 - beq _081B2D2E - adds r0, r7, 0 - movs r1, 0x39 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - bl sub_81B2D3C -_081B2D2E: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81B2CD4 - - thumb_func_start sub_81B2D3C -sub_81B2D3C: @ 81B2D3C - push {r4,r5,lr} - adds r2, r0, 0 - adds r4, r1, 0 - lsls r2, 16 - lsrs r2, 16 - ldr r5, =gStringVar1 - adds r0, r5, 0 - adds r1, r2, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - movs r1, 0xBA - strb r1, [r0] - movs r1, 0xFF - strb r1, [r0, 0x1] - ldrb r0, [r4, 0x8] - ldr r3, [r4] - adds r3, 0x10 - adds r1, r5, 0 - movs r2, 0 - bl sub_81B2A3C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2D3C - - thumb_func_start sub_81B2D74 -sub_81B2D74: @ 81B2D74 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - adds r7, r0, 0 - adds r6, r1, 0 - lsls r2, 24 - lsrs r4, r2, 24 - mov r8, r4 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B2DD0 - cmp r4, 0 - beq _081B2DB8 - ldr r5, [r6] - ldrb r0, [r6, 0x8] - ldrb r1, [r5, 0x14] - lsrs r1, 3 - adds r1, 0x1 - ldrb r2, [r5, 0x15] - lsrs r2, 3 - adds r2, 0x1 - ldrb r3, [r5, 0x16] - lsrs r3, 3 - ldrb r4, [r5, 0x17] - lsrs r4, 3 - str r4, [sp] - movs r4, 0 - str r4, [sp, 0x4] - ldr r4, [r5] - bl _call_via_r4 -_081B2DB8: - mov r0, r8 - cmp r0, 0x2 - beq _081B2DD0 - adds r0, r7, 0 - movs r1, 0x3A - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - bl sub_81B2DDC -_081B2DD0: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81B2D74 - - thumb_func_start sub_81B2DDC -sub_81B2DDC: @ 81B2DDC - push {r4-r6,lr} - adds r2, r0, 0 - adds r6, r1, 0 - lsls r2, 16 - lsrs r2, 16 - ldr r5, =gStringVar2 - adds r0, r5, 0 - adds r1, r2, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar1 - ldr r1, =gText_Slash - adds r0, r4, 0 - bl StringCopy - adds r0, r4, 0 - adds r1, r5, 0 - bl StringAppend - ldrb r0, [r6, 0x8] - ldr r3, [r6] - adds r3, 0x14 - adds r1, r4, 0 - movs r2, 0 - bl sub_81B2A3C - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2DDC - - thumb_func_start sub_81B2E28 -sub_81B2E28: @ 81B2E28 - push {r4-r6,lr} - adds r5, r0, 0 - adds r6, r1, 0 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B2E5C - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0x3A - bl GetMonData - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - adds r2, r6, 0 - bl sub_81B2E64 -_081B2E5C: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81B2E28 - - thumb_func_start sub_81B2E64 -sub_81B2E64: @ 81B2E64 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x8 - adds r6, r2, 0 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r1, 16 - lsrs r1, 16 - mov r9, r1 - ldrb r0, [r6, 0x8] - movs r1, 0x5 - bl GetWindowAttribute - lsls r0, 28 - lsrs r7, r0, 24 - mov r1, r8 - lsls r0, r1, 16 - asrs r0, 16 - mov r2, r9 - lsls r1, r2, 16 - asrs r1, 16 - bl sub_8075060 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - beq _081B2EB0 - cmp r0, 0x2 - blt _081B2EE0 - cmp r0, 0x4 - bgt _081B2EE0 - ldr r5, =gUnknown_08615AC7 - b _081B2EB2 - .pool -_081B2EB0: - ldr r5, =gUnknown_08615AC9 -_081B2EB2: - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615AB8 - ldrb r1, [r4] - adds r1, r7 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r7 - movs r2, 0x2 - bl LoadPalette - b _081B2F04 - .pool -_081B2EE0: - ldr r5, =gUnknown_08615ACB - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615AB8 - ldrb r1, [r4] - adds r1, r7 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r7 - movs r2, 0x2 - bl LoadPalette -_081B2F04: - mov r1, r8 - lsls r0, r1, 16 - asrs r0, 16 - mov r2, r9 - lsls r1, r2, 16 - asrs r1, 16 - ldr r2, [r6] - ldrb r2, [r2, 0x1A] - bl sub_8075034 - lsls r0, 24 - lsrs r5, r0, 24 - ldrb r0, [r6, 0x8] - ldr r4, =gUnknown_08615AB8 - ldrb r1, [r4, 0x1] - ldr r3, [r6] - ldrb r2, [r3, 0x18] - ldrb r3, [r3, 0x19] - str r5, [sp] - movs r7, 0x1 - str r7, [sp, 0x4] - bl FillWindowPixelRect - ldrb r0, [r6, 0x8] - ldrb r1, [r4] - ldr r3, [r6] - ldrb r2, [r3, 0x18] - ldrb r3, [r3, 0x19] - adds r3, 0x1 - str r5, [sp] - movs r4, 0x2 - str r4, [sp, 0x4] - bl FillWindowPixelRect - ldr r1, [r6] - ldrb r0, [r1, 0x1A] - cmp r5, r0 - beq _081B2F88 - ldrb r0, [r6, 0x8] - ldrb r2, [r1, 0x18] - adds r2, r5 - ldrb r3, [r1, 0x19] - ldrb r1, [r1, 0x1A] - subs r1, r5 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp] - str r7, [sp, 0x4] - movs r1, 0xD - bl FillWindowPixelRect - ldrb r0, [r6, 0x8] - ldr r1, [r6] - ldrb r2, [r1, 0x18] - adds r2, r5 - ldrb r3, [r1, 0x19] - adds r3, 0x1 - ldrb r1, [r1, 0x1A] - subs r1, r5 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp] - str r4, [sp, 0x4] - movs r1, 0x2 - bl FillWindowPixelRect -_081B2F88: - ldrb r0, [r6, 0x8] - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2E64 - - thumb_func_start sub_81B2FA8 -sub_81B2FA8: @ 81B2FA8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - adds r6, r1, 0 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r2, 24 - lsrs r7, r2, 24 - cmp r7, 0 - beq _081B2FF2 - ldr r5, [r6] - ldrb r1, [r5, 0x1C] - movs r4, 0x7 - adds r0, r1, 0 - ands r0, r4 - ldrb r2, [r5, 0x1E] - adds r0, r2 - adds r3, r0, 0x7 - asrs r3, 3 - ldrb r2, [r5, 0x1D] - adds r0, r2, 0 - ands r0, r4 - ldrb r4, [r5, 0x1F] - adds r0, r4 - adds r4, r0, 0x7 - ldrb r0, [r6, 0x8] - lsrs r1, 3 - lsrs r2, 3 - lsrs r4, 3 - str r4, [sp] - movs r4, 0x1 - str r4, [sp, 0x4] - ldr r4, [r5] - bl _call_via_r4 -_081B2FF2: - cmp r7, 0x2 - beq _081B3018 - ldrb r0, [r6, 0x8] - ldr r1, [r6] - ldrb r2, [r1, 0x1C] - ldrb r3, [r1, 0x1D] - ldr r1, =gUnknown_086157FC - str r1, [sp] - movs r1, 0 - str r1, [sp, 0x4] - ldr r4, =gUnknown_08615B60 - mov r5, r8 - lsls r1, r5, 2 - adds r1, r4 - ldr r1, [r1] - str r1, [sp, 0x8] - movs r1, 0x1 - bl box_print -_081B3018: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2FA8 - - thumb_func_start sub_81B302C -sub_81B302C: @ 81B302C - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4] - cmp r0, 0xFF - beq _081B304C - movs r1, 0 - bl sub_8198070 - ldrb r0, [r4] - bl RemoveWindow - movs r0, 0xFF - strb r0, [r4] - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram -_081B304C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B302C - - thumb_func_start display_pokemon_menu_message -display_pokemon_menu_message: @ 81B3054 - push {r4-r6,lr} - sub sp, 0xC - adds r6, r0, 0 - ldr r0, =gUnknown_0203CEC4 - ldr r4, [r0] - adds r5, r4, 0 - adds r5, 0xD - ldrb r0, [r4, 0xD] - cmp r0, 0xFF - beq _081B306E - adds r0, r5, 0 - bl sub_81B302C -_081B306E: - cmp r6, 0x7F - beq _081B313C - adds r0, r6, 0 - subs r0, 0x15 - cmp r0, 0x5 - bhi _081B30D4 - lsls r0, 2 - ldr r1, =_081B308C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081B308C: - .4byte _081B30A4 - .4byte _081B30BC - .4byte _081B30BC - .4byte _081B30AC - .4byte _081B30B4 - .4byte _081B30C4 -_081B30A4: - ldr r0, =gUnknown_08615928 - b _081B30C6 - .pool -_081B30AC: - ldr r0, =gUnknown_08615930 - b _081B30C6 - .pool -_081B30B4: - ldr r0, =gUnknown_08615938 - b _081B30C6 - .pool -_081B30BC: - ldr r0, =gUnknown_08615940 - b _081B30C6 - .pool -_081B30C4: - ldr r0, =gUnknown_08615948 -_081B30C6: - bl AddWindow - strb r0, [r5] - b _081B30DC - .pool -_081B30D4: - ldr r0, =gUnknown_08615920 - bl AddWindow - strb r0, [r4, 0xD] -_081B30DC: - cmp r6, 0 - bne _081B3104 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 31 - cmp r0, 0 - beq _081B30F8 - movs r6, 0x2 - b _081B3104 - .pool -_081B30F8: - bl sub_81B314C - lsls r0, 24 - cmp r0, 0 - bne _081B3104 - movs r6, 0x1 -_081B3104: - ldrb r0, [r5] - movs r1, 0 - movs r2, 0x4F - movs r3, 0xD - bl SetWindowBorderStyle - ldr r4, =gStringVar4 - ldr r1, =gUnknown_08615AF4 - lsls r0, r6, 2 - adds r0, r1 - ldr r1, [r0] - adds r0, r4, 0 - bl StringExpandPlaceholders - ldrb r0, [r5] - movs r1, 0x1 - str r1, [sp] - movs r1, 0 - str r1, [sp, 0x4] - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0 - bl PrintTextOnWindow - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram -_081B313C: - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end display_pokemon_menu_message - - thumb_func_start sub_81B314C -sub_81B314C: @ 81B314C - push {r4-r7,lr} - ldr r7, =gPlayerParty - movs r6, 0 - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0xB] - cmp r0, 0x1 - bne _081B3168 -_081B315A: - movs r0, 0x1 - b _081B31AA - .pool -_081B3168: - movs r5, 0 -_081B316A: - movs r0, 0x64 - muls r0, r5 - adds r4, r7, r0 - adds r0, r4, 0 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B319A - adds r0, r4, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - bne _081B3194 - adds r0, r4, 0 - movs r1, 0x2D - bl GetMonData - cmp r0, 0 - beq _081B319A -_081B3194: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_081B319A: - cmp r6, 0x1 - bhi _081B315A - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _081B316A - movs r0, 0 -_081B31AA: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81B314C - - thumb_func_start sub_81B31B0 -sub_81B31B0: @ 81B31B0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x1C - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - beq _081B320C - cmp r4, 0x1 - bgt _081B31CC - cmp r4, 0 - beq _081B31D2 - b _081B321C -_081B31CC: - cmp r4, 0x2 - beq _081B3214 - b _081B321C -_081B31D2: - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - ldrb r0, [r1, 0x17] - lsls r0, 1 - movs r3, 0x13 - subs r3, r0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0xA - str r0, [sp] - ldrb r0, [r1, 0x17] - lsls r0, 25 - lsrs r0, 24 - str r0, [sp, 0x4] - movs r0, 0xE - str r0, [sp, 0x8] - ldr r0, =0x000002e9 - str r0, [sp, 0xC] - add r0, sp, 0x14 - movs r1, 0x2 - movs r2, 0x13 - bl SetWindowTemplateFields - b _081B3226 - .pool -_081B320C: - ldr r0, =gUnknown_08615950 - b _081B321E - .pool -_081B3214: - ldr r0, =gUnknown_08615958 - b _081B321E - .pool -_081B321C: - ldr r0, =gUnknown_08615960 -_081B321E: - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp, 0x14] - str r1, [sp, 0x18] -_081B3226: - add r0, sp, 0x14 - bl AddWindow - ldr r6, =gUnknown_0203CEC4 - ldr r1, [r6] - strb r0, [r1, 0xC] - ldr r0, [r6] - ldrb r0, [r0, 0xC] - movs r1, 0 - movs r2, 0x4F - movs r3, 0xD - bl SetWindowBorderStyle - cmp r4, 0x3 - bne _081B3250 - ldr r0, [r6] - b _081B32E2 - .pool -_081B3250: - movs r0, 0x1 - movs r1, 0 - bl GetMenuCursorDimensionByFont - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - movs r0, 0x1 - movs r1, 0x2 - bl GetFontAttribute - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r5, 0 - ldr r0, [r6] - ldrb r0, [r0, 0x17] - cmp r5, r0 - bcs _081B32CA - adds r7, r6, 0 - movs r6, 0 -_081B327A: - ldr r1, [r7] - adds r0, r1, 0 - adds r0, 0xF - adds r4, r0, r5 - ldrb r0, [r4] - movs r2, 0x3 - cmp r0, 0x12 - bls _081B328C - movs r2, 0x4 -_081B328C: - ldrb r0, [r1, 0xC] - lsls r3, r5, 4 - adds r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - mov r1, r8 - str r1, [sp] - str r6, [sp, 0x4] - lsls r1, r2, 1 - adds r1, r2 - ldr r2, =gUnknown_086157FC - adds r1, r2 - str r1, [sp, 0x8] - str r6, [sp, 0xC] - ldr r2, =gUnknown_08615C08 - ldrb r1, [r4] - lsls r1, 3 - adds r1, r2 - ldr r1, [r1] - str r1, [sp, 0x10] - movs r1, 0x1 - mov r2, r9 - bl AddTextPrinterParametrized2 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, [r7] - ldrb r0, [r0, 0x17] - cmp r5, r0 - bcc _081B327A -_081B32CA: - ldr r4, =gUnknown_0203CEC4 - ldr r1, [r4] - ldrb r0, [r1, 0xC] - ldrb r1, [r1, 0x17] - movs r2, 0 - movs r3, 0x1 - bl InitMenuInUpperLeftCorner - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r0, [r4] -_081B32E2: - ldrb r0, [r0, 0xC] - add sp, 0x1C - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B31B0 - - thumb_func_start sub_81B3300 -sub_81B3300: @ 81B3300 - push {r4,lr} - sub sp, 0x10 - adds r4, r0, 0 - movs r0, 0x6 - movs r1, 0 - movs r2, 0x4F - movs r3, 0xD - bl SetWindowBorderStyle - ldr r2, =gTextFlags - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - bl sav2_get_text_speed - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x1 - str r0, [sp, 0x8] - movs r0, 0x3 - str r0, [sp, 0xC] - movs r0, 0x6 - movs r1, 0x1 - adds r2, r4, 0 - bl AddTextPrinterParametrized - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B3300 - - thumb_func_start sub_81B334C -sub_81B334C: @ 81B334C - push {lr} - ldr r0, =gUnknown_08615968 - movs r1, 0x4F - movs r2, 0xD - movs r3, 0 - bl CreateYesNoMenu - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B334C - - thumb_func_start sub_81B3364 -sub_81B3364: @ 81B3364 - push {r4,lr} - ldr r0, =gUnknown_08615970 - bl AddWindow - ldr r4, =gUnknown_0203CEC4 - ldr r1, [r4] - strb r0, [r1, 0xC] - ldr r0, [r4] - ldrb r0, [r0, 0xC] - movs r1, 0 - movs r2, 0x4F - movs r3, 0xD - bl SetWindowBorderStyle - ldr r0, [r4] - ldrb r0, [r0, 0xC] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B3364 - - thumb_func_start sub_81B3394 -sub_81B3394: @ 81B3394 - push {r4,lr} - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - ldrb r0, [r0, 0xC] - bl ClearWindowTilemap - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B3394 - - thumb_func_start sub_81B33B4 -sub_81B33B4: @ 81B33B4 - push {r4,lr} - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - cmp r2, 0 - bne _081B33C8 - bl sub_81B3414 - b _081B3400 -_081B33C8: - ldr r4, =gUnknown_0203CEC4 - ldr r1, [r4] - ldr r0, =gUnknown_08615D70 - adds r0, r2, r0 - ldrb r0, [r0] - strb r0, [r1, 0x17] - movs r3, 0 - ldr r0, [r4] - ldrb r0, [r0, 0x17] - cmp r3, r0 - bcs _081B3400 - ldr r1, =gUnknown_08615D38 - lsls r0, r2, 2 - adds r2, r0, r1 -_081B33E4: - ldr r1, [r4] - adds r1, 0xF - adds r1, r3 - ldr r0, [r2] - adds r0, r3 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - ldr r0, [r4] - ldrb r0, [r0, 0x17] - cmp r3, r0 - bcc _081B33E4 -_081B3400: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B33B4 - - thumb_func_start sub_81B3414 -sub_81B3414: @ 81B3414 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r9, r0 - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - ldr r2, =gUnknown_0203CEC4 - ldr r1, [r2] - movs r0, 0 - strb r0, [r1, 0x17] - ldr r1, [r2] - adds r0, r1, 0 - adds r0, 0xF - adds r1, 0x17 - movs r2, 0 - bl AppendToList - movs r7, 0 - ldr r0, =gUnknown_08615D7E - ldrh r0, [r0] - str r0, [sp] -_081B3446: - movs r4, 0 - adds r0, r7, 0x1 - mov r8, r0 - ldr r1, [sp] - cmp r1, 0xE - beq _081B34A0 - movs r0, 0x64 - mov r6, r10 - muls r6, r0 - ldr r5, =gUnknown_08615D7E -_081B345A: - mov r1, r9 - adds r0, r1, r6 - adds r1, r7, 0 - adds r1, 0xD - bl GetMonData - lsls r1, r4, 1 - adds r1, r5 - ldrh r1, [r1] - cmp r0, r1 - bne _081B3490 - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0xF - adds r1, 0x17 - adds r2, r4, 0 - adds r2, 0x13 - lsls r2, 24 - lsrs r2, 24 - bl AppendToList - b _081B34A0 - .pool -_081B3490: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 1 - adds r0, r5 - ldrh r0, [r0] - cmp r0, 0xE - bne _081B345A -_081B34A0: - mov r1, r8 - lsls r0, r1, 24 - lsrs r7, r0, 24 - cmp r7, 0x3 - bls _081B3446 - bl InBattlePike - lsls r0, 24 - cmp r0, 0 - bne _081B3518 - mov r0, r9 - adds r0, 0x64 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B34D2 - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0xF - adds r1, 0x17 - movs r2, 0x1 - bl AppendToList -_081B34D2: - movs r0, 0x64 - mov r1, r10 - muls r1, r0 - adds r0, r1, 0 - add r0, r9 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - bl itemid_is_mail - lsls r0, 24 - cmp r0, 0 - beq _081B3508 - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0xF - adds r1, 0x17 - movs r2, 0x6 - bl AppendToList - b _081B3518 - .pool -_081B3508: - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0xF - adds r1, 0x17 - movs r2, 0x3 - bl AppendToList -_081B3518: - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0xF - adds r1, 0x17 - movs r2, 0x2 - bl AppendToList - 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_81B3414 - - thumb_func_start sub_81B353C -sub_81B353C: @ 81B353C - push {r4,lr} - adds r4, r0, 0 - ldr r1, =gUnknown_0203CEC8 - ldrb r0, [r1, 0x8] - lsls r0, 28 - lsrs r0, 28 - adds r2, r1, 0 - cmp r0, 0xC - bhi _081B35FE - lsls r0, 2 - ldr r1, =_081B3560 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081B3560: - .4byte _081B3594 - .4byte _081B35B0 - .4byte _081B35FE - .4byte _081B35FE - .4byte _081B35BC - .4byte _081B35FE - .4byte _081B35DC - .4byte _081B35FE - .4byte _081B35EE - .4byte _081B35F2 - .4byte _081B35F6 - .4byte _081B35FE - .4byte _081B35FA -_081B3594: - bl InMultiBattleRoom - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B35AC - adds r0, r4, 0 - movs r1, 0x2D - bl GetMonData - cmp r0, 0 - beq _081B35FE -_081B35AC: - movs r1, 0x1 - b _081B3600 -_081B35B0: - adds r0, r4, 0 - bl sub_81B8A2C - lsls r0, 24 - lsrs r1, r0, 24 - b _081B3600 -_081B35BC: - movs r0, 0x9 - ldrsb r0, [r2, r0] - bl sub_81B856C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _081B35D4 - cmp r0, 0x1 - beq _081B35D8 - movs r1, 0x7 - b _081B3600 -_081B35D4: - movs r1, 0x4 - b _081B3600 -_081B35D8: - movs r1, 0x5 - b _081B3600 -_081B35DC: - adds r0, r4, 0 - movs r1, 0x2D - bl GetMonData - movs r1, 0x6 - cmp r0, 0 - beq _081B3600 - movs r1, 0x7 - b _081B3600 -_081B35EE: - movs r1, 0xA - b _081B3600 -_081B35F2: - movs r1, 0xB - b _081B3600 -_081B35F6: - movs r1, 0xC - b _081B3600 -_081B35FA: - movs r1, 0xD - b _081B3600 -_081B35FE: - movs r1, 0 -_081B3600: - adds r0, r1, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81B353C - - thumb_func_start sub_81B3608 -sub_81B3608: @ 81B3608 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r4, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r4, r1] - movs r0, 0x64 - muls r0, r1 - ldr r7, =gPlayerParty - adds r5, r0, r7 - ldr r1, =gStringVar1 - adds r0, r5, 0 - bl GetMonNickname - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - adds r0, 0xD - bl sub_81B302C - ldrb r1, [r4, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0xC - beq _081B3674 - ldrb r4, [r4, 0x9] - adds r0, r5, 0 - bl sub_81B353C - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r7, 0 - adds r1, r4, 0 - bl sub_81B33B4 - movs r0, 0 - bl sub_81B31B0 - movs r0, 0x15 - bl display_pokemon_menu_message - b _081B36EA - .pool -_081B3674: - adds r0, r5, 0 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0 - bne _081B36C0 - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9980 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - mov r2, r8 - lsls r0, r2, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B469C - str r1, [r0] - movs r0, 0 - b _081B36EC - .pool -_081B36C0: - ldrb r4, [r4, 0x9] - adds r0, r5, 0 - bl sub_81B353C - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r7, 0 - adds r1, r4, 0 - bl sub_81B33B4 - movs r0, 0x1 - bl sub_81B31B0 - ldr r1, =gStringVar2 - adds r0, r6, 0 - bl CopyItemName - movs r0, 0x1A - bl display_pokemon_menu_message -_081B36EA: - movs r0, 0x1 -_081B36EC: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B3608 - - thumb_func_start sub_81B36FC -sub_81B36FC: @ 81B36FC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_81B3608 - lsls r0, 24 - cmp r0, 0 - beq _081B3720 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0xFF - strh r1, [r0, 0x8] - ldr r1, =sub_81B3730 - str r1, [r0] -_081B3720: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B36FC - - thumb_func_start sub_81B3730 -sub_81B3730: @ 81B3730 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B37EE - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B37EE - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r5, r0, r1 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrb r0, [r0, 0x17] - cmp r0, 0x3 - bhi _081B3774 - bl ProcessMenuInputNoWrapAround_other - b _081B3778 - .pool -_081B3774: - bl ProcessMenuInput_other -_081B3778: - lsls r0, 24 - lsrs r4, r0, 24 - bl GetMenuCursorPos - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5] - lsls r0, r4, 24 - asrs r5, r0, 24 - movs r0, 0x2 - negs r0, r0 - cmp r5, r0 - beq _081B37EE - adds r0, 0x1 - cmp r5, r0 - bne _081B37CC - movs r0, 0x5 - bl PlaySE - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xE - bl sub_81B302C - ldr r2, =gUnknown_08615C08 - ldr r0, [r4] - ldrb r1, [r0, 0x17] - adds r0, r1 - ldrb r0, [r0, 0xE] - lsls r0, 3 - adds r2, 0x4 - adds r0, r2 - ldr r1, [r0] - adds r0, r6, 0 - bl _call_via_r1 - b _081B37EE - .pool -_081B37CC: - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xE - bl sub_81B302C - ldr r1, =gUnknown_08615C08 - ldr r0, [r4] - adds r0, 0xF - adds r0, r5 - ldrb r0, [r0] - lsls r0, 3 - adds r1, 0x4 - adds r0, r1 - ldr r1, [r0] - adds r0, r6, 0 - bl _call_via_r1 -_081B37EE: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B3730 - - thumb_func_start sub_81B37FC -sub_81B37FC: @ 81B37FC - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - ldr r0, =sub_81B3828 - str r0, [r1, 0x4] - adds r0, r4, 0 - bl sub_81B12C0 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B37FC - - thumb_func_start sub_81B3828 -sub_81B3828: @ 81B3828 - push {r4,lr} - sub sp, 0x4 - ldr r4, =gUnknown_0203CEC8 - ldrb r1, [r4, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x1 - bne _081B3868 - bl pokemon_change_order - ldr r1, =gPlayerParty - ldrb r2, [r4, 0x9] - ldr r0, =gPlayerPartyCount - ldrb r3, [r0] - subs r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =sub_81B3894 - str r0, [sp] - movs r0, 0x1 - bl sub_81BF8EC - b _081B3880 - .pool -_081B3868: - ldr r1, =gPlayerParty - ldrb r2, [r4, 0x9] - ldr r0, =gPlayerPartyCount - ldrb r3, [r0] - subs r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =sub_81B3894 - str r0, [sp] - movs r0, 0 - bl sub_81BF8EC -_081B3880: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B3828 - - thumb_func_start sub_81B3894 -sub_81B3894: @ 81B3894 - push {lr} - sub sp, 0xC - ldr r2, =gPaletteFade - ldrb r0, [r2, 0x8] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0x8] - ldr r3, =gUnknown_0203CEC8 - ldr r0, =gUnknown_0203CF20 - ldrb r0, [r0] - strb r0, [r3, 0x9] - ldrb r0, [r3, 0x8] - lsls r0, 28 - lsrs r0, 28 - ldrb r2, [r3, 0xB] - movs r1, 0x15 - str r1, [sp] - ldr r1, =sub_81B36FC - str r1, [sp, 0x4] - ldr r1, [r3] - str r1, [sp, 0x8] - movs r1, 0xFF - movs r3, 0x1 - bl sub_81B0038 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B3894 - - thumb_func_start brm_switch -brm_switch: @ 81B38DC - push {r4-r6,lr} - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - movs r0, 0x5 - bl PlaySE - ldr r5, =gUnknown_0203CEC8 - movs r0, 0x8 - strb r0, [r5, 0xB] - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - movs r0, 0x3 - bl display_pokemon_menu_message - ldrb r0, [r5, 0x9] - movs r1, 0x1 - bl sub_81B0FCC - ldrb r0, [r5, 0x9] - strb r0, [r5, 0xA] - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1370 - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end brm_switch - - thumb_func_start sub_81B3938 -sub_81B3938: @ 81B3938 - push {r4-r7,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r6, r0, r1 - ldr r3, =gUnknown_0203CEC8 - movs r1, 0xA - ldrsb r1, [r3, r1] - movs r0, 0x9 - ldrsb r0, [r3, r0] - cmp r1, r0 - bne _081B3968 - adds r0, r7, 0 - bl sub_81B407C - b _081B3ABA - .pool -_081B3968: - add r2, sp, 0x8 - movs r0, 0x9 - ldrsb r0, [r3, r0] - ldr r1, =gUnknown_0203CEDC - ldr r1, [r1] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x8] - movs r4, 0 - strb r0, [r2] - adds r0, r2, 0 - ldrb r0, [r0] - movs r1, 0x1 - bl GetWindowAttribute - strh r0, [r6] - add r0, sp, 0x8 - ldrb r0, [r0] - movs r1, 0x2 - bl GetWindowAttribute - strh r0, [r6, 0x2] - add r0, sp, 0x8 - ldrb r0, [r0] - movs r1, 0x3 - bl GetWindowAttribute - strh r0, [r6, 0x4] - add r0, sp, 0x8 - ldrb r0, [r0] - movs r1, 0x4 - bl GetWindowAttribute - strh r0, [r6, 0x6] - strh r4, [r6, 0x10] - movs r1, 0x4 - ldrsh r0, [r6, r1] - cmp r0, 0xA - bne _081B39C4 - movs r2, 0x1 - negs r2, r2 - adds r0, r2, 0 - b _081B39C6 - .pool -_081B39C4: - movs r0, 0x1 -_081B39C6: - strh r0, [r6, 0x14] - add r2, sp, 0x8 - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0xA] - lsls r0, 24 - asrs r0, 24 - ldr r1, =gUnknown_0203CEDC - ldr r1, [r1] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x8] - movs r4, 0 - strb r0, [r2, 0x1] - adds r0, r2, 0 - ldrb r0, [r0, 0x1] - movs r1, 0x1 - bl GetWindowAttribute - strh r0, [r6, 0x8] - add r0, sp, 0x8 - ldrb r0, [r0, 0x1] - movs r1, 0x2 - bl GetWindowAttribute - strh r0, [r6, 0xA] - add r0, sp, 0x8 - ldrb r0, [r0, 0x1] - movs r1, 0x3 - bl GetWindowAttribute - strh r0, [r6, 0xC] - add r0, sp, 0x8 - ldrb r0, [r0, 0x1] - movs r1, 0x4 - bl GetWindowAttribute - strh r0, [r6, 0xE] - strh r4, [r6, 0x12] - movs r1, 0xC - ldrsh r0, [r6, r1] - cmp r0, 0xA - bne _081B3A2C - movs r2, 0x1 - negs r2, r2 - adds r0, r2, 0 - b _081B3A2E - .pool -_081B3A2C: - movs r0, 0x1 -_081B3A2E: - strh r0, [r6, 0x16] - ldr r4, =gUnknown_0203CEF0 - movs r0, 0x4 - ldrsh r1, [r6, r0] - movs r2, 0x6 - ldrsh r0, [r6, r2] - lsls r0, 1 - muls r0, r1 - bl Alloc - str r0, [r4] - ldr r5, =gUnknown_0203CEF4 - movs r0, 0xC - ldrsh r1, [r6, r0] - movs r2, 0xE - ldrsh r0, [r6, r2] - lsls r0, 1 - muls r0, r1 - bl Alloc - str r0, [r5] - ldr r1, [r4] - ldrb r2, [r6] - ldrb r3, [r6, 0x2] - ldrb r0, [r6, 0x4] - str r0, [sp] - ldrb r0, [r6, 0x6] - str r0, [sp, 0x4] - movs r0, 0 - bl sub_8199CBC - ldr r1, [r5] - ldrb r2, [r6, 0x8] - ldrb r3, [r6, 0xA] - ldrb r0, [r6, 0xC] - str r0, [sp] - ldrb r0, [r6, 0xE] - str r0, [sp, 0x4] - movs r0, 0 - bl sub_8199CBC - add r0, sp, 0x8 - ldrb r0, [r0] - bl ClearWindowTilemap - add r0, sp, 0x8 - ldrb r0, [r0, 0x1] - bl ClearWindowTilemap - ldr r4, =gUnknown_0203CEC8 - movs r0, 0x9 - strb r0, [r4, 0xB] - ldrb r0, [r4, 0x9] - movs r1, 0x1 - bl sub_81B0FCC - ldrb r0, [r4, 0xA] - movs r1, 0x1 - bl sub_81B0FCC - adds r0, r7, 0 - bl sub_81B3CC0 - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B3D48 - str r1, [r0] -_081B3ABA: - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B3938 - - thumb_func_start sub_81B3AD8 -sub_81B3AD8: @ 81B3AD8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r2, 0 - mov r12, r3 - ldr r7, [sp, 0x18] - lsls r0, 16 - lsrs r3, r0, 16 - adds r5, r3, 0 - lsls r1, 16 - lsrs r2, r1, 16 - mov r8, r2 - lsls r0, r3, 16 - asrs r1, r0, 16 - lsls r0, r2, 16 - asrs r0, 16 - adds r4, r1, r0 - cmp r4, 0 - blt _081B3B02 - cmp r1, 0x1F - ble _081B3B06 -_081B3B02: - movs r0, 0 - b _081B3B34 -_081B3B06: - cmp r1, 0 - bge _081B3B1A - negs r0, r1 - strb r0, [r6] - movs r0, 0 - mov r1, r12 - strb r0, [r1] - adds r0, r2, r3 - strb r0, [r7] - b _081B3B32 -_081B3B1A: - movs r0, 0 - strb r0, [r6] - mov r0, r12 - strb r5, [r0] - cmp r4, 0x1F - ble _081B3B2E - movs r0, 0x20 - subs r0, r5 - strb r0, [r7] - b _081B3B32 -_081B3B2E: - mov r1, r8 - strb r1, [r7] -_081B3B32: - movs r0, 0x1 -_081B3B34: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81B3AD8 - - thumb_func_start sub_81B3B40 -sub_81B3B40: @ 81B3B40 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x34 - str r0, [sp, 0x28] - ldr r0, [sp, 0x54] - ldr r4, [sp, 0x58] - lsls r2, 16 - lsrs r2, 16 - mov r9, r2 - lsls r3, 16 - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - lsls r4, 16 - lsrs r4, 16 - str r4, [sp, 0x30] - lsls r1, 16 - asrs r7, r1, 16 - lsrs r0, r3, 16 - str r0, [sp, 0x2C] - asrs r3, 16 - mov r8, r3 - mov r5, sp - adds r5, 0x25 - mov r6, sp - adds r6, 0x26 - str r6, [sp] - adds r0, r7, 0 - mov r1, r8 - add r2, sp, 0x24 - adds r3, r5, 0 - bl sub_81B3AD8 - lsls r0, 24 - cmp r0, 0 - beq _081B3BFA - ldrb r2, [r5] - mov r1, r9 - lsls r0, r1, 24 - lsrs r0, 24 - mov r9, r0 - ldrb r0, [r6] - str r0, [sp] - mov r1, r10 - lsls r0, r1, 24 - lsrs r4, r0, 24 - str r4, [sp, 0x4] - movs r0, 0 - movs r1, 0 - mov r3, r9 - bl FillBgTilemapBufferRect_Palette0 - ldr r1, [sp, 0x30] - lsls r0, r1, 16 - asrs r0, 16 - adds r0, r7, r0 - lsls r0, 16 - asrs r0, 16 - str r6, [sp] - mov r1, r8 - add r2, sp, 0x24 - adds r3, r5, 0 - bl sub_81B3AD8 - lsls r0, 24 - cmp r0, 0 - beq _081B3BFA - add r0, sp, 0x24 - ldrb r2, [r0] - ldr r1, [sp, 0x2C] - lsls r0, r1, 24 - lsrs r0, 24 - str r0, [sp] - str r4, [sp, 0x4] - ldrb r0, [r5] - str r0, [sp, 0x8] - mov r0, r9 - str r0, [sp, 0xC] - ldrb r0, [r6] - str r0, [sp, 0x10] - str r4, [sp, 0x14] - movs r0, 0x11 - str r0, [sp, 0x18] - movs r0, 0 - str r0, [sp, 0x1C] - str r0, [sp, 0x20] - ldr r1, [sp, 0x28] - movs r3, 0 - bl CopyRectToBgTilemapBufferRect -_081B3BFA: - add sp, 0x34 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81B3B40 - - thumb_func_start sub_81B3C0C -sub_81B3C0C: @ 81B3C0C - push {r4,lr} - ldr r4, =gSprites - ldrb r2, [r0, 0xB] - lsls r3, r2, 4 - adds r3, r2 - lsls r3, 2 - adds r3, r4 - lsls r1, 16 - asrs r1, 13 - ldrh r2, [r3, 0x24] - adds r2, r1 - strh r2, [r3, 0x24] - ldrb r3, [r0, 0xA] - lsls r2, r3, 4 - adds r2, r3 - lsls r2, 2 - adds r2, r4 - ldrh r3, [r2, 0x24] - adds r3, r1 - strh r3, [r2, 0x24] - ldrb r3, [r0, 0x9] - lsls r2, r3, 4 - adds r2, r3 - lsls r2, 2 - adds r2, r4 - ldrh r3, [r2, 0x24] - adds r3, r1 - strh r3, [r2, 0x24] - ldrb r2, [r0, 0xC] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r4 - ldrh r2, [r0, 0x24] - adds r2, r1 - strh r2, [r0, 0x24] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B3C0C - - thumb_func_start sub_81B3C60 -sub_81B3C60: @ 81B3C60 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r4, r1, r0 - movs r1, 0x14 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _081B3C8E - ldr r2, =gUnknown_0203CEDC - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - lsls r1, 4 - ldr r0, [r2] - adds r0, r1 - movs r2, 0x14 - ldrsh r1, [r4, r2] - bl sub_81B3C0C -_081B3C8E: - movs r1, 0x16 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _081B3CAC - ldr r2, =gUnknown_0203CEDC - ldr r0, =gUnknown_0203CEC8 - movs r1, 0xA - ldrsb r1, [r0, r1] - lsls r1, 4 - ldr r0, [r2] - adds r0, r1 - movs r2, 0x16 - ldrsh r1, [r4, r2] - bl sub_81B3C0C -_081B3CAC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B3C60 - - thumb_func_start sub_81B3CC0 -sub_81B3CC0: @ 81B3CC0 - push {r4-r6,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r5, r1, r0 - movs r1, 0x14 - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _081B3D00 - ldr r0, =gUnknown_0203CEF0 - ldr r0, [r0] - ldrh r1, [r5, 0x10] - ldrh r2, [r5] - adds r1, r2 - lsls r1, 16 - asrs r1, 16 - movs r3, 0x2 - ldrsh r2, [r5, r3] - movs r4, 0x4 - ldrsh r3, [r5, r4] - movs r6, 0x6 - ldrsh r4, [r5, r6] - str r4, [sp] - movs r6, 0x14 - ldrsh r4, [r5, r6] - str r4, [sp, 0x4] - bl sub_81B3B40 -_081B3D00: - movs r1, 0x16 - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _081B3D2E - ldr r0, =gUnknown_0203CEF4 - ldr r0, [r0] - ldrh r1, [r5, 0x12] - ldrh r2, [r5, 0x8] - adds r1, r2 - lsls r1, 16 - asrs r1, 16 - movs r3, 0xA - ldrsh r2, [r5, r3] - movs r4, 0xC - ldrsh r3, [r5, r4] - movs r6, 0xE - ldrsh r4, [r5, r6] - str r4, [sp] - movs r6, 0x16 - ldrsh r4, [r5, r6] - str r4, [sp, 0x4] - bl sub_81B3B40 -_081B3D2E: - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B3CC0 - - thumb_func_start sub_81B3D48 -sub_81B3D48: @ 81B3D48 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r7, r0, 3 - ldr r0, =gTasks + 0x8 - mov r8, r0 - adds r6, r7, r0 - adds r0, r4, 0 - bl sub_81B3CC0 - adds r0, r4, 0 - bl sub_81B3C60 - ldrh r1, [r6, 0x14] - ldrh r2, [r6, 0x10] - adds r1, r2 - strh r1, [r6, 0x10] - ldrh r0, [r6, 0x16] - ldrh r3, [r6, 0x12] - adds r0, r3 - strh r0, [r6, 0x12] - add r2, sp, 0x8 - ldrh r0, [r6] - adds r0, r1 - strh r0, [r2] - adds r1, r2, 0 - ldrh r0, [r6, 0x12] - ldrh r3, [r6, 0x8] - adds r2, r0, r3 - strh r2, [r1, 0x2] - adds r0, r1, 0 - ldrh r0, [r0] - cmp r0, 0x21 - bls _081B3E3A - lsls r0, r2, 16 - lsrs r0, 16 - cmp r0, 0x21 - bls _081B3E3A - movs r1, 0x14 - ldrsh r0, [r6, r1] - negs r0, r0 - strh r0, [r6, 0x14] - movs r2, 0x16 - ldrsh r0, [r6, r2] - negs r0, r0 - strh r0, [r6, 0x16] - bl swap_pokemon_and_oams - ldr r4, =gUnknown_0203CEC8 - ldrb r0, [r4, 0x9] - bl sub_81B0948 - ldrb r0, [r4, 0xA] - bl sub_81B0948 - movs r0, 0x9 - ldrsb r0, [r4, r0] - ldr r5, =gUnknown_0203CEDC - ldr r1, [r5] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x8] - bl PutWindowTilemap - movs r0, 0xA - ldrsb r0, [r4, r0] - ldr r1, [r5] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x8] - bl PutWindowTilemap - ldr r0, =gUnknown_0203CEF0 - ldr r1, [r0] - ldrb r2, [r6] - ldrb r3, [r6, 0x2] - ldrb r0, [r6, 0x4] - str r0, [sp] - ldrb r0, [r6, 0x6] - str r0, [sp, 0x4] - movs r0, 0 - bl sub_8199CBC - ldr r0, =gUnknown_0203CEF4 - ldr r1, [r0] - ldrb r2, [r6, 0x8] - ldrb r3, [r6, 0xA] - ldrb r0, [r6, 0xC] - str r0, [sp] - ldrb r0, [r6, 0xE] - str r0, [sp, 0x4] - movs r0, 0 - bl sub_8199CBC - movs r0, 0x9 - ldrsb r0, [r4, r0] - ldr r1, [r5] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x8] - bl ClearWindowTilemap - movs r0, 0xA - ldrsb r0, [r4, r0] - ldr r1, [r5] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x8] - bl ClearWindowTilemap - mov r0, r8 - subs r0, 0x8 - adds r0, r7, r0 - ldr r1, =sub_81B3E60 - str r1, [r0] -_081B3E3A: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B3D48 - - thumb_func_start sub_81B3E60 -sub_81B3E60: @ 81B3E60 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - adds r0, r6, 0 - bl sub_81B3CC0 - adds r0, r6, 0 - bl sub_81B3C60 - movs r1, 0x14 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081B3EE4 - movs r2, 0x16 - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _081B3EE4 - ldr r5, =gUnknown_0203CEC8 - movs r0, 0x9 - ldrsb r0, [r5, r0] - ldr r4, =gUnknown_0203CEDC - ldr r1, [r4] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x8] - bl PutWindowTilemap - movs r0, 0xA - ldrsb r0, [r5, r0] - ldr r1, [r4] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x8] - bl PutWindowTilemap - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldr r0, =gUnknown_0203CEF0 - ldr r0, [r0] - bl Free - ldr r0, =gUnknown_0203CEF4 - ldr r0, [r0] - bl Free - adds r0, r6, 0 - bl sub_81B407C - b _081B3F08 - .pool -_081B3EE4: - ldrh r1, [r4, 0x14] - ldrh r0, [r4, 0x10] - adds r1, r0 - strh r1, [r4, 0x10] - ldrh r0, [r4, 0x16] - ldrh r2, [r4, 0x12] - adds r0, r2 - strh r0, [r4, 0x12] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0 - bne _081B3EFE - strh r1, [r4, 0x14] -_081B3EFE: - movs r1, 0x12 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081B3F08 - strh r0, [r4, 0x16] -_081B3F08: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81B3E60 - - thumb_func_start oamt_swap_pos -oamt_swap_pos: @ 81B3F10 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - ldrb r3, [r0] - ldrb r2, [r1] - strb r2, [r0] - strb r3, [r1] - ldr r5, =gSprites - ldrb r2, [r0] - lsls r3, r2, 4 - adds r3, r2 - lsls r3, 2 - adds r3, r5 - ldrh r6, [r3, 0x20] - ldrh r2, [r3, 0x22] - mov r8, r2 - ldrh r2, [r3, 0x24] - mov r9, r2 - ldrh r2, [r3, 0x26] - mov r10, r2 - ldrb r4, [r1] - lsls r2, r4, 4 - adds r2, r4 - lsls r2, 2 - adds r2, r5 - ldrh r2, [r2, 0x20] - strh r2, [r3, 0x20] - ldrb r2, [r0] - lsls r3, r2, 4 - adds r3, r2 - lsls r3, 2 - adds r3, r5 - ldrb r4, [r1] - lsls r2, r4, 4 - adds r2, r4 - lsls r2, 2 - adds r2, r5 - ldrh r2, [r2, 0x22] - strh r2, [r3, 0x22] - ldrb r2, [r0] - lsls r3, r2, 4 - adds r3, r2 - lsls r3, 2 - adds r3, r5 - ldrb r4, [r1] - lsls r2, r4, 4 - adds r2, r4 - lsls r2, 2 - adds r2, r5 - ldrh r2, [r2, 0x24] - strh r2, [r3, 0x24] - ldrb r0, [r0] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r5 - ldrb r3, [r1] - lsls r0, r3, 4 - adds r0, r3 - lsls r0, 2 - adds r0, r5 - ldrh r0, [r0, 0x26] - strh r0, [r2, 0x26] - ldrb r2, [r1] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r5 - strh r6, [r0, 0x20] - ldrb r2, [r1] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r5 - mov r2, r8 - strh r2, [r0, 0x22] - ldrb r2, [r1] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r5 - mov r2, r9 - strh r2, [r0, 0x24] - ldrb r1, [r1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - mov r1, r10 - strh r1, [r0, 0x26] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end oamt_swap_pos - - thumb_func_start swap_pokemon_and_oams -swap_pokemon_and_oams: @ 81B3FDC - push {r4-r6,lr} - sub sp, 0x8 - ldr r1, =gUnknown_0203CEDC - ldr r2, =gUnknown_0203CEC8 - movs r3, 0x9 - ldrsb r3, [r2, r3] - lsls r0, r3, 4 - ldr r1, [r1] - adds r0, r1, r0 - str r0, [sp] - ldrb r2, [r2, 0xA] - lsls r2, 24 - asrs r2, 24 - lsls r0, r2, 4 - adds r0, r1, r0 - str r0, [sp, 0x4] - movs r1, 0x64 - adds r4, r3, 0 - muls r4, r1 - ldr r0, =gPlayerParty - adds r4, r0 - adds r5, r2, 0 - muls r5, r1 - adds r5, r0 - movs r0, 0x64 - bl Alloc - adds r6, r0, 0 - adds r1, r4, 0 - movs r2, 0x64 - bl memcpy - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x64 - bl memcpy - adds r0, r5, 0 - adds r1, r6, 0 - movs r2, 0x64 - bl memcpy - adds r0, r6, 0 - bl Free - ldr r0, [sp] - adds r0, 0xB - ldr r1, [sp, 0x4] - adds r1, 0xB - bl oamt_swap_pos - ldr r0, [sp] - adds r0, 0xA - ldr r1, [sp, 0x4] - adds r1, 0xA - bl oamt_swap_pos - ldr r0, [sp] - adds r0, 0x9 - ldr r1, [sp, 0x4] - adds r1, 0x9 - bl oamt_swap_pos - ldr r0, [sp] - adds r0, 0xC - ldr r1, [sp, 0x4] - adds r1, 0xC - bl oamt_swap_pos - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end swap_pokemon_and_oams - - thumb_func_start sub_81B407C -sub_81B407C: @ 81B407C - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - adds r0, 0xD - bl sub_81B302C - 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, 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] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B407C - - thumb_func_start brm_cancel_1 -brm_cancel_1: @ 81B40D4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0x5 - bl PlaySE - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - ldr r0, =gUnknown_0203CEC8 - ldrb r1, [r0, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x6 - bne _081B4110 - movs r0, 0xF - bl display_pokemon_menu_message - b _081B4116 - .pool -_081B4110: - movs r0, 0 - bl display_pokemon_menu_message -_081B4116: - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B1370 - str r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end brm_cancel_1 - - thumb_func_start sub_81B4134 -sub_81B4134: @ 81B4134 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - movs r0, 0x5 - bl PlaySE - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - ldr r0, =gPlayerParty - ldr r1, =gUnknown_0203CEC8 - ldrb r1, [r1, 0x9] - movs r2, 0x8 - bl sub_81B33B4 - movs r0, 0x1 - bl sub_81B31B0 - movs r0, 0x18 - bl display_pokemon_menu_message - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0xFF - strh r1, [r0, 0x8] - ldr r1, =sub_81B3730 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4134 - - thumb_func_start sub_81B4198 -sub_81B4198: @ 81B4198 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - ldr r0, =sub_81B41C4 - str r0, [r1, 0x4] - adds r0, r4, 0 - bl sub_81B12C0 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4198 - - thumb_func_start sub_81B41C4 -sub_81B41C4: @ 81B41C4 - push {lr} - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - bne _081B41E0 - ldr r2, =c2_8123744 - movs r0, 0x2 - movs r1, 0x5 - bl GoToBagMenu - b _081B41E8 - .pool -_081B41E0: - ldr r1, =c2_8123744 - movs r0, 0x2 - bl sub_81C4F98 -_081B41E8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B41C4 - - thumb_func_start c2_8123744 -c2_8123744: @ 81B41F0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - ldr r6, =gScriptItemId - ldrh r0, [r6] - cmp r0, 0 - bne _081B4224 - ldr r3, =gUnknown_0203CEC8 - ldrb r0, [r3, 0x8] - lsls r0, 28 - lsrs r0, 28 - ldrb r2, [r3, 0xB] - movs r1, 0x7F - str r1, [sp] - ldr r1, =sub_81B36FC - str r1, [sp, 0x4] - ldr r1, [r3] - b _081B425A - .pool -_081B4224: - ldr r4, =gUnknown_0203CEFC - ldr r5, =gUnknown_0203CEC8 - movs r0, 0x9 - ldrsb r0, [r5, r0] - movs r1, 0x64 - mov r8, r1 - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - ldr r7, =gPlayerParty - adds r0, r7 - movs r1, 0xC - bl GetMonData - strh r0, [r4] - lsls r0, 16 - cmp r0, 0 - beq _081B4278 - ldrb r0, [r5, 0x8] - lsls r0, 28 - lsrs r0, 28 - ldrb r2, [r5, 0xB] - movs r1, 0x7F - str r1, [sp] - ldr r1, =sub_81B4350 - str r1, [sp, 0x4] - ldr r1, [r5] -_081B425A: - str r1, [sp, 0x8] - movs r1, 0xFF - movs r3, 0x1 - bl sub_81B0038 - b _081B42C0 - .pool -_081B4278: - ldrh r0, [r6] - bl itemid_is_mail - lsls r0, 24 - cmp r0, 0 - beq _081B42A4 - ldrh r0, [r6] - movs r1, 0x1 - bl RemoveBagItem - movs r0, 0x9 - ldrsb r0, [r5, r0] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r7 - ldrh r1, [r6] - bl sub_81B1DB8 - bl sub_81B452C - b _081B42C0 -_081B42A4: - ldrb r0, [r5, 0x8] - lsls r0, 28 - lsrs r0, 28 - ldrb r2, [r5, 0xB] - movs r1, 0x7F - str r1, [sp] - ldr r1, =sub_81B42D0 - str r1, [sp, 0x4] - ldr r1, [r5] - str r1, [sp, 0x8] - movs r1, 0xFF - movs r3, 0x1 - bl sub_81B0038 -_081B42C0: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end c2_8123744 - - thumb_func_start sub_81B42D0 -sub_81B42D0: @ 81B42D0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B432C - ldr r0, =gScriptItemId - ldrh r4, [r0] - ldr r0, =gUnknown_0203CEC8 - mov r8, r0 - ldrb r0, [r0, 0x9] - lsls r0, 24 - asrs r0, 24 - movs r6, 0x64 - muls r0, r6 - ldr r5, =gPlayerParty - adds r0, r5 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0 - bl sub_81B1C84 - mov r1, r8 - movs r0, 0x9 - ldrsb r0, [r1, r0] - muls r0, r6 - adds r0, r5 - adds r1, r4, 0 - bl sub_81B1DB8 - adds r0, r4, 0 - movs r1, 0x1 - bl RemoveBagItem - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B469C - str r1, [r0] -_081B432C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B42D0 - - thumb_func_start sub_81B4350 -sub_81B4350: @ 81B4350 - 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 _081B4388 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gUnknown_0203CEFC - ldrh r1, [r1] - movs r2, 0x1 - bl sub_81B1D1C - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B43A8 - str r1, [r0] -_081B4388: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4350 - - thumb_func_start sub_81B43A8 -sub_81B43A8: @ 81B43A8 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B43CC - bl sub_81B334C - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B43DC - str r0, [r1] -_081B43CC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B43A8 - - thumb_func_start sub_81B43DC -sub_81B43DC: @ 81B43DC - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _081B4402 - cmp r1, 0 - bgt _081B43FC - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _081B44D8 - b _081B44EC -_081B43FC: - cmp r1, 0x1 - beq _081B44DE - b _081B44EC -_081B4402: - ldr r5, =gScriptItemId - ldrh r0, [r5] - movs r1, 0x1 - bl RemoveBagItem - ldr r6, =gUnknown_0203CEFC - ldrh r0, [r6] - movs r1, 0x1 - bl AddBagItem - lsls r0, 24 - cmp r0, 0 - bne _081B4458 - ldrh r0, [r5] - movs r1, 0x1 - bl AddBagItem - ldrh r0, [r6] - bl pokemon_item_not_removed - ldr r0, =gStringVar4 - movs r1, 0 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1C1C - str r1, [r0] - b _081B44EC - .pool -_081B4458: - ldrh r0, [r5] - bl itemid_is_mail - lsls r0, 24 - cmp r0, 0 - beq _081B4498 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - ldrh r1, [r5] - bl sub_81B1DB8 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B44FC - str r1, [r0] - b _081B44EC - .pool -_081B4498: - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - ldrh r1, [r5] - bl sub_81B1DB8 - ldrh r0, [r5] - ldrh r1, [r6] - movs r2, 0x1 - bl sub_81B1D68 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B469C - str r1, [r0] - b _081B44EC - .pool -_081B44D8: - movs r0, 0x5 - bl PlaySE -_081B44DE: - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B1C1C - str r0, [r1] -_081B44EC: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B43DC - - thumb_func_start sub_81B44FC -sub_81B44FC: @ 81B44FC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B451C - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - ldr r0, =sub_81B452C - str r0, [r1, 0x4] - adds r0, r4, 0 - bl sub_81B12C0 -_081B451C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B44FC - - thumb_func_start sub_81B452C -sub_81B452C: @ 81B452C - push {lr} - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x40 - bl GetMonData - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gSaveBlock1Ptr - lsls r2, r0, 3 - adds r2, r0 - lsls r2, 2 - ldr r0, =0x00002be0 - adds r2, r0 - ldr r1, [r1] - adds r1, r2 - ldr r2, =sub_81B4578 - movs r0, 0x4 - movs r3, 0x3 - bl sub_811A20C - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B452C - - thumb_func_start sub_81B4578 -sub_81B4578: @ 81B4578 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - ldr r6, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r6, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - ldr r0, =gScriptResult - ldrh r7, [r0] - cmp r7, 0 - bne _081B45F8 - adds r0, r5, 0 - bl sub_80D4680 - ldr r4, =gUnknown_0203CEFC - adds r0, r5, 0 - movs r1, 0xC - adds r2, r4, 0 - bl SetMonData - ldrh r0, [r4] - movs r1, 0x1 - bl RemoveBagItem - mov r0, r8 - movs r1, 0x1 - bl AddBagItem - ldrb r0, [r6, 0x8] - lsls r0, 28 - lsrs r0, 28 - ldrb r2, [r6, 0xB] - str r7, [sp] - ldr r1, =sub_81B36FC - str r1, [sp, 0x4] - ldr r1, [r6] - str r1, [sp, 0x8] - movs r1, 0xFF - movs r3, 0x1 - bl sub_81B0038 - b _081B4614 - .pool -_081B45F8: - ldrb r0, [r6, 0x8] - lsls r0, 28 - lsrs r0, 28 - ldrb r2, [r6, 0xB] - movs r1, 0x7F - str r1, [sp] - ldr r1, =sub_81B4624 - str r1, [sp, 0x4] - ldr r1, [r6] - str r1, [sp, 0x8] - movs r1, 0xFF - movs r3, 0x1 - bl sub_81B0038 -_081B4614: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4578 - - thumb_func_start sub_81B4624 -sub_81B4624: @ 81B4624 - 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 _081B468A - ldr r1, =gUnknown_0203CEFC - ldrh r0, [r1] - cmp r0, 0 - bne _081B4670 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gScriptItemId - ldrh r1, [r1] - movs r2, 0 - movs r3, 0 - bl sub_81B1C84 - b _081B467C - .pool -_081B4670: - ldr r0, =gScriptItemId - ldrh r0, [r0] - ldrh r1, [r1] - movs r2, 0 - bl sub_81B1D68 -_081B467C: - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B469C - str r0, [r1] -_081B468A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4624 - - thumb_func_start sub_81B469C -sub_81B469C: @ 81B469C - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r4, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r4, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r6, r1, r0 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B471C - ldr r5, =gUnknown_0203CEDC - movs r0, 0x9 - ldrsb r0, [r4, r0] - lsls r0, 4 - ldr r1, [r5] - adds r1, r0 - adds r0, r6, 0 - bl sub_81B5C94 - ldrb r1, [r4, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0xC - bne _081B4716 - adds r0, r6, 0 - movs r1, 0xC - bl GetMonData - cmp r0, 0 - beq _081B4704 - movs r0, 0x9 - ldrsb r0, [r4, r0] - lsls r0, 4 - ldr r1, [r5] - adds r1, r0 - movs r0, 0xB - movs r2, 0x1 - bl sub_81B2FA8 - b _081B4716 - .pool -_081B4704: - movs r0, 0x9 - ldrsb r0, [r4, r0] - lsls r0, 4 - ldr r1, [r5] - adds r1, r0 - movs r0, 0xC - movs r2, 0x1 - bl sub_81B2FA8 -_081B4716: - adds r0, r7, 0 - bl sub_81B1C1C -_081B471C: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81B469C - - thumb_func_start sub_81B4724 -sub_81B4724: @ 81B4724 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r6, r0, 16 - movs r0, 0x5 - bl PlaySE - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - adds r0, r5, 0 - bl sub_81B1E00 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _081B4788 - cmp r0, 0x1 - beq _081B47AC - adds r0, r5, 0 - adds r1, r6, 0 - movs r2, 0x1 - bl sub_81B1CD0 - b _081B47BA - .pool -_081B4788: - ldr r1, =gStringVar1 - adds r0, r5, 0 - bl GetMonNickname - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9980 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - b _081B47B4 - .pool -_081B47AC: - adds r0, r6, 0 - bl pokemon_item_not_removed - ldr r0, =gStringVar4 -_081B47B4: - movs r1, 0x1 - bl sub_81B1B5C -_081B47BA: - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r0, =gTasks - lsls r1, r7, 2 - adds r1, r7 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B469C - str r0, [r1] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4724 - - thumb_func_start sub_81B47E0 -sub_81B47E0: @ 81B47E0 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r7, r1, r0 - adds r0, r7, 0 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r5, r0, 16 - movs r0, 0x5 - bl PlaySE - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - cmp r5, 0 - bne _081B4864 - ldr r1, =gStringVar1 - adds r0, r7, 0 - bl GetMonNickname - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9980 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B469C - b _081B488A - .pool -_081B4864: - ldr r1, =gStringVar1 - adds r0, r5, 0 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9E00 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B48A8 -_081B488A: - str r1, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B47E0 - - thumb_func_start sub_81B48A8 -sub_81B48A8: @ 81B48A8 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B48CC - bl sub_81B334C - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B48DC - str r0, [r1] -_081B48CC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B48A8 - - thumb_func_start sub_81B48DC -sub_81B48DC: @ 81B48DC - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r4, r1, r0 - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _081B491A - cmp r1, 0 - bgt _081B4914 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _081B4964 - b _081B4978 - .pool -_081B4914: - cmp r1, 0x1 - beq _081B496A - b _081B4978 -_081B491A: - adds r0, r4, 0 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - ldr r1, =gStringVar1 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9E14 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B4988 - str r1, [r0] - b _081B4978 - .pool -_081B4964: - movs r0, 0x5 - bl PlaySE -_081B496A: - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B1C1C - str r0, [r1] -_081B4978: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B48DC - - thumb_func_start sub_81B4988 -sub_81B4988: @ 81B4988 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r6, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r6, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B49EC - movs r1, 0 - mov r0, sp - strh r1, [r0] - adds r0, r5, 0 - movs r1, 0xC - mov r2, sp - bl SetMonData - ldr r4, =gUnknown_0203CEDC - movs r0, 0x9 - ldrsb r0, [r6, r0] - lsls r0, 4 - ldr r1, [r4] - adds r1, r0 - adds r0, r5, 0 - bl sub_81B5C94 - movs r0, 0x9 - ldrsb r0, [r6, r0] - lsls r0, 4 - ldr r1, [r4] - adds r1, r0 - movs r0, 0xC - movs r2, 0x1 - bl sub_81B2FA8 - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1C1C - str r1, [r0] -_081B49EC: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4988 - - thumb_func_start sub_81B4A08 -sub_81B4A08: @ 81B4A08 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - movs r0, 0x5 - bl PlaySE - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - ldr r0, =gPlayerParty - ldr r1, =gUnknown_0203CEC8 - ldrb r1, [r1, 0x9] - movs r2, 0x9 - bl sub_81B33B4 - movs r0, 0x2 - bl sub_81B31B0 - movs r0, 0x19 - bl display_pokemon_menu_message - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0xFF - strh r1, [r0, 0x8] - ldr r1, =sub_81B3730 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4A08 - - thumb_func_start sub_81B4A6C -sub_81B4A6C: @ 81B4A6C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - ldr r0, =sub_81B4A98 - str r0, [r1, 0x4] - adds r0, r4, 0 - bl sub_81B12C0 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4A6C - - thumb_func_start sub_81B4A98 -sub_81B4A98: @ 81B4A98 - push {lr} - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x40 - bl GetMonData - ldr r2, =gSaveBlock1Ptr - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x00002be0 - adds r1, r0 - ldr r0, [r2] - adds r0, r1 - ldr r1, =sub_81B4AE0 - movs r2, 0x1 - bl sub_8121478 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4A98 - - thumb_func_start sub_81B4AE0 -sub_81B4AE0: @ 81B4AE0 - push {lr} - sub sp, 0xC - ldr r2, =gPaletteFade - ldrb r0, [r2, 0x8] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0x8] - ldr r3, =gUnknown_0203CEC8 - ldrb r0, [r3, 0x8] - lsls r0, 28 - lsrs r0, 28 - ldrb r2, [r3, 0xB] - movs r1, 0x15 - str r1, [sp] - ldr r1, =sub_81B36FC - str r1, [sp, 0x4] - ldr r1, [r3] - str r1, [sp, 0x8] - movs r1, 0xFF - movs r3, 0x1 - bl sub_81B0038 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4AE0 - - thumb_func_start brm_take_2 -brm_take_2: @ 81B4B20 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl PlaySE - ldr r5, =gUnknown_0203CEC4 - ldr r0, [r5] - adds r0, 0xD - bl sub_81B302C - ldr r0, [r5] - adds r0, 0xC - bl sub_81B302C - ldr r0, =gUnknown_085E9855 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B4B6C - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end brm_take_2 - - thumb_func_start sub_81B4B6C -sub_81B4B6C: @ 81B4B6C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B4B90 - bl sub_81B334C - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B4BA0 - str r0, [r1] -_081B4B90: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4B6C - - thumb_func_start sub_81B4BA0 -sub_81B4BA0: @ 81B4BA0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _081B4BC6 - cmp r1, 0 - bgt _081B4BC0 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _081B4C30 - b _081B4C4C -_081B4BC0: - cmp r1, 0x1 - beq _081B4C36 - b _081B4C4C -_081B4BC6: - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - bl sub_80D4700 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _081B4C0C - ldr r0, =gUnknown_085E9877 - movs r1, 0 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B469C - b _081B4C4A - .pool -_081B4C0C: - ldr r0, =gUnknown_085E9897 - movs r1, 0 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1C1C - b _081B4C4A - .pool -_081B4C30: - movs r0, 0x5 - bl PlaySE -_081B4C36: - ldr r0, =gUnknown_085E98B4 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B4C60 -_081B4C4A: - str r1, [r0] -_081B4C4C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4BA0 - - thumb_func_start sub_81B4C60 -sub_81B4C60: @ 81B4C60 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B4C84 - bl sub_81B334C - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B4C94 - str r0, [r1] -_081B4C84: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4C60 - - thumb_func_start sub_81B4C94 -sub_81B4C94: @ 81B4C94 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _081B4CBE - cmp r1, 0 - bgt _081B4CB8 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _081B4D50 - b _081B4D64 -_081B4CB8: - cmp r1, 0x1 - beq _081B4D56 - b _081B4D64 -_081B4CBE: - ldr r0, =gUnknown_0203CEC8 - mov r8, r0 - ldrb r0, [r0, 0x9] - lsls r0, 24 - asrs r0, 24 - movs r7, 0x64 - muls r0, r7 - ldr r6, =gPlayerParty - adds r0, r6 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - movs r1, 0x1 - bl AddBagItem - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B4D24 - mov r1, r8 - movs r0, 0x9 - ldrsb r0, [r1, r0] - muls r0, r7 - adds r0, r6 - bl sub_80D4680 - ldr r0, =gUnknown_085E99B8 - movs r1, 0 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B469C - str r1, [r0] - b _081B4D64 - .pool -_081B4D24: - adds r0, r4, 0 - bl pokemon_item_not_removed - ldr r0, =gStringVar4 - movs r1, 0 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1C1C - str r1, [r0] - b _081B4D64 - .pool -_081B4D50: - movs r0, 0x5 - bl PlaySE -_081B4D56: - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B1C1C - str r0, [r1] -_081B4D64: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4C94 - - thumb_func_start sub_81B4D78 -sub_81B4D78: @ 81B4D78 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r5, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r5, r1] - movs r0, 0x64 - muls r0, r1 - ldr r6, =gPlayerParty - adds r7, r0, r6 - movs r0, 0x5 - bl PlaySE - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - ldrb r4, [r5, 0x9] - adds r0, r7, 0 - bl sub_81B353C - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_81B33B4 - ldrb r1, [r5, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0xC - beq _081B4DE4 - movs r0, 0 - bl sub_81B31B0 - movs r0, 0x15 - bl display_pokemon_menu_message - b _081B4E02 - .pool -_081B4DE4: - movs r0, 0x1 - bl sub_81B31B0 - adds r0, r7, 0 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - ldr r1, =gStringVar2 - bl CopyItemName - movs r0, 0x1A - bl display_pokemon_menu_message -_081B4E02: - ldr r1, =gTasks - mov r2, r8 - lsls r0, r2, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r1, 0xFF - strh r1, [r0, 0x8] - ldr r1, =sub_81B3730 - str r1, [r0] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4D78 - - thumb_func_start brm_shift_sendout -brm_shift_sendout: @ 81B4E2C - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x5 - bl PlaySE - ldr r5, =gUnknown_0203CEC4 - ldr r0, [r5] - adds r0, 0xC - bl sub_81B302C - bl sub_81B8A7C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B4E5C - adds r0, r4, 0 - bl sub_81B12C0 - b _081B4E7A - .pool -_081B4E5C: - ldr r0, [r5] - adds r0, 0xD - bl sub_81B302C - ldr r0, =gStringVar4 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1C1C - str r1, [r0] -_081B4E7A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end brm_shift_sendout - - thumb_func_start sub_81B4E8C -sub_81B4E8C: @ 81B4E8C - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - bl sub_81B8830 - lsls r0, 24 - lsrs r6, r0, 24 - movs r5, 0 - cmp r5, r6 - bcs _081B4F36 - ldr r2, =gUnknown_0203CEC8 - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - mov r8, r0 -_081B4EC6: - ldr r0, =gUnknown_0203CEF8 - adds r4, r5, r0 - ldrb r0, [r4] - cmp r0, 0 - bne _081B4F2C - movs r0, 0x5 - str r2, [sp] - bl PlaySE - ldr r2, [sp] - ldrb r0, [r2, 0x9] - adds r0, 0x1 - strb r0, [r4] - adds r0, r5, 0x2 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0203CEDC - ldrb r2, [r2, 0x9] - lsls r2, 24 - asrs r2, 24 - lsls r2, 4 - ldr r1, [r1] - adds r1, r2 - movs r2, 0x1 - bl sub_81B2FA8 - subs r0, r6, 0x1 - cmp r5, r0 - bne _081B4F04 - bl sub_81B4F88 -_081B4F04: - movs r0, 0 - bl display_pokemon_menu_message - ldr r0, =sub_81B1370 - mov r1, r8 - str r0, [r1] - b _081B4F68 - .pool -_081B4F2C: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, r6 - bcc _081B4EC6 -_081B4F36: - ldr r0, =gStringVar1 - adds r1, r6, 0 - movs r2, 0 - movs r3, 0x1 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9830 - adds r0, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x20 - bl PlaySE - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1C1C - str r1, [r0] -_081B4F68: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4E8C - - thumb_func_start sub_81B4F88 -sub_81B4F88: @ 81B4F88 - push {r4,lr} - ldr r4, =gUnknown_0203CEC8 - ldrb r0, [r4, 0x9] - movs r1, 0 - bl sub_81B0FCC - movs r0, 0x6 - strb r0, [r4, 0x9] - movs r1, 0x1 - bl sub_81B0FCC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4F88 - - thumb_func_start sub_81B4FA8 -sub_81B4FA8: @ 81B4FA8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r0, 0x5 - bl PlaySE - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - bl sub_81B8830 - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - cmp r4, r5 - bcs _081B502A - ldr r6, =gUnknown_0203CEF8 - subs r2, r5, 0x1 - adds r7, r6, 0 - ldr r3, =gUnknown_0203CEC8 -_081B4FE2: - adds r0, r4, r6 - ldrb r1, [r0] - movs r0, 0x9 - ldrsb r0, [r3, r0] - adds r0, 0x1 - cmp r1, r0 - bne _081B5020 - adds r0, r4, 0 - adds r4, r2, 0 - cmp r0, r4 - bge _081B500C - adds r3, r7, 0 -_081B4FFA: - adds r2, r0, r3 - adds r1, r0, 0x1 - adds r0, r1, r3 - ldrb r0, [r0] - strb r0, [r2] - lsls r1, 24 - lsrs r0, r1, 24 - cmp r0, r4 - blt _081B4FFA -_081B500C: - adds r1, r0, r6 - movs r0, 0 - strb r0, [r1] - b _081B502A - .pool -_081B5020: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _081B4FE2 -_081B502A: - ldr r6, =gUnknown_0203CEDC - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0x9] - lsls r0, 24 - asrs r0, 24 - lsls r0, 4 - ldr r1, [r6] - adds r1, r0 - movs r0, 0x1 - movs r2, 0x1 - bl sub_81B2FA8 - movs r4, 0 - subs r5, 0x1 - mov r0, r8 - lsls r7, r0, 2 - cmp r4, r5 - bge _081B5078 -_081B504E: - ldr r0, =gUnknown_0203CEF8 - adds r1, r4, r0 - ldrb r0, [r1] - cmp r0, 0 - beq _081B506E - adds r0, r4, 0x2 - lsls r0, 24 - lsrs r0, 24 - ldrb r2, [r1] - lsls r2, 4 - subs r2, 0x10 - ldr r1, [r6] - adds r1, r2 - movs r2, 0x1 - bl sub_81B2FA8 -_081B506E: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - blt _081B504E -_081B5078: - movs r0, 0 - bl display_pokemon_menu_message - ldr r0, =gTasks - mov r2, r8 - adds r1, r7, r2 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B1370 - str r0, [r1] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4FA8 - - thumb_func_start sub_81B50AC -sub_81B50AC: @ 81B50AC - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl PlaySE - adds r0, r4, 0 - bl sub_81B12C0 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B50AC - - thumb_func_start sub_81B50C8 -sub_81B50C8: @ 81B50C8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =gUnknown_0203CEC8 - mov r9, r0 - ldrb r0, [r0, 0x9] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x64 - mov r8, r1 - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - ldr r4, =gPlayerParty - adds r0, r4 - movs r1, 0x41 - bl GetMonData - adds r6, r0, 0 - lsls r6, 16 - lsrs r6, 16 - mov r1, r9 - movs r0, 0x9 - ldrsb r0, [r1, r0] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r4 - movs r1, 0xB - bl GetMonData - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - mov r1, r9 - movs r0, 0x9 - ldrsb r0, [r1, r0] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r4 - movs r1, 0x50 - bl GetMonData - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_800F7DC - ldr r0, [r0] - adds r1, r6, 0 - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_807A8D0 - cmp r0, 0x1 - beq _081B515C - cmp r0, 0x2 - beq _081B5170 - movs r0, 0x5 - bl PlaySE - adds r0, r7, 0 - bl sub_81B12C0 - b _081B51B0 - .pool -_081B515C: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EA210 - bl StringExpandPlaceholders - b _081B5178 - .pool -_081B5170: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EA234 - bl StringExpandPlaceholders -_081B5178: - movs r0, 0x20 - bl PlaySE - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EA1CA - adds r0, r4, 0 - bl StringAppend - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1C1C - str r1, [r0] -_081B51B0: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B50C8 - - thumb_func_start brm_trade_1 -brm_trade_1: @ 81B51D4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0xC - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =gUnknown_0203CEC8 - mov r8, r0 - ldrb r0, [r0, 0x9] - lsls r0, 24 - asrs r0, 24 - movs r6, 0x64 - muls r0, r6 - ldr r4, =gPlayerParty - adds r0, r4 - movs r1, 0x41 - bl GetMonData - mov r9, r0 - mov r1, r9 - lsls r1, 16 - lsrs r1, 16 - mov r9, r1 - mov r1, r8 - movs r0, 0x9 - ldrsb r0, [r1, r0] - muls r0, r6 - adds r0, r4 - movs r1, 0xB - bl GetMonData - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - mov r1, r8 - movs r0, 0x9 - ldrsb r0, [r1, r0] - muls r0, r6 - adds r0, r4 - movs r1, 0x50 - bl GetMonData - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_800F7DC - ldr r0, [r0] - ldr r1, =gUnknown_02022C38 - ldr r1, [r1] - ldr r2, =gUnknown_02022C3C - ldrh r3, [r2] - ldr r2, =gUnknown_02022C3E - ldrb r2, [r2] - str r2, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - mov r2, r9 - bl sub_807A7E0 - cmp r0, 0 - beq _081B52C8 - ldr r5, =gStringVar4 - ldr r1, =gUnknown_08615E0C - subs r0, 0x1 - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - adds r0, r5, 0 - bl StringExpandPlaceholders - movs r0, 0x20 - bl PlaySE - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - ldr r1, =gUnknown_085EA1CA - adds r0, r5, 0 - bl StringAppend - adds r0, r5, 0 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1C1C - str r1, [r0] - b _081B52D4 - .pool -_081B52C8: - movs r0, 0x5 - bl PlaySE - adds r0, r7, 0 - bl sub_81B12C0 -_081B52D4: - add sp, 0xC - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end brm_trade_1 - - thumb_func_start sub_81B52E4 -sub_81B52E4: @ 81B52E4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - ldr r0, =gPlayerParty - ldr r1, =gUnknown_0203CEC8 - ldrb r1, [r1, 0x9] - lsls r1, 24 - asrs r1, 24 - lsls r1, 16 - lsrs r1, 16 - bl sub_807A918 - cmp r0, 0x2 - beq _081B5340 - cmp r0, 0x2 - bgt _081B5328 - cmp r0, 0x1 - beq _081B532E - b _081B5368 - .pool -_081B5328: - cmp r0, 0x3 - beq _081B5354 - b _081B5368 -_081B532E: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EA1E8 - bl StringExpandPlaceholders - b _081B53C0 - .pool -_081B5340: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EA210 - bl StringExpandPlaceholders - b _081B53C0 - .pool -_081B5354: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EA234 - bl StringExpandPlaceholders - b _081B53C0 - .pool -_081B5368: - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - 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_085EA1CD - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B53FC - b _081B53E4 - .pool -_081B53C0: - movs r0, 0x20 - bl PlaySE - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EA1CA - adds r0, r4, 0 - bl StringAppend - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1C1C -_081B53E4: - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B52E4 - - thumb_func_start sub_81B53FC -sub_81B53FC: @ 81B53FC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B5420 - bl sub_81B334C - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B5430 - str r0, [r1] -_081B5420: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B53FC - - thumb_func_start sub_81B5430 -sub_81B5430: @ 81B5430 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _081B5456 - cmp r1, 0 - bgt _081B5450 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _081B545E - b _081B546A -_081B5450: - cmp r1, 0x1 - beq _081B5464 - b _081B546A -_081B5456: - adds r0, r4, 0 - bl sub_81B12C0 - b _081B546A -_081B545E: - movs r0, 0x5 - bl PlaySE -_081B5464: - adds r0, r4, 0 - bl sub_81B1C1C -_081B546A: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B5430 - - thumb_func_start sub_81B5470 -sub_81B5470: @ 81B5470 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - bl GetMenuCursorPos - ldr r5, =gUnknown_0203CEC4 - ldr r1, [r5] - lsls r0, 24 - lsrs r0, 24 - adds r1, 0xF - adds r1, r0 - ldrb r0, [r1] - subs r0, 0x13 - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x5 - bl PlaySE - ldr r1, =gUnknown_08615D9C - lsls r0, r4, 3 - adds r7, r0, r1 - ldr r0, [r7] - cmp r0, 0 - bne _081B54A2 - b _081B5664 -_081B54A2: - ldr r0, [r5] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r5] - adds r0, 0xD - bl sub_81B302C - bl sub_81221AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B54C6 - bl InUnionRoom - cmp r0, 0x1 - bne _081B54E8 -_081B54C6: - adds r0, r4, 0 - subs r0, 0xB - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _081B54E4 - movs r0, 0xD - bl display_pokemon_menu_message - b _081B5656 - .pool -_081B54E4: - ldrb r0, [r7, 0x4] - b _081B5652 -_081B54E8: - cmp r4, 0x7 - bhi _081B5524 - ldr r1, =0x00000867 - adds r0, r4, r1 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B5524 - ldr r0, =gUnknown_085E97FC - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1C1C - str r1, [r0] - b _081B5664 - .pool -_081B5524: - ldr r1, =gUnknown_08615D9C - lsls r0, r4, 3 - adds r5, r0, r1 - ldr r0, [r5] - bl _call_via_r0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B553A - b _081B563C -_081B553A: - subs r0, r4, 0x5 - cmp r0, 0x7 - bhi _081B5624 - lsls r0, 2 - ldr r1, =_081B5554 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081B5554: - .4byte _081B5614 - .4byte _081B5624 - .4byte _081B5624 - .4byte _081B557C - .4byte _081B55B8 - .4byte _081B5624 - .4byte _081B5574 - .4byte _081B5574 -_081B5574: - adds r0, r6, 0 - bl sub_8161560 - b _081B5664 -_081B557C: - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - movs r0, 0x1C - ldrsb r0, [r1, r0] - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r1, 0x1D] - lsls r1, 24 - asrs r1, 24 - lsls r1, 16 - lsrs r1, 16 - bl get_mapheader_by_bank_and_number - adds r1, r0, 0 - ldr r0, =gStringVar1 - ldrb r1, [r1, 0x14] - bl sub_81245DC - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EA196 - b _081B55E8 - .pool -_081B55B8: - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x24 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - lsls r0, 16 - lsrs r0, 16 - adds r1, 0x25 - ldrb r1, [r1] - lsls r1, 24 - asrs r1, 24 - lsls r1, 16 - lsrs r1, 16 - bl get_mapheader_by_bank_and_number - adds r1, r0, 0 - ldr r0, =gStringVar1 - ldrb r1, [r1, 0x14] - bl sub_81245DC - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EA16B -_081B55E8: - bl StringExpandPlaceholders - adds r0, r6, 0 - bl sub_81B5674 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - movs r1, 0x86 - lsls r1, 2 - adds r0, r1 - strh r4, [r0] - b _081B5664 - .pool -_081B5614: - ldr r1, =gUnknown_0203CEC8 - ldr r0, =sub_8124690 - b _081B5628 - .pool -_081B5624: - ldr r1, =gUnknown_0203CEC8 - ldr r0, =c2_exit_to_overworld_2_switch -_081B5628: - str r0, [r1] - adds r0, r6, 0 - bl sub_81B12C0 - b _081B5664 - .pool -_081B563C: - cmp r4, 0x1 - beq _081B564A - cmp r4, 0x4 - bne _081B5650 - bl sub_81B5864 - b _081B5656 -_081B564A: - bl sub_81B57DC - b _081B5656 -_081B5650: - ldrb r0, [r5, 0x4] -_081B5652: - bl display_pokemon_menu_message -_081B5656: - ldr r0, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =task_brm_cancel_1_on_keypad_a_or_b - str r0, [r1] -_081B5664: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B5470 - - thumb_func_start sub_81B5674 -sub_81B5674: @ 81B5674 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gStringVar4 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B56A4 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B5674 - - thumb_func_start sub_81B56A4 -sub_81B56A4: @ 81B56A4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B56C8 - bl sub_81B334C - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B56D8 - str r0, [r1] -_081B56C8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B56A4 - - thumb_func_start sub_81B56D8 -sub_81B56D8: @ 81B56D8 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _081B56FE - cmp r1, 0 - bgt _081B56F8 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _081B5714 - b _081B572A -_081B56F8: - cmp r1, 0x1 - beq _081B571A - b _081B572A -_081B56FE: - ldr r1, =gUnknown_0203CEC8 - ldr r0, =c2_exit_to_overworld_2_switch - str r0, [r1] - adds r0, r4, 0 - bl sub_81B12C0 - b _081B572A - .pool -_081B5714: - movs r0, 0x5 - bl PlaySE -_081B571A: - ldr r0, =gUnknown_03005DB0 - movs r1, 0 - str r1, [r0] - ldr r0, =gUnknown_0203CEEC - str r1, [r0] - adds r0, r4, 0 - bl sub_81B1C1C -_081B572A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B56D8 - - thumb_func_start hm_add_c3_launch_phase_2 -hm_add_c3_launch_phase_2: @ 81B5738 - push {lr} - bl pal_fill_black - ldr r0, =task_launch_hm_phase_2 - movs r1, 0x8 - bl CreateTask - movs r0, 0x1 - pop {r1} - bx r1 - .pool - thumb_func_end hm_add_c3_launch_phase_2 - - thumb_func_start task_launch_hm_phase_2 -task_launch_hm_phase_2: @ 81B5750 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80ABDFC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B577C - bl brm_get_selected_species - ldr r1, =gUnknown_02038C08 - lsls r0, 16 - lsrs r0, 16 - str r0, [r1] - ldr r0, =gUnknown_0203CEEC - ldr r0, [r0] - bl _call_via_r0 - adds r0, r4, 0 - bl DestroyTask -_081B577C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task_launch_hm_phase_2 - - thumb_func_start brm_get_selected_species -brm_get_selected_species: @ 81B578C - push {lr} - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - .pool - thumb_func_end brm_get_selected_species - - thumb_func_start task_brm_cancel_1_on_keypad_a_or_b -task_brm_cancel_1_on_keypad_a_or_b: @ 81B57B4 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081B57CE - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081B57D4 -_081B57CE: - adds r0, r2, 0 - bl brm_cancel_1 -_081B57D4: - pop {r0} - bx r0 - .pool - thumb_func_end task_brm_cancel_1_on_keypad_a_or_b - - thumb_func_start sub_81B57DC -sub_81B57DC: @ 81B57DC - push {lr} - ldr r0, =0x00000888 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B57F8 - movs r0, 0xC - bl display_pokemon_menu_message - b _081B57FE - .pool -_081B57F8: - movs r0, 0xD - bl display_pokemon_menu_message -_081B57FE: - pop {r0} - bx r0 - thumb_func_end sub_81B57DC - - thumb_func_start hm_surf_run_dp02scr -hm_surf_run_dp02scr: @ 81B5804 - push {lr} - bl brm_get_pokemon_selection - ldr r1, =gUnknown_02038C08 - lsls r0, 24 - lsrs r0, 24 - str r0, [r1] - movs r0, 0x9 - bl FieldEffectStart - pop {r0} - bx r0 - .pool - thumb_func_end hm_surf_run_dp02scr - - thumb_func_start sub_81B5820 -sub_81B5820: @ 81B5820 - push {lr} - bl PartyHasMonWithSurf - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B585C - bl IsPlayerFacingSurfableFishableWater - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B585C - ldr r1, =gUnknown_03005DB0 - ldr r0, =hm_add_c3_launch_phase_2 - str r0, [r1] - ldr r1, =gUnknown_0203CEEC - ldr r0, =hm_surf_run_dp02scr - str r0, [r1] - movs r0, 0x1 - b _081B585E - .pool -_081B585C: - movs r0, 0 -_081B585E: - pop {r1} - bx r1 - thumb_func_end sub_81B5820 - - thumb_func_start sub_81B5864 -sub_81B5864: @ 81B5864 - push {lr} - movs r0, 0x8 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _081B587A - movs r0, 0x9 - bl display_pokemon_menu_message - b _081B5880 -_081B587A: - movs r0, 0x8 - bl display_pokemon_menu_message -_081B5880: - pop {r0} - bx r0 - thumb_func_end sub_81B5864 - - thumb_func_start sub_81B5884 -sub_81B5884: @ 81B5884 - push {lr} - ldr r0, =gMapHeader - ldrb r0, [r0, 0x17] - bl is_light_level_1_2_3_or_6 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B58A0 - movs r0, 0 - b _081B58A2 - .pool -_081B58A0: - movs r0, 0x1 -_081B58A2: - pop {r1} - bx r1 - thumb_func_end sub_81B5884 - - thumb_func_start sub_81B58A8 -sub_81B58A8: @ 81B58A8 - push {lr} - sub sp, 0xC - movs r0, 0 - str r0, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =sub_8086194 - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_81B0038 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B58A8 - - thumb_func_start hm2_waterfall -hm2_waterfall: @ 81B58D4 - push {lr} - bl brm_get_pokemon_selection - ldr r1, =gUnknown_02038C08 - lsls r0, 24 - lsrs r0, 24 - str r0, [r1] - movs r0, 0x2B - bl FieldEffectStart - pop {r0} - bx r0 - .pool - thumb_func_end hm2_waterfall - - thumb_func_start hm_prepare_waterfall -hm_prepare_waterfall: @ 81B58F0 - push {r4,lr} - sub sp, 0x4 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl GetXYCoordsOneStepInFrontOfPlayer - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl MetatileBehavior_IsWaterfall - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B594C - bl IsPlayerSurfingNorth - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B594C - ldr r1, =gUnknown_03005DB0 - ldr r0, =hm_add_c3_launch_phase_2 - str r0, [r1] - ldr r1, =gUnknown_0203CEEC - ldr r0, =hm2_waterfall - str r0, [r1] - movs r0, 0x1 - b _081B594E - .pool -_081B594C: - movs r0, 0 -_081B594E: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end hm_prepare_waterfall - - thumb_func_start sub_81B5958 -sub_81B5958: @ 81B5958 - push {lr} - bl brm_get_pokemon_selection - ldr r1, =gUnknown_02038C08 - lsls r0, 24 - lsrs r0, 24 - str r0, [r1] - movs r0, 0x2C - bl FieldEffectStart - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B5958 - - thumb_func_start sub_81B5974 -sub_81B5974: @ 81B5974 - push {lr} - bl sub_809D1E8 - ldr r1, =gUnknown_02038C08 - lsls r0, 24 - lsrs r0, 24 - str r0, [r1, 0x4] - cmp r0, 0 - bne _081B5990 - movs r0, 0 - b _081B599E - .pool -_081B5990: - ldr r1, =gUnknown_03005DB0 - ldr r0, =hm_add_c3_launch_phase_2 - str r0, [r1] - ldr r1, =gUnknown_0203CEEC - ldr r0, =sub_81B5958 - str r0, [r1] - movs r0, 0x1 -_081B599E: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B5974 - - thumb_func_start party_menu_icon_anim -@ void party_menu_icon_anim(struct pokemon *mon, int a2, int a3) -party_menu_icon_anim: @ 81B59B4 - push {r4-r7,lr} - sub sp, 0x4 - adds r5, r0, 0 - adds r7, r1, 0 - adds r4, r2, 0 - movs r6, 0x1 - bl sub_81B1250 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B59EA - ldr r0, =gMain - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081B59EA - ldr r0, =gUnknown_08616020 - adds r0, r4, r0 - ldrb r1, [r0] - eors r1, r6 - negs r0, r1 - orrs r0, r1 - lsrs r6, r0, 31 -_081B59EA: - adds r0, r5, 0 - movs r1, 0x41 - bl GetMonData - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0 - bl GetMonData - adds r1, r0, 0 - str r6, [sp] - adds r0, r4, 0 - adds r2, r7, 0 - movs r3, 0x1 - bl party_menu_link_mon_icon_anim - ldrb r0, [r7, 0x9] - adds r1, r5, 0 - bl sub_81B5B38 - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end party_menu_icon_anim - - thumb_func_start party_menu_link_mon_icon_anim -@ void party_menu_link_mon_icon_anim(u16 speciesId, u32 personality, int a3, char a4, int a5) -party_menu_link_mon_icon_anim: @ 81B5A2C - push {r4-r7,lr} - sub sp, 0xC - adds r6, r1, 0 - adds r4, r2, 0 - lsls r0, 16 - lsrs r5, r0, 16 - lsls r3, 24 - lsrs r7, r3, 24 - cmp r5, 0 - beq _081B5A7A - ldr r1, =sub_80D3014 - ldr r0, [r4, 0x4] - ldrb r2, [r0] - ldrb r3, [r0, 0x1] - movs r0, 0x4 - str r0, [sp] - str r6, [sp, 0x4] - ldr r0, [sp, 0x20] - str r0, [sp, 0x8] - adds r0, r5, 0 - bl sub_80D2CC4 - strb r0, [r4, 0x9] - ldr r2, =gSprites - ldrb r0, [r4, 0x9] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x3 - adds r2, r7, 0 - ands r2, r0 - lsls r2, 2 - ldrb r3, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r3 - orrs r0, r2 - strb r0, [r1, 0x5] -_081B5A7A: - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end party_menu_link_mon_icon_anim - - thumb_func_start sub_81B5A8C -sub_81B5A8C: @ 81B5A8C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 16 - asrs r1, 16 - lsls r2, 16 - asrs r2, 16 - adds r0, r1, 0 - adds r1, r2, 0 - bl sub_8075060 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - beq _081B5AEC - cmp r0, 0x2 - bgt _081B5AB4 - cmp r0, 0x1 - beq _081B5B04 - b _081B5B1C -_081B5AB4: - cmp r0, 0x3 - beq _081B5AD4 - cmp r0, 0x4 - bne _081B5B1C - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - movs r1, 0 - bl sub_80D32C8 - b _081B5B2C - .pool -_081B5AD4: - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - movs r1, 0x1 - bl sub_80D32C8 - b _081B5B2C - .pool -_081B5AEC: - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - movs r1, 0x2 - bl sub_80D32C8 - b _081B5B2C - .pool -_081B5B04: - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - movs r1, 0x3 - bl sub_80D32C8 - b _081B5B2C - .pool -_081B5B1C: - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - movs r1, 0x4 - bl sub_80D32C8 -_081B5B2C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B5A8C - - thumb_func_start sub_81B5B38 -sub_81B5B38: @ 81B5B38 - push {r4-r6,lr} - adds r5, r0, 0 - adds r6, r1, 0 - lsls r5, 24 - lsrs r5, 24 - adds r0, r6, 0 - movs r1, 0x39 - bl GetMonData - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r6, 0 - movs r1, 0x3A - bl GetMonData - adds r2, r0, 0 - lsls r2, 16 - lsrs r2, 16 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_81B5A8C - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81B5B38 - - thumb_func_start sub_81B5B6C -sub_81B5B6C: @ 81B5B6C - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - ldr r5, =gSprites - lsls r0, r4, 4 - adds r0, r4 - lsls r6, r0, 2 - adds r2, r6, r5 - movs r7, 0 - movs r3, 0 - strh r3, [r2, 0x2E] - mov r12, r5 - cmp r1, 0 - bne _081B5BC4 - movs r1, 0x20 - ldrsh r0, [r2, r1] - cmp r0, 0x10 - bne _081B5BA4 - strh r3, [r2, 0x24] - ldr r0, =0x0000fffc - strh r0, [r2, 0x26] - b _081B5BAA - .pool -_081B5BA4: - ldr r0, =0x0000fffc - strh r0, [r2, 0x24] - strh r3, [r2, 0x26] -_081B5BAA: - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - mov r1, r12 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_81B5C08 - b _081B5BD0 - .pool -_081B5BC4: - strh r3, [r2, 0x24] - strh r3, [r2, 0x26] - adds r0, r5, 0 - adds r0, 0x1C - adds r0, r6, r0 - ldr r1, =sub_81B5BDC -_081B5BD0: - str r1, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B5B6C - - thumb_func_start sub_81B5BDC -sub_81B5BDC: @ 81B5BDC - push {r4,lr} - adds r4, r0, 0 - bl sub_80D30DC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _081B5C02 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081B5C00 - ldr r0, =0x0000fffd - strh r0, [r4, 0x26] - b _081B5C02 - .pool -_081B5C00: - strh r1, [r4, 0x26] -_081B5C02: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B5BDC - - thumb_func_start sub_81B5C08 -sub_81B5C08: @ 81B5C08 - push {lr} - bl sub_80D30DC - pop {r0} - bx r0 - thumb_func_end sub_81B5C08 - - thumb_func_start party_menu_held_item_object -party_menu_held_item_object: @ 81B5C14 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B5C3C - ldr r0, =gUnknown_08615EC0 - ldr r2, [r4, 0x4] - ldrb r1, [r2, 0x2] - ldrb r2, [r2, 0x3] - movs r3, 0 - bl CreateSprite - strb r0, [r4, 0xA] - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_81B5C94 -_081B5C3C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end party_menu_held_item_object - - thumb_func_start party_menu_link_mon_held_item_object -party_menu_link_mon_held_item_object: @ 81B5C48 - push {r4,r5,lr} - adds r4, r2, 0 - lsls r0, 16 - lsls r1, 16 - lsrs r5, r1, 16 - cmp r0, 0 - beq _081B5C84 - ldr r0, =gUnknown_08615EC0 - ldr r2, [r4, 0x4] - ldrb r1, [r2, 0x2] - ldrb r2, [r2, 0x3] - movs r3, 0 - bl CreateSprite - strb r0, [r4, 0xA] - ldr r2, =gSprites - ldrb r0, [r4, 0xA] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x5] - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_81B5CB0 -_081B5C84: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end party_menu_link_mon_held_item_object - - thumb_func_start sub_81B5C94 -sub_81B5C94: @ 81B5C94 - push {r4,lr} - adds r4, r1, 0 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - adds r1, r4, 0 - bl sub_81B5CB0 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B5C94 - - thumb_func_start sub_81B5CB0 -sub_81B5CB0: @ 81B5CB0 - push {r4,lr} - adds r4, r1, 0 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - bne _081B5CD8 - ldr r2, =gSprites - ldrb r1, [r4, 0xA] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - b _081B5D24 - .pool -_081B5CD8: - bl itemid_is_mail - lsls r0, 24 - cmp r0, 0 - beq _081B5CFC - ldrb r1, [r4, 0xA] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - movs r1, 0x1 - bl StartSpriteAnim - b _081B5D0E - .pool -_081B5CFC: - ldrb r1, [r4, 0xA] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - movs r1, 0 - bl StartSpriteAnim -_081B5D0E: - ldr r2, =gSprites - ldrb r1, [r4, 0xA] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 -_081B5D24: - strb r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B5CB0 - - thumb_func_start sub_81B5D30 -sub_81B5D30: @ 81B5D30 - push {lr} - ldr r0, =gUnknown_08615EB0 - bl LoadSpriteSheet - ldr r0, =gUnknown_08615EB8 - bl LoadSpritePalette - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B5D30 - - thumb_func_start sub_81B5D4C -sub_81B5D4C: @ 81B5D4C - push {r4-r7,lr} - adds r6, r0, 0 - adds r7, r1, 0 - lsls r2, 24 - lsrs r2, 24 - cmp r2, 0 - beq _081B5D60 - cmp r2, 0x1 - beq _081B5DA8 - b _081B5DE4 -_081B5D60: - movs r5, 0 - ldrb r0, [r6] - cmp r5, r0 - bcs _081B5DE4 -_081B5D68: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - beq _081B5D94 - adds r0, r7, r5 - ldrb r4, [r0] - adds r0, r1, 0 - bl itemid_is_mail - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_81B5DF0 -_081B5D94: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - ldrb r0, [r6] - cmp r5, r0 - bcc _081B5D68 - b _081B5DE4 - .pool -_081B5DA8: - movs r5, 0 - b _081B5DDE -_081B5DAC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - beq _081B5DD8 - adds r0, r5, r7 - ldrb r4, [r0, 0x6] - adds r0, r1, 0 - bl itemid_is_mail - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_81B5DF0 -_081B5DD8: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 -_081B5DDE: - ldrb r0, [r6, 0x1] - cmp r5, r0 - bcc _081B5DAC -_081B5DE4: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B5D4C - - thumb_func_start sub_81B5DF0 -sub_81B5DF0: @ 81B5DF0 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - adds r6, r0, 0 - mov r9, r1 - lsls r6, 24 - lsrs r6, 24 - mov r0, r9 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldr r0, =gSprites - mov r8, r0 - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - add r0, r8 - adds r0, 0x43 - ldrb r3, [r0] - ldr r0, =gUnknown_08615EC0 - subs r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - movs r1, 0xFA - movs r2, 0xAA - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - mov r0, r8 - adds r5, r4, r0 - movs r0, 0x4 - strh r0, [r5, 0x24] - movs r0, 0xA - strh r0, [r5, 0x26] - movs r0, 0x1C - add r8, r0 - add r4, r8 - ldr r0, =sub_81B5E74 - str r0, [r4] - strh r6, [r5, 0x3C] - adds r0, r5, 0 - mov r1, r9 - bl StartSpriteAnim - ldr r1, [r4] - adds r0, r5, 0 - bl _call_via_r1 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B5DF0 - - thumb_func_start sub_81B5E74 -sub_81B5E74: @ 81B5E74 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x3C] - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gSprites - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, r0, r2 - adds r0, r2, 0 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - bge _081B5EA8 - adds r0, r4, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - b _081B5EC6 - .pool -_081B5EA8: - adds r3, r4, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r3] - ldrh r0, [r2, 0x24] - ldrh r1, [r2, 0x20] - adds r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r2, 0x26] - ldrh r2, [r2, 0x22] - adds r0, r2 - strh r0, [r4, 0x22] -_081B5EC6: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B5E74 - - thumb_func_start party_menu_pokeball_object -party_menu_pokeball_object: @ 81B5ECC - push {r4,lr} - adds r4, r1, 0 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B5EEA - ldr r0, =gUnknown_08615F08 - ldr r2, [r4, 0x4] - ldrb r1, [r2, 0x6] - ldrb r2, [r2, 0x7] - movs r3, 0x8 - bl CreateSprite - strb r0, [r4, 0xB] -_081B5EEA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end party_menu_pokeball_object - - thumb_func_start party_menu_link_mon_pokeball_object -party_menu_link_mon_pokeball_object: @ 81B5EF4 - push {r4,lr} - adds r4, r1, 0 - lsls r0, 16 - cmp r0, 0 - beq _081B5F24 - ldr r0, =gUnknown_08615F08 - ldr r2, [r4, 0x4] - ldrb r1, [r2, 0x6] - ldrb r2, [r2, 0x7] - movs r3, 0x8 - bl CreateSprite - strb r0, [r4, 0xB] - ldr r2, =gSprites - ldrb r0, [r4, 0xB] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x5] -_081B5F24: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end party_menu_link_mon_pokeball_object - - thumb_func_start sub_81B5F34 -sub_81B5F34: @ 81B5F34 - push {lr} - adds r3, r0, 0 - adds r2, r1, 0 - lsls r3, 24 - lsrs r3, 24 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_08615F08 - adds r1, r3, 0 - movs r3, 0x8 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gSprites - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r3, [r1, 0x5] - movs r2, 0xD - negs r2, r2 - ands r2, r3 - movs r3, 0x8 - orrs r2, r3 - strb r2, [r1, 0x5] - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B5F34 - - thumb_func_start sub_81B5F74 -sub_81B5F74: @ 81B5F74 - push {lr} - adds r3, r0, 0 - adds r2, r1, 0 - lsls r3, 24 - lsrs r3, 24 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_08615F78 - adds r1, r3, 0 - movs r3, 0x8 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B5F74 - - thumb_func_start sub_81B5F98 -sub_81B5F98: @ 81B5F98 - push {lr} - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - ldr r2, =gSprites - adds r0, r2 - bl StartSpriteAnim - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B5F98 - - thumb_func_start sub_81B5FBC -sub_81B5FBC: @ 81B5FBC - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r6, r2, 24 - cmp r6, 0 - bne _081B6000 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =gSprites - mov r8, r0 - add r4, r8 - adds r0, r4, 0 - movs r1, 0x2 - bl StartSpriteAnim - lsls r5, r7, 4 - adds r5, r7 - lsls r5, 2 - add r5, r8 - adds r0, r5, 0 - movs r1, 0x4 - bl StartSpriteAnim - strh r6, [r4, 0x26] - strh r6, [r5, 0x26] - b _081B602C - .pool -_081B6000: - lsls r5, r0, 4 - adds r5, r0 - lsls r5, 2 - ldr r0, =gSprites - mov r8, r0 - add r5, r8 - adds r0, r5, 0 - movs r1, 0x3 - bl StartSpriteAnim - lsls r4, r7, 4 - adds r4, r7 - lsls r4, 2 - add r4, r8 - adds r0, r4, 0 - movs r1, 0x5 - bl StartSpriteAnim - ldr r0, =0x0000fffc - strh r0, [r5, 0x26] - movs r0, 0x4 - strh r0, [r4, 0x26] -_081B602C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B5FBC - - thumb_func_start sub_81B6040 -sub_81B6040: @ 81B6040 - push {lr} - ldr r0, =gUnknown_08615EF8 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_08615F70 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_08615F00 - bl LoadCompressedObjectPalette - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6040 - - thumb_func_start party_menu_status_condition_object -party_menu_status_condition_object: @ 81B6064 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B608C - ldr r0, =gUnknown_08616008 - ldr r2, [r4, 0x4] - ldrb r1, [r2, 0x4] - ldrb r2, [r2, 0x5] - movs r3, 0 - bl CreateSprite - strb r0, [r4, 0xC] - adds r0, r5, 0 - adds r1, r4, 0 - bl party_menu_get_status_condition_and_update_object -_081B608C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end party_menu_status_condition_object - - thumb_func_start party_menu_link_mon_status_condition_object -party_menu_link_mon_status_condition_object: @ 81B6098 - push {r4,r5,lr} - adds r4, r2, 0 - lsls r0, 16 - lsls r1, 24 - lsrs r5, r1, 24 - cmp r0, 0 - beq _081B60D4 - ldr r0, =gUnknown_08616008 - ldr r2, [r4, 0x4] - ldrb r1, [r2, 0x4] - ldrb r2, [r2, 0x5] - movs r3, 0 - bl CreateSprite - strb r0, [r4, 0xC] - adds r0, r5, 0 - adds r1, r4, 0 - bl party_menu_update_status_condition_object - ldr r2, =gSprites - ldrb r0, [r4, 0xC] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x5] -_081B60D4: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end party_menu_link_mon_status_condition_object - - thumb_func_start party_menu_get_status_condition_and_update_object -@ void party_menu_get_status_condition_and_update_object(struct pokemon *mon, void *a2, void *a3) -party_menu_get_status_condition_and_update_object: @ 81B60E4 - push {r4,lr} - adds r4, r1, 0 - bl sub_81B205C - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - bl party_menu_update_status_condition_object - pop {r4} - pop {r0} - bx r0 - thumb_func_end party_menu_get_status_condition_and_update_object - - thumb_func_start party_menu_update_status_condition_object -@ void party_menu_update_status_condition_object(u8 a1, void *a2) -party_menu_update_status_condition_object: @ 81B60FC - push {r4,r5,lr} - adds r5, r1, 0 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - beq _081B610C - cmp r2, 0x6 - bne _081B6128 -_081B610C: - ldr r2, =gSprites - ldrb r1, [r5, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - b _081B6152 - .pool -_081B6128: - ldrb r1, [r5, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =gSprites - adds r0, r4 - subs r1, r2, 0x1 - lsls r1, 24 - lsrs r1, 24 - bl StartSpriteAnim - ldrb r1, [r5, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 -_081B6152: - strb r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end party_menu_update_status_condition_object - - thumb_func_start sub_81B6160 -sub_81B6160: @ 81B6160 - push {lr} - ldr r0, =gUnknown_08615FF8 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_08616000 - bl LoadCompressedObjectPalette - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6160 - - thumb_func_start sub_81B617C -sub_81B617C: @ 81B617C - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - ldr r0, =c2_815ABFC - mov r8, r0 - ldr r0, =gMain - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081B61BC - movs r7, 0x1 - bl sub_81B8984 - lsls r0, 24 - lsrs r6, r0, 24 - b _081B61C0 - .pool -_081B61B0: - ldr r0, =gUnknown_0203CEC8 - strb r5, [r0, 0x9] - b _081B6204 - .pool -_081B61BC: - movs r7, 0 - movs r6, 0 -_081B61C0: - ldr r4, =gScriptItemId - ldrh r0, [r4] - bl GetItemEffectType - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xA - bne _081B621C - ldr r1, =gUnknown_0203CEC8 - movs r0, 0 - strb r0, [r1, 0x9] - movs r5, 0 -_081B61D8: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =gPlayerParty - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B61FA - adds r0, r4, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - beq _081B61B0 -_081B61FA: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _081B61D8 -_081B6204: - ldr r0, =sub_81B6280 - movs r1, 0x7F - b _081B6230 - .pool -_081B621C: - ldrh r0, [r4] - bl GetPocketByItemId - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x5 - cmp r0, 0x3 - bne _081B622E - movs r1, 0x4 -_081B622E: - ldr r0, =sub_81B1370 -_081B6230: - str r1, [sp] - str r0, [sp, 0x4] - mov r0, r8 - str r0, [sp, 0x8] - adds r0, r7, 0 - adds r1, r6, 0 - movs r2, 0x3 - movs r3, 0x1 - bl sub_81B0038 - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B617C - - thumb_func_start c2_815ABFC -c2_815ABFC: @ 81B6254 - push {lr} - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - bne _081B626C - movs r0, 0xC - movs r1, 0x5 - movs r2, 0 - bl GoToBagMenu - b _081B6276 -_081B626C: - ldr r0, =gUnknown_0203CF30 - ldr r1, [r0] - movs r0, 0x4 - bl sub_81C4F98 -_081B6276: - pop {r0} - bx r0 - .pool - thumb_func_end c2_815ABFC - - thumb_func_start sub_81B6280 -sub_81B6280: @ 81B6280 - push {lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B62B2 - ldr r0, =gUnknown_0203CEC8 - ldrb r1, [r0, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x1 - bne _081B62A6 - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - ldr r0, =sub_81B9140 - str r0, [r1, 0x4] -_081B62A6: - ldr r0, =gUnknown_03006328 - ldr r1, =sub_81B6794 - ldr r2, [r0] - adds r0, r3, 0 - bl _call_via_r2 -_081B62B2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6280 - - thumb_func_start IsHPRecoveryItem -@ bool8 IsHPRecoveryItem(u16 itemId) -IsHPRecoveryItem: @ 81B62D0 - push {lr} - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xAF - bne _081B62EC - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003214 - adds r0, r1 - b _081B62F6 - .pool -_081B62EC: - ldr r1, =gItemEffectTable - subs r0, 0xD - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] -_081B62F6: - ldrb r1, [r0, 0x4] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - bne _081B6308 - movs r0, 0 - b _081B630A - .pool -_081B6308: - movs r0, 0x1 -_081B630A: - pop {r1} - bx r1 - thumb_func_end IsHPRecoveryItem - - thumb_func_start GetMedicineItemEffectMessage -@ void GetMedicineItemEffectMessage(u16 itemId) -GetMedicineItemEffectMessage: @ 81B6310 - push {lr} - lsls r0, 16 - lsrs r0, 16 - bl GetItemEffectType - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x3 - cmp r0, 0x12 - bls _081B6326 - b _081B64BC -_081B6326: - lsls r0, 2 - ldr r1, =_081B6334 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081B6334: - .4byte _081B6380 - .4byte _081B6394 - .4byte _081B63A8 - .4byte _081B63BC - .4byte _081B63D0 - .4byte _081B63E4 - .4byte _081B63F8 - .4byte _081B64BC - .4byte _081B640C - .4byte _081B6430 - .4byte _081B6420 - .4byte _081B6460 - .4byte _081B6470 - .4byte _081B6450 - .4byte _081B6440 - .4byte _081B64BC - .4byte _081B6494 - .4byte _081B6494 - .4byte _081B64A8 -_081B6380: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9C3E - bl StringExpandPlaceholders - b _081B64C4 - .pool -_081B6394: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9C7C - bl StringExpandPlaceholders - b _081B64C4 - .pool -_081B63A8: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9C8A - bl StringExpandPlaceholders - b _081B64C4 - .pool -_081B63BC: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9CA2 - bl StringExpandPlaceholders - b _081B64C4 - .pool -_081B63D0: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9C5F - bl StringExpandPlaceholders - b _081B64C4 - .pool -_081B63E4: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9DBE - bl StringExpandPlaceholders - b _081B64C4 - .pool -_081B63F8: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9DE1 - bl StringExpandPlaceholders - b _081B64C4 - .pool -_081B640C: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9CE0 - bl StringExpandPlaceholders - b _081B64C4 - .pool -_081B6420: - ldr r0, =gStringVar2 - ldr r1, =gUnknown_085E96E3 - b _081B6474 - .pool -_081B6430: - ldr r0, =gStringVar2 - ldr r1, =gUnknown_085EA33C - b _081B6474 - .pool -_081B6440: - ldr r0, =gStringVar2 - ldr r1, =gUnknown_085EA343 - b _081B6474 - .pool -_081B6450: - ldr r0, =gStringVar2 - ldr r1, =gUnknown_085EA35B - b _081B6474 - .pool -_081B6460: - ldr r0, =gStringVar2 - ldr r1, =gUnknown_085E96E6 - b _081B6474 - .pool -_081B6470: - ldr r0, =gStringVar2 - ldr r1, =gUnknown_085E96EE -_081B6474: - bl StringCopy - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9D25 - bl StringExpandPlaceholders - b _081B64C4 - .pool -_081B6494: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9CF5 - bl StringExpandPlaceholders - b _081B64C4 - .pool -_081B64A8: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9CB7 - bl StringExpandPlaceholders - b _081B64C4 - .pool -_081B64BC: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E96F6 - bl StringExpandPlaceholders -_081B64C4: - pop {r0} - bx r0 - .pool - thumb_func_end GetMedicineItemEffectMessage - - thumb_func_start UsingHPEVItemOnShedinja -@ bool8 UsingHPEVItemOnShedinja(struct pokemon *mon, u16 itemId) -UsingHPEVItemOnShedinja: @ 81B64D0 - push {r4,lr} - adds r4, r0, 0 - lsls r0, r1, 16 - lsrs r0, 16 - bl GetItemEffectType - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xD - bne _081B64FC - adds r0, r4, 0 - movs r1, 0xB - bl GetMonData - ldr r1, =0x0000012f - cmp r0, r1 - bne _081B64FC - movs r0, 0 - b _081B64FE - .pool -_081B64FC: - movs r0, 0x1 -_081B64FE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end UsingHPEVItemOnShedinja - - thumb_func_start IsBlueYellowRedFlute -@ bool8 IsBlueYellowRedFlute(u16 itemId) -IsBlueYellowRedFlute: @ 81B6504 - push {lr} - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x27 - beq _081B6516 - cmp r0, 0x29 - beq _081B6516 - cmp r0, 0x28 - bne _081B651A -_081B6516: - movs r0, 0x1 - b _081B651C -_081B651A: - movs r0, 0 -_081B651C: - pop {r1} - bx r1 - thumb_func_end IsBlueYellowRedFlute - - thumb_func_start ExecuteTableBasedItemEffect__ -@ bool8 ExecuteTableBasedItemEffect__(u8 partyMonIndex, u16 itemId, u8 monMoveIndex) -ExecuteTableBasedItemEffect__: @ 81B6520 - push {r4-r6,lr} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r1, 16 - lsrs r5, r1, 16 - lsls r2, 24 - lsrs r6, r2, 24 - ldr r0, =gMain - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _081B6558 - movs r0, 0x64 - muls r0, r3 - ldr r1, =gPlayerParty - adds r0, r1 - adds r1, r5, 0 - adds r2, r3, 0 - b _081B6572 - .pool -_081B6558: - movs r0, 0x64 - adds r4, r3, 0 - muls r4, r0 - ldr r0, =gPlayerParty - adds r4, r0 - adds r0, r3, 0 - bl sub_81B8F38 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 -_081B6572: - adds r3, r6, 0 - bl ExecuteTableBasedItemEffect_ - lsls r0, 24 - lsrs r0, 24 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end ExecuteTableBasedItemEffect__ - - thumb_func_start ItemUseCB_Medicine -ItemUseCB_Medicine: @ 81B6588 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - str r1, [sp, 0x4] - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - movs r0, 0 - mov r10, r0 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - ldr r0, =gScriptItemId - ldrh r6, [r0] - adds r0, r5, 0 - adds r1, r6, 0 - bl UsingHPEVItemOnShedinja - lsls r0, 24 - cmp r0, 0 - beq _081B6600 - adds r0, r6, 0 - bl IsHPRecoveryItem - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - cmp r0, 0x1 - bne _081B65EE - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - adds r0, r5, 0 - movs r1, 0x3A - bl GetMonData - cmp r10, r0 - bne _081B65EE - movs r1, 0 - mov r8, r1 -_081B65EE: - ldr r4, =gUnknown_0203CEC8 - ldrb r0, [r4, 0x9] - adds r1, r6, 0 - movs r2, 0 - bl ExecuteTableBasedItemEffect__ - lsls r0, 24 - cmp r0, 0 - beq _081B6624 -_081B6600: - ldr r1, =gUnknown_0203CEE8 - movs r0, 0 - strb r0, [r1] - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_085E96F6 - b _081B66F4 - .pool -_081B6624: - ldr r1, =gUnknown_0203CEE8 - movs r0, 0x1 - strb r0, [r1] - adds r0, r6, 0 - bl IsBlueYellowRedFlute - lsls r0, 24 - cmp r0, 0 - bne _081B6650 - movs r0, 0x1 - bl PlaySE - ldrb r0, [r4, 0xB] - cmp r0, 0xE - beq _081B6656 - adds r0, r6, 0 - movs r1, 0x1 - bl RemoveBagItem - b _081B6656 - .pool -_081B6650: - movs r0, 0x75 - bl PlaySE -_081B6656: - ldr r4, =gUnknown_0203CEDC - ldr r7, =gUnknown_0203CEC8 - movs r0, 0x9 - ldrsb r0, [r7, r0] - lsls r0, 4 - ldr r1, [r4] - adds r1, r0 - adds r0, r5, 0 - bl party_menu_get_status_condition_and_update_object - ldr r2, =gSprites - movs r0, 0x9 - ldrsb r0, [r7, r0] - ldr r1, [r4] - lsls r0, 4 - adds r3, r0, r1 - ldrb r1, [r3, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - bge _081B6694 - adds r0, r5, 0 - adds r1, r3, 0 - movs r2, 0x1 - bl sub_81B2AC8 -_081B6694: - mov r2, r8 - cmp r2, 0x1 - bne _081B66E4 - mov r0, r10 - cmp r0, 0 - bne _081B66A8 - ldrb r0, [r7, 0x9] - movs r1, 0x1 - bl sub_81B0FCC -_081B66A8: - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - adds r3, r0, 0 - mov r1, r10 - subs r3, r1 - lsls r3, 16 - asrs r3, 16 - ldrb r1, [r7, 0x9] - ldr r0, =sub_81B672C - str r0, [sp] - mov r0, r9 - movs r2, 0x1 - bl sub_81B1F18 - mov r0, r9 - movs r1, 0 - mov r2, r10 - bl sub_81B1FA8 - b _081B6710 - .pool -_081B66E4: - ldr r1, =gStringVar1 - adds r0, r5, 0 - bl GetMonNickname - adds r0, r6, 0 - bl GetMedicineItemEffectMessage - ldr r0, =gStringVar4 -_081B66F4: - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - mov r2, r9 - lsls r0, r2, 2 - add r0, r9 - lsls r0, 3 - adds r0, r1 - ldr r1, [sp, 0x4] - str r1, [r0] -_081B6710: - 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 ItemUseCB_Medicine - - thumb_func_start sub_81B672C -sub_81B672C: @ 81B672C - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - 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 - bl sub_805EAE8 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B6794 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B672C - - thumb_func_start sub_81B6794 -sub_81B6794: @ 81B6794 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B67BA - ldr r0, =gUnknown_0203CEE8 - ldrb r1, [r0] - cmp r1, 0 - bne _081B67B4 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - str r1, [r0, 0x4] -_081B67B4: - adds r0, r4, 0 - bl sub_81B12C0 -_081B67BA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6794 - - thumb_func_start sub_81B67C8 -sub_81B67C8: @ 81B67C8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - str r1, [sp] - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldr r4, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r4, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - ldr r0, =gScriptItemId - ldrh r6, [r0] - adds r0, r6, 0 - bl GetItemEffectType - lsls r0, 24 - lsrs r7, r0, 24 - adds r0, r5, 0 - movs r1, 0x20 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x4] - adds r0, r5, 0 - adds r1, r7, 0 - bl sub_81B691C - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x8] - ldrb r0, [r4, 0x9] - adds r1, r6, 0 - movs r2, 0 - bl ExecuteTableBasedItemEffect__ - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x20 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - adds r0, r5, 0 - adds r1, r7, 0 - bl sub_81B691C - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - cmp r4, 0 - bne _081B6850 - ldr r0, [sp, 0x4] - cmp r0, r9 - bne _081B6874 - ldr r1, [sp, 0x8] - cmp r1, r8 - bne _081B6874 -_081B6850: - ldr r1, =gUnknown_0203CEE8 - movs r0, 0 - strb r0, [r1] - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_085E96F6 - b _081B68E2 - .pool -_081B6874: - ldr r1, =gUnknown_0203CEE8 - movs r0, 0x1 - strb r0, [r1] - movs r0, 0x1 - bl PlaySE - adds r0, r6, 0 - movs r1, 0x1 - bl RemoveBagItem - ldr r1, =gStringVar1 - adds r0, r5, 0 - bl GetMonNickname - ldr r1, =gStringVar2 - adds r0, r7, 0 - bl option_menu_get_string - ldr r2, [sp, 0x4] - cmp r2, r9 - beq _081B68D8 - ldr r0, [sp, 0x8] - cmp r0, r8 - beq _081B68C4 - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9D45 - bl StringExpandPlaceholders - b _081B68E0 - .pool -_081B68C4: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9D90 - bl StringExpandPlaceholders - b _081B68E0 - .pool -_081B68D8: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9D6D - bl StringExpandPlaceholders -_081B68E0: - ldr r0, =gStringVar4 -_081B68E2: - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - mov r2, r10 - lsls r0, r2, 2 - add r0, r10 - lsls r0, 3 - adds r0, r1 - ldr r1, [sp] - str r1, [r0] - 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_81B67C8 - - thumb_func_start sub_81B691C -sub_81B691C: @ 81B691C - push {r4,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r1, 0 - subs r0, 0xC - cmp r0, 0x5 - bhi _081B6992 - lsls r0, 2 - ldr r1, =_081B693C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081B693C: - .4byte _081B696C - .4byte _081B6954 - .4byte _081B697E - .4byte _081B6984 - .4byte _081B6978 - .4byte _081B6972 -_081B6954: - adds r0, r4, 0 - movs r1, 0xB - bl GetMonData - ldr r1, =0x0000012f - cmp r0, r1 - beq _081B6992 - adds r0, r4, 0 - movs r1, 0x1A - b _081B6988 - .pool -_081B696C: - adds r0, r4, 0 - movs r1, 0x1B - b _081B6988 -_081B6972: - adds r0, r4, 0 - movs r1, 0x1C - b _081B6988 -_081B6978: - adds r0, r4, 0 - movs r1, 0x1D - b _081B6988 -_081B697E: - adds r0, r4, 0 - movs r1, 0x1E - b _081B6988 -_081B6984: - adds r0, r4, 0 - movs r1, 0x1F -_081B6988: - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - b _081B6994 -_081B6992: - movs r0, 0 -_081B6994: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81B691C - - thumb_func_start option_menu_get_string -option_menu_get_string: @ 81B699C - push {lr} - adds r2, r1, 0 - lsls r0, 24 - lsrs r0, 24 - subs r0, 0xC - cmp r0, 0x5 - bhi _081B6A08 - lsls r0, 2 - ldr r1, =_081B69B8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081B69B8: - .4byte _081B69D8 - .4byte _081B69D0 - .4byte _081B69F0 - .4byte _081B6A00 - .4byte _081B69E8 - .4byte _081B69E0 -_081B69D0: - ldr r1, =gUnknown_085E96E3 - b _081B69F2 - .pool -_081B69D8: - ldr r1, =gUnknown_085EA33C - b _081B69F2 - .pool -_081B69E0: - ldr r1, =gUnknown_085EA343 - b _081B69F2 - .pool -_081B69E8: - ldr r1, =gUnknown_085EA35B - b _081B69F2 - .pool -_081B69F0: - ldr r1, =gUnknown_085E96E6 -_081B69F2: - adds r0, r2, 0 - bl StringCopy - b _081B6A08 - .pool -_081B6A00: - ldr r1, =gUnknown_085E96EE - adds r0, r2, 0 - bl StringCopy -_081B6A08: - pop {r0} - bx r0 - .pool - thumb_func_end option_menu_get_string - - thumb_func_start sub_81B6A10 -sub_81B6A10: @ 81B6A10 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r7, 0 - movs r0, 0x1 - mov r10, r0 - movs r0, 0x3 - bl sub_81B31B0 - lsls r0, 24 - lsrs r6, r0, 24 - movs r5, 0 - movs r0, 0x64 - adds r1, r4, 0 - muls r1, r0 - mov r8, r1 - ldr r0, =gPlayerParty - mov r9, r0 -_081B6A40: - adds r1, r5, 0 - adds r1, 0xD - mov r0, r8 - add r0, r9 - bl GetMonData - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - movs r0, 0xD - adds r2, r4, 0 - muls r2, r0 - ldr r0, =gMoveNames - adds r2, r0 - lsls r0, r5, 4 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - adds r0, r6, 0 - mov r1, r10 - movs r3, 0x8 - bl PrintTextOnWindow - cmp r4, 0 - beq _081B6A82 - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 -_081B6A82: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _081B6A40 - adds r0, r6, 0 - adds r1, r7, 0 - movs r2, 0 - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - 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_81B6A10 - - thumb_func_start ether_effect_related_3 -ether_effect_related_3: @ 81B6AB4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - bl ProcessMenuInput - lsls r0, 24 - asrs r1, r0, 24 - movs r0, 0x2 - negs r0, r0 - cmp r1, r0 - beq _081B6AF0 - adds r0, 0x1 - cmp r1, r0 - bne _081B6AE0 - movs r0, 0x5 - bl PlaySE - adds r0, r4, 0 - bl sub_81B6BB4 - b _081B6AF0 -_081B6AE0: - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - adds r0, 0xD - bl sub_81B302C - adds r0, r5, 0 - bl ether_effect_related_2 -_081B6AF0: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ether_effect_related_3 - - thumb_func_start dp05_ether -dp05_ether: @ 81B6AFC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gScriptItemId - ldrh r0, [r0] - cmp r0, 0xAF - bne _081B6B20 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003214 - adds r0, r1 - b _081B6B2A - .pool -_081B6B20: - ldr r1, =gItemEffectTable - subs r0, 0xD - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] -_081B6B2A: - ldrb r1, [r0, 0x4] - movs r0, 0x10 - ands r0, r1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _081B6B4C - ldr r0, =gUnknown_0203CEC8 - strh r1, [r0, 0xE] - adds r0, r4, 0 - bl ether_effect_related - b _081B6B6E - .pool -_081B6B4C: - movs r0, 0x5 - bl PlaySE - movs r0, 0x16 - bl display_pokemon_menu_message - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0x9] - bl sub_81B6A10 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =ether_effect_related_3 - str r1, [r0] -_081B6B6E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp05_ether - - thumb_func_start ether_effect_related_2 -ether_effect_related_2: @ 81B6B80 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - adds r0, 0xC - bl sub_81B302C - bl GetMenuCursorPos - ldr r1, =gUnknown_0203CEC8 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1, 0xE] - adds r0, r4, 0 - bl ether_effect_related - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ether_effect_related_2 - - thumb_func_start sub_81B6BB4 -sub_81B6BB4: @ 81B6BB4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r0, =sub_81B1370 - str r0, [r1] - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - movs r1, 0 - str r1, [r0, 0x4] - adds r0, 0xC - bl sub_81B302C - movs r0, 0x5 - bl display_pokemon_menu_message - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6BB4 - - thumb_func_start ether_effect_related -ether_effect_related: @ 81B6BEC - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - movs r4, 0 - ldr r7, =gUnknown_0203CED6 - ldr r0, =gScriptItemId - ldrh r5, [r0] - movs r0, 0xE - negs r0, r0 - adds r0, r7 - mov r8, r0 - ldrb r0, [r0, 0x9] - ldrb r2, [r7] - adds r1, r5, 0 - bl ExecuteTableBasedItemEffect__ - lsls r0, 24 - cmp r0, 0 - beq _081B6C34 - ldr r0, =gUnknown_0203CEE8 - strb r4, [r0] - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_085E96F6 - b _081B6C7E - .pool -_081B6C34: - ldr r1, =gUnknown_0203CEE8 - movs r0, 0x1 - strb r0, [r1] - mov r0, r8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - adds r4, r1, 0 - muls r4, r0 - ldr r0, =gPlayerParty - adds r4, r0 - movs r0, 0x1 - bl PlaySE - adds r0, r5, 0 - movs r1, 0x1 - bl RemoveBagItem - movs r0, 0 - ldrsh r1, [r7, r0] - adds r1, 0xD - adds r0, r4, 0 - bl GetMonData - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =gStringVar1 - movs r1, 0xD - muls r1, r4 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - adds r0, r5, 0 - bl GetMedicineItemEffectMessage - ldr r0, =gStringVar4 -_081B6C7E: - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B6794 - str r1, [r0] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end ether_effect_related - - thumb_func_start dp05_pp_up -dp05_pp_up: @ 81B6CC0 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl PlaySE - movs r0, 0x17 - bl display_pokemon_menu_message - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0x9] - bl sub_81B6A10 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =ether_effect_related_3 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp05_pp_up - - thumb_func_start ItemIdToBattleMoveId -ItemIdToBattleMoveId: @ 81B6CFC - lsls r0, 16 - ldr r1, =0xfedf0000 - adds r0, r1 - ldr r1, =gUnknown_08616040 - lsrs r0, 15 - adds r0, r1 - ldrh r0, [r0] - bx lr - .pool - thumb_func_end ItemIdToBattleMoveId - - thumb_func_start sub_81B6D14 -sub_81B6D14: @ 81B6D14 - push {lr} - lsls r0, 16 - lsrs r2, r0, 16 - movs r1, 0 - ldr r3, =gUnknown_08616040 -_081B6D1E: - adds r0, r1, 0 - adds r0, 0x32 - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - cmp r0, r2 - bne _081B6D34 - movs r0, 0x1 - b _081B6D40 - .pool -_081B6D34: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x7 - bls _081B6D1E - movs r0, 0 -_081B6D40: - pop {r1} - bx r1 - thumb_func_end sub_81B6D14 - - thumb_func_start pokemon_has_move -pokemon_has_move: @ 81B6D44 - push {r4-r6,lr} - adds r6, r0, 0 - lsls r1, 16 - lsrs r5, r1, 16 - movs r4, 0 -_081B6D4E: - adds r1, r4, 0 - adds r1, 0xD - adds r0, r6, 0 - bl GetMonData - cmp r0, r5 - bne _081B6D60 - movs r0, 0x1 - b _081B6D6C -_081B6D60: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _081B6D4E - movs r0, 0 -_081B6D6C: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end pokemon_has_move - - thumb_func_start sub_81B6D74 -sub_81B6D74: @ 81B6D74 - push {r4,lr} - adds r1, r0, 0 - ldr r4, =gStringVar4 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6D74 - - thumb_func_start sub_81B6D98 -sub_81B6D98: @ 81B6D98 - push {r4,lr} - adds r4, r0, 0 - adds r0, r1, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_81B6D74 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B6794 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6D98 - - thumb_func_start sub_81B6DC4 -sub_81B6DC4: @ 81B6DC4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - movs r0, 0x5 - bl PlaySE - ldr r7, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r7, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - movs r0, 0xE - adds r0, r7 - mov r8, r0 - ldr r0, =gScriptItemId - ldrh r4, [r0] - ldr r1, =gStringVar1 - adds r0, r5, 0 - bl GetMonNickname - adds r0, r4, 0 - bl ItemIdToBattleMoveId - strh r0, [r7, 0xE] - ldr r0, =gStringVar2 - movs r1, 0xE - ldrsh r2, [r7, r1] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - movs r0, 0 - mov r1, r8 - strh r0, [r1, 0x2] - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0 - bl sub_81B22D8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B6E70 - cmp r0, 0x2 - beq _081B6E78 - ldrh r1, [r7, 0xE] - adds r0, r5, 0 - bl GiveMoveToMon - lsls r0, 16 - ldr r1, =0xffff0000 - cmp r0, r1 - beq _081B6E88 - ldr r0, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B6EB4 - str r0, [r1] - b _081B6E9C - .pool -_081B6E70: - ldr r1, =gUnknown_085E9AB4 - b _081B6E7A - .pool -_081B6E78: - ldr r1, =gUnknown_085E9C00 -_081B6E7A: - adds r0, r6, 0 - bl sub_81B6D98 - b _081B6E9C - .pool -_081B6E88: - ldr r0, =gUnknown_085E9AE9 - bl sub_81B6D74 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B6FF4 - str r1, [r0] -_081B6E9C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6DC4 - - thumb_func_start sub_81B6EB4 -sub_81B6EB4: @ 81B6EB4 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r2, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r2, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - adds r6, r2, 0 - adds r6, 0xE - ldr r0, =gScriptItemId - ldrh r4, [r0] - movs r1, 0x2 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _081B6EF0 - adds r0, r5, 0 - movs r1, 0x4 - bl AdjustFriendship - movs r0, 0xA9 - lsls r0, 1 - cmp r4, r0 - bhi _081B6EF0 - adds r0, r4, 0 - movs r1, 0x1 - bl RemoveBagItem -_081B6EF0: - ldr r1, =gStringVar1 - adds r0, r5, 0 - bl GetMonNickname - ldr r0, =gStringVar2 - movs r1, 0 - ldrsh r2, [r6, r1] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9AA5 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B6F60 - str r1, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6EB4 - - thumb_func_start sub_81B6F60 -sub_81B6F60: @ 81B6F60 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B6F86 - ldr r0, =0x0000016f - bl PlayFanfare - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B6F98 - str r1, [r0] -_081B6F86: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6F60 - - thumb_func_start sub_81B6F98 -sub_81B6F98: @ 81B6F98 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - bl IsFanfareTaskInactive - lsls r0, 24 - cmp r0, 0 - beq _081B6FEA - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r2, 0x1 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - bne _081B6FC0 - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081B6FEA -_081B6FC0: - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x10 - ldrsh r0, [r0, r1] - cmp r0, 0x1 - bne _081B6FDC - adds r0, r4, 0 - bl sub_81B77AC - b _081B6FEA - .pool -_081B6FDC: - cmp r0, 0x2 - bne _081B6FE4 - ldr r0, =gScriptResult - strh r2, [r0] -_081B6FE4: - adds r0, r5, 0 - bl sub_81B12C0 -_081B6FEA: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6F98 - - thumb_func_start sub_81B6FF4 -sub_81B6FF4: @ 81B6FF4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B7018 - bl sub_81B334C - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B7028 - str r0, [r1] -_081B7018: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6FF4 - - thumb_func_start sub_81B7028 -sub_81B7028: @ 81B7028 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _081B704E - cmp r1, 0 - bgt _081B7048 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _081B7074 - b _081B7080 -_081B7048: - cmp r1, 0x1 - beq _081B707A - b _081B7080 -_081B704E: - ldr r0, =gUnknown_085E9B96 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B7088 - str r1, [r0] - b _081B7080 - .pool -_081B7074: - movs r0, 0x5 - bl PlaySE -_081B707A: - adds r0, r4, 0 - bl sub_81B7230 -_081B7080: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B7028 - - thumb_func_start sub_81B7088 -sub_81B7088: @ 81B7088 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B70A8 - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - ldr r0, =sub_81B70B8 - str r0, [r1, 0x4] - adds r0, r4, 0 - bl sub_81B12C0 -_081B70A8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B7088 - - thumb_func_start sub_81B70B8 -sub_81B70B8: @ 81B70B8 - push {r4,lr} - sub sp, 0x4 - ldr r0, =gPlayerParty - ldr r4, =gUnknown_0203CEC8 - ldrb r1, [r4, 0x9] - ldr r2, =gPlayerPartyCount - ldrb r2, [r2] - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - ldr r3, =sub_81B70F0 - ldrh r4, [r4, 0xE] - str r4, [sp] - bl sub_81BFA38 - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B70B8 - - thumb_func_start sub_81B70F0 -sub_81B70F0: @ 81B70F0 - push {lr} - sub sp, 0xC - movs r0, 0x7F - str r0, [sp] - ldr r0, =sub_81B711C - str r0, [sp, 0x4] - ldr r0, =gUnknown_0203CEC8 - ldr r0, [r0] - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_81B0038 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B70F0 - - thumb_func_start sub_81B711C -sub_81B711C: @ 81B711C - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B714E - bl sub_81C1B94 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - beq _081B7148 - adds r0, r4, 0 - bl sub_81B7154 - b _081B714E - .pool -_081B7148: - adds r0, r5, 0 - bl sub_81B7230 -_081B714E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81B711C - - thumb_func_start sub_81B7154 -sub_81B7154: @ 81B7154 - push {r4-r6,lr} - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - adds r5, r1, 0 - muls r5, r0 - ldr r0, =gPlayerParty - adds r5, r0 - bl sub_81C1B94 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r1, 0xD - adds r0, r5, 0 - bl GetMonData - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r1, =gStringVar1 - adds r0, r5, 0 - bl GetMonNickname - ldr r0, =gStringVar2 - movs r1, 0xD - muls r1, r4 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - ldr r0, =gUnknown_085E9BB8 - bl sub_81B6D74 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B71D4 - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B7154 - - thumb_func_start sub_81B71D4 -sub_81B71D4: @ 81B71D4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B7220 - ldr r5, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r5, r1] - movs r0, 0x64 - adds r4, r1, 0 - muls r4, r0 - ldr r0, =gPlayerParty - adds r4, r0 - bl sub_81C1B94 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl RemoveMonPPBonus - ldrh r5, [r5, 0xE] - bl sub_81C1B94 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl SetMonMoveSlot - adds r0, r6, 0 - bl sub_81B6EB4 -_081B7220: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B71D4 - - thumb_func_start sub_81B7230 -sub_81B7230: @ 81B7230 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gStringVar2 - ldr r1, =gUnknown_0203CEC8 - movs r3, 0xE - ldrsh r2, [r1, r3] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9B5D - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x1 - 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_81B7294 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B7230 - - thumb_func_start sub_81B7294 -sub_81B7294: @ 81B7294 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B72B8 - bl sub_81B334C - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B72C8 - str r0, [r1] -_081B72B8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B7294 - - thumb_func_start sub_81B72C8 -sub_81B72C8: @ 81B72C8 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r7, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r7, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r4, r1, r0 - bl sub_8198C58 - lsls r0, 24 - asrs r5, r0, 24 - cmp r5, 0 - beq _081B7306 - cmp r5, 0 - bgt _081B7300 - movs r0, 0x1 - negs r0, r0 - cmp r5, r0 - beq _081B738C - b _081B73C2 - .pool -_081B7300: - cmp r5, 0x1 - beq _081B7392 - b _081B73C2 -_081B7306: - ldr r1, =gStringVar1 - adds r0, r4, 0 - bl GetMonNickname - ldr r0, =gStringVar2 - movs r1, 0xE - ldrsh r2, [r7, r1] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9B76 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - movs r3, 0x10 - ldrsh r0, [r7, r3] - cmp r0, 0x1 - bne _081B7368 - ldr r0, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B73E4 - str r0, [r1] - b _081B73C2 - .pool -_081B7368: - cmp r0, 0x2 - bne _081B7370 - ldr r0, =gScriptResult - strh r5, [r0] -_081B7370: - ldr r0, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B6794 - str r0, [r1] - b _081B73C2 - .pool -_081B738C: - movs r0, 0x5 - bl PlaySE -_081B7392: - ldr r1, =gStringVar1 - adds r0, r4, 0 - bl GetMonNickname - ldr r0, =gStringVar2 - ldr r1, =gUnknown_0203CEC8 - movs r3, 0xE - ldrsh r2, [r1, r3] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - ldr r0, =gUnknown_085E9AE9 - bl sub_81B6D74 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B6FF4 - str r1, [r0] -_081B73C2: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B72C8 - - thumb_func_start sub_81B73E4 -sub_81B73E4: @ 81B73E4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B73FC - adds r0, r4, 0 - bl sub_81B77AC -_081B73FC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B73E4 - - thumb_func_start dp05_rare_candy -dp05_rare_candy: @ 81B7404 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r10, r1 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =gUnknown_0203CEC8 - mov r9, r0 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - ldr r0, =gUnknown_0203CEC4 - ldr r6, [r0] - movs r1, 0x86 - lsls r1, 2 - adds r4, r6, r1 - ldr r2, =gScriptItemId - mov r8, r2 - adds r0, r5, 0 - movs r1, 0x38 - bl GetMonData - cmp r0, 0x64 - beq _081B7478 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_81B79A0 - mov r1, r9 - ldrb r0, [r1, 0x9] - mov r2, r8 - ldrh r1, [r2] - movs r2, 0 - bl ExecuteTableBasedItemEffect__ - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x89 - lsls r0, 2 - adds r1, r6, r0 - adds r0, r5, 0 - bl sub_81B79A0 - b _081B747A - .pool -_081B7478: - movs r4, 0x1 -_081B747A: - movs r0, 0x5 - bl PlaySE - cmp r4, 0 - beq _081B74B4 - ldr r1, =gUnknown_0203CEE8 - movs r0, 0 - strb r0, [r1] - ldr r0, =gUnknown_085E96F6 - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - mov r1, r10 - b _081B7516 - .pool -_081B74B4: - ldr r1, =gUnknown_0203CEE8 - movs r0, 0x1 - strb r0, [r1] - movs r0, 0 - bl PlayFanfareByFanfareNum - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0x9] - adds r1, r5, 0 - bl sub_81B754C - ldr r0, =gScriptItemId - ldrh r0, [r0] - movs r1, 0x1 - bl RemoveBagItem - ldr r1, =gStringVar1 - adds r0, r5, 0 - bl GetMonNickname - ldr r4, =gStringVar2 - adds r0, r5, 0 - movs r1, 0x38 - bl GetMonData - adds r1, r0, 0 - adds r0, r4, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9D0A - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B75D4 -_081B7516: - str r1, [r0] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end dp05_rare_candy - - thumb_func_start sub_81B754C -sub_81B754C: @ 81B754C - push {r4-r7,lr} - adds r5, r1, 0 - lsls r0, 24 - lsrs r0, 24 - adds r7, r0, 0 - ldr r6, =gUnknown_0203CEDC - lsls r4, r7, 4 - ldr r1, [r6] - adds r1, r4 - adds r0, r5, 0 - bl party_menu_get_status_condition_and_update_object - ldr r2, =gSprites - ldr r0, [r6] - adds r3, r4, r0 - ldrb r1, [r3, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - bge _081B7588 - adds r0, r5, 0 - adds r1, r3, 0 - movs r2, 0x1 - bl sub_81B2AC8 -_081B7588: - ldr r1, [r6] - adds r1, r4 - adds r0, r5, 0 - movs r2, 0x1 - bl sub_81B2CD4 - ldr r1, [r6] - adds r1, r4 - adds r0, r5, 0 - movs r2, 0x1 - bl sub_81B2D74 - ldr r1, [r6] - adds r1, r4 - adds r0, r5, 0 - bl sub_81B2E28 - ldr r0, [r6] - adds r0, r4, r0 - ldrb r0, [r0, 0x9] - adds r1, r5, 0 - bl sub_81B5B38 - adds r0, r7, 0 - movs r1, 0x1 - bl sub_81B0FCC - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B754C - - thumb_func_start sub_81B75D4 -sub_81B75D4: @ 81B75D4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0 - bl WaitFanfare - lsls r0, 24 - cmp r0, 0 - beq _081B7620 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B7620 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081B7606 - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081B7620 -_081B7606: - movs r0, 0x5 - bl PlaySE - adds r0, r4, 0 - bl sub_81B767C - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B7634 - str r0, [r1] -_081B7620: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B75D4 - - thumb_func_start sub_81B7634 -sub_81B7634: @ 81B7634 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081B764E - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081B7668 -_081B764E: - movs r0, 0x5 - bl PlaySE - adds r0, r4, 0 - bl sub_81B76C8 - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B7704 - str r0, [r1] -_081B7668: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B7634 - - thumb_func_start sub_81B767C -sub_81B767C: @ 81B767C - push {r4,r5,lr} - sub sp, 0x8 - ldr r0, =gUnknown_0203CEC4 - ldr r5, [r0] - movs r0, 0x86 - lsls r0, 2 - adds r4, r5, r0 - bl sub_81B3364 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x18] - ldrh r0, [r4, 0x18] - movs r1, 0x89 - lsls r1, 2 - adds r2, r5, r1 - movs r1, 0x2 - str r1, [sp] - movs r1, 0x3 - str r1, [sp, 0x4] - adds r1, r4, 0 - movs r3, 0x1 - bl sub_81D3640 - ldrb r0, [r4, 0x18] - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B767C - - thumb_func_start sub_81B76C8 -sub_81B76C8: @ 81B76C8 - push {r4,lr} - sub sp, 0x4 - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - movs r0, 0x86 - lsls r0, 2 - adds r4, r1, r0 - ldrh r0, [r4, 0x18] - movs r2, 0x89 - lsls r2, 2 - adds r1, r2 - movs r2, 0x3 - str r2, [sp] - movs r2, 0x1 - movs r3, 0x2 - bl sub_81D3784 - ldrb r0, [r4, 0x18] - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B76C8 - - thumb_func_start sub_81B7704 -sub_81B7704: @ 81B7704 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0 - bl WaitFanfare - lsls r0, 24 - cmp r0, 0 - beq _081B77A6 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r6, 0x1 - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - bne _081B772C - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081B77A6 -_081B772C: - bl sub_81B3394 - ldr r4, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r4, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x1 - bl MonTryLearningNewMove - lsls r0, 16 - lsrs r1, r0, 16 - strh r6, [r4, 0x10] - ldr r0, =0x0000fffe - cmp r1, r0 - beq _081B7788 - cmp r1, r0 - bgt _081B776C - cmp r1, 0 - beq _081B7778 - b _081B77A0 - .pool -_081B776C: - ldr r0, =0x0000ffff - cmp r1, r0 - beq _081B7780 - b _081B77A0 - .pool -_081B7778: - adds r0, r5, 0 - bl sub_81B7810 - b _081B77A6 -_081B7780: - adds r0, r5, 0 - bl sub_81B787C - b _081B77A6 -_081B7788: - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B77AC - str r0, [r1] - b _081B77A6 - .pool -_081B77A0: - adds r0, r5, 0 - bl sub_81B7910 -_081B77A6: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81B7704 - - thumb_func_start sub_81B77AC -sub_81B77AC: @ 81B77AC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0 - bl MonTryLearningNewMove - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, =0x0000fffe - cmp r1, r0 - beq _081B780A - cmp r1, r0 - bgt _081B77E8 - cmp r1, 0 - beq _081B77F4 - b _081B7804 - .pool -_081B77E8: - ldr r0, =0x0000ffff - cmp r1, r0 - beq _081B77FC - b _081B7804 - .pool -_081B77F4: - adds r0, r4, 0 - bl sub_81B7810 - b _081B780A -_081B77FC: - adds r0, r4, 0 - bl sub_81B787C - b _081B780A -_081B7804: - adds r0, r4, 0 - bl sub_81B7910 -_081B780A: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B77AC - - thumb_func_start sub_81B7810 -sub_81B7810: @ 81B7810 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r6, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r6, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r7, r1, r0 - adds r0, r7, 0 - movs r1, 0 - movs r2, 0 - bl GetEvolutionTargetSpecies - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - beq _081B7860 - bl sub_81B06F4 - ldr r0, =gUnknown_030061E8 - ldr r1, [r6] - str r1, [r0] - ldrb r3, [r6, 0x9] - adds r0, r7, 0 - adds r1, r4, 0 - movs r2, 0x1 - bl sub_813DA40 - adds r0, r5, 0 - bl DestroyTask - b _081B786E - .pool -_081B7860: - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B6794 - str r0, [r1] -_081B786E: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B7810 - - thumb_func_start sub_81B787C -sub_81B787C: @ 81B787C - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_0203CEC8 - mov r8, r0 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gStringVar1 - bl GetMonNickname - ldr r0, =gStringVar2 - ldr r6, =gMoveToLearn - ldrh r2, [r6] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9AE9 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldrh r0, [r6] - mov r1, r8 - strh r0, [r1, 0xE] - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B6FF4 - str r1, [r0] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B787C - - thumb_func_start sub_81B7910 -sub_81B7910: @ 81B7910 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r6, r0, 0 - adds r5, r1, 0 - lsls r6, 24 - lsrs r6, 24 - lsls r5, 16 - lsrs r5, 16 - ldr r0, =gUnknown_0203CEC8 - mov r8, r0 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gStringVar1 - bl GetMonNickname - ldr r0, =gStringVar2 - movs r1, 0xD - muls r1, r5 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9AA5 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - mov r0, r8 - strh r5, [r0, 0xE] - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B6F60 - str r1, [r0] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B7910 - - thumb_func_start sub_81B79A0 -sub_81B79A0: @ 81B79A0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r1, 0x3A - bl GetMonData - strh r0, [r5] - adds r0, r4, 0 - movs r1, 0x3B - bl GetMonData - strh r0, [r5, 0x2] - adds r0, r4, 0 - movs r1, 0x3C - bl GetMonData - strh r0, [r5, 0x4] - adds r0, r4, 0 - movs r1, 0x3E - bl GetMonData - strh r0, [r5, 0x8] - adds r0, r4, 0 - movs r1, 0x3F - bl GetMonData - strh r0, [r5, 0xA] - adds r0, r4, 0 - movs r1, 0x3D - bl GetMonData - strh r0, [r5, 0x6] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81B79A0 - - thumb_func_start sub_81B79E8 -sub_81B79E8: @ 81B79E8 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0203CEC4 - ldr r2, [r1] - movs r3, 0x86 - lsls r3, 2 - adds r1, r2, r3 - movs r3, 0 - strh r3, [r1] - ldr r4, =0x0000021a - adds r1, r2, r4 - strh r3, [r1] - ldr r1, =gUnknown_0203CEC8 - ldrb r1, [r1, 0x9] - lsls r1, 24 - asrs r1, 24 - movs r3, 0x87 - lsls r3, 2 - adds r2, r3 - strh r1, [r2] - bl sub_81B7A28 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B79E8 - - thumb_func_start sub_81B7A28 -sub_81B7A28: @ 81B7A28 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - mov r8, r4 - ldr r6, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r6, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B7A6E - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - lsls r0, 16 - lsrs r7, r0, 16 - ldrb r0, [r6, 0x9] - ldr r1, =gScriptItemId - ldrh r1, [r1] - movs r2, 0 - bl ExecuteTableBasedItemEffect__ - lsls r0, 24 - cmp r0, 0 - beq _081B7A94 -_081B7A6E: - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =task_intro_gamefreak - str r0, [r1] - b _081B7B2A - .pool -_081B7A94: - movs r0, 0x1 - bl PlaySE - ldr r4, =gUnknown_0203CEDC - movs r0, 0x9 - ldrsb r0, [r6, r0] - lsls r0, 4 - ldr r1, [r4] - adds r1, r0 - adds r0, r5, 0 - bl party_menu_get_status_condition_and_update_object - ldr r2, =gSprites - movs r0, 0x9 - ldrsb r0, [r6, r0] - ldr r1, [r4] - lsls r0, 4 - adds r3, r0, r1 - ldrb r1, [r3, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - bge _081B7AD6 - adds r0, r5, 0 - adds r1, r3, 0 - movs r2, 0x1 - bl sub_81B2AC8 -_081B7AD6: - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - movs r1, 0x87 - lsls r1, 2 - adds r0, r1 - ldrb r0, [r0] - movs r1, 0 - bl sub_81B0FCC - ldrb r0, [r6, 0x9] - movs r1, 0x1 - bl sub_81B0FCC - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - adds r3, r0, 0 - subs r3, r7 - lsls r3, 16 - asrs r3, 16 - ldrb r1, [r6, 0x9] - ldr r0, =sub_81B7C10 - str r0, [sp] - mov r0, r8 - movs r2, 0x1 - bl sub_81B1F18 - mov r0, r8 - movs r1, 0 - adds r2, r7, 0 - bl sub_81B1FA8 - ldr r0, [r4] - movs r2, 0x86 - lsls r2, 2 - adds r1, r0, r2 - movs r2, 0x1 - strh r2, [r1] - ldr r1, =0x0000021a - adds r0, r1 - strh r2, [r0] -_081B7B2A: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B7A28 - - thumb_func_start task_intro_gamefreak -task_intro_gamefreak: @ 81B7B4C - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B7C0A - ldr r5, =gUnknown_0203CEC4 - ldr r2, [r5] - movs r0, 0x86 - lsls r0, 2 - adds r1, r2, r0 - movs r3, 0 - ldrsh r0, [r1, r3] - ldr r3, =gUnknown_0203CEC8 - cmp r0, 0x1 - bne _081B7B82 - movs r0, 0 - strh r0, [r1] - movs r1, 0x9 - ldrsb r1, [r3, r1] - movs r6, 0x87 - lsls r6, 2 - adds r0, r2, r6 - strh r1, [r0] -_081B7B82: - ldrb r0, [r3, 0x9] - adds r0, 0x1 - strb r0, [r3, 0x9] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0x6 - bne _081B7C04 - ldr r0, [r5] - ldr r1, =0x0000021a - adds r0, r1 - movs r2, 0 - ldrsh r1, [r0, r2] - cmp r1, 0 - bne _081B7BC8 - ldr r0, =gUnknown_0203CEE8 - strb r1, [r0] - ldr r0, =gUnknown_085E96F6 - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - b _081B7BD8 - .pool -_081B7BC8: - ldr r1, =gUnknown_0203CEE8 - movs r0, 0x1 - strb r0, [r1] - ldr r0, =gScriptItemId - ldrh r0, [r0] - movs r1, 0x1 - bl RemoveBagItem -_081B7BD8: - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B6794 - str r1, [r0] - ldr r1, =gUnknown_0203CEC8 - movs r0, 0 - strb r0, [r1, 0x9] - b _081B7C0A - .pool -_081B7C04: - adds r0, r4, 0 - bl sub_81B7A28 -_081B7C0A: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end task_intro_gamefreak - - thumb_func_start sub_81B7C10 -sub_81B7C10: @ 81B7C10 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - 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, =task_intro_gamefreak - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B7C10 - - thumb_func_start sub_81B7C74 -sub_81B7C74: @ 81B7C74 - push {r4-r6,lr} - adds r6, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0x5 - bl PlaySE - ldr r2, =gUnknown_030061E8 - ldr r1, =gUnknown_0203CEC8 - ldr r0, [r1] - str r0, [r2] - ldrb r0, [r1, 0x9] - ldr r4, =gScriptItemId - ldrh r1, [r4] - movs r2, 0 - bl ExecuteTableBasedItemEffect__ - lsls r0, 24 - cmp r0, 0 - beq _081B7CD8 - ldr r1, =gUnknown_0203CEE8 - movs r0, 0 - strb r0, [r1] - ldr r0, =gUnknown_085E96F6 - movs r1, 0x1 - 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 - str r6, [r0] - b _081B7CE4 - .pool -_081B7CD8: - ldrh r0, [r4] - movs r1, 0x1 - bl RemoveBagItem - bl sub_81B06F4 -_081B7CE4: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81B7C74 - - thumb_func_start GetItemEffectType -@ u8 GetItemEffectType(u16 itemId) -GetItemEffectType: @ 81B7CEC - push {r4,r5,lr} - lsls r0, 16 - lsrs r1, r0, 16 - adds r2, r1, 0 - subs r2, 0xD - lsls r0, r2, 16 - lsrs r0, 16 - cmp r0, 0xA5 - bls _081B7D00 - b _081B7E40 -_081B7D00: - cmp r1, 0xAF - bne _081B7D18 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003214 - adds r4, r0, r1 - b _081B7D20 - .pool -_081B7D18: - ldr r1, =gItemEffectTable - lsls r0, r2, 2 - adds r0, r1 - ldr r4, [r0] -_081B7D20: - ldrb r1, [r4] - movs r5, 0x3F - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - bne _081B7D42 - ldrb r0, [r4, 0x1] - cmp r0, 0 - bne _081B7D42 - ldrb r0, [r4, 0x2] - cmp r0, 0 - bne _081B7D42 - ldrb r3, [r4, 0x3] - movs r0, 0x80 - ands r0, r3 - cmp r0, 0 - beq _081B7D4C -_081B7D42: - movs r0, 0 - b _081B7E46 - .pool -_081B7D4C: - movs r2, 0x40 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _081B7D5A - movs r0, 0xA - b _081B7E46 -_081B7D5A: - adds r0, r2, 0 - ands r0, r3 - cmp r0, 0 - beq _081B7D66 - movs r0, 0x1 - b _081B7E46 -_081B7D66: - adds r2, r5, 0 - ands r2, r3 - cmp r2, 0 - bne _081B7D74 - lsrs r0, r1, 7 - cmp r0, 0 - beq _081B7DB6 -_081B7D74: - cmp r2, 0x20 - bne _081B7D7C - movs r0, 0x4 - b _081B7E46 -_081B7D7C: - cmp r2, 0x10 - bne _081B7D84 - movs r0, 0x3 - b _081B7E46 -_081B7D84: - cmp r2, 0x8 - bne _081B7D8C - movs r0, 0x5 - b _081B7E46 -_081B7D8C: - cmp r2, 0x4 - bne _081B7D94 - movs r0, 0x6 - b _081B7E46 -_081B7D94: - cmp r2, 0x2 - bne _081B7D9C - movs r0, 0x7 - b _081B7E46 -_081B7D9C: - cmp r2, 0x1 - bne _081B7DA4 - movs r0, 0x8 - b _081B7E46 -_081B7DA4: - lsrs r0, r1, 7 - cmp r0, 0 - beq _081B7DB2 - cmp r2, 0 - bne _081B7DB2 - movs r0, 0x9 - b _081B7E46 -_081B7DB2: - movs r0, 0xB - b _081B7E46 -_081B7DB6: - ldrb r1, [r4, 0x4] - movs r0, 0x44 - ands r0, r1 - adds r2, r1, 0 - cmp r0, 0 - beq _081B7DC6 - movs r0, 0x2 - b _081B7E46 -_081B7DC6: - movs r5, 0x2 - adds r0, r5, 0 - ands r0, r2 - cmp r0, 0 - beq _081B7DD4 - movs r0, 0xC - b _081B7E46 -_081B7DD4: - movs r3, 0x1 - adds r0, r3, 0 - ands r0, r2 - cmp r0, 0 - beq _081B7DE2 - movs r0, 0xD - b _081B7E46 -_081B7DE2: - ldrb r1, [r4, 0x5] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _081B7DF0 - movs r0, 0xE - b _081B7E46 -_081B7DF0: - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _081B7DFC - movs r0, 0xF - b _081B7E46 -_081B7DFC: - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _081B7E08 - movs r0, 0x10 - b _081B7E46 -_081B7E08: - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _081B7E14 - movs r0, 0x11 - b _081B7E46 -_081B7E14: - movs r0, 0x80 - ands r0, r2 - cmp r0, 0 - beq _081B7E20 - movs r0, 0x12 - b _081B7E46 -_081B7E20: - movs r0, 0x20 - ands r0, r2 - cmp r0, 0 - beq _081B7E2C - movs r0, 0x13 - b _081B7E46 -_081B7E2C: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _081B7E38 - movs r0, 0x14 - b _081B7E46 -_081B7E38: - movs r0, 0x18 - ands r0, r2 - cmp r0, 0 - bne _081B7E44 -_081B7E40: - movs r0, 0x16 - b _081B7E46 -_081B7E44: - movs r0, 0x15 -_081B7E46: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end GetItemEffectType - - thumb_func_start sub_81B7E4C -sub_81B7E4C: @ 81B7E4C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B7F1C - ldr r7, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r7, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - movs r0, 0xE - adds r0, r7 - mov r8, r0 - ldr r1, =gStringVar1 - adds r0, r5, 0 - bl GetMonNickname - ldr r4, =gSpecialVar_0x8005 - ldrb r0, [r4] - bl sub_81B2360 - strh r0, [r7, 0xE] - ldr r0, =gStringVar2 - movs r1, 0xE - ldrsh r2, [r7, r1] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - movs r0, 0x2 - mov r1, r8 - strh r0, [r1, 0x2] - ldrb r2, [r4] - adds r0, r5, 0 - movs r1, 0 - bl sub_81B22D8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B7EF0 - cmp r0, 0x2 - beq _081B7EF8 - ldrh r1, [r7, 0xE] - adds r0, r5, 0 - bl GiveMoveToMon - lsls r0, 16 - ldr r1, =0xffff0000 - cmp r0, r1 - beq _081B7F08 - adds r0, r6, 0 - bl sub_81B6EB4 - b _081B7F1C - .pool -_081B7EF0: - ldr r1, =gUnknown_085E9AB4 - b _081B7EFA - .pool -_081B7EF8: - ldr r1, =gUnknown_085E9C00 -_081B7EFA: - adds r0, r6, 0 - bl sub_81B6D98 - b _081B7F1C - .pool -_081B7F08: - ldr r0, =gUnknown_085E9AE9 - bl sub_81B6D74 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B6FF4 - str r1, [r0] -_081B7F1C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B7E4C - - thumb_func_start CB2_PartyMenuFromStartMenu -CB2_PartyMenuFromStartMenu: @ 81B7F34 - push {lr} - sub sp, 0xC - movs r0, 0 - str r0, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =sub_8086194 - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl sub_81B0038 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end CB2_PartyMenuFromStartMenu - - thumb_func_start sub_81B7F60 -sub_81B7F60: @ 81B7F60 - push {lr} - sub sp, 0xC - bl InBattlePyramid - lsls r0, 24 - ldr r1, =sub_81C4F84 - cmp r0, 0 - bne _081B7F72 - ldr r1, =c2_815ABFC -_081B7F72: - movs r0, 0x6 - str r0, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - str r1, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0x5 - movs r3, 0 - bl sub_81B0038 - ldr r1, =gUnknown_0203CEC8 - ldr r0, =gScriptItemId - ldrh r0, [r0] - strh r0, [r1, 0xC] - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B7F60 - - thumb_func_start sub_81B7FAC -sub_81B7FAC: @ 81B7FAC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r4, r0, 24 - adds r6, r4, 0 - ldr r5, =gUnknown_0203CEFC - ldr r0, =gUnknown_0203CEC8 - mov r9, r0 - ldrb r0, [r0, 0x9] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x64 - mov r8, r1 - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - ldr r7, =gPlayerParty - adds r0, r7 - movs r1, 0xC - bl GetMonData - strh r0, [r5] - lsls r0, 16 - cmp r0, 0 - bne _081B7FF8 - adds r0, r4, 0 - bl sub_81B8044 - b _081B8030 - .pool -_081B7FF8: - ldrh r0, [r5] - bl itemid_is_mail - lsls r0, 24 - cmp r0, 0 - beq _081B800C - adds r0, r4, 0 - bl sub_81B83B8 - b _081B8030 -_081B800C: - mov r1, r9 - movs r0, 0x9 - ldrsb r0, [r1, r0] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r7 - ldrh r1, [r5] - movs r2, 0x1 - bl sub_81B1D1C - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B82A0 - str r1, [r0] -_081B8030: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B7FAC - - thumb_func_start sub_81B8044 -sub_81B8044: @ 81B8044 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r5, =gUnknown_0203CEC8 - ldrh r0, [r5, 0xC] - bl itemid_is_mail - lsls r0, 24 - cmp r0, 0 - beq _081B807C - ldrh r0, [r5, 0xC] - bl sub_81B83F0 - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - ldr r0, =sub_81B814C - str r0, [r1, 0x4] - adds r0, r4, 0 - bl sub_81B12C0 - b _081B8082 - .pool -_081B807C: - adds r0, r4, 0 - bl sub_81B8088 -_081B8082: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81B8044 - - thumb_func_start sub_81B8088 -sub_81B8088: @ 81B8088 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B80E4 - ldr r4, =gUnknown_0203CEC8 - ldrh r5, [r4, 0xC] - movs r0, 0x9 - ldrsb r0, [r4, r0] - movs r1, 0x64 - mov r8, r1 - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - ldr r6, =gPlayerParty - adds r0, r6 - adds r1, r5, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_81B1C84 - movs r0, 0x9 - ldrsb r0, [r4, r0] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r6 - adds r1, r5, 0 - bl sub_81B1DB8 - adds r0, r5, 0 - bl sub_81B83F0 - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B8104 - str r1, [r0] -_081B80E4: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8088 - - thumb_func_start sub_81B8104 -sub_81B8104: @ 81B8104 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gUnknown_0203CEC8 - ldrb r4, [r0, 0x9] - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B8138 - lsls r2, r4, 24 - asrs r2, 24 - movs r0, 0x64 - muls r0, r2 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gUnknown_0203CEDC - lsls r2, 4 - ldr r1, [r1] - adds r1, r2 - bl sub_81B5C94 - adds r0, r5, 0 - bl sub_81B12C0 -_081B8138: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8104 - - thumb_func_start sub_81B814C -sub_81B814C: @ 81B814C - push {r4-r6,lr} - ldr r4, =gUnknown_0203CEC8 - movs r0, 0x9 - ldrsb r0, [r4, r0] - movs r6, 0x64 - muls r0, r6 - ldr r5, =gPlayerParty - adds r0, r5 - ldrh r1, [r4, 0xC] - bl sub_81B1DB8 - movs r0, 0x9 - ldrsb r0, [r4, r0] - muls r0, r6 - adds r0, r5 - movs r1, 0x40 - bl GetMonData - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gSaveBlock1Ptr - lsls r2, r0, 3 - adds r2, r0 - lsls r2, 2 - ldr r0, =0x00002be0 - adds r2, r0 - ldr r1, [r1] - adds r1, r2 - ldr r2, =sub_81B81A8 - movs r0, 0x4 - movs r3, 0x3 - bl sub_811A20C - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B814C - - thumb_func_start sub_81B81A8 -sub_81B81A8: @ 81B81A8 - push {r4-r7,lr} - sub sp, 0xC - ldr r6, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r6, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r7, r0, 16 - ldr r0, =gScriptResult - ldrh r0, [r0] - cmp r0, 0 - bne _081B8208 - adds r0, r5, 0 - bl sub_80D4680 - ldr r4, =gUnknown_0203CEFC - adds r0, r5, 0 - movs r1, 0xC - adds r2, r4, 0 - bl SetMonData - ldrh r0, [r4] - movs r1, 0x1 - bl RemoveBagItem - adds r0, r7, 0 - bl sub_81B841C - ldr r0, [r6] - bl SetMainCallback2 - b _081B8224 - .pool -_081B8208: - ldrb r0, [r6, 0x8] - lsls r0, 28 - lsrs r0, 28 - ldrb r2, [r6, 0xB] - movs r1, 0x7F - str r1, [sp] - ldr r1, =sub_81B8230 - str r1, [sp, 0x4] - ldr r1, [r6] - str r1, [sp, 0x8] - movs r1, 0xFF - movs r3, 0x1 - bl sub_81B0038 -_081B8224: - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B81A8 - - thumb_func_start sub_81B8230 -sub_81B8230: @ 81B8230 - 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 _081B828A - ldr r1, =gUnknown_0203CEFC - ldrh r0, [r1] - cmp r0, 0 - beq _081B8264 - ldr r0, =gUnknown_0203CEC8 - ldrh r0, [r0, 0xC] - ldrh r1, [r1] - movs r2, 0 - bl sub_81B1D68 - b _081B827C - .pool -_081B8264: - ldr r2, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r2, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - ldrh r1, [r2, 0xC] - movs r2, 0 - movs r3, 0x1 - bl sub_81B1C84 -_081B827C: - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B8104 - str r0, [r1] -_081B828A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8230 - - thumb_func_start sub_81B82A0 -sub_81B82A0: @ 81B82A0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B82C4 - bl sub_81B334C - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B82D4 - str r0, [r1] -_081B82C4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B82A0 - - thumb_func_start sub_81B82D4 -sub_81B82D4: @ 81B82D4 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _081B82FA - cmp r1, 0 - bgt _081B82F4 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _081B8394 - b _081B83A8 -_081B82F4: - cmp r1, 0x1 - beq _081B839A - b _081B83A8 -_081B82FA: - ldr r7, =gUnknown_0203CEC8 - ldrh r4, [r7, 0xC] - adds r0, r4, 0 - bl sub_81B83F0 - ldr r6, =gUnknown_0203CEFC - ldrh r0, [r6] - movs r1, 0x1 - bl AddBagItem - lsls r0, 24 - cmp r0, 0 - bne _081B8338 - adds r0, r4, 0 - bl sub_81B841C - ldrh r0, [r6] - bl pokemon_item_not_removed - ldr r0, =gStringVar4 - movs r1, 0 - bl sub_81B1B5C - b _081B8378 - .pool -_081B8338: - adds r0, r4, 0 - bl itemid_is_mail - lsls r0, 24 - cmp r0, 0 - beq _081B835C - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - ldr r0, =sub_81B814C - str r0, [r1, 0x4] - adds r0, r5, 0 - bl sub_81B12C0 - b _081B83A8 - .pool -_081B835C: - movs r1, 0x9 - ldrsb r1, [r7, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - adds r1, r4, 0 - bl sub_81B1DB8 - ldrh r1, [r6] - adds r0, r4, 0 - movs r2, 0x1 - bl sub_81B1D68 -_081B8378: - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B8104 - str r1, [r0] - b _081B83A8 - .pool -_081B8394: - movs r0, 0x5 - bl PlaySE -_081B839A: - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B8104 - str r0, [r1] -_081B83A8: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B82D4 - - thumb_func_start sub_81B83B8 -sub_81B83B8: @ 81B83B8 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_085E98EC - movs r1, 0x1 - 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_81B8104 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B83B8 - - thumb_func_start sub_81B83F0 -sub_81B83F0: @ 81B83F0 - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0xB] - cmp r0, 0x6 - bne _081B8410 - lsls r0, r1, 24 - lsrs r0, 24 - movs r1, 0x1 - bl sub_80D6E48 - b _081B8418 - .pool -_081B8410: - adds r0, r1, 0 - movs r1, 0x1 - bl RemoveBagItem -_081B8418: - pop {r0} - bx r0 - thumb_func_end sub_81B83F0 - - thumb_func_start sub_81B841C -sub_81B841C: @ 81B841C - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0xB] - cmp r0, 0x5 - beq _081B8438 - adds r0, r1, 0 - movs r1, 0x1 - bl sub_80D6D70 - b _081B8440 - .pool -_081B8438: - adds r0, r1, 0 - movs r1, 0x1 - bl AddBagItem -_081B8440: - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_81B841C - - thumb_func_start sub_81B8448 -sub_81B8448: @ 81B8448 - push {lr} - sub sp, 0xC - movs r0, 0x6 - str r0, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =sub_816BB28 - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0x7 - movs r3, 0 - bl sub_81B0038 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8448 - - thumb_func_start sub_81B8474 -sub_81B8474: @ 81B8474 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - ldr r1, =gUnknown_0203CEE8 - movs r0, 0 - strb r0, [r1] - ldr r2, =gSaveBlock1Ptr - ldr r0, =gUnknown_0203BCB8 - ldrh r1, [r0] - adds r1, 0x6 - ldrh r0, [r0, 0x2] - adds r1, r0 - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x00002be0 - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - adds r0, r5, 0 - movs r1, 0xC - bl GetMonData - cmp r0, 0 - beq _081B84DC - ldr r0, =gUnknown_085E9A08 - movs r1, 0x1 - bl sub_81B1B5C - b _081B84F2 - .pool -_081B84DC: - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_80D460C - adds r0, r4, 0 - bl sub_80D439C - ldr r0, =gUnknown_085E9A40 - movs r1, 0x1 - bl sub_81B1B5C -_081B84F2: - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r0, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B8104 - str r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8474 - - thumb_func_start sub_81B8518 -sub_81B8518: @ 81B8518 - push {lr} - sub sp, 0xC - bl sub_81B8558 - movs r0, 0 - str r0, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =gMain - ldr r0, [r0, 0x8] - str r0, [sp, 0x8] - movs r0, 0x4 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl sub_81B0038 - ldr r1, =gUnknown_0203CEC8 - ldr r0, =sub_81B879C - str r0, [r1, 0x4] - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8518 - - thumb_func_start sub_81B8558 -sub_81B8558: @ 81B8558 - push {lr} - ldr r0, =gUnknown_0203CEF8 - movs r1, 0 - movs r2, 0x4 - bl memset - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8558 - - thumb_func_start sub_81B856C -sub_81B856C: @ 81B856C - push {r4,lr} - lsls r0, 24 - asrs r4, r0, 24 - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - bl sub_81B85AC - lsls r0, 24 - cmp r0, 0 - bne _081B858C - movs r0, 0x2 - b _081B85A4 - .pool -_081B858C: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r0, 24 - bl sub_81B8770 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B85A2 - movs r0, 0 - b _081B85A4 -_081B85A2: - movs r0, 0x1 -_081B85A4: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81B856C - - thumb_func_start sub_81B85AC -sub_81B85AC: @ 81B85AC - push {r4-r6,lr} - adds r5, r0, 0 - movs r6, 0 - movs r1, 0x2D - bl GetMonData - cmp r0, 0 - bne _081B8608 - adds r0, r5, 0 - movs r1, 0x38 - bl GetMonData - adds r4, r0, 0 - bl sub_81B8888 - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bhi _081B8608 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldrh r1, [r0, 0x4] - ldr r0, =0x0000191a - cmp r1, r0 - bne _081B85EA - adds r0, r5, 0 - movs r1, 0xC - bl GetMonData - cmp r0, 0 - bne _081B8608 -_081B85EA: - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x8 - beq _081B864A - cmp r0, 0x9 - bne _081B8618 - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - bne _081B864A -_081B8608: - movs r0, 0 - b _081B864C - .pool -_081B8618: - adds r0, r5, 0 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r4, r0, 16 - ldr r3, =gUnknown_08611C9A - lsls r1, r6, 1 - adds r0, r1, r3 - ldrh r0, [r0] - ldr r2, =0x0000ffff - cmp r0, r2 - beq _081B864A -_081B8632: - adds r0, r1, r3 - ldrh r0, [r0] - cmp r0, r4 - beq _081B8608 - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, r6, 1 - adds r0, r1, r3 - ldrh r0, [r0] - cmp r0, r2 - bne _081B8632 -_081B864A: - movs r0, 0x1 -_081B864C: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B85AC - - thumb_func_start sub_81B865C -sub_81B865C: @ 81B865C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - bl sub_81B885C - lsls r0, 24 - lsrs r2, r0, 24 - adds r1, r2, 0 - ldr r3, =gUnknown_0203CEF8 - adds r0, r2, r3 - subs r0, 0x1 - ldrb r0, [r0] - cmp r0, 0 - bne _081B869C - cmp r2, 0x1 - bne _081B8688 - movs r0, 0xE - b _081B8758 - .pool -_081B8688: - ldr r0, =gStringVar1 - movs r2, 0 - movs r3, 0x1 - bl ConvertIntToDecimalStringN - movs r0, 0x11 - b _081B8758 - .pool -_081B869C: - ldr r0, =0x000040cf - bl VarGet - lsls r0, 24 - movs r1, 0xF8 - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x1 - bhi _081B86C0 - b _081B8756 - .pool -_081B86B8: - movs r0, 0x12 - b _081B8758 -_081B86BC: - movs r0, 0x13 - b _081B8758 -_081B86C0: - bl sub_81B8830 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r5, 0 - b _081B8750 -_081B86CE: - ldr r3, =gUnknown_0203CEF8 - adds r4, r3, r5 - ldrb r0, [r4] - movs r1, 0x64 - muls r0, r1 - subs r0, 0x64 - ldr r3, =gPlayerParty - adds r0, r3, r0 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - ldrb r0, [r4] - movs r1, 0x64 - muls r0, r1 - subs r0, 0x64 - ldr r3, =gPlayerParty - adds r0, r3, r0 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r6, r0, 16 - adds r1, r5, 0x1 - lsls r0, r1, 24 - lsrs r4, r0, 24 - mov r9, r1 - cmp r4, r8 - bcs _081B8748 - movs r7, 0x64 -_081B870E: - ldr r0, =gUnknown_0203CEF8 - adds r5, r0, r4 - ldrb r0, [r5] - muls r0, r7 - subs r0, 0x64 - ldr r1, =gPlayerParty - adds r0, r1, r0 - movs r1, 0xB - bl GetMonData - cmp r10, r0 - beq _081B86B8 - cmp r6, 0 - beq _081B873E - ldrb r0, [r5] - muls r0, r7 - subs r0, 0x64 - ldr r3, =gPlayerParty - adds r0, r3, r0 - movs r1, 0xC - bl GetMonData - cmp r6, r0 - beq _081B86BC -_081B873E: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r8 - bcc _081B870E -_081B8748: - mov r1, r9 - lsls r0, r1, 24 - lsrs r5, r0, 24 - mov r0, r8 -_081B8750: - subs r0, 0x1 - cmp r5, r0 - blt _081B86CE -_081B8756: - movs r0, 0xFF -_081B8758: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B865C - - thumb_func_start sub_81B8770 -sub_81B8770: @ 81B8770 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - movs r1, 0 - ldr r3, =gUnknown_0203CEF8 -_081B877A: - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _081B878C - movs r0, 0x1 - b _081B8798 - .pool -_081B878C: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x3 - bls _081B877A - movs r0, 0 -_081B8798: - pop {r1} - bx r1 - thumb_func_end sub_81B8770 - - thumb_func_start sub_81B879C -sub_81B879C: @ 81B879C - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_81B865C - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xFF - beq _081B87D4 - movs r0, 0x20 - bl PlaySE - adds r0, r4, 0 - bl display_pokemon_menu_message - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B87E8 - str r0, [r1] - b _081B87E0 - .pool -_081B87D4: - movs r0, 0x5 - bl PlaySE - adds r0, r5, 0 - bl sub_81B12C0 -_081B87E0: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81B879C - - thumb_func_start sub_81B87E8 -sub_81B87E8: @ 81B87E8 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081B8802 - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081B881C -_081B8802: - movs r0, 0x5 - bl PlaySE - movs r0, 0 - 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] -_081B881C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B87E8 - - thumb_func_start sub_81B8830 -sub_81B8830: @ 81B8830 - push {lr} - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x8 - beq _081B884C - cmp r0, 0x9 - bne _081B8850 - movs r0, 0x3 - b _081B8854 - .pool -_081B884C: - movs r0, 0x2 - b _081B8854 -_081B8850: - ldr r0, =gSpecialVar_0x8005 - ldrb r0, [r0] -_081B8854: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B8830 - - thumb_func_start sub_81B885C -sub_81B885C: @ 81B885C - push {lr} - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x8 - beq _081B8878 - cmp r0, 0x9 - bne _081B887C - movs r0, 0x1 - b _081B8880 - .pool -_081B8878: - movs r0, 0x2 - b _081B8880 -_081B887C: - ldr r0, =gSpecialVar_0x8005 - ldrb r0, [r0] -_081B8880: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B885C - - thumb_func_start sub_81B8888 -sub_81B8888: @ 81B8888 - push {lr} - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x8 - beq _081B88A4 - cmp r0, 0x9 - bne _081B88A8 -_081B889C: - movs r0, 0x64 - b _081B88B2 - .pool -_081B88A4: - movs r0, 0x1E - b _081B88B2 -_081B88A8: - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - cmp r0, 0 - bne _081B889C - movs r0, 0x32 -_081B88B2: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B8888 - - thumb_func_start sub_81B88BC -sub_81B88BC: @ 81B88BC - push {lr} - ldr r0, =0x000040cf - bl VarGet - lsls r0, 24 - lsrs r1, r0, 24 - movs r2, 0xF8 - lsls r2, 24 - adds r0, r2 - lsrs r0, 24 - cmp r0, 0x1 - bhi _081B88E0 - ldr r0, =gUnknown_085EA126 - b _081B88FA - .pool -_081B88E0: - cmp r1, 0x1 - bne _081B88F8 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x2 - bne _081B88F8 - ldr r0, =gUnknown_085EA139 - b _081B88FA - .pool -_081B88F8: - ldr r0, =gUnknown_085EA155 -_081B88FA: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B88BC - - thumb_func_start sub_81B8904 -sub_81B8904: @ 81B8904 - push {lr} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - movs r2, 0 - str r2, [sp] - ldr r2, =sub_81B1370 - str r2, [sp, 0x4] - str r1, [sp, 0x8] - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl sub_81B0038 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8904 - - thumb_func_start sub_81B892C -sub_81B892C: @ 81B892C - push {lr} - sub sp, 0xC - movs r0, 0x4 - str r0, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0xC - movs r3, 0 - bl sub_81B0038 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B892C - - thumb_func_start sub_81B8958 -sub_81B8958: @ 81B8958 - push {lr} - sub sp, 0xC - movs r0, 0x1 - str r0, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - str r0, [sp, 0x8] - movs r0, 0xB - movs r1, 0 - movs r2, 0xD - movs r3, 0 - bl sub_81B0038 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8958 - - thumb_func_start sub_81B8984 -sub_81B8984: @ 81B8984 - push {lr} - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - bne _081B8994 - movs r0, 0 - b _081B89A6 -_081B8994: - bl sub_81B1250 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B89A4 - movs r0, 0x1 - b _081B89A6 -_081B89A4: - movs r0, 0x2 -_081B89A6: - pop {r1} - bx r1 - thumb_func_end sub_81B8984 - - thumb_func_start sub_81B89AC -sub_81B89AC: @ 81B89AC - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_81B8984 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0 - str r0, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =sub_8059D40 - str r0, [sp, 0x8] - movs r0, 0x1 - adds r2, r4, 0 - movs r3, 0 - bl sub_81B0038 - bl nullsub_35 - bl pokemon_change_order - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B89AC - - thumb_func_start sub_81B89F0 -sub_81B89F0: @ 81B89F0 - push {lr} - sub sp, 0xC - bl sub_81B8984 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x5 - str r0, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =c2_815ABFC - str r0, [sp, 0x8] - movs r0, 0x1 - movs r2, 0x3 - movs r3, 0 - bl sub_81B0038 - bl nullsub_35 - bl pokemon_change_order - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B89F0 - - thumb_func_start sub_81B8A2C -sub_81B8A2C: @ 81B8A2C - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gPlayerParty + 0x64 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B8A74 - adds r0, r4, 0 - movs r1, 0x2D - bl GetMonData - cmp r0, 0 - bne _081B8A74 - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0xB] - cmp r0, 0x1 - bne _081B8A5C - movs r0, 0x3 - b _081B8A76 - .pool -_081B8A5C: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - bne _081B8A74 - movs r0, 0x2 - b _081B8A76 - .pool -_081B8A74: - movs r0, 0x7 -_081B8A76: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81B8A2C - - thumb_func_start sub_81B8A7C -sub_81B8A7C: @ 81B8A7C - push {r4-r7,lr} - mov r7, r8 - push {r7} - bl brm_get_pokemon_selection - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_81B1250 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B8AC4 - cmp r5, 0x1 - beq _081B8AA2 - cmp r5, 0x4 - beq _081B8AA2 - cmp r5, 0x5 - bne _081B8AC4 -_081B8AA2: - ldr r4, =gStringVar1 - bl GetTrainerPartnerName - adds r1, r0, 0 - adds r0, r4, 0 - bl StringCopy - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E97B2 - b _081B8C42 - .pool -_081B8AC4: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =gPlayerParty - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - bne _081B8AF8 - ldr r1, =gStringVar1 - adds r0, r4, 0 - bl GetMonNickname - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E978F - b _081B8C42 - .pool -_081B8AF8: - movs r4, 0 - b _081B8B24 -_081B8AFC: - adds r0, r4, 0 - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _081B8B1E - adds r0, r5, 0 - bl sub_81B8F38 - lsls r0, 24 - ldr r2, =gBattlePartyID - lsls r1, r4, 1 - adds r1, r2 - lsrs r0, 24 - ldrh r1, [r1] - cmp r0, r1 - beq _081B8BFC -_081B8B1E: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_081B8B24: - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r4, r0 - bcc _081B8AFC - movs r7, 0x64 - adds r0, r5, 0 - muls r0, r7 - ldr r1, =gPlayerParty - mov r8, r1 - adds r6, r0, r1 - adds r0, r6, 0 - movs r1, 0x2D - bl GetMonData - cmp r0, 0 - beq _081B8B60 - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E97E5 - b _081B8C42 - .pool -_081B8B60: - adds r0, r5, 0 - bl sub_81B8F38 - ldr r1, =gBattleStruct - ldr r1, [r1] - adds r1, 0x8B - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bne _081B8B94 - ldr r1, =gStringVar1 - adds r0, r6, 0 - bl GetMonNickname - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E976F - b _081B8C42 - .pool -_081B8B94: - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0xB] - cmp r0, 0x4 - bne _081B8BA8 - bl sub_806E994 - b _081B8C46 - .pool -_081B8BA8: - cmp r0, 0x2 - beq _081B8C20 - adds r0, r5, 0 - bl sub_81B8F38 - ldr r1, =gUnknown_0203CEE9 - strb r0, [r1] - ldr r1, =gUnknown_0203CEE8 - movs r0, 0x1 - strb r0, [r1] - ldr r1, =gBattlePartyID - ldr r0, =gBankInMenu - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrb r0, [r0] - bl pokemon_order_func - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_81B8FB0 - adds r0, r4, 0 - muls r0, r7 - add r0, r8 - adds r1, r6, 0 - bl sub_81B1288 - movs r0, 0x1 - b _081B8C48 - .pool -_081B8BFC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gStringVar1 - bl GetMonNickname - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9754 - b _081B8C42 - .pool -_081B8C20: - ldr r0, =gBankInMenu - ldrb r0, [r0] - ldr r1, =gBattlePartyID - lsls r0, 1 - adds r0, r1 - ldrb r0, [r0] - bl pokemon_order_func - lsls r0, 24 - lsrs r0, 24 - muls r0, r7 - add r0, r8 - ldr r1, =gStringVar1 - bl GetMonNickname - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9738 -_081B8C42: - bl StringExpandPlaceholders -_081B8C46: - movs r0, 0 -_081B8C48: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B8A7C - - thumb_func_start sub_81B8C68 -sub_81B8C68: @ 81B8C68 - push {r4,lr} - ldr r4, =gUnknown_0203CF00 - bl sub_806D7EC - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_81B8C88 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8C68 - - thumb_func_start sub_81B8C88 -sub_81B8C88: @ 81B8C88 - push {r4-r6,lr} - sub sp, 0x8 - adds r6, r0, 0 - lsls r1, 24 - lsrs r4, r1, 24 - bl sub_81B1250 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B8CBE - cmp r4, 0 - beq _081B8CB0 - movs r0, 0x30 - strb r0, [r6] - movs r0, 0x45 - strb r0, [r6, 0x1] - movs r0, 0x12 - strb r0, [r6, 0x2] - b _081B8D58 -_081B8CB0: - movs r0, 0x3 - strb r0, [r6] - movs r0, 0x12 - strb r0, [r6, 0x1] - movs r0, 0x45 - strb r0, [r6, 0x2] - b _081B8D58 -_081B8CBE: - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - bne _081B8CFC - movs r5, 0x1 - movs r0, 0 - bl GetBankByPlayerAI - mov r2, sp - ldr r1, =gBattlePartyID - lsls r0, 24 - lsrs r0, 23 - adds r0, r1 - ldrh r0, [r0] - strb r0, [r2] - movs r4, 0 - mov r1, sp -_081B8CE2: - ldrb r0, [r1] - cmp r4, r0 - beq _081B8CF0 - mov r2, sp - adds r0, r2, r5 - strb r4, [r0] - adds r5, 0x1 -_081B8CF0: - adds r4, 0x1 - cmp r4, 0x5 - ble _081B8CE2 - b _081B8D40 - .pool -_081B8CFC: - movs r5, 0x2 - movs r0, 0 - bl GetBankByPlayerAI - mov r1, sp - ldr r4, =gBattlePartyID - lsls r0, 24 - lsrs r0, 23 - adds r0, r4 - ldrh r0, [r0] - strb r0, [r1] - movs r0, 0x2 - bl GetBankByPlayerAI - mov r1, sp - lsls r0, 24 - lsrs r0, 23 - adds r0, r4 - ldrh r0, [r0] - strb r0, [r1, 0x1] - movs r4, 0 -_081B8D26: - ldrb r0, [r1] - cmp r4, r0 - beq _081B8D3A - ldrb r0, [r1, 0x1] - cmp r4, r0 - beq _081B8D3A - mov r2, sp - adds r0, r2, r5 - strb r4, [r0] - adds r5, 0x1 -_081B8D3A: - adds r4, 0x1 - cmp r4, 0x5 - ble _081B8D26 -_081B8D40: - movs r4, 0 - mov r3, sp -_081B8D44: - adds r0, r6, r4 - ldrb r1, [r3] - lsls r1, 4 - ldrb r2, [r3, 0x1] - orrs r1, r2 - strb r1, [r0] - adds r3, 0x2 - adds r4, 0x1 - cmp r4, 0x2 - ble _081B8D44 -_081B8D58: - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8C88 - - thumb_func_start sub_81B8D64 -sub_81B8D64: @ 81B8D64 - push {lr} - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =gBattleStruct - lsls r3, r2, 1 - adds r3, r2 - adds r3, 0x60 - ldr r0, [r0] - adds r0, r3 - bl sub_81B8D88 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8D64 - - thumb_func_start sub_81B8D88 -sub_81B8D88: @ 81B8D88 - push {r4-r7,lr} - sub sp, 0x8 - adds r5, r0, 0 - adds r0, r2, 0 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r0, 24 - lsrs r0, 24 - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _081B8DB0 - movs r0, 0 - bl GetBankByPlayerAI - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x2 - b _081B8DBC -_081B8DB0: - movs r0, 0x1 - bl GetBankByPlayerAI - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x3 -_081B8DBC: - bl GetBankByPlayerAI - lsls r0, 24 - lsrs r6, r0, 24 - bl sub_81B1250 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B8DF0 - cmp r7, 0 - beq _081B8DE2 - movs r0, 0x30 - strb r0, [r5] - movs r0, 0x45 - strb r0, [r5, 0x1] - movs r0, 0x12 - strb r0, [r5, 0x2] - b _081B8E72 -_081B8DE2: - movs r0, 0x3 - strb r0, [r5] - movs r0, 0x12 - strb r0, [r5, 0x1] - movs r0, 0x45 - strb r0, [r5, 0x2] - b _081B8E72 -_081B8DF0: - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - bne _081B8E28 - movs r3, 0x1 - mov r2, sp - ldr r1, =gBattlePartyID - lsls r0, r4, 1 - adds r0, r1 - ldrh r0, [r0] - strb r0, [r2] - movs r4, 0 - mov r1, sp -_081B8E0C: - ldrb r0, [r1] - cmp r4, r0 - beq _081B8E1A - mov r2, sp - adds r0, r2, r3 - strb r4, [r0] - adds r3, 0x1 -_081B8E1A: - adds r4, 0x1 - cmp r4, 0x5 - ble _081B8E0C - b _081B8E5A - .pool -_081B8E28: - movs r3, 0x2 - mov r1, sp - ldr r2, =gBattlePartyID - lsls r0, r4, 1 - adds r0, r2 - ldrh r0, [r0] - strb r0, [r1] - lsls r0, r6, 1 - adds r0, r2 - ldrh r0, [r0] - strb r0, [r1, 0x1] - movs r4, 0 -_081B8E40: - ldrb r0, [r1] - cmp r4, r0 - beq _081B8E54 - ldrb r0, [r1, 0x1] - cmp r4, r0 - beq _081B8E54 - mov r2, sp - adds r0, r2, r3 - strb r4, [r0] - adds r3, 0x1 -_081B8E54: - adds r4, 0x1 - cmp r4, 0x5 - ble _081B8E40 -_081B8E5A: - movs r4, 0 - mov r3, sp -_081B8E5E: - adds r0, r5, r4 - ldrb r1, [r3] - lsls r1, 4 - ldrb r2, [r3, 0x1] - orrs r1, r2 - strb r1, [r0] - adds r3, 0x2 - adds r4, 0x1 - cmp r4, 0x2 - ble _081B8E5E -_081B8E72: - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8D88 - - thumb_func_start sub_81B8E80 -sub_81B8E80: @ 81B8E80 - push {r4-r7,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - lsls r2, 24 - lsrs r6, r2, 24 - movs r7, 0 - bl sub_81B1250 - lsls r0, 24 - cmp r0, 0 - beq _081B8F2E - ldr r0, =gBattleStruct - lsls r1, r4, 1 - adds r1, r4 - adds r1, 0x60 - ldr r0, [r0] - adds r4, r0, r1 - movs r2, 0 - add r6, sp - mov r12, r6 - movs r6, 0xF - mov r3, sp -_081B8EB2: - adds r1, r4, r2 - ldrb r0, [r1] - lsrs r0, 4 - strb r0, [r3] - adds r3, 0x1 - ldrb r1, [r1] - adds r0, r6, 0 - ands r0, r1 - strb r0, [r3] - adds r3, 0x1 - adds r2, 0x1 - cmp r2, 0x2 - ble _081B8EB2 - mov r0, r12 - ldrb r3, [r0] - movs r2, 0 - mov r0, sp - ldrb r0, [r0] - cmp r0, r5 - bne _081B8EE8 - mov r0, sp - ldrb r7, [r0] - strb r3, [r0] - b _081B8EFC - .pool -_081B8EE8: - adds r2, 0x1 - cmp r2, 0x5 - bgt _081B8EFC - mov r0, sp - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, r5 - bne _081B8EE8 - adds r7, r0, 0 - strb r3, [r1] -_081B8EFC: - cmp r2, 0x6 - beq _081B8F2E - mov r0, r12 - strb r7, [r0] - mov r0, sp - ldrb r0, [r0] - lsls r0, 4 - mov r1, sp - ldrb r1, [r1, 0x1] - orrs r0, r1 - strb r0, [r4] - mov r0, sp - ldrb r0, [r0, 0x2] - lsls r0, 4 - mov r1, sp - ldrb r1, [r1, 0x3] - orrs r0, r1 - strb r0, [r4, 0x1] - mov r0, sp - ldrb r0, [r0, 0x4] - lsls r0, 4 - mov r1, sp - ldrb r1, [r1, 0x5] - orrs r0, r1 - strb r0, [r4, 0x2] -_081B8F2E: - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81B8E80 - - thumb_func_start sub_81B8F38 -sub_81B8F38: @ 81B8F38 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - movs r1, 0x1 - ands r1, r2 - lsrs r2, r0, 25 - cmp r1, 0 - beq _081B8F58 - ldr r0, =gUnknown_0203CF00 - adds r0, r2, r0 - ldrb r0, [r0] - movs r1, 0xF - ands r1, r0 - b _081B8F60 - .pool -_081B8F58: - ldr r0, =gUnknown_0203CF00 - adds r0, r2, r0 - ldrb r0, [r0] - lsrs r1, r0, 4 -_081B8F60: - adds r0, r1, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B8F38 - - thumb_func_start sub_81B8F6C -sub_81B8F6C: @ 81B8F6C - push {r4,lr} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - movs r1, 0x1 - ands r1, r3 - lsrs r3, r0, 25 - cmp r1, 0 - beq _081B8F94 - ldr r0, =gUnknown_0203CF00 - adds r0, r3, r0 - ldrb r2, [r0] - movs r1, 0xF0 - ands r1, r2 - orrs r1, r4 - strb r1, [r0] - b _081B8FA4 - .pool -_081B8F94: - ldr r2, =gUnknown_0203CF00 - adds r2, r3, r2 - ldrb r1, [r2] - movs r0, 0xF - ands r0, r1 - lsls r1, r4, 4 - orrs r0, r1 - strb r0, [r2] -_081B8FA4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8F6C - - thumb_func_start sub_81B8FB0 -sub_81B8FB0: @ 81B8FB0 - push {r4-r6,lr} - adds r5, r0, 0 - adds r6, r1, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - adds r0, r5, 0 - bl sub_81B8F38 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r6, 0 - bl sub_81B8F38 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl sub_81B8F6C - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_81B8F6C - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81B8FB0 - - thumb_func_start pokemon_order_func -pokemon_order_func: @ 81B8FEC - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r3, 0 - movs r2, 0 - ldr r5, =gUnknown_0203CF00 -_081B8FF8: - adds r0, r3, r5 - ldrb r1, [r0] - lsrs r0, r1, 4 - cmp r0, r4 - beq _081B9010 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - movs r0, 0xF - ands r0, r1 - cmp r0, r4 - bne _081B9018 -_081B9010: - adds r0, r2, 0 - b _081B902A - .pool -_081B9018: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x2 - bls _081B8FF8 - movs r0, 0 -_081B902A: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end pokemon_order_func - - thumb_func_start pokemon_change_order -pokemon_change_order: @ 81B9030 - push {r4-r6,lr} - movs r4, 0x96 - lsls r4, 2 - adds r0, r4, 0 - bl Alloc - adds r5, r0, 0 - ldr r1, =gPlayerParty - adds r2, r4, 0 - bl memcpy - movs r4, 0 - movs r6, 0x64 -_081B904A: - adds r0, r4, 0 - bl pokemon_order_func - lsls r0, 24 - lsrs r0, 24 - muls r0, r6 - ldr r1, =gPlayerParty - adds r0, r1 - adds r1, r4, 0 - muls r1, r6 - adds r1, r5 - movs r2, 0x64 - bl memcpy - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _081B904A - adds r0, r5, 0 - bl Free - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end pokemon_change_order - - thumb_func_start sub_81B9080 -sub_81B9080: @ 81B9080 - push {r4-r6,lr} - movs r4, 0x96 - lsls r4, 2 - adds r0, r4, 0 - bl Alloc - adds r5, r0, 0 - ldr r1, =gPlayerParty - adds r2, r4, 0 - bl memcpy - movs r4, 0 - movs r6, 0x64 -_081B909A: - adds r0, r4, 0 - bl sub_81B8F38 - lsls r0, 24 - lsrs r0, 24 - muls r0, r6 - ldr r1, =gPlayerParty - adds r0, r1 - adds r1, r4, 0 - muls r1, r6 - adds r1, r5 - movs r2, 0x64 - bl memcpy - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _081B909A - adds r0, r5, 0 - bl Free - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9080 - - thumb_func_start sub_81B90D0 -sub_81B90D0: @ 81B90D0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r6, 0x1 - movs r7, 0x64 - ldr r0, =gPlayerParty - mov r8, r0 -_081B90DE: - adds r0, r6, 0 - bl sub_81B8F38 - lsls r0, 24 - lsrs r0, 24 - muls r0, r7 - mov r1, r8 - adds r5, r0, r1 - adds r0, r5, 0 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B912C - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - beq _081B912C - movs r0, 0 - bl sub_81B8F38 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - adds r1, r6, 0 - bl sub_81B8FB0 - adds r0, r4, 0 - muls r0, r7 - add r0, r8 - adds r1, r5, 0 - bl sub_81B1288 - b _081B9136 - .pool -_081B912C: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x5 - bls _081B90DE -_081B9136: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81B90D0 - - thumb_func_start sub_81B9140 -sub_81B9140: @ 81B9140 - push {lr} - ldr r0, =sub_8059D40 - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9140 - - thumb_func_start sub_81B9150 -sub_81B9150: @ 81B9150 - push {lr} - sub sp, 0xC - movs r0, 0x7F - str r0, [sp] - ldr r0, =sub_81B917C - str r0, [sp, 0x4] - ldr r0, =gMain - ldr r0, [r0, 0x8] - str r0, [sp, 0x8] - movs r0, 0x5 - movs r1, 0x3 - movs r2, 0 - movs r3, 0 - bl sub_81B0038 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9150 - - thumb_func_start sub_81B917C -sub_81B917C: @ 81B917C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gTasks - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r4, r1 - movs r1, 0x80 - lsls r1, 1 - strh r1, [r4, 0x8] - bl sub_81B9294 - movs r1, 0x80 - lsls r1, 9 - movs r0, 0x2 - movs r2, 0 - bl ChangeBgX - ldr r0, =sub_81B91B4 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B917C - - thumb_func_start sub_81B91B4 -sub_81B91B4: @ 81B91B4 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r6, r5, 2 - adds r0, r6, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B9220 - ldrh r0, [r4] - subs r0, 0x8 - strh r0, [r4] - adds r0, r5, 0 - bl sub_81B9294 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081B9220 - movs r4, 0x3 - ldr r7, =gUnknown_02022FF8 -_081B91E8: - subs r0, r4, 0x3 - lsls r0, 5 - adds r0, r7 - ldrh r0, [r0] - cmp r0, 0 - beq _081B9204 - ldr r0, =gUnknown_0203CEDC - ldr r1, [r0] - lsls r0, r4, 4 - adds r0, r1 - ldrb r0, [r0, 0x9] - movs r1, 0 - bl sub_81B5B6C -_081B9204: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _081B91E8 - movs r0, 0x78 - bl PlaySE - ldr r0, =gTasks - adds r1, r6, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B9240 - str r0, [r1] -_081B9220: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B91B4 - - thumb_func_start sub_81B9240 -sub_81B9240: @ 81B9240 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r0, r1 - ldrh r1, [r0] - adds r1, 0x1 - strh r1, [r0] - lsls r1, 16 - movs r0, 0x80 - lsls r0, 17 - cmp r1, r0 - bne _081B9266 - adds r0, r2, 0 - bl sub_81B12C0 -_081B9266: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9240 - - thumb_func_start sub_81B9270 -sub_81B9270: @ 81B9270 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r1, 16 - lsrs r3, r1, 16 - cmp r1, 0 - blt _081B928A - ldr r1, =gSprites - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - strh r3, [r0, 0x24] -_081B928A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9270 - - thumb_func_start sub_81B9294 -sub_81B9294: @ 81B9294 - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r5, r1, r0 - movs r6, 0x3 - ldr r7, =gUnknown_0203CEDC -_081B92A8: - ldr r0, =gUnknown_02022FF8 - subs r1, r6, 0x3 - lsls r1, 5 - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0 - beq _081B9300 - ldr r0, [r7] - lsls r4, r6, 4 - adds r0, r4, r0 - ldrb r0, [r0, 0x9] - ldrh r1, [r5] - subs r1, 0x8 - lsls r1, 16 - asrs r1, 16 - bl sub_81B9270 - ldr r0, [r7] - adds r0, r4, r0 - ldrb r0, [r0, 0xA] - ldrh r1, [r5] - subs r1, 0x8 - lsls r1, 16 - asrs r1, 16 - bl sub_81B9270 - ldr r0, [r7] - adds r0, r4, r0 - ldrb r0, [r0, 0xB] - ldrh r1, [r5] - subs r1, 0x8 - lsls r1, 16 - asrs r1, 16 - bl sub_81B9270 - ldr r0, [r7] - adds r4, r0 - ldrb r0, [r4, 0xC] - ldrh r1, [r5] - subs r1, 0x8 - lsls r1, 16 - asrs r1, 16 - bl sub_81B9270 -_081B9300: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x5 - bls _081B92A8 - movs r1, 0x80 - lsls r1, 4 - movs r0, 0x2 - movs r2, 0x1 - bl ChangeBgX - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9294 - - thumb_func_start sub_81B9328 -sub_81B9328: @ 81B9328 - push {lr} - sub sp, 0xC - movs r0, 0xF - str r0, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =sub_81B9390 - str r0, [sp, 0x8] - movs r0, 0x6 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl sub_81B0038 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9328 - - thumb_func_start sub_81B9354 -sub_81B9354: @ 81B9354 - push {lr} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_03005DB0 - ldr r1, =hm_add_c3_without_phase_2 - str r1, [r2] - movs r1, 0 - str r1, [sp] - ldr r1, =sub_81B1370 - str r1, [sp, 0x4] - ldr r1, =c2_exit_to_overworld_2_switch - str r1, [sp, 0x8] - movs r1, 0 - movs r2, 0xB - movs r3, 0 - bl sub_81B0038 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9354 - - thumb_func_start sub_81B9390 -sub_81B9390: @ 81B9390 - push {r4,lr} - ldr r4, =gSpecialVar_0x8004 - bl brm_get_pokemon_selection - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - cmp r0, 0x5 - bls _081B93A6 - movs r0, 0xFF - strh r0, [r4] -_081B93A6: - ldr r0, =gUnknown_03005DB0 - ldr r1, =hm_add_c3_without_phase_2 - str r1, [r0] - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9390 - - thumb_func_start hm_add_c3_without_phase_2 -hm_add_c3_without_phase_2: @ 81B93C8 - push {lr} - bl pal_fill_black - ldr r0, =task_hm_without_phase_2 - movs r1, 0xA - bl CreateTask - movs r0, 0x1 - pop {r1} - bx r1 - .pool - thumb_func_end hm_add_c3_without_phase_2 - - thumb_func_start task_hm_without_phase_2 -task_hm_without_phase_2: @ 81B93E0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80ABDFC - lsls r0, 24 - cmp r0, 0 - beq _081B93FE - adds r0, r4, 0 - bl DestroyTask - bl ScriptContext2_Disable - bl EnableBothScriptContexts -_081B93FE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end task_hm_without_phase_2 - - thumb_func_start sub_81B9404 -sub_81B9404: @ 81B9404 - push {lr} - bl ScriptContext2_Enable - movs r0, 0x1 - movs r1, 0 - bl fade_screen - ldr r0, =sub_81B9424 - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9404 - - thumb_func_start sub_81B9424 -sub_81B9424: @ 81B9424 - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _081B945C - bl overworld_free_bg_tilemaps - str r4, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =sub_81B9470 - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0 - movs r2, 0xB - movs r3, 0 - bl sub_81B0038 - adds r0, r5, 0 - bl DestroyTask -_081B945C: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9424 - - thumb_func_start sub_81B9470 -sub_81B9470: @ 81B9470 - push {lr} - bl brm_get_pokemon_selection - ldr r2, =gUnknown_02039F24 - strb r0, [r2] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x5 - bls _081B9486 - movs r0, 0xFF - strb r0, [r2] -_081B9486: - ldr r1, =gSpecialVar_0x8004 - ldrb r0, [r2] - strh r0, [r1] - ldr r1, =gUnknown_03005DB0 - ldr r0, =hm_add_c3_without_phase_2 - str r0, [r1] - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9470 - - thumb_func_start sub_81B94B0 -sub_81B94B0: @ 81B94B0 - push {lr} - bl ScriptContext2_Enable - movs r0, 0x1 - movs r1, 0 - bl fade_screen - ldr r0, =sub_81B94D0 - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B94B0 - - thumb_func_start sub_81B94D0 -sub_81B94D0: @ 81B94D0 - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _081B9508 - bl overworld_free_bg_tilemaps - str r4, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =sub_81B9390 - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0 - movs r2, 0xB - movs r3, 0 - bl sub_81B0038 - adds r0, r5, 0 - bl DestroyTask -_081B9508: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B94D0 - - thumb_func_start sub_81B951C -sub_81B951C: @ 81B951C - push {lr} - bl ScriptContext2_Enable - movs r0, 0x1 - movs r1, 0 - bl fade_screen - ldr r0, =sub_81B953C - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B951C - - thumb_func_start sub_81B953C -sub_81B953C: @ 81B953C - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _081B9574 - bl overworld_free_bg_tilemaps - str r4, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =sub_81B9588 - str r0, [sp, 0x8] - movs r0, 0x7 - movs r1, 0 - movs r2, 0xB - movs r3, 0 - bl sub_81B0038 - adds r0, r5, 0 - bl DestroyTask -_081B9574: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B953C - - thumb_func_start sub_81B9588 -sub_81B9588: @ 81B9588 - push {r4,r5,lr} - ldr r5, =gSpecialVar_0x8004 - bl brm_get_pokemon_selection - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5] - cmp r0, 0x5 - bls _081B95A4 - movs r0, 0xFF - strh r0, [r5] - b _081B95BA - .pool -_081B95A4: - ldr r4, =gSpecialVar_0x8005 - ldrh r1, [r5] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - bl GetNumberOfRelearnableMoves - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] -_081B95BA: - ldr r0, =gUnknown_03005DB0 - ldr r1, =hm_add_c3_without_phase_2 - str r1, [r0] - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9588 - - thumb_func_start sub_81B95E0 -sub_81B95E0: @ 81B95E0 - push {r4,r5,lr} - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - movs r4, 0 - adds r5, r1, 0 - b _081B95FA - .pool -_081B95F4: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_081B95FA: - cmp r4, 0x2 - bhi _081B9614 - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xC - bl GetMonData - cmp r0, 0 - beq _081B95F4 - movs r0, 0x1 - strh r0, [r5] -_081B9614: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B95E0 - - thumb_func_start sub_81B9620 -sub_81B9620: @ 81B9620 - push {lr} - bl ScriptContext2_Enable - movs r0, 0x1 - movs r1, 0 - bl fade_screen - ldr r0, =sub_81B9640 - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9620 - - thumb_func_start sub_81B9640 -sub_81B9640: @ 81B9640 - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _081B9678 - bl overworld_free_bg_tilemaps - str r4, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =sub_81B9390 - str r0, [sp, 0x8] - movs r0, 0xC - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl sub_81B0038 - adds r0, r5, 0 - bl DestroyTask -_081B9678: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9640 - - thumb_func_start sub_81B968C -sub_81B968C: @ 81B968C - push {lr} - sub sp, 0x4 - ldr r1, =gPlayerParty - ldr r0, =gSpecialVar_0x8004 - ldrb r2, [r0] - ldr r0, =gPlayerPartyCount - ldrb r3, [r0] - subs r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =c2_exit_to_overworld_2_switch - str r0, [sp] - movs r0, 0x3 - bl sub_81BF8EC - ldr r1, =gUnknown_03005DAC - ldr r0, =sub_80AF168 - str r0, [r1] - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B968C - - thumb_func_start sub_81B96D0 -sub_81B96D0: @ 81B96D0 - push {r4,r5,lr} - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - movs r4, 0 - adds r5, r1, 0 -_081B96DC: - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - adds r1, r4, 0 - adds r1, 0xD - bl GetMonData - cmp r0, 0 - beq _081B96FA - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] -_081B96FA: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _081B96DC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B96D0 - - thumb_func_start sub_81B9718 -sub_81B9718: @ 81B9718 - push {r4,r5,lr} - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - movs r0, 0x64 - adds r5, r1, 0 - muls r5, r0 - ldr r0, =gPlayerParty - adds r5, r0 - ldr r0, =gSpecialVar_0x8005 - ldrh r1, [r0] - adds r1, 0xD - adds r0, r5, 0 - bl GetMonData - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r1, =gStringVar1 - adds r0, r5, 0 - bl GetMonNickname - ldr r0, =gStringVar2 - movs r1, 0xD - muls r1, r4 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9718 - - thumb_func_start sub_81B9770 -sub_81B9770: @ 81B9770 - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r0, =gSpecialVar_0x8004 - mov r8, r0 - ldrh r0, [r0] - movs r6, 0x64 - muls r0, r6 - ldr r5, =gPlayerParty - adds r0, r5 - ldr r4, =gSpecialVar_0x8005 - ldrb r2, [r4] - movs r1, 0 - bl SetMonMoveSlot - mov r1, r8 - ldrh r0, [r1] - muls r0, r6 - adds r0, r5 - ldrb r1, [r4] - bl RemoveMonPPBonus - ldrh r4, [r4] - cmp r4, 0x2 - bhi _081B97C4 -_081B97A2: - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - lsls r1, r4, 24 - lsrs r1, 24 - adds r4, 0x1 - lsls r2, r4, 24 - lsrs r2, 24 - bl sub_81B97DC - lsls r4, 16 - lsrs r4, 16 - cmp r4, 0x2 - bls _081B97A2 -_081B97C4: - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9770 - - thumb_func_start sub_81B97DC -sub_81B97DC: @ 81B97DC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - mov r8, r0 - adds r5, r1, 0 - adds r4, r2, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - adds r0, 0xD - str r0, [sp, 0x8] - mov r0, r8 - ldr r1, [sp, 0x8] - bl GetMonData - mov r1, sp - adds r1, 0x2 - str r1, [sp, 0x14] - strh r0, [r1] - adds r3, r4, 0 - adds r3, 0xD - str r3, [sp, 0xC] - mov r0, r8 - adds r1, r3, 0 - bl GetMonData - mov r1, sp - strh r0, [r1] - adds r7, r5, 0 - adds r7, 0x11 - str r7, [sp, 0x10] - mov r0, r8 - adds r1, r7, 0 - bl GetMonData - mov r1, sp - adds r1, 0x5 - str r1, [sp, 0x18] - strb r0, [r1] - adds r3, r4, 0 - adds r3, 0x11 - str r3, [sp, 0x1C] - mov r0, r8 - adds r1, r3, 0 - bl GetMonData - add r7, sp, 0x4 - mov r10, r7 - strb r0, [r7] - mov r0, r8 - movs r1, 0x15 - bl GetMonData - mov r6, sp - adds r6, 0x6 - strb r0, [r6] - ldr r1, =gUnknown_08329D22 - adds r0, r5, r1 - ldrb r0, [r0] - mov r9, r0 - ldrb r0, [r6] - adds r2, r0, 0 - mov r3, r9 - ands r2, r3 - lsls r5, 1 - asrs r2, r5 - lsls r2, 24 - lsrs r2, 24 - adds r1, r4, r1 - ldrb r3, [r1] - adds r1, r0, 0 - ands r1, r3 - lsls r4, 1 - asrs r1, r4 - lsls r1, 24 - lsrs r1, 24 - mov r7, r9 - bics r0, r7 - strb r0, [r6] - ldrb r0, [r6] - bics r0, r3 - strb r0, [r6] - lsls r2, r4 - lsls r1, r5 - adds r2, r1 - ldrb r0, [r6] - orrs r0, r2 - strb r0, [r6] - mov r0, r8 - ldr r1, [sp, 0x8] - mov r2, sp - bl SetMonData - mov r0, r8 - ldr r1, [sp, 0xC] - ldr r2, [sp, 0x14] - bl SetMonData - mov r0, r8 - ldr r1, [sp, 0x10] - mov r2, r10 - bl SetMonData - mov r0, r8 - ldr r1, [sp, 0x1C] - ldr r2, [sp, 0x18] - bl SetMonData - mov r0, r8 - movs r1, 0x15 - adds r2, r6, 0 - bl SetMonData - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B97DC - - thumb_func_start sub_81B98DC -sub_81B98DC: @ 81B98DC - push {lr} - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x2D - bl GetMonData - adds r1, r0, 0 - cmp r1, 0 - beq _081B990C - ldr r1, =gScriptResult - movs r0, 0x1 - strh r0, [r1] - b _081B9910 - .pool -_081B990C: - ldr r0, =gScriptResult - strh r1, [r0] -_081B9910: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B98DC - - thumb_func_start sub_81B9918 -sub_81B9918: @ 81B9918 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - adds r1, 0xD - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - cmp r0, 0x39 - bne _081B999C - movs r6, 0 - b _081B9980 - .pool -_081B9958: - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - cmp r6, r0 - beq _081B997E - movs r4, 0 - movs r0, 0x64 - adds r5, r6, 0 - muls r5, r0 - ldr r7, =gPlayerParty -_081B996A: - adds r1, r4, 0 - adds r1, 0xD - adds r0, r5, r7 - bl GetMonData - cmp r0, 0x39 - beq _081B999C - adds r4, 0x1 - cmp r4, 0x3 - bls _081B996A -_081B997E: - adds r6, 0x1 -_081B9980: - bl CalculatePlayerPartyCount - lsls r0, 24 - lsrs r0, 24 - cmp r6, r0 - bcc _081B9958 - mov r0, r8 - bl sub_80D23A8 - cmp r0, 0x1 - beq _081B999C - ldr r1, =gScriptResult - movs r0, 0x1 - strh r0, [r1] -_081B999C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9918 - - thumb_func_start sub_81B99B4 -sub_81B99B4: @ 81B99B4 - push {lr} - ldr r1, =gUnknown_086160B4 - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B99B4 - - thumb_func_start sub_81B99D4 -sub_81B99D4: @ 81B99D4 - push {lr} - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - movs r2, 0 - strb r2, [r0] - ldr r1, [r1] - ldr r3, =0x00000cb2 - adds r0, r1, r3 - strh r2, [r0] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0x4 - ldrsb r1, [r0, r1] - movs r2, 0x5 - ldrsb r2, [r0, r2] - movs r3, 0x1 - negs r3, r3 - movs r0, 0 - bl saved_warp2_set - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B99D4 - - thumb_func_start sub_81B9A28 -sub_81B9A28: @ 81B9A28 - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000e6a - adds r0, r2 - ldrh r0, [r0] - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_81B9A28 - - thumb_func_start sub_81B9A44 -sub_81B9A44: @ 81B9A44 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =gSpecialVar_0x8006 - ldrh r1, [r1] - ldr r2, =0x00000e6a - adds r0, r2 - strh r1, [r0] - bx lr - .pool - thumb_func_end sub_81B9A44 - - thumb_func_start sub_81B9A60 -sub_81B9A60: @ 81B9A60 - push {r4,lr} - ldr r4, =gTrainerBattleOpponent_A - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xFF - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - lsls r1, r0, 2 - adds r1, r0 - lsrs r1, 6 - strh r1, [r4] - ldrh r0, [r4] - movs r1, 0 - bl sub_8162614 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9A60 - - thumb_func_start sub_81B9A90 -sub_81B9A90: @ 81B9A90 - push {lr} - ldr r3, =gTrainerBattleOpponent_A - ldrh r1, [r3] - ldr r0, =0x0000012b - cmp r1, r0 - bhi _081B9AAC - ldr r2, =gUnknown_0203BC88 - movs r0, 0x34 - muls r1, r0 - ldr r0, [r2] - adds r0, r1 - adds r0, 0xC - bl ConvertBattleFrontierTrainerSpeechToString -_081B9AAC: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9A90 - - thumb_func_start sub_81B9ABC -sub_81B9ABC: @ 81B9ABC - push {r4,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - strb r1, [r0] - movs r0, 0x80 - lsls r0, 7 - movs r1, 0 - bl VarSet - ldr r1, [r4] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - bl sub_81A4C30 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9ABC - - thumb_func_start sub_81B9B00 -sub_81B9B00: @ 81B9B00 - push {r4,r5,lr} - ldr r0, =gSaveBlock2Ptr - ldr r4, [r0] - ldr r5, =gUnknown_086160D4 - bl Random - ldrh r0, [r5] - ldr r1, =0x00000e6a - adds r4, r1 - strh r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9B00 - - thumb_func_start sub_81B9B28 -sub_81B9B28: @ 81B9B28 - push {r4,r5,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000e6a - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x1 - bl AddBagItem - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bne _081B9B70 - ldr r0, [r4] - ldr r1, =0x00000e6a - adds r0, r1 - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r0, [r4] - ldr r1, =0x00000e6a - adds r0, r1 - movs r1, 0 - strh r1, [r0] - ldr r0, =gScriptResult - strh r5, [r0] - b _081B9B76 - .pool -_081B9B70: - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] -_081B9B76: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9B28 - - thumb_func_start sub_81B9B80 -sub_81B9B80: @ 81B9B80 - push {lr} - ldr r1, =gUnknown_086160D8 - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9B80 - - thumb_func_start sub_81B9BA0 -sub_81B9BA0: @ 81B9BA0 - push {lr} - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - movs r2, 0 - strb r2, [r0] - ldr r1, [r1] - ldr r3, =0x00000cb2 - adds r0, r1, r3 - strh r2, [r0] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0x4 - ldrsb r1, [r0, r1] - movs r2, 0x5 - ldrsb r2, [r0, r2] - movs r3, 0x1 - negs r3, r3 - movs r0, 0 - bl saved_warp2_set - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9BA0 - - thumb_func_start sub_81B9BF4 -sub_81B9BF4: @ 81B9BF4 - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000e6c - adds r0, r2 - ldrh r0, [r0] - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_81B9BF4 - - thumb_func_start sub_81B9C10 -sub_81B9C10: @ 81B9C10 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =gSpecialVar_0x8006 - ldrh r1, [r1] - ldr r2, =0x00000e6c - adds r0, r2 - strh r1, [r0] - bx lr - .pool - thumb_func_end sub_81B9C10 - - thumb_func_start sub_81B9C2C -sub_81B9C2C: @ 81B9C2C - push {r4,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - strb r1, [r0] - movs r0, 0x80 - lsls r0, 7 - movs r1, 0 - bl VarSet - ldr r1, [r4] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - bl sub_81A4C30 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9C2C - - thumb_func_start sub_81B9C70 -sub_81B9C70: @ 81B9C70 - push {r4,r5,lr} - ldr r0, =gSaveBlock2Ptr - ldr r4, [r0] - ldr r5, =gUnknown_086160F4 - bl Random - ldrh r0, [r5] - ldr r1, =0x00000e6c - adds r4, r1 - strh r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9C70 - - thumb_func_start sub_81B9C98 -sub_81B9C98: @ 81B9C98 - push {r4,r5,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000e6c - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x1 - bl AddBagItem - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bne _081B9CE0 - ldr r0, [r4] - ldr r1, =0x00000e6c - adds r0, r1 - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r0, [r4] - ldr r1, =0x00000e6c - adds r0, r1 - movs r1, 0 - strh r1, [r0] - ldr r0, =gScriptResult - strh r5, [r0] - b _081B9CE6 - .pool -_081B9CE0: - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] -_081B9CE6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9C98 - - thumb_func_start sub_81B9CF0 -sub_81B9CF0: @ 81B9CF0 - push {lr} - ldr r0, =gStringVar1 - ldr r1, =gTrainerBattleOpponent_A - ldrh r1, [r1] - bl GetFrontierTrainerName - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9CF0 - - thumb_func_start sub_81B9D08 -sub_81B9D08: @ 81B9D08 - push {lr} - ldr r1, =gUnknown_086160F8 - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9D08 - - thumb_func_start sub_81B9D28 -sub_81B9D28: @ 81B9D28 - push {lr} - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - movs r2, 0 - strb r2, [r0] - ldr r1, [r1] - ldr r3, =0x00000cb2 - adds r0, r1, r3 - strh r2, [r0] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0x4 - ldrsb r1, [r0, r1] - movs r2, 0x5 - ldrsb r2, [r0, r2] - movs r3, 0x1 - negs r3, r3 - movs r0, 0 - bl saved_warp2_set - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9D28 - - thumb_func_start sub_81B9D7C -sub_81B9D7C: @ 81B9D7C - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000e6e - adds r0, r2 - ldrh r0, [r0] - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_81B9D7C - - thumb_func_start sub_81B9D98 -sub_81B9D98: @ 81B9D98 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =gSpecialVar_0x8006 - ldrh r1, [r1] - ldr r2, =0x00000e6e - adds r0, r2 - strh r1, [r0] - bx lr - .pool - thumb_func_end sub_81B9D98 - - thumb_func_start sub_81B9DB4 -sub_81B9DB4: @ 81B9DB4 - push {r4,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - strb r1, [r0] - movs r0, 0x80 - lsls r0, 7 - movs r1, 0 - bl VarSet - ldr r1, [r4] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - bl sub_81A4C30 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9DB4 - - thumb_func_start sub_81B9DF8 -sub_81B9DF8: @ 81B9DF8 - push {r4,r5,lr} - ldr r0, =gSaveBlock2Ptr - ldr r4, [r0] - ldr r5, =gUnknown_08616120 - bl Random - ldrh r0, [r5] - ldr r1, =0x00000e6e - adds r4, r1 - strh r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9DF8 - - thumb_func_start sub_81B9E20 -sub_81B9E20: @ 81B9E20 - push {r4,r5,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000e6e - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x1 - bl AddBagItem - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bne _081B9E68 - ldr r0, [r4] - ldr r1, =0x00000e6e - adds r0, r1 - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r0, [r4] - ldr r1, =0x00000e6e - adds r0, r1 - movs r1, 0 - strh r1, [r0] - ldr r0, =gScriptResult - strh r5, [r0] - b _081B9E6E - .pool -_081B9E68: - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] -_081B9E6E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9E20 - - thumb_func_start sub_81B9E78 -sub_81B9E78: @ 81B9E78 - push {lr} - bl ZeroPlayerPartyMons - bl sub_819A4F8 - pop {r0} - bx r0 - thumb_func_end sub_81B9E78 - - thumb_func_start sub_81B9E88 -sub_81B9E88: @ 81B9E88 - push {lr} - bl sub_819DC00 - pop {r0} - bx r0 - thumb_func_end sub_81B9E88 - - thumb_func_start sub_81B9E94 -sub_81B9E94: @ 81B9E94 - push {lr} - movs r2, 0 - ldr r1, =gMapHeader - ldrb r0, [r1, 0x14] - cmp r0, 0x8 - bne _081B9EB2 - ldr r3, =0xfffffe7f - adds r0, r3, 0 - ldrh r1, [r1, 0x12] - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bhi _081B9EB2 - movs r2, 0x1 -_081B9EB2: - adds r0, r2, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B9E94 - - thumb_func_start sub_81B9EC0 -sub_81B9EC0: @ 81B9EC0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x3C - ldr r1, =gUnknown_0203BC88 - ldr r0, =gSlateportBattleTentTrainers - str r0, [r1] - add r0, sp, 0xC - mov r9, r0 - mov r1, sp - adds r1, 0x18 - str r1, [sp, 0x2C] - ldr r5, =gUnknown_0203BC8C - ldr r4, =gSlateportBattleTentMons - movs r2, 0 - adds r3, r1, 0 - mov r1, r9 - mov r0, sp - movs r6, 0x5 - mov r8, r6 -_081B9EEC: - strh r2, [r0] - strh r2, [r1] - strh r2, [r3] - adds r3, 0x2 - adds r1, 0x2 - adds r0, 0x2 - movs r7, 0x1 - negs r7, r7 - add r8, r7 - mov r6, r8 - cmp r6, 0 - bge _081B9EEC - str r4, [r5] - movs r7, 0 - mov r10, r7 - movs r0, 0 - mov r8, r0 - ldr r1, [sp, 0x2C] - str r1, [sp, 0x30] - mov r2, sp - str r2, [sp, 0x34] - lsls r6, r0, 1 - str r6, [sp, 0x24] - add r6, r9 - str r6, [sp, 0x28] -_081B9F1E: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x46 - bl __umodsi3 - lsls r0, 16 - lsrs r5, r0, 16 - movs r2, 0 - mov r7, r8 - adds r6, r2, r7 - cmp r2, r6 - bge _081B9F7C - ldr r1, [sp, 0x28] - ldrh r0, [r1] - cmp r0, r5 - beq _081B9F7C - ldr r0, =gUnknown_0203BC8C - ldr r1, [r0] - lsls r0, r5, 4 - adds r4, r0, r1 - ldrh r7, [r4] - mov r12, r7 - lsls r3, r2, 1 - ldr r1, [sp, 0x24] - add r1, sp - str r6, [sp, 0x38] -_081B9F56: - ldrh r0, [r1] - cmp r0, r12 - bne _081B9F66 - mov r0, r10 - cmp r0, 0 - bne _081B9F7C - ldrh r7, [r4] - mov r10, r7 -_081B9F66: - adds r3, 0x2 - adds r1, 0x2 - adds r2, 0x1 - ldr r0, [sp, 0x38] - cmp r2, r0 - bge _081B9F7C - mov r7, r9 - adds r0, r7, r3 - ldrh r0, [r0] - cmp r0, r5 - bne _081B9F56 -_081B9F7C: - cmp r2, r6 - bne _081BA01C - movs r2, 0 - cmp r2, r6 - bge _081B9FD4 - ldr r0, =gBattleFrontierHeldItems - mov r12, r0 - ldr r7, =gUnknown_0203BC8C - ldr r1, [sp, 0x24] - ldr r0, [sp, 0x2C] - adds r4, r1, r0 -_081B9F92: - ldrh r3, [r4] - cmp r3, 0 - beq _081B9FCC - ldr r1, [r7] - lsls r0, r5, 4 - adds r1, r0, r1 - ldrb r0, [r1, 0xA] - lsls r0, 1 - add r0, r12 - ldrh r0, [r0] - cmp r3, r0 - bne _081B9FCC - ldrh r0, [r1] - cmp r0, r10 - bne _081B9FD4 - movs r1, 0 - mov r10, r1 - b _081B9FD4 - .pool -_081B9FCC: - adds r4, 0x2 - adds r2, 0x1 - cmp r2, r6 - blt _081B9F92 -_081B9FD4: - cmp r2, r6 - bne _081BA01C - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - mov r2, r8 - lsls r3, r2, 1 - adds r0, r3, r2 - lsls r0, 2 - adds r1, r0 - movs r6, 0xE7 - lsls r6, 4 - adds r1, r6 - strh r5, [r1] - ldr r0, =gUnknown_0203BC8C - ldr r0, [r0] - lsls r1, r5, 4 - adds r1, r0 - ldrh r0, [r1] - ldr r7, [sp, 0x34] - strh r0, [r7] - ldr r2, =gBattleFrontierHeldItems - ldrb r0, [r1, 0xA] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - ldr r1, [sp, 0x30] - strh r0, [r1] - add r3, r9 - strh r5, [r3] - adds r1, 0x2 - str r1, [sp, 0x30] - adds r2, r7, 0 - adds r2, 0x2 - str r2, [sp, 0x34] - movs r6, 0x1 - add r8, r6 -_081BA01C: - mov r7, r8 - cmp r7, 0x6 - beq _081BA024 - b _081B9F1E -_081BA024: - add sp, 0x3C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9EC0 - - thumb_func_start sub_81BA040 -sub_81BA040: @ 81BA040 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - movs r0, 0 - mov r10, r0 - ldr r1, =gUnknown_0203BC88 - ldr r0, =gSlateportBattleTentTrainers - str r0, [r1] - ldr r1, =gUnknown_0203BC8C - ldr r0, =gSlateportBattleTentMons - str r0, [r1] - ldr r7, =gSaveBlock2Ptr - ldr r1, =0x0000ffff - mov r8, r1 -_081BA062: - mov r2, r10 - lsls r6, r2, 1 -_081BA066: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1E - bl __umodsi3 - lsls r0, 16 - lsrs r3, r0, 16 - movs r5, 0 - ldr r1, [r7] - ldr r4, =0x00000cb2 - adds r0, r1, r4 - ldrh r0, [r0] - cmp r5, r0 - bge _081BA0AA - ldr r2, =0x00000cb4 - adds r0, r1, r2 - ldrh r0, [r0] - cmp r0, r3 - beq _081BA0AA - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - adds r0, r1, r4 - ldrh r2, [r0] - adds r4, 0x2 - adds r1, r4 -_081BA09C: - adds r1, 0x2 - adds r5, 0x1 - cmp r5, r2 - bge _081BA0AA - ldrh r0, [r1] - cmp r0, r3 - bne _081BA09C -_081BA0AA: - ldr r0, [r7] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - cmp r5, r0 - bne _081BA066 - ldr r2, =gTrainerBattleOpponent_A - strh r3, [r2] - ldrh r3, [r2] - ldr r4, =gUnknown_0203BC88 - ldr r1, [r4] - movs r0, 0x34 - muls r0, r3 - adds r0, r1 - ldr r0, [r0, 0x30] - adds r1, r6, r0 - ldrh r0, [r1] - cmp r0, r8 - beq _081BA0DE - ldr r3, =0x0000ffff -_081BA0D2: - adds r1, 0x2 - movs r6, 0x1 - add r10, r6 - ldrh r0, [r1] - cmp r0, r3 - bne _081BA0D2 -_081BA0DE: - mov r0, r10 - cmp r0, 0x8 - bgt _081BA110 - movs r1, 0 - mov r10, r1 - b _081BA062 - .pool -_081BA110: - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r6, =0x00000cb2 - adds r3, r1, r6 - ldrh r0, [r3] - cmp r0, 0x1 - bhi _081BA12A - lsls r0, 1 - ldr r3, =0x00000cb4 - adds r1, r3 - adds r1, r0 - ldrh r0, [r2] - strh r0, [r1] -_081BA12A: - ldrh r1, [r2] - ldr r2, [r4] - movs r0, 0x34 - muls r0, r1 - adds r0, r2 - ldr r0, [r0, 0x30] - mov r9, r0 - movs r5, 0 - ldr r7, =gUnknown_03001298 - mov r8, sp -_081BA13E: - bl Random - lsls r0, 16 - lsrs r0, 16 - mov r1, r10 - bl __modsi3 - lsls r0, 1 - add r0, r9 - ldrh r0, [r0] - strh r0, [r7] - movs r2, 0 - ldrh r0, [r7] - ldr r4, =gUnknown_0203BC8C - ldr r3, [r4] - lsls r0, 4 - adds r0, r3 - ldr r1, =gSaveBlock2Ptr - ldrh r6, [r0] - ldr r1, [r1] -_081BA166: - movs r4, 0xE7 - lsls r4, 4 - adds r0, r1, r4 - ldrh r0, [r0] - lsls r0, 4 - adds r0, r3 - ldrh r0, [r0] - cmp r6, r0 - beq _081BA180 - adds r1, 0xC - adds r2, 0x1 - cmp r2, 0x5 - ble _081BA166 -_081BA180: - cmp r2, 0x6 - bne _081BA220 - movs r4, 0 - cmp r4, r5 - bge _081BA1B0 - mov r0, sp - ldrh r0, [r0] - cmp r0, r6 - beq _081BA1B0 - ldr r6, =gUnknown_03001298 - ldr r3, =gUnknown_0203BC8C - mov r2, sp -_081BA198: - adds r2, 0x2 - adds r4, 0x1 - cmp r4, r5 - bge _081BA1B0 - ldrh r0, [r6] - ldr r1, [r3] - lsls r0, 4 - adds r0, r1 - ldrh r1, [r2] - ldrh r0, [r0] - cmp r1, r0 - bne _081BA198 -_081BA1B0: - cmp r4, r5 - bne _081BA220 - movs r4, 0 - cmp r4, r5 - bge _081BA1E6 - ldr r6, =gBattleFrontierHeldItems - mov r12, r6 - add r3, sp, 0x8 -_081BA1C0: - ldrh r2, [r3] - cmp r2, 0 - beq _081BA1DE - ldr r1, =gUnknown_03001298 - ldrh r0, [r1] - ldr r6, =gUnknown_0203BC8C - ldr r1, [r6] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0xA] - lsls r0, 1 - add r0, r12 - ldrh r0, [r0] - cmp r2, r0 - beq _081BA1E6 -_081BA1DE: - adds r3, 0x2 - adds r4, 0x1 - cmp r4, r5 - blt _081BA1C0 -_081BA1E6: - cmp r4, r5 - bne _081BA220 - lsls r2, r5, 1 - ldrh r0, [r7] - ldr r1, =gUnknown_0203BC8C - ldr r4, [r1] - lsls r0, 4 - adds r0, r4 - ldrh r0, [r0] - mov r3, r8 - strh r0, [r3] - add r1, sp, 0x8 - adds r1, r2 - ldr r3, =gBattleFrontierHeldItems - ldrh r0, [r7] - lsls r0, 4 - adds r0, r4 - ldrb r0, [r0, 0xA] - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - strh r0, [r1] - ldr r0, =gUnknown_03006298 - adds r2, r0 - ldrh r0, [r7] - strh r0, [r2] - movs r4, 0x2 - add r8, r4 - adds r5, 0x1 -_081BA220: - cmp r5, 0x3 - bne _081BA13E - 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_81BA040 - - 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. diff --git a/asm/save_location.s b/asm/save_location.s new file mode 100755 index 000000000..1a5b3c6da --- /dev/null +++ b/asm/save_location.s @@ -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. diff --git a/asm/script_movement.s b/asm/script_movement.s new file mode 100755 index 000000000..f28fc9d44 --- /dev/null +++ b/asm/script_movement.s @@ -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. diff --git a/asm/smokescreen.s b/asm/smokescreen.s new file mode 100755 index 000000000..464e25c40 --- /dev/null +++ b/asm/smokescreen.s @@ -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. diff --git a/asm/trainer_rematch.s b/asm/trainer_rematch.s new file mode 100755 index 000000000..0c30cfea9 --- /dev/null +++ b/asm/trainer_rematch.s @@ -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. diff --git a/asm/rom_81BAD84.s b/asm/unk_81BAD84.s similarity index 100% rename from asm/rom_81BAD84.s rename to asm/unk_81BAD84.s diff --git a/asm/unk_sprite_file.s b/asm/unk_sprite_file.s new file mode 100755 index 000000000..5a25b8e08 --- /dev/null +++ b/asm/unk_sprite_file.s @@ -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. diff --git a/asm/unk_text_util.s b/asm/unk_text_util.s new file mode 100755 index 000000000..f8dabb5b7 --- /dev/null +++ b/asm/unk_text_util.s @@ -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. diff --git a/asm/unk_text_util_2.s b/asm/unk_text_util_2.s new file mode 100755 index 000000000..7f1a5ef70 --- /dev/null +++ b/asm/unk_text_util_2.s @@ -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. diff --git a/asm/unk_transition.s b/asm/unk_transition.s new file mode 100755 index 000000000..385a8771e --- /dev/null +++ b/asm/unk_transition.s @@ -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. diff --git a/asm/unk_transition_2.s b/asm/unk_transition_2.s new file mode 100755 index 000000000..a2ec93e5d --- /dev/null +++ b/asm/unk_transition_2.s @@ -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. diff --git a/asm/use_pokeblock.s b/asm/use_pokeblock.s new file mode 100755 index 000000000..67441ee8b --- /dev/null +++ b/asm/use_pokeblock.s @@ -0,0 +1,3771 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_8166204 +sub_8166204: @ 8166204 + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + ldr r4, =gUnknown_0203BCAC + ldr r0, =0x0000806c + bl AllocZeroed + str r0, [r4] + ldr r1, =gUnknown_0203BC90 + ldr r2, =0x00007fd0 + adds r0, r2 + str r0, [r1] + str r5, [r0, 0x8] + str r6, [r0, 0x4] + ldr r0, =sub_8166380 + bl launch_c3_walk_stairs_and_run_once + ldr r0, =sub_816631C + bl SetMainCallback2 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8166204 + + thumb_func_start sub_816624C +sub_816624C: @ 816624C + push {r4,r5,lr} + ldr r4, =gUnknown_0203BCAC + ldr r0, =0x0000806c + bl AllocZeroed + str r0, [r4] + ldr r5, =gUnknown_0203BC90 + ldr r1, =0x00007fd0 + adds r0, r1 + str r0, [r5] + ldr r1, =gUnknown_0203BC98 + ldr r1, [r1] + str r1, [r0, 0x8] + ldr r1, =gUnknown_0203BC94 + ldr r1, [r1] + str r1, [r0, 0x4] + ldr r4, =gUnknown_0203BC9C + ldrb r0, [r4] + bl sub_81672E4 + strb r0, [r4] + ldr r5, [r5] + movs r1, 0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _08166284 + movs r1, 0x1 +_08166284: + adds r0, r5, 0 + adds r0, 0x56 + strb r1, [r0] + ldr r0, =sub_8166380 + bl launch_c3_walk_stairs_and_run_once + ldr r0, =sub_81662C0 + bl SetMainCallback2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816624C + + thumb_func_start sub_81662C0 +sub_81662C0: @ 81662C0 + push {r4,lr} + ldr r4, =gUnknown_0203BC90 + ldr r0, [r4] + ldr r0, [r0] + bl _call_via_r0 + bl AnimateSprites + bl BuildOamBuffer + bl UpdatePaletteFade + ldr r4, [r4] + ldr r1, [r4] + ldr r0, =map_warp_consider_1_to_outside_or_stair_or_dive + cmp r1, r0 + bne _081662F0 + adds r0, r4, 0 + adds r0, 0x50 + movs r1, 0 + strb r1, [r0] + ldr r0, =sub_8166304 + bl SetMainCallback2 +_081662F0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81662C0 + + thumb_func_start sub_8166304 +sub_8166304: @ 8166304 + push {lr} + bl sub_81668F8 + bl AnimateSprites + bl BuildOamBuffer + bl UpdatePaletteFade + pop {r0} + bx r0 + thumb_func_end sub_8166304 + + thumb_func_start sub_816631C +sub_816631C: @ 816631C + push {lr} + ldr r0, =gUnknown_0203BC90 + ldr r0, [r0] + ldr r0, [r0] + bl _call_via_r0 + bl AnimateSprites + bl BuildOamBuffer + bl RunTextPrinters + bl UpdatePaletteFade + pop {r0} + bx r0 + .pool + thumb_func_end sub_816631C + + thumb_func_start sub_8166340 +sub_8166340: @ 8166340 + push {lr} + bl LoadOam + bl ProcessSpriteCopyRequests + bl TransferPlttBuffer + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r1, =0x00007c58 + adds r0, r1 + bl sub_81D2108 + bl sub_80BA0A8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8166340 + + thumb_func_start launch_c3_walk_stairs_and_run_once +launch_c3_walk_stairs_and_run_once: @ 816636C + ldr r1, =gUnknown_0203BC90 + ldr r1, [r1] + str r0, [r1] + adds r1, 0x50 + movs r0, 0 + strb r0, [r1] + bx lr + .pool + thumb_func_end launch_c3_walk_stairs_and_run_once + + thumb_func_start sub_8166380 +sub_8166380: @ 8166380 + push {r4,r5,lr} + sub sp, 0x4 + ldr r1, =gUnknown_0203BC90 + ldr r0, [r1] + adds r0, 0x50 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0xF + bls _08166394 + b _08166556 +_08166394: + lsls r0, 2 + ldr r1, =_081663A8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081663A8: + .4byte _081663E8 + .4byte _0816640C + .4byte _08166416 + .4byte _08166434 + .4byte _08166464 + .4byte _08166468 + .4byte _08166474 + .4byte _08166484 + .4byte _08166490 + .4byte _0816649C + .4byte _081664B8 + .4byte _081664BC + .4byte _081664E4 + .4byte _08166510 + .4byte _08166528 + .4byte _08166550 +_081663E8: + ldr r2, =gUnknown_0203BCAC + ldr r0, [r2] + ldr r1, =0x00007b10 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldr r0, [r2] + ldr r2, =0x00007c58 + adds r0, r2 + bl sub_81D1ED4 + b _0816653C + .pool +_0816640C: + bl ResetSpriteData + bl FreeAllSpritePalettes + b _0816653C +_08166416: + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + str r0, [sp] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, =0x05006000 + mov r0, sp + bl CpuSet + b _0816653C + .pool +_08166434: + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_085DFCCC + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + ldr r0, =gUnknown_085DFCDC + bl InitWindows + bl DeactivateAllTextPrinters + movs r0, 0 + movs r1, 0x97 + movs r2, 0xE0 + bl sub_809882C + b _0816653C + .pool +_08166464: + ldr r1, [r2] + b _08166540 +_08166468: + bl sub_8168328 + lsls r0, 24 + cmp r0, 0 + bne _08166556 + b _0816653C +_08166474: + ldr r1, =gKeyRepeatStartDelay + movs r0, 0x14 + strh r0, [r1] + bl sub_8167420 + b _0816653C + .pool +_08166484: + bl sub_8167930 + lsls r0, 24 + cmp r0, 0 + bne _08166556 + b _0816653C +_08166490: + movs r0, 0 + bl sub_8167608 + bl sub_8167760 + b _0816653C +_0816649C: + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r1, =0x00007b0e + adds r0, r1 + bl sub_81D312C + lsls r0, 24 + cmp r0, 0 + bne _08166556 + b _0816653C + .pool +_081664B8: + ldr r1, [r2] + b _08166540 +_081664BC: + ldr r5, =gUnknown_0203BCAC + ldr r1, [r5] + ldr r4, =0x00007c58 + adds r0, r1, r4 + ldr r2, =0x00007c6c + adds r1, r2 + bl sub_81D2754 + ldr r0, [r5] + adds r0, r4 + bl sub_81D20AC + b _0816653C + .pool +_081664E4: + ldr r4, =gUnknown_0203BCAC + ldr r0, [r4] + ldr r1, =0x00007c58 + adds r0, r1 + bl sub_81D20BC + lsls r0, 24 + cmp r0, 0 + bne _08166556 + ldr r2, [r4] + ldr r1, =0x00007c58 + adds r0, r2, r1 + adds r1, 0x14 + adds r2, r1 + adds r1, r2, 0 + bl sub_81D1F84 + b _0816653C + .pool +_08166510: + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r2, =0x00007c58 + adds r0, r2 + bl sub_81D2230 + b _0816653C + .pool +_08166528: + movs r0, 0 + bl PutWindowTilemap + movs r0, 0x1 + bl PutWindowTilemap + movs r0, 0 + movs r1, 0x1 + bl sub_8167BA0 +_0816653C: + ldr r0, =gUnknown_0203BC90 + ldr r1, [r0] +_08166540: + adds r1, 0x50 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08166556 + .pool +_08166550: + ldr r0, =map_warp_consider_1_to_outside_or_stair_or_dive + bl launch_c3_walk_stairs_and_run_once +_08166556: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8166380 + + thumb_func_start map_warp_consider_1_to_outside_or_stair_or_dive +map_warp_consider_1_to_outside_or_stair_or_dive: @ 8166564 + push {r4,lr} + sub sp, 0x4 + ldr r4, =gUnknown_0203BC90 + ldr r0, [r4] + adds r0, 0x50 + ldrb r1, [r0] + cmp r1, 0 + beq _08166580 + cmp r1, 0x1 + beq _081665C0 + b _08166610 + .pool +_08166580: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade + ldr r0, =sub_8166340 + bl SetVBlankCallback + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x3 + bl ShowBg + movs r0, 0x2 + bl ShowBg + ldr r1, [r4] + adds r1, 0x50 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08166610 + .pool +_081665C0: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08166610 + ldr r4, =gUnknown_0203BCAC + ldr r0, [r4] + ldr r1, =0x00007b1c + adds r0, r1 + bl sub_81D3464 + ldr r4, [r4] + ldr r2, =0x00008041 + adds r0, r4, r2 + ldrb r1, [r0] + ldr r3, =0x00008040 + adds r0, r4, r3 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + beq _0816660A + ldr r1, =0x00007fb3 + adds r0, r4, r1 + movs r1, 0 + ldrsb r1, [r0, r1] + subs r2, 0x91 + adds r0, r4, r2 + adds r0, r1 + ldrb r2, [r0] + ldr r3, =0x00007b1c + adds r0, r4, r3 + subs r3, 0xC + adds r1, r4, r3 + ldrb r1, [r1] + bl sub_81D3480 +_0816660A: + ldr r0, =sub_8166634 + bl launch_c3_walk_stairs_and_run_once +_08166610: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end map_warp_consider_1_to_outside_or_stair_or_dive + + thumb_func_start sub_8166634 +sub_8166634: @ 8166634 + push {lr} + ldr r0, =gUnknown_0203BC90 + ldr r0, [r0] + adds r0, 0x50 + ldrb r0, [r0] + cmp r0, 0x7 + bls _08166644 + b _0816680E +_08166644: + lsls r0, 2 + ldr r1, =_08166658 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08166658: + .4byte _08166678 + .4byte _0816675C + .4byte _0816680E + .4byte _08166788 + .4byte _0816680E + .4byte _08166794 + .4byte _081667AC + .4byte _081667F4 +_08166678: + ldr r2, =gMain + ldrh r1, [r2, 0x2C] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081666B8 + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + bl sub_8167CA0 + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r1, =0x00007b1c + adds r0, r1 + bl sub_81D3520 + ldr r0, =gUnknown_0203BC90 + ldr r0, [r0] + adds r0, 0x50 + movs r1, 0x1 + b _0816680C + .pool +_081666B8: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081666F0 + movs r0, 0x5 + bl PlaySE + movs r0, 0 + bl sub_8167CA0 + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r2, =0x00007b1c + adds r0, r2 + bl sub_81D3520 + ldr r0, =gUnknown_0203BC90 + ldr r0, [r0] + adds r0, 0x50 + movs r1, 0x1 + b _0816680C + .pool +_081666F0: + ldrh r1, [r2, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08166710 + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_0203BC90 + ldr r0, [r0] + adds r0, 0x50 + movs r1, 0x3 + b _0816680C + .pool +_08166710: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0816671A + b _0816680E +_0816671A: + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r2, =0x00008041 + adds r1, r0, r2 + ldrb r1, [r1] + subs r2, 0x1 + adds r0, r2 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + bne _0816674C + ldr r0, =gUnknown_0203BC90 + ldr r0, [r0] + adds r0, 0x50 + movs r1, 0x3 + b _0816680C + .pool +_0816674C: + ldr r0, =gUnknown_0203BC90 + ldr r0, [r0] + adds r0, 0x50 + movs r1, 0x5 + b _0816680C + .pool +_0816675C: + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r1, =0x00008044 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _0816680E + ldr r0, =gUnknown_0203BC90 + ldr r0, [r0] + adds r0, 0x50 + b _0816680C + .pool +_08166788: + ldr r0, =sub_8166BEC + bl launch_c3_walk_stairs_and_run_once + b _0816680E + .pool +_08166794: + bl sub_8166D44 + ldr r0, =gUnknown_0203BC90 + ldr r1, [r0] + adds r1, 0x50 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0816680E + .pool +_081667AC: + bl sub_8166DE4 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081667CC + cmp r1, 0 + bgt _081667C6 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08166804 + b _0816680E +_081667C6: + cmp r1, 0x1 + bne _0816680E + b _08166804 +_081667CC: + bl sub_8167268 + lsls r0, 24 + cmp r0, 0 + beq _081667E8 + bl sub_8166F50 + ldr r0, =gUnknown_0203BC90 + ldr r0, [r0] + adds r0, 0x50 + movs r1, 0x7 + b _0816680C + .pool +_081667E8: + ldr r0, =sub_816681C + bl launch_c3_walk_stairs_and_run_once + b _0816680E + .pool +_081667F4: + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _0816680E + bl sub_8166F94 +_08166804: + ldr r0, =gUnknown_0203BC90 + ldr r0, [r0] + adds r0, 0x50 + movs r1, 0 +_0816680C: + strb r1, [r0] +_0816680E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8166634 + + thumb_func_start sub_816681C +sub_816681C: @ 816681C + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, =gUnknown_0203BC90 + ldr r0, [r5] + adds r0, 0x50 + ldrb r4, [r0] + cmp r4, 0 + beq _08166838 + cmp r4, 0x1 + beq _08166888 + b _081668D4 + .pool +_08166838: + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r1, =0x00008041 + adds r0, r1 + ldrb r0, [r0] + bl sub_81672A4 + ldr r1, =gUnknown_0203BC9C + strb r0, [r1] + ldr r1, =gUnknown_0203BC94 + ldr r2, [r5] + ldr r0, [r2, 0x4] + str r0, [r1] + ldr r1, =gUnknown_0203BC98 + ldr r0, [r2, 0x8] + str r0, [r1] + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + ldr r1, [r5] + adds r1, 0x50 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _081668D4 + .pool +_08166888: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _081668D4 + movs r0, 0 + bl SetVBlankCallback + ldr r4, =gUnknown_0203BCA0 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203BCA4 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203BCA8 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203BCAC + ldr r0, [r4] + bl Free + str r5, [r4] + bl FreeAllWindowBuffers + ldr r1, =gMain + ldr r0, =sub_816624C + str r0, [r1, 0x8] + bl sub_8179D70 +_081668D4: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816681C + + thumb_func_start sub_81668F8 +sub_81668F8: @ 81668F8 + push {r4,lr} + sub sp, 0x4 + ldr r1, =gUnknown_0203BC90 + ldr r0, [r1] + adds r0, 0x50 + ldrb r0, [r0] + adds r4, r1, 0 + cmp r0, 0x6 + bls _0816690C + b _08166A18 +_0816690C: + lsls r0, 2 + ldr r1, =_08166920 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08166920: + .4byte _0816693C + .4byte _08166972 + .4byte _08166A18 + .4byte _081669A0 + .4byte _081669AE + .4byte _081669C8 + .4byte _081669F4 +_0816693C: + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r1, =0x00008041 + adds r0, r1 + ldr r1, =gUnknown_0203BC9C + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + beq _08166968 + ldr r0, [r4] + adds r0, 0x56 + ldrb r0, [r0] + bl sub_8167CA0 + ldr r1, [r4] + b _081669E2 + .pool +_08166968: + ldr r0, [r4] + adds r0, 0x50 + movs r1, 0x3 + strb r1, [r0] + b _08166A18 +_08166972: + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r1, =0x00008044 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _08166A18 + ldr r0, =gUnknown_0203BC90 + ldr r0, [r0] + adds r0, 0x50 + strb r1, [r0] + b _08166A18 + .pool +_081669A0: + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl BlendPalettes + b _081669DE +_081669AE: + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x3 + bl ShowBg + movs r0, 0x2 + bl ShowBg + b _081669DE +_081669C8: + ldr r0, =sub_8166340 + bl SetVBlankCallback + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade +_081669DE: + ldr r0, =gUnknown_0203BC90 + ldr r1, [r0] +_081669E2: + adds r1, 0x50 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08166A18 + .pool +_081669F4: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08166A18 + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r1, =0x00007b1c + adds r0, r1 + bl sub_81D3464 + ldr r0, =sub_8166A34 + bl launch_c3_walk_stairs_and_run_once + ldr r0, =sub_816631C + bl SetMainCallback2 +_08166A18: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81668F8 + + thumb_func_start sub_8166A34 +sub_8166A34: @ 8166A34 + push {r4-r6,lr} + ldr r1, =gUnknown_0203BC90 + ldr r0, [r1] + adds r0, 0x50 + ldrb r0, [r0] + adds r5, r1, 0 + cmp r0, 0x5 + bls _08166A46 + b _08166BDA +_08166A46: + lsls r0, 2 + ldr r1, =_08166A58 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08166A58: + .4byte _08166A70 + .4byte _08166AAC + .4byte _08166AC0 + .4byte _08166B14 + .4byte _08166B94 + .4byte _08166BB6 +_08166A70: + ldr r4, [r5] + ldr r3, =gPlayerParty + str r3, [r4, 0xC] + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r2, =0x00008041 + adds r1, r0, r2 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r0, r1 + subs r2, 0x88 + adds r1, r2 + ldrb r2, [r1] + movs r1, 0x64 + muls r1, r2 + adds r1, r3 + str r1, [r4, 0xC] + ldr r3, =0x00007b1c + adds r0, r3 + bl sub_81D3520 + b _08166BAA + .pool +_08166AAC: + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _08166ABA + b _08166BDA +_08166ABA: + b _08166BAA + .pool +_08166AC0: + bl sub_8167104 + ldr r6, =gUnknown_0203BC90 + ldr r0, [r6] + adds r0, 0x5C + ldr r4, =gUnknown_0203BCAC + ldr r1, [r4] + ldr r5, =0x00007ca8 + adds r1, r5 + bl sub_81D2754 + ldr r2, [r4] + ldr r4, =0x00007c58 + adds r0, r2, r4 + ldr r3, =0x00007fb3 + adds r1, r2, r3 + movs r3, 0 + ldrsb r3, [r1, r3] + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 2 + adds r4, 0x14 + adds r1, r4 + adds r1, r2, r1 + adds r2, r5 + bl sub_81D1F84 + bl sub_8167338 + ldr r1, [r6] + b _08166BAC + .pool +_08166B14: + ldr r5, =gUnknown_0203BCAC + ldr r0, [r5] + ldr r1, =0x00007c58 + adds r0, r1 + bl sub_81D2074 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _08166BDA + ldr r0, [r5] + ldr r4, =0x00008041 + adds r0, r4 + ldrb r0, [r0] + bl sub_81672A4 + lsls r0, 24 + lsrs r0, 24 + bl sub_81681F4 + ldr r3, [r5] + adds r4, r3, r4 + ldrb r1, [r4] + ldr r2, =0x00008040 + adds r0, r3, r2 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + beq _08166B6C + ldr r4, =0x00007fb3 + adds r0, r3, r4 + movs r1, 0 + ldrsb r1, [r0, r1] + subs r2, 0x90 + adds r0, r3, r2 + adds r0, r1 + ldrb r2, [r0] + ldr r4, =0x00007b1c + adds r0, r3, r4 + subs r4, 0xC + adds r1, r3, r4 + ldrb r1, [r1] + bl sub_81D3480 +_08166B6C: + ldr r1, =gUnknown_0203BC90 + ldr r0, [r1] + adds r0, 0x52 + strb r6, [r0] + ldr r1, [r1] + b _08166BAC + .pool +_08166B94: + ldr r1, [r5] + adds r1, 0x52 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x10 + bls _08166BDA + bl sub_8166E24 +_08166BAA: + ldr r1, [r5] +_08166BAC: + adds r1, 0x50 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08166BDA +_08166BB6: + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _08166BDA + bl sub_8166EDC + lsls r0, 24 + cmp r0, 0 + bne _08166BDA + ldr r0, =gScriptItemId + ldrb r0, [r0] + bl sub_8136F68 + ldr r0, =sub_8166BEC + bl launch_c3_walk_stairs_and_run_once +_08166BDA: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8166A34 + + thumb_func_start sub_8166BEC +sub_8166BEC: @ 8166BEC + push {r4-r6,lr} + sub sp, 0x4 + ldr r4, =gUnknown_0203BC90 + ldr r0, [r4] + adds r2, r0, 0 + adds r2, 0x50 + ldrb r1, [r2] + cmp r1, 0x1 + beq _08166C28 + cmp r1, 0x1 + bgt _08166C0C + cmp r1, 0 + beq _08166C16 + b _08166D18 + .pool +_08166C0C: + cmp r1, 0x2 + beq _08166C40 + cmp r1, 0x3 + beq _08166C5C + b _08166D18 +_08166C16: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + b _08166C4A +_08166C28: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08166D18 + movs r0, 0x2 + strb r0, [r2] + b _08166D18 + .pool +_08166C40: + ldr r1, =gUnknown_02039B28 + movs r0, 0x3 + strb r0, [r1, 0x15] + bl sub_80BA0A8 +_08166C4A: + ldr r1, [r4] + adds r1, 0x50 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08166D18 + .pool +_08166C5C: + ldr r0, [r0, 0x4] + bl SetMainCallback2 + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r1, =0x00007b1c + adds r0, r1 + bl sub_81D354C + movs r4, 0 +_08166C70: + ldr r5, =gUnknown_0203BCAC + ldr r0, [r5] + ldr r2, =0x00007b06 + adds r0, r2 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + bl DestroySprite + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x6 + bls _08166C70 + movs r0, 0 + bl FreeSpriteTilesByTag + movs r0, 0x1 + bl FreeSpriteTilesByTag + movs r0, 0 + bl FreeSpritePaletteByTag + movs r0, 0x1 + bl FreeSpritePaletteByTag + movs r4, 0 +_08166CAE: + ldr r0, [r5] + lsls r1, r4, 2 + ldr r2, =0x00007b44 + adds r0, r2 + adds r0, r1 + ldr r0, [r0] + bl DestroySprite + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _08166CAE + ldr r6, =gUnknown_0203BCAC + ldr r0, [r6] + ldr r2, =0x00007b10 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xFF + beq _08166CE6 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + bl DestroySprite +_08166CE6: + movs r0, 0 + bl SetVBlankCallback + ldr r4, =gUnknown_0203BCA0 + ldr r0, [r4] + bl Free + movs r5, 0 + str r5, [r4] + ldr r4, =gUnknown_0203BCA4 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203BCA8 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r0, [r6] + bl Free + str r5, [r6] + bl FreeAllWindowBuffers +_08166D18: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8166BEC + + thumb_func_start sub_8166D44 +sub_8166D44: @ 8166D44 + push {r4,lr} + sub sp, 0x4C + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r1, =0x00008041 + adds r0, r1 + ldrb r0, [r0] + bl sub_81672A4 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x2 + add r2, sp, 0xC + bl GetMonData + add r0, sp, 0xC + bl StringGetEnd10 + ldr r1, =gUnknown_085EC7A0 + add r0, sp, 0xC + bl StringAppend + ldr r4, =gStringVar4 + adds r0, r4, 0 + add r1, sp, 0xC + bl StringCopy + movs r0, 0x2 + movs r1, 0x11 + bl FillWindowPixelBuffer + movs r0, 0x2 + movs r1, 0x97 + movs r2, 0xE + bl sub_8098858 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0 + bl PrintTextOnWindow + movs r0, 0x2 + bl PutWindowTilemap + movs r0, 0x2 + movs r1, 0x3 + bl CopyWindowToVram + ldr r0, =gUnknown_085DFCFC + movs r1, 0x97 + movs r2, 0xE + movs r3, 0 + bl CreateYesNoMenu + add sp, 0x4C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8166D44 + + thumb_func_start sub_8166DE4 +sub_8166DE4: @ 8166DE4 + push {r4,lr} + bl sub_8198C58 + lsls r0, 24 + lsrs r4, r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _08166E18 + cmp r1, 0 + bgt _08166E02 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08166E06 + b _08166E18 +_08166E02: + cmp r1, 0x1 + bne _08166E18 +_08166E06: + movs r0, 0x5 + bl PlaySE + movs r0, 0x2 + bl rbox_fill_rectangle + movs r0, 0x2 + bl ClearWindowTilemap +_08166E18: + lsls r0, r4, 24 + asrs r0, 24 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8166DE4 + + thumb_func_start sub_8166E24 +sub_8166E24: @ 8166E24 + push {r4,lr} + movs r0, 0x2 + movs r1, 0x97 + movs r2, 0xE + bl sub_8098858 + movs r0, 0x2 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r3, =gUnknown_0203BC90 + ldr r0, [r3] + adds r0, 0x53 + movs r1, 0 + strb r1, [r0] + ldr r2, [r3] + adds r1, r2, 0 + adds r1, 0x53 + ldrb r0, [r1] + cmp r0, 0x4 + bhi _08166EA8 + adds r0, r2, 0 + adds r0, 0x61 + ldrb r1, [r1] + adds r0, r1 + ldrb r0, [r0] + adds r4, r3, 0 + cmp r0, 0 + bne _08166E84 + adds r2, r4, 0 +_08166E60: + ldr r0, [r2] + adds r0, 0x53 + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + ldr r3, [r2] + adds r1, r3, 0 + adds r1, 0x53 + ldrb r0, [r1] + cmp r0, 0x4 + bhi _08166EA8 + adds r0, r3, 0 + adds r0, 0x61 + ldrb r1, [r1] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08166E60 +_08166E84: + ldr r2, [r4] + adds r1, r2, 0 + adds r1, 0x53 + ldrb r0, [r1] + cmp r0, 0x4 + bhi _08166EA8 + ldr r0, =gStringVar4 + ldrb r1, [r1] + adds r2, 0x61 + adds r2, r1 + ldrb r2, [r2] + bl sub_8166FD4 + b _08166EB8 + .pool +_08166EA8: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_0203BC90 + ldr r1, [r1] + adds r1, 0x53 + ldrb r1, [r1] + movs r2, 0 + bl sub_8166FD4 +_08166EB8: + ldr r0, =gStringVar4 + bl sub_8166FB0 + movs r0, 0x2 + bl PutWindowTilemap + movs r0, 0x2 + movs r1, 0x3 + bl CopyWindowToVram + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8166E24 + + thumb_func_start sub_8166EDC +sub_8166EDC: @ 8166EDC + push {r4,r5,lr} + movs r0, 0x2 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r5, =gUnknown_0203BC90 + adds r3, r5, 0 + movs r4, 0x5 +_08166EEC: + ldr r0, [r3] + adds r0, 0x53 + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + ldr r2, [r3] + adds r1, r2, 0 + adds r1, 0x53 + ldrb r0, [r1] + cmp r0, 0x4 + bhi _08166F18 + adds r0, r2, 0 + adds r0, 0x61 + ldrb r1, [r1] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _08166F1E + b _08166EEC + .pool +_08166F18: + strb r4, [r1] + movs r0, 0 + b _08166F44 +_08166F1E: + ldr r4, =gStringVar4 + ldr r0, [r5] + adds r1, r0, 0 + adds r1, 0x53 + ldrb r1, [r1] + adds r0, 0x61 + adds r0, r1 + ldrb r2, [r0] + adds r0, r4, 0 + bl sub_8166FD4 + adds r0, r4, 0 + bl sub_8166FB0 + movs r0, 0x2 + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0x1 +_08166F44: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8166EDC + + thumb_func_start sub_8166F50 +sub_8166F50: @ 8166F50 + push {lr} + sub sp, 0xC + movs r0, 0x2 + movs r1, 0x11 + bl FillWindowPixelBuffer + movs r0, 0x2 + movs r1, 0x97 + movs r2, 0xE + bl sub_8098858 + ldr r2, =gUnknown_085EC800 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r3, 0 + bl PrintTextOnWindow + movs r0, 0x2 + bl PutWindowTilemap + movs r0, 0x2 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_8166F50 + + thumb_func_start sub_8166F94 +sub_8166F94: @ 8166F94 + push {lr} + movs r0, 0x2 + bl rbox_fill_rectangle + movs r0, 0x2 + bl ClearWindowTilemap + movs r0, 0x2 + movs r1, 0x3 + bl CopyWindowToVram + pop {r0} + bx r0 + thumb_func_end sub_8166F94 + + thumb_func_start sub_8166FB0 +sub_8166FB0: @ 8166FB0 + push {lr} + sub sp, 0xC + ldr r2, =gStringVar4 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r3, 0 + bl PrintTextOnWindow + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_8166FB0 + + thumb_func_start sub_8166FD4 +sub_8166FD4: @ 8166FD4 + push {r4,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r3, r1, 24 + lsls r2, 16 + lsrs r0, r2, 16 + asrs r2, 16 + cmp r2, 0 + beq _08167010 + cmp r2, 0 + ble _08166FEC + movs r0, 0 +_08166FEC: + lsls r0, 16 + ldr r1, =gUnknown_085DFD04 + lsls r0, r3, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r4, 0 + bl StringCopy + ldr r1, =gUnknown_085EC7E1 + adds r0, r4, 0 + bl StringAppend + b _08167018 + .pool +_08167010: + ldr r1, =gUnknown_085EC7EF + adds r0, r4, 0 + bl StringCopy +_08167018: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8166FD4 + + thumb_func_start sub_8167024 +sub_8167024: @ 8167024 + push {r4-r7,lr} + adds r6, r0, 0 + adds r5, r1, 0 + movs r4, 0 + ldr r7, =gUnknown_085DFCB0 +_0816702E: + lsls r0, r4, 2 + adds r0, r7 + ldr r1, [r0] + adds r0, r6, 0 + bl GetMonData + adds r1, r5, r4 + strb r0, [r1] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x4 + bls _0816702E + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8167024 + + thumb_func_start sub_8167054 +sub_8167054: @ 8167054 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + mov r8, r0 + adds r5, r1, 0 + adds r0, r5, 0 + movs r1, 0x30 + bl GetMonData + cmp r0, 0xFF + beq _081670F0 + mov r0, r8 + adds r1, r5, 0 + bl sub_8167184 + movs r4, 0 + mov r7, sp +_08167078: + ldr r1, =gUnknown_085DFCB0 + lsls r0, r4, 2 + adds r0, r1 + ldr r6, [r0] + adds r0, r5, 0 + adds r1, r6, 0 + bl GetMonData + lsls r0, 24 + lsrs r0, 24 + strb r0, [r7] + ldr r1, =gUnknown_0203BC90 + ldr r1, [r1] + lsls r2, r4, 1 + adds r1, 0x66 + adds r1, r2 + ldrh r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r0, 0 + bge _081670A6 + movs r1, 0 +_081670A6: + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _081670B0 + movs r1, 0xFF +_081670B0: + strb r1, [r7] + adds r0, r5, 0 + adds r1, r6, 0 + mov r2, sp + bl SetMonData + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x4 + bls _08167078 + adds r0, r5, 0 + movs r1, 0x30 + bl GetMonData + lsls r0, 24 + lsrs r0, 24 + mov r2, r8 + ldrb r2, [r2, 0x6] + adds r1, r0, r2 + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _081670E2 + movs r1, 0xFF +_081670E2: + mov r0, sp + strb r1, [r0] + adds r0, r5, 0 + movs r1, 0x30 + mov r2, sp + bl SetMonData +_081670F0: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8167054 + + thumb_func_start sub_8167104 +sub_8167104: @ 8167104 + push {r4,r5,lr} + ldr r5, =gPlayerParty + ldr r0, =gUnknown_0203BCAC + ldr r1, [r0] + ldr r2, =0x00008041 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r1, r0 + ldr r0, =0x00007fb9 + adds r1, r0 + ldrb r1, [r1] + movs r0, 0x64 + muls r0, r1 + adds r5, r0, r5 + ldr r4, =gUnknown_0203BC90 + ldr r1, [r4] + adds r1, 0x57 + adds r0, r5, 0 + bl sub_8167024 + ldr r0, [r4] + ldr r0, [r0, 0x8] + adds r1, r5, 0 + bl sub_8167054 + ldr r1, [r4] + adds r1, 0x5C + adds r0, r5, 0 + bl sub_8167024 + movs r3, 0 +_08167144: + ldr r0, [r4] + adds r2, r0, 0 + adds r2, 0x61 + adds r2, r3 + adds r1, r0, 0 + adds r1, 0x5C + adds r1, r3 + adds r0, 0x57 + adds r0, r3 + ldrb r1, [r1] + ldrb r0, [r0] + subs r1, r0 + strb r1, [r2] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x4 + bls _08167144 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8167104 + + thumb_func_start sub_8167184 +sub_8167184: @ 8167184 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r10, r1 + ldr r1, =gUnknown_0203BC90 + ldr r3, [r1] + ldrb r1, [r0, 0x1] + adds r2, r3, 0 + adds r2, 0x66 + strh r1, [r2] + ldrb r2, [r0, 0x5] + adds r1, r3, 0 + adds r1, 0x68 + strh r2, [r1] + ldrb r1, [r0, 0x4] + adds r2, r3, 0 + adds r2, 0x6A + strh r1, [r2] + ldrb r2, [r0, 0x3] + adds r1, r3, 0 + adds r1, 0x6C + strh r2, [r1] + ldrb r1, [r0, 0x2] + adds r0, r3, 0 + adds r0, 0x6E + strh r1, [r0] + ldr r0, =gUnknown_0203BC9E + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + ble _081671D4 + movs r0, 0x1 + b _081671DA + .pool +_081671D4: + cmp r0, 0 + bge _08167250 + movs r0, 0xFF +_081671DA: + movs r2, 0 + lsls r0, 24 + mov r9, r0 + ldr r0, =gUnknown_0203BC90 + mov r8, r0 +_081671E4: + mov r0, r8 + ldr r1, [r0] + lsls r0, r2, 24 + asrs r6, r0, 24 + lsls r7, r6, 1 + adds r1, 0x66 + adds r1, r7 + movs r2, 0 + ldrsh r4, [r1, r2] + adds r0, r4, 0 + movs r1, 0xA + bl __divsi3 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0 + movs r1, 0xA + bl __modsi3 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _0816721C + lsls r0, r5, 24 + movs r1, 0x80 + lsls r1, 17 + adds r0, r1 + lsrs r5, r0, 24 +_0816721C: + ldr r0, =gUnknown_085DFCC4 + adds r0, r6, r0 + ldrb r1, [r0] + mov r0, r10 + bl GetMonFlavourRelation + lsls r0, 24 + asrs r2, r0, 24 + cmp r0, r9 + bne _08167244 + mov r1, r8 + ldr r0, [r1] + adds r0, 0x66 + adds r0, r7 + lsls r1, r5, 24 + asrs r1, 24 + muls r1, r2 + ldrh r2, [r0] + adds r1, r2 + strh r1, [r0] +_08167244: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + asrs r0, 24 + cmp r0, 0x4 + ble _081671E4 +_08167250: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8167184 + + thumb_func_start sub_8167268 +sub_8167268: @ 8167268 + push {lr} + ldr r0, =gUnknown_0203BCAC + ldr r1, [r0] + ldr r2, =0x00008041 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r1, r0 + subs r2, 0x89 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + movs r2, 0x30 + movs r3, 0 + bl sub_81D2C68 + cmp r0, 0xFF + beq _0816729C + movs r0, 0 + b _0816729E + .pool +_0816729C: + movs r0, 0x1 +_0816729E: + pop {r1} + bx r1 + thumb_func_end sub_8167268 + + thumb_func_start sub_81672A4 +sub_81672A4: @ 81672A4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 +_081672AC: + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x2D + bl GetMonData + cmp r0, 0 + bne _081672D2 + cmp r5, 0 + bne _081672CC + adds r0, r4, 0 + b _081672DE + .pool +_081672CC: + subs r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_081672D2: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _081672AC + movs r0, 0 +_081672DE: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81672A4 + + thumb_func_start sub_81672E4 +sub_81672E4: @ 81672E4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + movs r6, 0 + cmp r6, r5 + bcs _08167314 +_081672F2: + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x2D + bl GetMonData + cmp r0, 0 + beq _0816730A + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0816730A: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _081672F2 +_08167314: + subs r0, r5, r6 + lsls r0, 24 + lsrs r0, 24 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81672E4 + + thumb_func_start sub_8167324 +sub_8167324: @ 8167324 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_81672A4 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_8167324 + + thumb_func_start sub_8167338 +sub_8167338: @ 8167338 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =gUnknown_085DFD18 + bl LoadSpriteSheet + ldr r0, =gUnknown_085DFD20 + bl LoadSpritePalette + ldr r2, =gUnknown_0203BC90 + ldr r0, [r2] + adds r0, 0x54 + movs r1, 0 + strb r1, [r0] + movs r4, 0 + adds r5, r2, 0 + ldr r6, =gUnknown_085DFD28 + adds r0, r6, 0x2 + mov r8, r0 + ldr r7, =gSprites + 0x1C +_08167360: + ldr r0, [r5] + adds r0, 0x61 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _081673AC + lsls r2, r4, 2 + adds r0, r2, r6 + movs r3, 0 + ldrsh r1, [r0, r3] + add r2, r8 + movs r0, 0 + ldrsh r2, [r2, r0] + ldr r0, =gUnknown_085DFD5C + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _081673AC + ldr r0, [r5] + adds r0, 0x61 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _081673A2 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_81673DC + str r1, [r0] +_081673A2: + ldr r1, [r5] + adds r1, 0x54 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_081673AC: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x4 + bls _08167360 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8167338 + + thumb_func_start sub_81673DC +sub_81673DC: @ 81673DC + push {lr} + adds r1, r0, 0 + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0x5 + bgt _081673EE + ldrh r0, [r1, 0x26] + subs r0, 0x2 + b _081673F6 +_081673EE: + cmp r0, 0xB + bgt _081673F8 + ldrh r0, [r1, 0x26] + adds r0, 0x2 +_081673F6: + strh r0, [r1, 0x26] +_081673F8: + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3C + ble _08167418 + adds r0, r1, 0 + bl DestroySprite + ldr r0, =gUnknown_0203BC90 + ldr r1, [r0] + adds r1, 0x54 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] +_08167418: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81673DC + + thumb_func_start sub_8167420 +sub_8167420: @ 8167420 + push {r4-r6,lr} + movs r4, 0 + movs r5, 0 + ldr r6, =gUnknown_0203BCAC + b _08167472 + .pool +_08167430: + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x2D + bl GetMonData + adds r3, r0, 0 + cmp r3, 0 + bne _0816746C + ldr r1, [r6] + lsls r2, r5, 2 + adds r1, r2 + ldr r0, =0x00007fb8 + adds r1, r0 + movs r0, 0xE + strb r0, [r1] + ldr r0, [r6] + adds r0, r2 + ldr r1, =0x00007fb9 + adds r0, r1 + strb r4, [r0] + ldr r0, [r6] + adds r0, r2 + ldr r2, =0x00007fba + adds r0, r2 + strh r3, [r0] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_0816746C: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 +_08167472: + bl CalculatePlayerPartyCount + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bcc _08167430 + ldr r2, =gUnknown_0203BCAC + ldr r0, [r2] + ldr r1, =0x00008041 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + adds r1, r5, 0x1 + ldr r2, =0x00008040 + adds r0, r2 + strb r1, [r0] + bl sub_81674BC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8167420 + + thumb_func_start sub_81674BC +sub_81674BC: @ 81674BC + push {r4,r5,lr} + ldr r4, =gUnknown_0203BCAC + ldr r0, [r4] + ldr r5, =0x00008041 + adds r0, r5 + ldrb r0, [r0] + movs r1, 0 + bl sub_816753C + ldr r0, [r4] + ldr r1, =0x00007fb3 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r4] + ldr r2, =0x00007fb4 + adds r0, r2 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r4] + ldr r1, =0x00007fb5 + adds r0, r1 + movs r1, 0x2 + strb r1, [r0] + ldr r0, [r4] + adds r5, r0, r5 + ldrb r3, [r5] + adds r1, r3, 0x1 + adds r2, 0x8C + adds r0, r2 + ldrb r2, [r0] + cmp r1, r2 + blt _08167500 + movs r1, 0 +_08167500: + subs r0, r3, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r0, 0 + bge _08167510 + subs r0, r2, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 +_08167510: + adds r0, r1, 0 + movs r1, 0x1 + bl sub_816753C + lsls r0, r4, 16 + asrs r0, 16 + movs r1, 0x2 + bl sub_816753C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81674BC + + thumb_func_start sub_816753C +sub_816753C: @ 816753C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + adds r5, r0, 0 + adds r4, r1, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_0203BCAC + mov r9, r0 + ldr r1, [r0] + lsls r5, 16 + asrs r0, r5, 14 + adds r0, r1, r0 + ldr r3, =0x00007fb8 + adds r2, r0, r3 + ldrb r7, [r2] + ldr r2, =0x00007fb9 + adds r0, r2 + ldrb r0, [r0] + mov r10, r0 + adds r3, 0x88 + adds r0, r1, r3 + ldrb r6, [r0] + movs r0, 0 + mov r8, r0 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 3 + ldr r2, =0x00007b4d + adds r0, r2 + adds r0, r1, r0 + lsls r2, r4, 6 + ldr r3, =0x00007b95 + adds r2, r3 + adds r1, r2 + lsrs r5, 16 + str r5, [sp] + str r6, [sp, 0x4] + mov r2, r8 + str r2, [sp, 0x8] + adds r2, r7, 0 + mov r3, r10 + bl sub_81D2ED4 + mov r3, r9 + ldr r1, [r3] + ldr r2, =0x00007c58 + adds r0, r1, r2 + ldr r3, =0x00007fb0 + adds r1, r3 + str r5, [sp] + str r4, [sp, 0x4] + str r6, [sp, 0x8] + mov r2, r8 + str r2, [sp, 0xC] + adds r2, r7, 0 + mov r3, r10 + bl sub_81D2F78 + lsls r0, r4, 13 + movs r1, 0xC1 + lsls r1, 2 + adds r0, r1 + mov r3, r9 + ldr r1, [r3] + adds r0, r1, r0 + lsls r4, 7 + adds r4, 0x4 + adds r1, r4 + str r5, [sp] + str r6, [sp, 0x4] + mov r2, r8 + str r2, [sp, 0x8] + adds r2, r7, 0 + mov r3, r10 + bl sub_81D3094 + 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_816753C + + thumb_func_start sub_8167608 +sub_8167608: @ 8167608 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x28 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =gUnknown_0203BCAC + ldr r3, [r1] + ldr r0, =0x00007b10 + mov r8, r0 + adds r0, r3, r0 + ldrb r0, [r0] + adds r7, r1, 0 + cmp r0, 0xFF + bne _08167714 + add r5, sp, 0x18 + add r4, sp, 0x20 + adds r0, r5, 0 + mov r1, sp + adds r2, r4, 0 + bl sub_81D31D0 + lsls r0, r6, 13 + movs r1, 0xC1 + lsls r1, 2 + adds r0, r1 + ldr r1, [r7] + adds r0, r1, r0 + str r0, [sp, 0x18] + lsls r0, r6, 7 + adds r0, 0x4 + adds r1, r0 + str r1, [sp, 0x20] + adds r0, r4, 0 + bl LoadSpritePalette + ldr r1, [r7] + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x00007b12 + adds r1, r2 + strh r0, [r1] + adds r0, r5, 0 + bl LoadSpriteSheet + ldr r1, [r7] + ldr r3, =0x00007b14 + adds r1, r3 + strh r0, [r1] + mov r0, sp + movs r1, 0x26 + movs r2, 0x68 + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, [r7] + ldr r2, =0x00007b10 + adds r0, r2 + strb r1, [r0] + cmp r1, 0x40 + bne _081676AC + movs r0, 0x64 + bl FreeSpriteTilesByTag + movs r0, 0x64 + bl FreeSpritePaletteByTag + ldr r0, [r7] + add r0, r8 + movs r1, 0xFF + strb r1, [r0] + b _08167742 + .pool +_081676AC: + ldr r0, [r7] + add r0, r8 + strb r1, [r0] + ldr r4, =gSprites + ldr r2, [r7] + mov r0, r8 + adds r3, r2, r0 + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_8168168 + str r1, [r0] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x26] + subs r1, 0x22 + strh r1, [r0, 0x26] + ldr r3, =0x00007b18 + adds r1, r2, r3 + subs r3, 0x4 + adds r0, r2, r3 + ldrh r0, [r0] + lsls r0, 5 + ldr r3, =0x06010000 + adds r0, r3 + str r0, [r1] + ldr r0, =0x00007b12 + adds r2, r0 + ldrh r0, [r2] + lsls r0, 4 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + strh r0, [r2] + b _08167742 + .pool +_08167714: + lsls r1, r6, 13 + movs r0, 0xC1 + lsls r0, 2 + adds r1, r0 + adds r1, r3, r1 + ldr r2, =0x00007b18 + adds r0, r3, r2 + ldr r2, [r0] + ldr r0, =0x040000d4 + str r1, [r0] + str r2, [r0, 0x4] + ldr r1, =0x80000400 + str r1, [r0, 0x8] + ldr r0, [r0, 0x8] + lsls r0, r6, 7 + adds r0, 0x4 + adds r0, r3, r0 + ldr r2, =0x00007b12 + adds r1, r3, r2 + ldrh r1, [r1] + movs r2, 0x20 + bl LoadPalette +_08167742: + add sp, 0x28 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8167608 + + thumb_func_start sub_8167760 +sub_8167760: @ 8167760 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x60 + add r5, sp, 0x20 + add r4, sp, 0x38 + mov r0, sp + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_81D321C + mov r0, sp + bl LoadSpriteSheets + adds r0, r4, 0 + bl LoadSpritePalettes + movs r4, 0 + ldr r1, =gUnknown_0203BCAC + ldr r0, [r1] + ldr r2, =0x00008040 + adds r0, r2 + ldrb r0, [r0] + subs r0, 0x1 + adds r6, r5, 0 + add r2, sp, 0x50 + mov r9, r2 + add r2, sp, 0x58 + mov r10, r2 + cmp r4, r0 + bge _0816781C + adds r5, r1, 0 + ldr r7, =gSprites + movs r0, 0x1C + adds r0, r7 + mov r8, r0 +_081677AC: + lsls r2, r4, 2 + adds r2, r4 + lsls r2, 18 + movs r1, 0x80 + lsls r1, 12 + adds r2, r1 + asrs r2, 16 + adds r0, r6, 0 + movs r1, 0xE2 + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x40 + beq _081677FC + ldr r0, [r5] + ldr r2, =0x00007b06 + adds r0, r2 + adds r0, r4 + strb r3, [r0] + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 2 + adds r1, r0, r7 + strh r4, [r1, 0x2E] + add r0, r8 + ldr r1, =sub_8168180 + str r1, [r0] + b _08167808 + .pool +_081677FC: + ldr r0, [r5] + ldr r1, =0x00007b06 + adds r0, r1 + adds r0, r4 + movs r1, 0xFF + strb r1, [r0] +_08167808: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, [r5] + ldr r2, =0x00008040 + adds r0, r2 + ldrb r0, [r0] + subs r0, 0x1 + cmp r4, r0 + blt _081677AC +_0816781C: + movs r0, 0x67 + strh r0, [r6] + cmp r4, 0x5 + bhi _0816788A + ldr r5, =gUnknown_0203BCAC + ldr r7, =gSprites +_08167828: + lsls r2, r4, 2 + adds r2, r4 + lsls r2, 18 + movs r0, 0x80 + lsls r0, 12 + adds r2, r0 + asrs r2, 16 + adds r0, r6, 0 + movs r1, 0xE6 + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x40 + beq _08167874 + ldr r0, [r5] + ldr r1, =0x00007b06 + adds r0, r1 + adds r0, r4 + strb r3, [r0] + lsls r1, r3, 4 + adds r1, r3 + lsls r1, 2 + adds r1, r7 + ldrb r2, [r1, 0x3] + movs r0, 0x3F + ands r0, r2 + strb r0, [r1, 0x3] + b _08167880 + .pool +_08167874: + ldr r0, [r5] + ldr r2, =0x00007b06 + adds r0, r2 + adds r0, r4 + movs r1, 0xFF + strb r1, [r0] +_08167880: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x5 + bls _08167828 +_0816788A: + movs r0, 0x66 + strh r0, [r6] + ldr r0, =sub_81681B4 + str r0, [r6, 0x14] + lsls r2, r4, 2 + adds r2, r4 + lsls r2, 18 + movs r0, 0x80 + lsls r0, 12 + adds r2, r0 + asrs r2, 16 + adds r0, r6, 0 + movs r1, 0xDE + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x40 + beq _081678F4 + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r1, =0x00007b06 + adds r0, r1 + adds r0, r4 + strb r3, [r0] + ldr r0, =gSprites + lsls r2, r3, 4 + adds r2, r3 + lsls r2, 2 + adds r2, r0 + ldrb r3, [r2, 0x1] + movs r1, 0x3F + adds r0, r1, 0 + ands r0, r3 + movs r3, 0x40 + orrs r0, r3 + strb r0, [r2, 0x1] + ldrb r0, [r2, 0x3] + ands r1, r0 + movs r0, 0x80 + orrs r1, r0 + strb r1, [r2, 0x3] + b _08167902 + .pool +_081678F4: + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r2, =0x00007b06 + adds r0, r2 + adds r0, r4 + movs r1, 0xFF + strb r1, [r0] +_08167902: + mov r0, r9 + mov r1, r10 + bl sub_81D32B0 + mov r0, r9 + bl LoadSpriteSheet + mov r0, r10 + bl LoadSpritePalette + add sp, 0x60 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8167760 + + thumb_func_start sub_8167930 +sub_8167930: @ 8167930 + push {r4,r5,lr} + sub sp, 0x8 + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r2, =0x00008048 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xB + bls _08167944 + b _08167B78 +_08167944: + lsls r0, 2 + ldr r1, =_0816795C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0816795C: + .4byte _0816798C + .4byte _08167A04 + .4byte _08167A38 + .4byte _08167A48 + .4byte _08167A5C + .4byte _08167A74 + .4byte _08167A9C + .4byte _08167AB0 + .4byte _08167AD4 + .4byte _08167AEC + .4byte _08167B1C + .4byte _08167B38 +_0816798C: + 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 r1, 0x88 + lsls r1, 6 + movs r0, 0x3 + movs r2, 0 + bl ChangeBgY + ldr r1, =0x00007040 + movs r0, 0 + bl SetGpuReg + movs r1, 0x91 + lsls r1, 2 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x0000040b + movs r0, 0x52 + bl SetGpuReg + b _08167B7E + .pool +_08167A04: + ldr r4, =gUnknown_0203BCA4 + movs r0, 0xD0 + lsls r0, 5 + bl Alloc + str r0, [r4] + ldr r5, =gUnknown_0203BCA0 + movs r4, 0xA0 + lsls r4, 3 + adds r0, r4, 0 + bl Alloc + str r0, [r5] + ldr r5, =gUnknown_0203BCA8 + adds r0, r4, 0 + bl Alloc + str r0, [r5] + b _08167B7E + .pool +_08167A38: + ldr r0, =gUnknown_085DFB60 + ldr r1, =gUnknown_0203BCA8 + b _08167AA0 + .pool +_08167A48: + ldr r1, =gUnknown_085DFA80 + movs r0, 0x3 + movs r2, 0xE0 + movs r3, 0 + bl LoadBgTiles + b _08167B7E + .pool +_08167A5C: + ldr r0, =gUnknown_0203BCA8 + ldr r1, [r0] + movs r2, 0xA0 + lsls r2, 3 + movs r0, 0x3 + movs r3, 0 + bl LoadBgTilemap + b _08167B7E + .pool +_08167A74: + ldr r0, =gUnknown_085DFA60 + movs r1, 0xD0 + movs r2, 0x20 + bl LoadPalette + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r1, =0x00007b0e + adds r0, r1 + ldr r1, =0x0000ffb0 + strh r1, [r0] + b _08167B7E + .pool +_08167A9C: + ldr r0, =gUnknown_08DCCF7C + ldr r1, =gUnknown_0203BCA4 +_08167AA0: + ldr r1, [r1] + bl LZ77UnCompVram + b _08167B7E + .pool +_08167AB0: + ldr r0, =gUnknown_08DCD81C + ldr r1, =gUnknown_0203BCA0 + ldr r1, [r1] + bl LZ77UnCompVram + ldr r0, =gUnknown_08DCCF5C + movs r1, 0x20 + movs r2, 0x20 + bl LoadPalette + b _08167B7E + .pool +_08167AD4: + ldr r0, =gUnknown_0203BCA4 + ldr r1, [r0] + movs r2, 0xD0 + lsls r2, 5 + movs r3, 0xA0 + lsls r3, 2 + movs r0, 0x1 + bl LoadBgTiles + b _08167B7E + .pool +_08167AEC: + ldr r0, =gUnknown_0203BCA0 + ldr r1, [r0] + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, =gUnknown_08DCDA30 + movs r0, 0xC + str r0, [sp] + movs r0, 0x4 + str r0, [sp, 0x4] + movs r0, 0x1 + movs r2, 0 + movs r3, 0xD + bl CopyToBgTilemapBufferRect + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + b _08167B7E + .pool +_08167B1C: + ldr r0, =gUnknown_085DFC0C + ldr r1, =gUnknown_0203BCAC + ldr r1, [r1] + ldr r2, =0x00007304 + adds r1, r2 + bl LZ77UnCompVram + b _08167B7E + .pool +_08167B38: + ldr r0, =gUnknown_0203BCAC + ldr r1, [r0] + ldr r0, =0x00007304 + adds r1, r0 + movs r2, 0xA0 + lsls r2, 3 + movs r0, 0x2 + movs r3, 0 + bl LoadBgTilemap + ldr r0, =gUnknown_086231E8 + movs r1, 0x30 + movs r2, 0x20 + bl LoadPalette + ldr r0, =gUnknown_08623208 + movs r1, 0xF0 + movs r2, 0x20 + bl LoadPalette + movs r0, 0x2 + bl sub_81D21DC + b _08167B7E + .pool +_08167B78: + movs r0, 0 + strb r0, [r1] + b _08167B8E +_08167B7E: + ldr r0, =gUnknown_0203BCAC + ldr r1, [r0] + ldr r2, =0x00008048 + adds r1, r2 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r0, 0x1 +_08167B8E: + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8167930 + + thumb_func_start sub_8167BA0 +sub_8167BA0: @ 8167BA0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + movs r0, 0 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r7, =gUnknown_0203BCAC + ldr r3, [r7] + ldr r1, =0x00008041 + adds r0, r3, r1 + ldrb r1, [r0] + ldr r2, =0x00008040 + adds r0, r3, r2 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + beq _08167C46 + lsls r2, r4, 6 + ldr r0, =0x00007b95 + adds r2, r0 + adds r2, r3, r2 + movs r0, 0x1 + str r0, [sp] + movs r5, 0 + str r5, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r3, 0 + bl PrintTextOnWindow + ldr r0, [r7] + ldr r1, =0x00008041 + adds r0, r1 + ldrb r0, [r0] + bl sub_81672A4 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + bl GetNature + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, [r7] + ldr r6, =0x0000804a + adds r0, r6 + ldr r1, =gUnknown_085EBF8D + bl StringCopy + ldr r1, =gNatureNamePointers + lsls r4, 2 + adds r4, r1 + ldr r1, [r4] + bl StringCopy + ldr r0, =gUnknown_085DFCC9 + str r0, [sp] + str r5, [sp, 0x4] + ldr r0, [r7] + adds r0, r6 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x2 + movs r3, 0x1 + bl box_print +_08167C46: + mov r2, r8 + cmp r2, 0 + beq _08167C84 + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + movs r0, 0x1 + movs r1, 0x3 + bl CopyWindowToVram + b _08167C94 + .pool +_08167C84: + movs r0, 0 + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0x1 + movs r1, 0x2 + bl CopyWindowToVram +_08167C94: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8167BA0 + + thumb_func_start sub_8167CA0 +sub_8167CA0: @ 8167CA0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0 + beq _08167CC0 + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r1, =0x00007fb5 + adds r0, r1 + b _08167CC8 + .pool +_08167CC0: + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r2, =0x00007fb4 + adds r0, r2 +_08167CC8: + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r5, =gUnknown_0203BCAC + ldr r2, [r5] + ldr r3, =0x00007c58 + adds r0, r2, r3 + ldr r4, =0x00007fb3 + adds r1, r2, r4 + movs r3, 0 + ldrsb r3, [r1, r3] + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 2 + ldr r4, =0x00007c6c + adds r1, r4 + adds r1, r2, r1 + lsls r3, r6, 2 + adds r3, r6 + lsls r3, 2 + adds r3, r4 + adds r2, r3 + bl sub_81D1F84 + ldr r4, [r5] + ldr r1, =0x00008041 + adds r0, r4, r1 + ldrb r1, [r0] + ldr r2, =0x00008040 + mov r12, r2 + adds r0, r4, r2 + ldrb r0, [r0] + subs r0, 0x1 + eors r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + mov r8, r0 + cmp r7, 0 + beq _08167D98 + ldr r3, =0x00007fb4 + adds r0, r4, r3 + ldrb r1, [r0] + subs r2, 0x8B + adds r0, r4, r2 + strb r1, [r0] + ldr r0, [r5] + ldr r4, =0x00007fb3 + adds r1, r0, r4 + ldrb r1, [r1] + adds r0, r3 + strb r1, [r0] + ldr r0, [r5] + adds r0, r4 + strb r6, [r0] + ldr r0, [r5] + adds r2, r0, r2 + ldrb r1, [r2] + ldr r2, =0x00007fb6 + adds r0, r2 + strb r1, [r0] + ldr r1, [r5] + adds r3, 0x8D + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _08167D58 + mov r4, r12 + adds r0, r1, r4 + ldrb r0, [r0] +_08167D58: + subs r2, r0, 0x1 + ldr r0, =0x00008041 + adds r1, r0 + strb r2, [r1] + ldr r1, =gUnknown_0203BCAC + ldr r3, [r1] + adds r0, r3, r0 + ldrb r0, [r0] + adds r6, r1, 0 + cmp r0, 0 + bne _08167D74 + ldr r1, =0x00008040 + adds r0, r3, r1 + ldrb r0, [r0] +_08167D74: + subs r1, r0, 0x1 + b _08167E1E + .pool +_08167D98: + ldr r3, =0x00007fb5 + adds r0, r4, r3 + ldrb r1, [r0] + ldr r2, =0x00007fb4 + adds r0, r4, r2 + strb r1, [r0] + ldr r0, [r5] + ldr r4, =0x00007fb3 + adds r1, r0, r4 + ldrb r1, [r1] + adds r0, r3 + strb r1, [r0] + ldr r0, [r5] + adds r0, r4 + strb r6, [r0] + ldr r0, [r5] + adds r2, r0, r2 + ldrb r1, [r2] + ldr r2, =0x00007fb6 + adds r0, r2 + strb r1, [r0] + ldr r2, [r5] + adds r3, 0x8C + adds r0, r2, r3 + ldrb r1, [r0] + adds r4, 0x8D + adds r0, r2, r4 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + bge _08167DEC + adds r3, r1, 0x1 + b _08167DEE + .pool +_08167DEC: + movs r3, 0 +_08167DEE: + ldr r1, =0x00008041 + adds r0, r2, r1 + strb r3, [r0] + ldr r2, =gUnknown_0203BCAC + ldr r3, [r2] + adds r1, r3, r1 + ldrb r1, [r1] + ldr r4, =0x00008040 + adds r0, r3, r4 + ldrb r0, [r0] + subs r0, 0x1 + adds r6, r2, 0 + cmp r1, r0 + bge _08167E1C + adds r1, 0x1 + b _08167E1E + .pool +_08167E1C: + movs r1, 0 +_08167E1E: + ldr r2, =0x00007b4c + adds r0, r3, r2 + strb r1, [r0] + adds r5, r6, 0 + ldr r0, [r5] + ldr r3, =0x00008041 + adds r1, r0, r3 + ldrb r2, [r1] + ldr r4, =0x00008040 + adds r1, r0, r4 + ldrb r1, [r1] + subs r1, 0x1 + eors r2, r1 + negs r1, r2 + orrs r1, r2 + lsrs r4, r1, 31 + ldr r1, =0x00007b1c + adds r0, r1 + bl sub_81D3520 + mov r2, r8 + cmp r2, 0 + bne _08167E70 + ldr r0, [r5] + ldr r3, =0x00008044 + adds r0, r3 + ldr r1, =sub_8167EA4 + b _08167E90 + .pool +_08167E70: + cmp r4, 0 + bne _08167E88 + ldr r0, [r5] + ldr r4, =0x00008044 + adds r0, r4 + ldr r1, =sub_8167FA4 + b _08167E90 + .pool +_08167E88: + ldr r0, [r6] + ldr r1, =0x00008044 + adds r0, r1 + ldr r1, =sub_8168048 +_08167E90: + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8167CA0 + + thumb_func_start sub_8167EA4 +sub_8167EA4: @ 8167EA4 + push {r4-r6,lr} + ldr r4, =gUnknown_0203BCAC + ldr r1, [r4] + ldr r5, =0x00008048 + adds r0, r1, r5 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08167EE4 + cmp r0, 0x1 + bgt _08167EC8 + cmp r0, 0 + beq _08167ED2 + b _08167F9C + .pool +_08167EC8: + cmp r0, 0x2 + beq _08167F08 + cmp r0, 0x3 + beq _08167F48 + b _08167F9C +_08167ED2: + ldr r2, =0x00007fb3 + adds r0, r1, r2 + ldrb r0, [r0] + bl sub_8167608 + b _08167F2C + .pool +_08167EE4: + ldr r6, =0x00007fb3 + adds r0, r1, r6 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + bl sub_8167BA0 + ldr r1, [r4] + ldr r0, =0x00008048 + adds r1, r0 + b _08167F30 + .pool +_08167F08: + ldr r2, =0x00007c58 + adds r0, r1, r2 + ldr r6, =0x00007b0e + adds r1, r6 + bl sub_81D3178 + lsls r0, 24 + cmp r0, 0 + bne _08167F9C + ldr r1, [r4] + ldr r2, =0x00007b4c + adds r0, r1, r2 + ldrb r0, [r0] + ldr r6, =0x00007fb6 + adds r1, r6 + ldrb r1, [r1] + bl sub_816753C +_08167F2C: + ldr r1, [r4] + adds r1, r5 +_08167F30: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08167F9C + .pool +_08167F48: + ldr r2, =0x00007b1c + adds r0, r1, r2 + bl sub_81D3464 + ldr r3, [r4] + ldr r6, =0x00008041 + adds r0, r3, r6 + ldrb r1, [r0] + ldr r2, =0x00008040 + adds r0, r3, r2 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + beq _08167F82 + subs r6, 0x8E + adds r0, r3, r6 + movs r1, 0 + ldrsb r1, [r0, r1] + subs r2, 0x90 + adds r0, r3, r2 + adds r0, r1 + ldrb r2, [r0] + ldr r6, =0x00007b1c + adds r0, r3, r6 + subs r6, 0xC + adds r1, r3, r6 + ldrb r1, [r1] + bl sub_81D3480 +_08167F82: + ldr r0, [r4] + adds r0, r5 + movs r1, 0 + strb r1, [r0] + movs r0, 0 + b _08167F9E + .pool +_08167F9C: + movs r0, 0x1 +_08167F9E: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8167EA4 + + thumb_func_start sub_8167FA4 +sub_8167FA4: @ 8167FA4 + push {r4,r5,lr} + ldr r4, =gUnknown_0203BCAC + ldr r1, [r4] + ldr r5, =0x00008048 + adds r2, r1, r5 + ldrb r0, [r2] + cmp r0, 0x1 + beq _08167FF0 + cmp r0, 0x1 + bgt _08167FC8 + cmp r0, 0 + beq _08167FD2 + b _0816803E + .pool +_08167FC8: + cmp r0, 0x2 + beq _08168014 + cmp r0, 0x3 + beq _08168038 + b _0816803E +_08167FD2: + ldr r2, =0x00007c58 + adds r0, r1, r2 + ldr r2, =0x00007b0e + adds r1, r2 + bl sub_81D31A4 + lsls r0, 24 + cmp r0, 0 + bne _0816803E + b _08168024 + .pool +_08167FF0: + ldr r2, =0x00007fb3 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + bl sub_8167BA0 + ldr r1, [r4] + ldr r0, =0x00008048 + adds r1, r0 + b _08168028 + .pool +_08168014: + ldr r2, =0x00007b4c + adds r0, r1, r2 + ldrb r0, [r0] + ldr r2, =0x00007fb6 + adds r1, r2 + ldrb r1, [r1] + bl sub_816753C +_08168024: + ldr r1, [r4] + adds r1, r5 +_08168028: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0816803E + .pool +_08168038: + movs r0, 0 + strb r0, [r2] + b _08168040 +_0816803E: + movs r0, 0x1 +_08168040: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8167FA4 + + thumb_func_start sub_8168048 +sub_8168048: @ 8168048 + push {r4-r6,lr} + ldr r4, =gUnknown_0203BCAC + ldr r1, [r4] + ldr r5, =0x00008048 + adds r0, r1, r5 + ldrb r0, [r0] + cmp r0, 0x1 + beq _081680A8 + cmp r0, 0x1 + bgt _0816806C + cmp r0, 0 + beq _08168076 + b _08168160 + .pool +_0816806C: + cmp r0, 0x2 + beq _081680CC + cmp r0, 0x3 + beq _0816810C + b _08168160 +_08168076: + ldr r2, =0x00007c58 + adds r0, r1, r2 + bl sub_81D2074 + ldr r0, [r4] + ldr r6, =0x00007b0e + adds r0, r6 + bl sub_81D3150 + lsls r0, 24 + cmp r0, 0 + bne _08168160 + ldr r0, [r4] + ldr r1, =0x00007fb3 + adds r0, r1 + ldrb r0, [r0] + bl sub_8167608 + b _081680F0 + .pool +_081680A8: + ldr r2, =0x00007fb3 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + bl sub_8167BA0 + ldr r1, [r4] + ldr r6, =0x00008048 + adds r1, r6 + b _081680F4 + .pool +_081680CC: + ldr r2, =0x00007c58 + adds r0, r1, r2 + ldr r6, =0x00007b0e + adds r1, r6 + bl sub_81D3178 + lsls r0, 24 + cmp r0, 0 + bne _08168160 + ldr r1, [r4] + ldr r2, =0x00007b4c + adds r0, r1, r2 + ldrb r0, [r0] + ldr r6, =0x00007fb6 + adds r1, r6 + ldrb r1, [r1] + bl sub_816753C +_081680F0: + ldr r1, [r4] + adds r1, r5 +_081680F4: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08168160 + .pool +_0816810C: + ldr r2, =0x00007b1c + adds r0, r1, r2 + bl sub_81D3464 + ldr r3, [r4] + ldr r6, =0x00008041 + adds r0, r3, r6 + ldrb r1, [r0] + ldr r2, =0x00008040 + adds r0, r3, r2 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + beq _08168146 + subs r6, 0x8E + adds r0, r3, r6 + movs r1, 0 + ldrsb r1, [r0, r1] + subs r2, 0x90 + adds r0, r3, r2 + adds r0, r1 + ldrb r2, [r0] + ldr r6, =0x00007b1c + adds r0, r3, r6 + subs r6, 0xC + adds r1, r3, r6 + ldrb r1, [r1] + bl sub_81D3480 +_08168146: + ldr r0, [r4] + adds r0, r5 + movs r1, 0 + strb r1, [r0] + movs r0, 0 + b _08168162 + .pool +_08168160: + movs r0, 0x1 +_08168162: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8168048 + + thumb_func_start sub_8168168 +sub_8168168: @ 8168168 + ldr r1, =gUnknown_0203BCAC + ldr r1, [r1] + ldr r2, =0x00007b0e + adds r1, r2 + ldrh r1, [r1] + adds r1, 0x26 + strh r1, [r0, 0x20] + bx lr + .pool + thumb_func_end sub_8168168 + + thumb_func_start sub_8168180 +sub_8168180: @ 8168180 + push {lr} + adds r2, r0, 0 + movs r0, 0x2E + ldrsh r1, [r2, r0] + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r3, =0x00008041 + adds r0, r3 + ldrb r0, [r0] + cmp r1, r0 + bne _081681A8 + adds r0, r2, 0 + movs r1, 0 + bl StartSpriteAnim + b _081681B0 + .pool +_081681A8: + adds r0, r2, 0 + movs r1, 0x1 + bl StartSpriteAnim +_081681B0: + pop {r0} + bx r0 + thumb_func_end sub_8168180 + + thumb_func_start sub_81681B4 +sub_81681B4: @ 81681B4 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r2, =0x00008041 + adds r1, r0, r2 + ldrb r1, [r1] + subs r2, 0x1 + adds r0, r2 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + bne _081681DC + movs r0, 0x65 + b _081681DE + .pool +_081681DC: + movs r0, 0x66 +_081681DE: + bl IndexOfSpritePaletteTag + lsls r0, 4 + ldrb r2, [r4, 0x5] + movs r1, 0xF + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0x5] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81681B4 + + thumb_func_start sub_81681F4 +sub_81681F4: @ 81681F4 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x30 + bl GetMonData + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r3, =0x00007fb3 + adds r1, r0, r3 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + subs r3, 0x3 + adds r0, r3 + adds r4, r0, r1 + cmp r2, 0xFF + beq _0816823C + adds r0, r2, 0 + movs r1, 0x1D + bl __udivsi3 + b _0816823E + .pool +_0816823C: + movs r0, 0x9 +_0816823E: + strb r0, [r4] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81681F4 + + thumb_func_start sub_8168248 +sub_8168248: @ 8168248 + push {lr} + sub sp, 0x10 + ldr r0, =gUnknown_085DFDB8 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0x8] + str r1, [sp, 0xC] + ldr r0, =gUnknown_08DCCBB8 + str r0, [sp] + ldr r1, =0xffff0000 + ldr r0, [sp, 0x4] + ands r0, r1 + movs r1, 0x80 + lsls r1, 4 + orrs r0, r1 + ldr r1, =0x0000ffff + ands r0, r1 + adds r1, 0x1 + orrs r0, r1 + str r0, [sp, 0x4] + mov r0, sp + bl LoadCompressedObjectPic + add r0, sp, 0x8 + bl LoadSpritePalette + add sp, 0x10 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8168248 + + thumb_func_start sub_8168294 +sub_8168294: @ 8168294 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r1, =0x00007b44 + adds r7, r0, r1 + ldr r0, =gUnknown_085DFDA0 + mov r10, r0 + movs r6, 0 + movs r1, 0x40 + mov r9, r1 + movs r0, 0x60 + negs r0, r0 + mov r8, r0 +_081682B6: + mov r5, r9 + muls r5, r6 + mov r0, r8 + adds r1, r0, r5 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x11 + lsls r2, r0, 16 + mov r0, r10 + asrs r2, 16 + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _081682FE + ldr r0, =gSprites + lsls r4, r1, 4 + adds r4, r1 + lsls r4, 2 + adds r4, r0 + movs r1, 0x8 + strh r1, [r4, 0x2E] + movs r0, 0x20 + orrs r5, r0 + strh r5, [r4, 0x30] + strh r6, [r4, 0x32] + lsls r1, r6, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartSpriteAnim + lsls r0, r6, 2 + adds r0, r7 + str r4, [r0] +_081682FE: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x1 + bls _081682B6 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8168294 + + thumb_func_start sub_8168328 +sub_8168328: @ 8168328 + push {r4,r5,lr} + ldr r4, =gUnknown_0203BCAC + ldr r0, [r4] + ldr r5, =0x00008048 + adds r0, r5 + ldrb r0, [r0] + cmp r0, 0 + beq _08168348 + cmp r0, 0x1 + beq _08168360 + b _0816836C + .pool +_08168348: + bl sub_8168248 + ldr r1, [r4] + ldr r0, =0x00008048 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r0, 0x1 + b _0816836E + .pool +_08168360: + bl sub_8168294 + ldr r0, [r4] + adds r0, r5 + movs r1, 0 + strb r1, [r0] +_0816836C: + movs r0, 0 +_0816836E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8168328 + + thumb_func_start sub_8168374 +sub_8168374: @ 8168374 + push {r4,lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x20] + ldrh r1, [r2, 0x2E] + adds r3, r0, r1 + strh r3, [r2, 0x20] + lsls r0, 16 + asrs r4, r0, 16 + movs r0, 0x30 + ldrsh r1, [r2, r0] + cmp r4, r1 + bgt _08168398 + lsls r0, r3, 16 + asrs r0, 16 + cmp r0, r1 + bge _081683A0 + cmp r4, r1 + blt _081683A8 +_08168398: + lsls r0, r3, 16 + asrs r0, 16 + cmp r0, r1 + bgt _081683A8 +_081683A0: + ldrh r0, [r2, 0x30] + strh r0, [r2, 0x20] + ldr r0, =SpriteCallbackDummy + str r0, [r2, 0x1C] +_081683A8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8168374 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/walda_phrase.s b/asm/walda_phrase.s new file mode 100755 index 000000000..2f1f7da60 --- /dev/null +++ b/asm/walda_phrase.s @@ -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. diff --git a/ld_script.txt b/ld_script.txt index 940616eeb..0cfee0ea6 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -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 : From a923091dec0fdbd8796ab4d86927f49e45c5d565 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Sat, 16 Sep 2017 21:35:02 -0400 Subject: [PATCH 13/13] formatting --- ld_script.txt | 72 +++++++++++++++++++++++++-------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/ld_script.txt b/ld_script.txt index 0cfee0ea6..d6b3953fe 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -82,8 +82,8 @@ SECTIONS { asm/daycare.o(.text); asm/egg_hatch.o(.text); asm/battle_interface.o(.text); - asm/smokescreen.o(.text); - asm/pokeball.o(.text); + asm/smokescreen.o(.text); + asm/pokeball.o(.text); src/load_save.o(.text); asm/load_save.o(.text); asm/trade.o(.text); @@ -133,13 +133,13 @@ SECTIONS { asm/pokedex.o(.text); asm/trainer_card.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); + 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); @@ -208,12 +208,12 @@ SECTIONS { asm/battle_controller_safari.o(.text); asm/fldeff_sweetscent.o(.text); asm/battle_anim_815A0D4.o(.text); - asm/learn_move.o(.text); - asm/fldeff_softboiled.o(.text); + asm/learn_move.o(.text); + asm/fldeff_softboiled.o(.text); asm/decoration_inventory.o(.text); asm/roamer.o(.text); asm/battle_tower.o(.text); - asm/use_pokeblock.o(.text); + asm/use_pokeblock.o(.text); asm/battle_controller_wally.o(.text); asm/player_pc.o(.text); asm/intro.o(.text); @@ -242,34 +242,34 @@ SECTIONS { asm/battle_dome_cards.o(.text); asm/lilycove_lady.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); + 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/unk_81BAD84.o(.text); asm/battle_controller_player_partner.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); + 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 :